diff --git a/JS/node_modules/.package-lock.json b/JS/node_modules/.package-lock.json deleted file mode 100644 index 6c9eeb0..0000000 --- a/JS/node_modules/.package-lock.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "name": "test", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "node_modules/@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" - }, - "node_modules/@types/zen-observable": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz", - "integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==" - }, - "node_modules/@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", - "dependencies": { - "@types/node": ">=6", - "tslib": "^1.9.3" - } - }, - "node_modules/@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-boost": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/apollo-boost/-/apollo-boost-0.4.9.tgz", - "integrity": "sha512-05y5BKcDaa8w47f8d81UVwKqrAjn8uKLv6QM9fNdldoNzQ+rnOHgFlnrySUZRz9QIT3vPftQkEz2UEASp1Mi5g==", - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "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.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "dependencies": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "integrity": "sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A==", - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "integrity": "sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA==", - "dependencies": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.3.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", - "dependencies": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - }, - "peerDependencies": { - "graphql": "^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "dependencies": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "integrity": "sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig==", - "dependencies": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", - "dependencies": { - "node-fetch": "2.6.1" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/graphql": { - "version": "15.5.3", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.5.3.tgz", - "integrity": "sha512-sM+jXaO5KinTui6lbK/7b7H/Knj9BpjGxZ+Ki35v7YbUJxxdBCUqNM0h3CRVU1ZF9t5lNiBzvBCSYPvIwxPOQA==", - "peer": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/graphql-tag": { - "version": "2.12.5", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.5.tgz", - "integrity": "sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ==", - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/graphql-tag/node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "dependencies": { - "@wry/context": "^0.4.0" - } - }, - "node_modules/symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/zen-observable": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" - }, - "node_modules/zen-observable-ts": { - "version": "0.8.21", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz", - "integrity": "sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg==", - "dependencies": { - "tslib": "^1.9.3", - "zen-observable": "^0.8.0" - } - } - } -} diff --git a/JS/node_modules/@types/node/LICENSE b/JS/node_modules/@types/node/LICENSE deleted file mode 100755 index 9e841e7..0000000 --- a/JS/node_modules/@types/node/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - 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/JS/node_modules/@types/node/README.md b/JS/node_modules/@types/node/README.md deleted file mode 100755 index 48a83fc..0000000 --- a/JS/node_modules/@types/node/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Installation -> `npm install --save @types/node` - -# Summary -This package contains type definitions for Node.js (https://nodejs.org/). - -# Details -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. - -### Additional Details - * Last updated: Thu, 09 Sep 2021 20:01:20 GMT - * Dependencies: none - * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require` - -# Credits -These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13). diff --git a/JS/node_modules/@types/node/assert.d.ts b/JS/node_modules/@types/node/assert.d.ts deleted file mode 100755 index 19f1e7d..0000000 --- a/JS/node_modules/@types/node/assert.d.ts +++ /dev/null @@ -1,912 +0,0 @@ -/** - * The `assert` module provides a set of assertion functions for verifying - * invariants. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/assert.js) - */ -declare module 'assert' { - /** - * An alias of {@link ok}. - * @since v0.5.9 - * @param value The input that is checked for being truthy. - */ - function assert(value: unknown, message?: string | Error): asserts value; - namespace assert { - /** - * Indicates the failure of an assertion. All errors thrown by the `assert` module - * will be instances of the `AssertionError` class. - */ - class AssertionError extends Error { - actual: unknown; - expected: unknown; - operator: string; - generatedMessage: boolean; - code: 'ERR_ASSERTION'; - constructor(options?: { - /** If provided, the error message is set to this value. */ - message?: string | undefined; - /** The `actual` property on the error instance. */ - actual?: unknown | undefined; - /** The `expected` property on the error instance. */ - expected?: unknown | undefined; - /** The `operator` property on the error instance. */ - operator?: string | undefined; - /** If provided, the generated stack trace omits frames before this function. */ - // tslint:disable-next-line:ban-types - stackStartFn?: Function | undefined; - }); - } - /** - * This feature is currently experimental and behavior might still change. - * @since v14.2.0, v12.19.0 - * @experimental - */ - class CallTracker { - /** - * The wrapper function is expected to be called exactly `exact` times. If the - * function has not been called exactly `exact` times when `tracker.verify()` is called, then `tracker.verify()` will throw an - * error. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func); - * ``` - * @since v14.2.0, v12.19.0 - * @param [fn='A no-op function'] - * @param [exact=1] - * @return that wraps `fn`. - */ - calls(exact?: number): () => void; - calls any>(fn?: Func, exact?: number): Func; - /** - * The arrays contains information about the expected and actual number of calls of - * the functions that have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * function foo() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * // Returns an array containing information on callsfunc() - * tracker.report(); - * // [ - * // { - * // message: 'Expected the func function to be executed 2 time(s) but was - * // executed 0 time(s).', - * // actual: 0, - * // expected: 2, - * // operator: 'func', - * // stack: stack trace - * // } - * // ] - * ``` - * @since v14.2.0, v12.19.0 - * @return of objects containing information about the wrapper functions returned by `calls`. - */ - report(): CallTrackerReportInformation[]; - /** - * Iterates through the list of functions passed to `tracker.calls()` and will throw an error for functions that - * have not been called the expected number of times. - * - * ```js - * import assert from 'assert'; - * - * // Creates call tracker. - * const tracker = new assert.CallTracker(); - * - * function func() {} - * - * // Returns a function that wraps func() that must be called exact times - * // before tracker.verify(). - * const callsfunc = tracker.calls(func, 2); - * - * callsfunc(); - * - * // Will throw an error since callsfunc() was only called once. - * tracker.verify(); - * ``` - * @since v14.2.0, v12.19.0 - */ - verify(): void; - } - interface CallTrackerReportInformation { - message: string; - /** The actual number of times the function was called. */ - actual: number; - /** The number of times the function was expected to be called. */ - expected: number; - /** The name of the function that is wrapped. */ - operator: string; - /** A stack trace of the function. */ - stack: object; - } - type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error; - /** - * Throws an `AssertionError` with the provided error message or a default - * error message. If the `message` parameter is an instance of an `Error` then - * it will be thrown instead of the `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.fail(); - * // AssertionError [ERR_ASSERTION]: Failed - * - * assert.fail('boom'); - * // AssertionError [ERR_ASSERTION]: boom - * - * assert.fail(new TypeError('need array')); - * // TypeError: need array - * ``` - * - * Using `assert.fail()` with more than two arguments is possible but deprecated. - * See below for further details. - * @since v0.1.21 - * @param [message='Failed'] - */ - function fail(message?: string | Error): never; - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */ - function fail( - actual: unknown, - expected: unknown, - message?: string | Error, - operator?: string, - // tslint:disable-next-line:ban-types - stackStartFn?: Function - ): never; - /** - * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`. - * - * If `value` is not truthy, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is `undefined`, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * If no arguments are passed in at all `message` will be set to the string:`` 'No value argument passed to `assert.ok()`' ``. - * - * Be aware that in the `repl` the error message will be different to the one - * thrown in a file! See below for further details. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ok(true); - * // OK - * assert.ok(1); - * // OK - * - * assert.ok(); - * // AssertionError: No value argument passed to `assert.ok()` - * - * assert.ok(false, 'it\'s false'); - * // AssertionError: it's false - * - * // In the repl: - * assert.ok(typeof 123 === 'string'); - * // AssertionError: false == true - * - * // In a file (e.g. test.js): - * assert.ok(typeof 123 === 'string'); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(typeof 123 === 'string') - * - * assert.ok(false); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(false) - * - * assert.ok(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert.ok(0) - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * // Using `assert()` works the same: - * assert(0); - * // AssertionError: The expression evaluated to a falsy value: - * // - * // assert(0) - * ``` - * @since v0.1.21 - */ - function ok(value: unknown, message?: string | Error): asserts value; - /** - * **Strict assertion mode** - * - * An alias of {@link strictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link strictEqual} instead. - * - * Tests shallow, coercive equality between the `actual` and `expected` parameters - * using the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison) ( `==` ). `NaN` is special handled - * and treated as being identical in case both sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.equal(1, 1); - * // OK, 1 == 1 - * assert.equal(1, '1'); - * // OK, 1 == '1' - * assert.equal(NaN, NaN); - * // OK - * - * assert.equal(1, 2); - * // AssertionError: 1 == 2 - * assert.equal({ a: { b: 1 } }, { a: { b: 1 } }); - * // AssertionError: { a: { b: 1 } } == { a: { b: 1 } } - * ``` - * - * If the values are not equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default - * error message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function equal(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notStrictEqual} instead. - * - * Tests shallow, coercive inequality with the [Abstract Equality Comparison](https://tc39.github.io/ecma262/#sec-abstract-equality-comparison)(`!=` ). `NaN` is special handled and treated as - * being identical in case both - * sides are `NaN`. - * - * ```js - * import assert from 'assert'; - * - * assert.notEqual(1, 2); - * // OK - * - * assert.notEqual(1, 1); - * // AssertionError: 1 != 1 - * - * assert.notEqual(1, '1'); - * // AssertionError: 1 != '1' - * ``` - * - * If the values are equal, an `AssertionError` is thrown with a `message`property set equal to the value of the `message` parameter. If the `message`parameter is undefined, a default error - * message is assigned. If the `message`parameter is an instance of an `Error` then it will be thrown instead of the`AssertionError`. - * @since v0.1.21 - */ - function notEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link deepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link deepStrictEqual} instead. - * - * Tests for deep equality between the `actual` and `expected` parameters. Consider - * using {@link deepStrictEqual} instead. {@link deepEqual} can have - * surprising results. - * - * _Deep equality_ means that the enumerable "own" properties of child objects - * are also recursively evaluated by the following rules. - * @since v0.1.21 - */ - function deepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * **Strict assertion mode** - * - * An alias of {@link notDeepStrictEqual}. - * - * **Legacy assertion mode** - * - * > Stability: 3 - Legacy: Use {@link notDeepStrictEqual} instead. - * - * Tests for any deep inequality. Opposite of {@link deepEqual}. - * - * ```js - * import assert from 'assert'; - * - * const obj1 = { - * a: { - * b: 1 - * } - * }; - * const obj2 = { - * a: { - * b: 2 - * } - * }; - * const obj3 = { - * a: { - * b: 1 - * } - * }; - * const obj4 = Object.create(obj1); - * - * assert.notDeepEqual(obj1, obj1); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj2); - * // OK - * - * assert.notDeepEqual(obj1, obj3); - * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * - * assert.notDeepEqual(obj1, obj4); - * // OK - * ``` - * - * If the values are deeply equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a default - * error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notDeepEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests strict equality between the `actual` and `expected` parameters as - * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.strictEqual(1, 2); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // - * // 1 !== 2 - * - * assert.strictEqual(1, 1); - * // OK - * - * assert.strictEqual('Hello foobar', 'Hello World!'); - * // AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal: - * // + actual - expected - * // - * // + 'Hello foobar' - * // - 'Hello World!' - * // ^ - * - * const apples = 1; - * const oranges = 2; - * assert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`); - * // AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2 - * - * assert.strictEqual(1, '1', new TypeError('Inputs are not identical')); - * // TypeError: Inputs are not identical - * ``` - * - * If the values are not strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function strictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests strict inequality between the `actual` and `expected` parameters as - * determined by the [SameValue Comparison](https://tc39.github.io/ecma262/#sec-samevalue). - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notStrictEqual(1, 2); - * // OK - * - * assert.notStrictEqual(1, 1); - * // AssertionError [ERR_ASSERTION]: Expected "actual" to be strictly unequal to: - * // - * // 1 - * - * assert.notStrictEqual(1, '1'); - * // OK - * ``` - * - * If the values are strictly equal, an `AssertionError` is thrown with a`message` property set equal to the value of the `message` parameter. If the`message` parameter is undefined, a - * default error message is assigned. If the`message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v0.1.21 - */ - function notStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Tests for deep equality between the `actual` and `expected` parameters. - * "Deep" equality means that the enumerable "own" properties of child objects - * are recursively evaluated also by the following rules. - * @since v1.2.0 - */ - function deepStrictEqual(actual: unknown, expected: T, message?: string | Error): asserts actual is T; - /** - * Tests for deep strict inequality. Opposite of {@link deepStrictEqual}. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.notDeepStrictEqual({ a: 1 }, { a: '1' }); - * // OK - * ``` - * - * If the values are deeply and strictly equal, an `AssertionError` is thrown - * with a `message` property set equal to the value of the `message` parameter. If - * the `message` parameter is undefined, a default error message is assigned. If - * the `message` parameter is an instance of an `Error` then it will be thrown - * instead of the `AssertionError`. - * @since v1.2.0 - */ - function notDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; - /** - * Expects the function `fn` to throw an error. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * a validation object where each property will be tested for strict deep equality, - * or an instance of error where each property will be tested for strict deep - * equality including the non-enumerable `message` and `name` properties. When - * using an object, it is also possible to use a regular expression, when - * validating against a string property. See below for examples. - * - * If specified, `message` will be appended to the message provided by the`AssertionError` if the `fn` call fails to throw or in case the error validation - * fails. - * - * Custom validation object/error instance: - * - * ```js - * import assert from 'assert/strict'; - * - * const err = new TypeError('Wrong value'); - * err.code = 404; - * err.foo = 'bar'; - * err.info = { - * nested: true, - * baz: 'text' - * }; - * err.reg = /abc/i; - * - * assert.throws( - * () => { - * throw err; - * }, - * { - * name: 'TypeError', - * message: 'Wrong value', - * info: { - * nested: true, - * baz: 'text' - * } - * // Only properties on the validation object will be tested for. - * // Using nested objects requires all properties to be present. Otherwise - * // the validation is going to fail. - * } - * ); - * - * // Using regular expressions to validate error properties: - * throws( - * () => { - * throw err; - * }, - * { - * // The `name` and `message` properties are strings and using regular - * // expressions on those will match against the string. If they fail, an - * // error is thrown. - * name: /^TypeError$/, - * message: /Wrong/, - * foo: 'bar', - * info: { - * nested: true, - * // It is not possible to use regular expressions for nested properties! - * baz: 'text' - * }, - * // The `reg` property contains a regular expression and only if the - * // validation object contains an identical regular expression, it is going - * // to pass. - * reg: /abc/i - * } - * ); - * - * // Fails due to the different `message` and `name` properties: - * throws( - * () => { - * const otherErr = new Error('Not found'); - * // Copy all enumerable properties from `err` to `otherErr`. - * for (const [key, value] of Object.entries(err)) { - * otherErr[key] = value; - * } - * throw otherErr; - * }, - * // The error's `message` and `name` properties will also be checked when using - * // an error as validation object. - * err - * ); - * ``` - * - * Validate instanceof using constructor: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * Error - * ); - * ``` - * - * Validate error message using [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions): - * - * Using a regular expression runs `.toString` on the error object, and will - * therefore also include the error name. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * /^Error: Wrong value$/ - * ); - * ``` - * - * Custom error validation: - * - * The function must return `true` to indicate all internal validations passed. - * It will otherwise fail with an `AssertionError`. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.throws( - * () => { - * throw new Error('Wrong value'); - * }, - * (err) => { - * assert(err instanceof Error); - * assert(/value/.test(err)); - * // Avoid returning anything from validation functions besides `true`. - * // Otherwise, it's not clear what part of the validation failed. Instead, - * // throw an error about the specific validation that failed (as done in this - * // example) and add as much helpful debugging information to that error as - * // possible. - * return true; - * }, - * 'unexpected error' - * ); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Using the same - * message as the thrown error message is going to result in an`ERR_AMBIGUOUS_ARGUMENT` error. Please read the example below carefully if using - * a string as the second argument gets considered: - * - * ```js - * import assert from 'assert/strict'; - * - * function throwingFirst() { - * throw new Error('First'); - * } - * - * function throwingSecond() { - * throw new Error('Second'); - * } - * - * function notThrowing() {} - * - * // The second argument is a string and the input function threw an Error. - * // The first case will not throw as it does not match for the error message - * // thrown by the input function! - * assert.throws(throwingFirst, 'Second'); - * // In the next example the message has no benefit over the message from the - * // error and since it is not clear if the user intended to actually match - * // against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error. - * assert.throws(throwingSecond, 'Second'); - * // TypeError [ERR_AMBIGUOUS_ARGUMENT] - * - * // The string is only used (as message) in case the function does not throw: - * assert.throws(notThrowing, 'Second'); - * // AssertionError [ERR_ASSERTION]: Missing expected exception: Second - * - * // If it was intended to match for the error message do this instead: - * // It does not throw because the error messages match. - * assert.throws(throwingSecond, /Second$/); - * - * // If the error message does not match, an AssertionError is thrown. - * assert.throws(throwingFirst, /Second$/); - * // AssertionError [ERR_ASSERTION] - * ``` - * - * Due to the confusing error-prone notation, avoid a string as the second - * argument. - * @since v0.1.21 - */ - function throws(block: () => unknown, message?: string | Error): void; - function throws(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Asserts that the function `fn` does not throw an error. - * - * Using `assert.doesNotThrow()` is actually not useful because there - * is no benefit in catching an error and then rethrowing it. Instead, consider - * adding a comment next to the specific code path that should not throw and keep - * error messages as expressive as possible. - * - * When `assert.doesNotThrow()` is called, it will immediately call the `fn`function. - * - * If an error is thrown and it is the same type as that specified by the `error`parameter, then an `AssertionError` is thrown. If the error is of a - * different type, or if the `error` parameter is undefined, the error is - * propagated back to the caller. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * The following, for instance, will throw the `TypeError` because there is no - * matching error type in the assertion: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * However, the following will result in an `AssertionError` with the message - * 'Got unwanted exception...': - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * TypeError - * ); - * ``` - * - * If an `AssertionError` is thrown and a value is provided for the `message`parameter, the value of `message` will be appended to the `AssertionError` message: - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotThrow( - * () => { - * throw new TypeError('Wrong value'); - * }, - * /Wrong value/, - * 'Whoops' - * ); - * // Throws: AssertionError: Got unwanted exception: Whoops - * ``` - * @since v0.1.21 - */ - function doesNotThrow(block: () => unknown, message?: string | Error): void; - function doesNotThrow(block: () => unknown, error: AssertPredicate, message?: string | Error): void; - /** - * Throws `value` if `value` is not `undefined` or `null`. This is useful when - * testing the `error` argument in callbacks. The stack trace contains all frames - * from the error passed to `ifError()` including the potential new frames for`ifError()` itself. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.ifError(null); - * // OK - * assert.ifError(0); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0 - * assert.ifError('error'); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error' - * assert.ifError(new Error()); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error - * - * // Create some random error frames. - * let err; - * (function errorFrame() { - * err = new Error('test error'); - * })(); - * - * (function ifErrorFrame() { - * assert.ifError(err); - * })(); - * // AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error - * // at ifErrorFrame - * // at errorFrame - * ``` - * @since v0.1.97 - */ - function ifError(value: unknown): asserts value is null | undefined; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.rejects()` will return a rejected `Promise` with that error. If the - * function does not return a promise, `assert.rejects()` will return a rejected`Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases the error - * handler is skipped. - * - * Besides the async nature to await the completion behaves identically to {@link throws}. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), a validation function, - * an object where each property will be tested for, or an instance of error where - * each property will be tested for including the non-enumerable `message` and`name` properties. - * - * If specified, `message` will be the message provided by the `AssertionError` if the `asyncFn` fails to reject. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * { - * name: 'TypeError', - * message: 'Wrong value' - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.rejects( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * (err) => { - * assert.strictEqual(err.name, 'TypeError'); - * assert.strictEqual(err.message, 'Wrong value'); - * return true; - * } - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.rejects( - * Promise.reject(new Error('Wrong value')), - * Error - * ).then(() => { - * // ... - * }); - * ``` - * - * `error` cannot be a string. If a string is provided as the second - * argument, then `error` is assumed to be omitted and the string will be used for`message` instead. This can lead to easy-to-miss mistakes. Please read the - * example in {@link throws} carefully if using a string as the second - * argument gets considered. - * @since v10.0.0 - */ - function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise; - function rejects(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately - * calls the function and awaits the returned promise to complete. It will then - * check that the promise is not rejected. - * - * If `asyncFn` is a function and it throws an error synchronously,`assert.doesNotReject()` will return a rejected `Promise` with that error. If - * the function does not return a promise, `assert.doesNotReject()` will return a - * rejected `Promise` with an `ERR_INVALID_RETURN_VALUE` error. In both cases - * the error handler is skipped. - * - * Using `assert.doesNotReject()` is actually not useful because there is little - * benefit in catching a rejection and then rejecting it again. Instead, consider - * adding a comment next to the specific code path that should not reject and keep - * error messages as expressive as possible. - * - * If specified, `error` can be a [`Class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), - * [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) or a validation - * function. See {@link throws} for more details. - * - * Besides the async nature to await the completion behaves identically to {@link doesNotThrow}. - * - * ```js - * import assert from 'assert/strict'; - * - * await assert.doesNotReject( - * async () => { - * throw new TypeError('Wrong value'); - * }, - * SyntaxError - * ); - * ``` - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotReject(Promise.reject(new TypeError('Wrong value'))) - * .then(() => { - * // ... - * }); - * ``` - * @since v10.0.0 - */ - function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise; - function doesNotReject(block: (() => Promise) | Promise, error: AssertPredicate, message?: string | Error): Promise; - /** - * Expects the `string` input to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.match('I will fail', /pass/); - * // AssertionError [ERR_ASSERTION]: The input did not match the regular ... - * - * assert.match(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.match('I will pass', /pass/); - * // OK - * ``` - * - * If the values do not match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function match(value: string, regExp: RegExp, message?: string | Error): void; - /** - * Expects the `string` input not to match the regular expression. - * - * ```js - * import assert from 'assert/strict'; - * - * assert.doesNotMatch('I will fail', /fail/); - * // AssertionError [ERR_ASSERTION]: The input was expected to not match the ... - * - * assert.doesNotMatch(123, /pass/); - * // AssertionError [ERR_ASSERTION]: The "string" argument must be of type string. - * - * assert.doesNotMatch('I will pass', /different/); - * // OK - * ``` - * - * If the values do match, or if the `string` argument is of another type than`string`, an `AssertionError` is thrown with a `message` property set equal - * to the value of the `message` parameter. If the `message` parameter is - * undefined, a default error message is assigned. If the `message` parameter is an - * instance of an `Error` then it will be thrown instead of the `AssertionError`. - * @since v13.6.0, v12.16.0 - */ - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; - const strict: Omit & { - (value: unknown, message?: string | Error): asserts value; - equal: typeof strictEqual; - notEqual: typeof notStrictEqual; - deepEqual: typeof deepStrictEqual; - notDeepEqual: typeof notDeepStrictEqual; - // Mapped types and assertion functions are incompatible? - // TS2775: Assertions require every name in the call target - // to be declared with an explicit type annotation. - ok: typeof ok; - strictEqual: typeof strictEqual; - deepStrictEqual: typeof deepStrictEqual; - ifError: typeof ifError; - strict: typeof strict; - }; - } - export = assert; -} -declare module 'node:assert' { - import assert = require('assert'); - export = assert; -} diff --git a/JS/node_modules/@types/node/assert/strict.d.ts b/JS/node_modules/@types/node/assert/strict.d.ts deleted file mode 100755 index b4319b9..0000000 --- a/JS/node_modules/@types/node/assert/strict.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare module 'assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} -declare module 'node:assert/strict' { - import { strict } from 'node:assert'; - export = strict; -} diff --git a/JS/node_modules/@types/node/async_hooks.d.ts b/JS/node_modules/@types/node/async_hooks.d.ts deleted file mode 100755 index 157bea9..0000000 --- a/JS/node_modules/@types/node/async_hooks.d.ts +++ /dev/null @@ -1,497 +0,0 @@ -/** - * The `async_hooks` module provides an API to track asynchronous resources. It - * can be accessed using: - * - * ```js - * import async_hooks from 'async_hooks'; - * ``` - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/async_hooks.js) - */ -declare module 'async_hooks' { - /** - * ```js - * import { executionAsyncId } from 'async_hooks'; - * - * console.log(executionAsyncId()); // 1 - bootstrap - * fs.open(path, 'r', (err, fd) => { - * console.log(executionAsyncId()); // 6 - open() - * }); - * ``` - * - * The ID returned from `executionAsyncId()` is related to execution timing, not - * causality (which is covered by `triggerAsyncId()`): - * - * ```js - * const server = net.createServer((conn) => { - * // Returns the ID of the server, not of the new connection, because the - * // callback runs in the execution scope of the server's MakeCallback(). - * async_hooks.executionAsyncId(); - * - * }).listen(port, () => { - * // Returns the ID of a TickObject (process.nextTick()) because all - * // callbacks passed to .listen() are wrapped in a nextTick(). - * async_hooks.executionAsyncId(); - * }); - * ``` - * - * Promise contexts may not get precise `executionAsyncIds` by default. - * See the section on `promise execution tracking`. - * @since v8.1.0 - * @return The `asyncId` of the current execution context. Useful to track when something calls. - */ - function executionAsyncId(): number; - /** - * Resource objects returned by `executionAsyncResource()` are most often internal - * Node.js handle objects with undocumented APIs. Using any functions or properties - * on the object is likely to crash your application and should be avoided. - * - * Using `executionAsyncResource()` in the top-level execution context will - * return an empty object as there is no handle or request object to use, - * but having an object representing the top-level can be helpful. - * - * ```js - * import { open } from 'fs'; - * import { executionAsyncId, executionAsyncResource } from 'async_hooks'; - * - * console.log(executionAsyncId(), executionAsyncResource()); // 1 {} - * open(new URL(import.meta.url), 'r', (err, fd) => { - * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap - * }); - * ``` - * - * This can be used to implement continuation local storage without the - * use of a tracking `Map` to store the metadata: - * - * ```js - * import { createServer } from 'http'; - * import { - * executionAsyncId, - * executionAsyncResource, - * createHook - * } from 'async_hooks'; - * const sym = Symbol('state'); // Private symbol to avoid pollution - * - * createHook({ - * init(asyncId, type, triggerAsyncId, resource) { - * const cr = executionAsyncResource(); - * if (cr) { - * resource[sym] = cr[sym]; - * } - * } - * }).enable(); - * - * const server = createServer((req, res) => { - * executionAsyncResource()[sym] = { state: req.url }; - * setTimeout(function() { - * res.end(JSON.stringify(executionAsyncResource()[sym])); - * }, 100); - * }).listen(3000); - * ``` - * @since v13.9.0, v12.17.0 - * @return The resource representing the current execution. Useful to store data within the resource. - */ - function executionAsyncResource(): object; - /** - * ```js - * const server = net.createServer((conn) => { - * // The resource that caused (or triggered) this callback to be called - * // was that of the new connection. Thus the return value of triggerAsyncId() - * // is the asyncId of "conn". - * async_hooks.triggerAsyncId(); - * - * }).listen(port, () => { - * // Even though all callbacks passed to .listen() are wrapped in a nextTick() - * // the callback itself exists because the call to the server's .listen() - * // was made. So the return value would be the ID of the server. - * async_hooks.triggerAsyncId(); - * }); - * ``` - * - * Promise contexts may not get valid `triggerAsyncId`s by default. See - * the section on `promise execution tracking`. - * @return 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. - * - * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the - * respective asynchronous event during a resource's lifetime. - * - * All callbacks are optional. For example, if only resource cleanup needs to - * be tracked, then only the `destroy` callback needs to be passed. The - * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section. - * - * ```js - * import { createHook } from 'async_hooks'; - * - * const asyncHook = createHook({ - * init(asyncId, type, triggerAsyncId, resource) { }, - * destroy(asyncId) { } - * }); - * ``` - * - * The callbacks will be inherited via the prototype chain: - * - * ```js - * class MyAsyncCallbacks { - * init(asyncId, type, triggerAsyncId, resource) { } - * destroy(asyncId) {} - * } - * - * class MyAddedCallbacks extends MyAsyncCallbacks { - * before(asyncId) { } - * after(asyncId) { } - * } - * - * const asyncHook = async_hooks.createHook(new MyAddedCallbacks()); - * ``` - * - * Because promises are asynchronous resources whose lifecycle is tracked - * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises. - * @since v8.1.0 - * @param callbacks The `Hook Callbacks` to register - * @return Instance used for disabling and enabling hooks - */ - function createHook(callbacks: HookCallbacks): AsyncHook; - interface AsyncResourceOptions { - /** - * The ID of the execution context that created this async event. - * @default executionAsyncId() - */ - triggerAsyncId?: number | undefined; - /** - * 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 | undefined; - } - /** - * The class `AsyncResource` is designed to be extended by the embedder's async - * resources. Using this, users can easily trigger the lifetime events of their - * own resources. - * - * The `init` hook will trigger when an `AsyncResource` is instantiated. - * - * The following is an overview of the `AsyncResource` API. - * - * ```js - * import { AsyncResource, executionAsyncId } from 'async_hooks'; - * - * // AsyncResource() is meant to be extended. Instantiating a - * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then - * // async_hook.executionAsyncId() is used. - * const asyncResource = new AsyncResource( - * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false } - * ); - * - * // Run a function in the execution context of the resource. This will - * // * establish the context of the resource - * // * trigger the AsyncHooks before callbacks - * // * call the provided function `fn` with the supplied arguments - * // * trigger the AsyncHooks after callbacks - * // * restore the original execution context - * asyncResource.runInAsyncScope(fn, thisArg, ...args); - * - * // Call AsyncHooks destroy callbacks. - * asyncResource.emitDestroy(); - * - * // Return the unique ID assigned to the AsyncResource instance. - * asyncResource.asyncId(); - * - * // Return the trigger ID for the AsyncResource instance. - * asyncResource.triggerAsyncId(); - * ``` - */ - 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); - /** - * Binds the given function to the current execution context. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current execution context. - * @param type An optional name to associate with the underlying `AsyncResource`. - */ - static bind any, ThisArg>( - fn: Func, - type?: string, - thisArg?: ThisArg - ): Func & { - asyncResource: AsyncResource; - }; - /** - * Binds the given function to execute to this `AsyncResource`'s scope. - * - * The returned function will have an `asyncResource` property referencing - * the `AsyncResource` to which the function is bound. - * @since v14.8.0, v12.19.0 - * @param fn The function to bind to the current `AsyncResource`. - */ - bind any>( - fn: Func - ): Func & { - asyncResource: AsyncResource; - }; - /** - * 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. - * @since v9.6.0 - * @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 all `destroy` hooks. This should only ever be called once. An error will - * be thrown if it is called more than once. This **must** be manually called. If - * the resource is left to be collected by the GC then the `destroy` hooks will - * never be called. - * @return A reference to `asyncResource`. - */ - emitDestroy(): this; - /** - * @return The unique `asyncId` assigned to the resource. - */ - asyncId(): number; - /** - * - * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor. - */ - triggerAsyncId(): number; - } - /** - * This class creates stores that stay coherent through asynchronous operations. - * - * While you can create your own implementation on top of the `async_hooks` module,`AsyncLocalStorage` should be preferred as it is a performant and memory safe - * implementation that involves significant optimizations that are non-obvious to - * implement. - * - * The following example uses `AsyncLocalStorage` to build a simple logger - * that assigns IDs to incoming HTTP requests and includes them in messages - * logged within each request. - * - * ```js - * import http from 'http'; - * import { AsyncLocalStorage } from 'async_hooks'; - * - * const asyncLocalStorage = new AsyncLocalStorage(); - * - * function logWithId(msg) { - * const id = asyncLocalStorage.getStore(); - * console.log(`${id !== undefined ? id : '-'}:`, msg); - * } - * - * let idSeq = 0; - * http.createServer((req, res) => { - * asyncLocalStorage.run(idSeq++, () => { - * logWithId('start'); - * // Imagine any chain of async operations here - * setImmediate(() => { - * logWithId('finish'); - * res.end(); - * }); - * }); - * }).listen(8080); - * - * http.get('http://localhost:8080'); - * http.get('http://localhost:8080'); - * // Prints: - * // 0: start - * // 1: start - * // 0: finish - * // 1: finish - * ``` - * - * Each instance of `AsyncLocalStorage` maintains an independent storage context. - * Multiple instances can safely exist simultaneously without risk of interfering - * with each other data. - * @since v13.10.0, v12.17.0 - */ - class AsyncLocalStorage { - /** - * Disables the instance of `AsyncLocalStorage`. All subsequent calls - * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again. - * - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the - * instance will be exited. - * - * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores - * provided by the `asyncLocalStorage`, as those objects are garbage collected - * along with the corresponding async resources. - * - * Use this method when the `asyncLocalStorage` is not in use anymore - * in the current process. - * @since v13.10.0, v12.17.0 - * @experimental - */ - disable(): void; - /** - * Returns the current store. - * If called outside of an asynchronous context initialized by - * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it - * returns `undefined`. - * @since v13.10.0, v12.17.0 - */ - getStore(): T | undefined; - /** - * Runs a function synchronously within a context and returns its - * return value. The store is not accessible outside of the callback function or - * the asynchronous operations created within the callback. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `run()` too. - * The stacktrace is not impacted by this call and the context is exited. - * - * Example: - * - * ```js - * const store = { id: 2 }; - * try { - * asyncLocalStorage.run(store, () => { - * asyncLocalStorage.getStore(); // Returns the store object - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns undefined - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - */ - run(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Runs a function synchronously outside of a context and returns its - * return value. The store is not accessible within the callback function or - * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`. - * - * The optional `args` are passed to the callback function. - * - * If the callback function throws an error, the error is thrown by `exit()` too. - * The stacktrace is not impacted by this call and the context is re-entered. - * - * Example: - * - * ```js - * // Within a call to run - * try { - * asyncLocalStorage.getStore(); // Returns the store object or value - * asyncLocalStorage.exit(() => { - * asyncLocalStorage.getStore(); // Returns undefined - * throw new Error(); - * }); - * } catch (e) { - * asyncLocalStorage.getStore(); // Returns the same object or value - * // The error will be caught here - * } - * ``` - * @since v13.10.0, v12.17.0 - * @experimental - */ - exit(callback: (...args: TArgs) => R, ...args: TArgs): R; - /** - * Transitions into the context for the remainder of the current - * synchronous execution and then persists the store through any following - * asynchronous calls. - * - * Example: - * - * ```js - * const store = { id: 1 }; - * // Replaces previous store with the given store object - * asyncLocalStorage.enterWith(store); - * asyncLocalStorage.getStore(); // Returns the store object - * someAsyncOperation(() => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * ``` - * - * This transition will continue for the _entire_ synchronous execution. - * This means that if, for example, the context is entered within an event - * handler subsequent event handlers will also run within that context unless - * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons - * to use the latter method. - * - * ```js - * const store = { id: 1 }; - * - * emitter.on('my-event', () => { - * asyncLocalStorage.enterWith(store); - * }); - * emitter.on('my-event', () => { - * asyncLocalStorage.getStore(); // Returns the same object - * }); - * - * asyncLocalStorage.getStore(); // Returns undefined - * emitter.emit('my-event'); - * asyncLocalStorage.getStore(); // Returns the same object - * ``` - * @since v13.11.0, v12.17.0 - * @experimental - */ - enterWith(store: T): void; - } -} -declare module 'node:async_hooks' { - export * from 'async_hooks'; -} diff --git a/JS/node_modules/@types/node/buffer.d.ts b/JS/node_modules/@types/node/buffer.d.ts deleted file mode 100755 index 9bf8ff9..0000000 --- a/JS/node_modules/@types/node/buffer.d.ts +++ /dev/null @@ -1,2142 +0,0 @@ -/** - * `Buffer` objects are used to represent a fixed-length sequence of bytes. Many - * Node.js APIs support `Buffer`s. - * - * The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and - * extends it with methods that cover additional use cases. Node.js APIs accept - * plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array)s wherever `Buffer`s are supported as well. - * - * While the `Buffer` class is available within the global scope, it is still - * recommended to explicitly reference it via an import or require statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a zero-filled Buffer of length 10. - * const buf1 = Buffer.alloc(10); - * - * // Creates a Buffer of length 10, - * // filled with bytes which all have the value `1`. - * const buf2 = Buffer.alloc(10, 1); - * - * // Creates an uninitialized buffer of length 10. - * // This is faster than calling Buffer.alloc() but the returned - * // Buffer instance might contain old data that needs to be - * // overwritten using fill(), write(), or other functions that fill the Buffer's - * // contents. - * const buf3 = Buffer.allocUnsafe(10); - * - * // Creates a Buffer containing the bytes [1, 2, 3]. - * const buf4 = Buffer.from([1, 2, 3]); - * - * // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries - * // are all truncated using `(value & 255)` to fit into the range 0–255. - * const buf5 = Buffer.from([257, 257.5, -255, '1']); - * - * // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést': - * // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation) - * // [116, 195, 169, 115, 116] (in decimal notation) - * const buf6 = Buffer.from('tést'); - * - * // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74]. - * const buf7 = Buffer.from('tést', 'latin1'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/buffer.js) - */ -declare module 'buffer' { - import { BinaryLike } from 'node:crypto'; - export const INSPECT_MAX_BYTES: number; - export const kMaxLength: number; - export const kStringMaxLength: number; - export const constants: { - MAX_LENGTH: number; - MAX_STRING_LENGTH: number; - }; - export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary'; - /** - * Re-encodes the given `Buffer` or `Uint8Array` instance from one character - * encoding to another. Returns a new `Buffer` instance. - * - * Throws if the `fromEnc` or `toEnc` specify invalid character encodings or if - * conversion from `fromEnc` to `toEnc` is not permitted. - * - * Encodings supported by `buffer.transcode()` are: `'ascii'`, `'utf8'`,`'utf16le'`, `'ucs2'`, `'latin1'`, and `'binary'`. - * - * The transcoding process will use substitution characters if a given byte - * sequence cannot be adequately represented in the target encoding. For instance: - * - * ```js - * import { Buffer, transcode } from 'buffer'; - * - * const newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii'); - * console.log(newBuf.toString('ascii')); - * // Prints: '?' - * ``` - * - * Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced - * with `?` in the transcoded `Buffer`. - * @since v7.1.0 - * @param source A `Buffer` or `Uint8Array` instance. - * @param fromEnc The current encoding. - * @param toEnc To target encoding. - */ - 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; - }; - /** - * Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using - * a prior call to `URL.createObjectURL()`. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - export function resolveObjectURL(id: string): Blob | undefined; - export { Buffer }; - /** - * @experimental - */ - export interface BlobOptions { - /** - * @default 'utf8' - */ - encoding?: BufferEncoding | undefined; - /** - * The Blob content-type. The intent is for `type` to convey - * the MIME media type of the data, however no validation of the type format - * is performed. - */ - type?: string | undefined; - } - /** - * A [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) encapsulates immutable, raw data that can be safely shared across - * multiple worker threads. - * @since v15.7.0 - * @experimental - */ - export class Blob { - /** - * The total size of the `Blob` in bytes. - * @since v15.7.0 - */ - readonly size: number; - /** - * The content-type of the `Blob`. - * @since v15.7.0 - */ - readonly type: string; - /** - * Creates a new `Blob` object containing a concatenation of the given sources. - * - * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into - * the 'Blob' and can therefore be safely modified after the 'Blob' is created. - * - * String sources are also copied into the `Blob`. - */ - constructor(sources: Array, options?: BlobOptions); - /** - * Returns a promise that fulfills with an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) containing a copy of - * the `Blob` data. - * @since v15.7.0 - */ - arrayBuffer(): Promise; - /** - * Creates and returns a new `Blob` containing a subset of this `Blob` objects - * data. The original `Blob` is not altered. - * @since v15.7.0 - * @param start The starting index. - * @param end The ending index. - * @param type The content-type for the new `Blob` - */ - slice(start?: number, end?: number, type?: string): Blob; - /** - * Returns a promise that fulfills with the contents of the `Blob` decoded as a - * UTF-8 string. - * @since v15.7.0 - */ - text(): Promise; - /** - * Returns a new `ReadableStream` that allows the content of the `Blob` to be read. - * @since v16.7.0 - */ - stream(): unknown; // pending web streams types - } - export import atob = globalThis.atob; - export import btoa = globalThis.btoa; - global { - // Buffer class - type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'; - type WithImplicitCoercion = - | T - | { - valueOf(): T; - }; - /** - * 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' - */ - interface BufferConstructor { - /** - * 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. - */ - new (str: string, encoding?: BufferEncoding): Buffer; - /** - * 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()`). - */ - new (size: number): Buffer; - /** - * 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. - */ - new (array: Uint8Array): Buffer; - /** - * 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. - */ - new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer; - /** - * 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. - */ - new (array: ReadonlyArray): Buffer; - /** - * 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. - */ - new (buffer: Buffer): Buffer; - /** - * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`. - * Array entries outside that range will be truncated to fit into it. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'. - * const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); - * ``` - * - * A `TypeError` will be thrown if `array` is not an `Array` or another type - * appropriate for `Buffer.from()` variants. - * - * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v5.10.0 - */ - from(arrayBuffer: WithImplicitCoercion, byteOffset?: number, length?: number): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param data data to create a new Buffer - */ - from(data: Uint8Array | ReadonlyArray): Buffer; - from(data: WithImplicitCoercion | string>): 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'. - */ - from( - str: - | WithImplicitCoercion - | { - [Symbol.toPrimitive](hint: 'string'): string; - }, - encoding?: BufferEncoding - ): Buffer; - /** - * Creates a new Buffer using the passed {data} - * @param values to create a new Buffer - */ - of(...items: number[]): Buffer; - /** - * Returns `true` if `obj` is a `Buffer`, `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * Buffer.isBuffer(Buffer.alloc(10)); // true - * Buffer.isBuffer(Buffer.from('foo')); // true - * Buffer.isBuffer('a string'); // false - * Buffer.isBuffer([]); // false - * Buffer.isBuffer(new Uint8Array(1024)); // false - * ``` - * @since v0.1.101 - */ - isBuffer(obj: any): obj is Buffer; - /** - * Returns `true` if `encoding` is the name of a supported character encoding, - * or `false` otherwise. - * - * ```js - * import { Buffer } from 'buffer'; - * - * console.log(Buffer.isEncoding('utf8')); - * // Prints: true - * - * console.log(Buffer.isEncoding('hex')); - * // Prints: true - * - * console.log(Buffer.isEncoding('utf/8')); - * // Prints: false - * - * console.log(Buffer.isEncoding('')); - * // Prints: false - * ``` - * @since v0.9.1 - * @param encoding A character encoding name to check. - */ - isEncoding(encoding: string): encoding is BufferEncoding; - /** - * Returns the byte length of a string when encoded using `encoding`. - * This is not the same as [`String.prototype.length`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length), which does not account - * for the encoding that is used to convert the string into bytes. - * - * For `'base64'`, `'base64url'`, and `'hex'`, this function assumes valid input. - * For strings that contain non-base64/hex-encoded data (e.g. whitespace), the - * return value might be greater than the length of a `Buffer` created from the - * string. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const str = '\u00bd + \u00bc = \u00be'; - * - * console.log(`${str}: ${str.length} characters, ` + - * `${Buffer.byteLength(str, 'utf8')} bytes`); - * // Prints: ½ + ¼ = ¾: 9 characters, 12 bytes - * ``` - * - * When `string` is a - * `Buffer`/[`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)/[`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/- - * Reference/Global_Objects/TypedArray)/[`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)/[`SharedArrayBuffer`](https://develop- - * er.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer), the byte length as reported by `.byteLength`is returned. - * @since v0.1.90 - * @param string A value to calculate the length of. - * @param [encoding='utf8'] If `string` is a string, this is its encoding. - * @return The number of bytes contained within `string`. - */ - byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; - /** - * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. - * - * If the list has no items, or if the `totalLength` is 0, then a new zero-length`Buffer` is returned. - * - * If `totalLength` is not provided, it is calculated from the `Buffer` instances - * in `list` by adding their lengths. - * - * If `totalLength` is provided, it is coerced to an unsigned integer. If the - * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is - * truncated to `totalLength`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a single `Buffer` from a list of three `Buffer` instances. - * - * const buf1 = Buffer.alloc(10); - * const buf2 = Buffer.alloc(14); - * const buf3 = Buffer.alloc(18); - * const totalLength = buf1.length + buf2.length + buf3.length; - * - * console.log(totalLength); - * // Prints: 42 - * - * const bufA = Buffer.concat([buf1, buf2, buf3], totalLength); - * - * console.log(bufA); - * // Prints: - * console.log(bufA.length); - * // Prints: 42 - * ``` - * - * `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does. - * @since v0.7.11 - * @param list List of `Buffer` or {@link Uint8Array} instances to concatenate. - * @param totalLength Total length of the `Buffer` instances in `list` when concatenated. - */ - concat(list: ReadonlyArray, totalLength?: number): Buffer; - /** - * Compares `buf1` to `buf2`, typically for the purpose of sorting arrays of`Buffer` instances. This is equivalent to calling `buf1.compare(buf2)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('1234'); - * const buf2 = Buffer.from('0123'); - * const arr = [buf1, buf2]; - * - * console.log(arr.sort(Buffer.compare)); - * // Prints: [ , ] - * // (This result is equal to: [buf2, buf1].) - * ``` - * @since v0.11.13 - * @return Either `-1`, `0`, or `1`, depending on the result of the comparison. See `compare` for details. - */ - compare(buf1: Uint8Array, buf2: Uint8Array): number; - /** - * Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5); - * - * console.log(buf); - * // Prints: - * ``` - * - * If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(5, 'a'); - * - * console.log(buf); - * // Prints: - * ``` - * - * If both `fill` and `encoding` are specified, the allocated `Buffer` will be - * initialized by calling `buf.fill(fill, encoding)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); - * - * console.log(buf); - * // Prints: - * ``` - * - * Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance - * contents will never contain sensitive data from previous allocations, including - * data that might not have been allocated for `Buffer`s. - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - * @param [fill=0] A value to pre-fill the new `Buffer` with. - * @param [encoding='utf8'] If `fill` is a string, this is its encoding. - */ - alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(10); - * - * console.log(buf); - * // Prints (contents may vary): - * - * buf.fill(0); - * - * console.log(buf); - * // Prints: - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * - * The `Buffer` module pre-allocates an internal `Buffer` instance of - * size `Buffer.poolSize` that is used as a pool for the fast allocation of new`Buffer` instances created using `Buffer.allocUnsafe()`,`Buffer.from(array)`, `Buffer.concat()`, and the - * deprecated`new Buffer(size)` constructor only when `size` is less than or equal - * to `Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). - * - * Use of this pre-allocated internal memory pool is a key difference between - * calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`. - * Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less - * than or equal to half `Buffer.poolSize`. The - * difference is subtle but can be important when an application requires the - * additional performance that `Buffer.allocUnsafe()` provides. - * @since v5.10.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafe(size: number): Buffer; - /** - * Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_INVALID_ARG_VALUE` is thrown. A zero-length `Buffer` is created - * if `size` is 0. - * - * The underlying memory for `Buffer` instances created in this way is _not_ - * _initialized_. The contents of the newly created `Buffer` are unknown and_may contain sensitive data_. Use `buf.fill(0)` to initialize - * such `Buffer` instances with zeroes. - * - * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances, - * allocations under 4 KB are sliced from a single pre-allocated `Buffer`. This - * allows applications to avoid the garbage collection overhead of creating many - * individually allocated `Buffer` instances. This approach improves both - * performance and memory usage by eliminating the need to track and clean up as - * many individual `ArrayBuffer` objects. - * - * However, in the case where a developer may need to retain a small chunk of - * memory from a pool for an indeterminate amount of time, it may be appropriate - * to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and - * then copying out the relevant bits. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Need to keep around a few small chunks of memory. - * const store = []; - * - * socket.on('readable', () => { - * let data; - * while (null !== (data = readable.read())) { - * // Allocate for retained data. - * const sb = Buffer.allocUnsafeSlow(10); - * - * // Copy the data into the new allocation. - * data.copy(sb, 0, 0, 10); - * - * store.push(sb); - * } - * }); - * ``` - * - * A `TypeError` will be thrown if `size` is not a number. - * @since v5.12.0 - * @param size The desired length of the new `Buffer`. - */ - allocUnsafeSlow(size: number): Buffer; - /** - * This is the size (in bytes) of pre-allocated internal `Buffer` instances used - * for pooling. This value may be modified. - * @since v0.11.3 - */ - poolSize: number; - } - interface Buffer extends Uint8Array { - /** - * Writes `string` to `buf` at `offset` according to the character encoding in`encoding`. The `length` parameter is the number of bytes to write. If `buf` did - * not contain enough space to fit the entire string, only part of `string` will be - * written. However, partially encoded characters will not be written. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.alloc(256); - * - * const len = buf.write('\u00bd + \u00bc = \u00be', 0); - * - * console.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`); - * // Prints: 12 bytes: ½ + ¼ = ¾ - * - * const buffer = Buffer.alloc(10); - * - * const length = buffer.write('abcd', 8); - * - * console.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`); - * // Prints: 2 bytes : ab - * ``` - * @since v0.1.90 - * @param string String to write to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write `string`. - * @param [length=buf.length - offset] Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). - * @param [encoding='utf8'] The character encoding of `string`. - * @return Number of bytes written. - */ - write(string: string, encoding?: BufferEncoding): number; - write(string: string, offset: number, encoding?: BufferEncoding): number; - write(string: string, offset: number, length: number, encoding?: BufferEncoding): number; - /** - * Decodes `buf` to a string according to the specified character encoding in`encoding`. `start` and `end` may be passed to decode only a subset of `buf`. - * - * If `encoding` is `'utf8'` and a byte sequence in the input is not valid UTF-8, - * then each invalid byte is replaced with the replacement character `U+FFFD`. - * - * The maximum length of a string instance (in UTF-16 code units) is available - * as {@link constants.MAX_STRING_LENGTH}. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * console.log(buf1.toString('utf8')); - * // Prints: abcdefghijklmnopqrstuvwxyz - * console.log(buf1.toString('utf8', 0, 5)); - * // Prints: abcde - * - * const buf2 = Buffer.from('tést'); - * - * console.log(buf2.toString('hex')); - * // Prints: 74c3a97374 - * console.log(buf2.toString('utf8', 0, 3)); - * // Prints: té - * console.log(buf2.toString(undefined, 0, 3)); - * // Prints: té - * ``` - * @since v0.1.90 - * @param [encoding='utf8'] The character encoding to use. - * @param [start=0] The byte offset to start decoding at. - * @param [end=buf.length] The byte offset to stop decoding at (not inclusive). - */ - toString(encoding?: BufferEncoding, start?: number, end?: number): string; - /** - * Returns a JSON representation of `buf`. [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) implicitly calls - * this function when stringifying a `Buffer` instance. - * - * `Buffer.from()` accepts objects in the format returned from this method. - * In particular, `Buffer.from(buf.toJSON())` works like `Buffer.from(buf)`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]); - * const json = JSON.stringify(buf); - * - * console.log(json); - * // Prints: {"type":"Buffer","data":[1,2,3,4,5]} - * - * const copy = JSON.parse(json, (key, value) => { - * return value && value.type === 'Buffer' ? - * Buffer.from(value) : - * value; - * }); - * - * console.log(copy); - * // Prints: - * ``` - * @since v0.9.2 - */ - toJSON(): { - type: 'Buffer'; - data: number[]; - }; - /** - * Returns `true` if both `buf` and `otherBuffer` have exactly the same bytes,`false` otherwise. Equivalent to `buf.compare(otherBuffer) === 0`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('414243', 'hex'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.equals(buf2)); - * // Prints: true - * console.log(buf1.equals(buf3)); - * // Prints: false - * ``` - * @since v0.11.13 - * @param otherBuffer A `Buffer` or {@link Uint8Array} with which to compare `buf`. - */ - equals(otherBuffer: Uint8Array): boolean; - /** - * Compares `buf` with `target` and returns a number indicating whether `buf`comes before, after, or is the same as `target` in sort order. - * Comparison is based on the actual sequence of bytes in each `Buffer`. - * - * * `0` is returned if `target` is the same as `buf` - * * `1` is returned if `target` should come _before_`buf` when sorted. - * * `-1` is returned if `target` should come _after_`buf` when sorted. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('ABC'); - * const buf2 = Buffer.from('BCD'); - * const buf3 = Buffer.from('ABCD'); - * - * console.log(buf1.compare(buf1)); - * // Prints: 0 - * console.log(buf1.compare(buf2)); - * // Prints: -1 - * console.log(buf1.compare(buf3)); - * // Prints: -1 - * console.log(buf2.compare(buf1)); - * // Prints: 1 - * console.log(buf2.compare(buf3)); - * // Prints: 1 - * console.log([buf1, buf2, buf3].sort(Buffer.compare)); - * // Prints: [ , , ] - * // (This result is equal to: [buf1, buf3, buf2].) - * ``` - * - * The optional `targetStart`, `targetEnd`, `sourceStart`, and `sourceEnd`arguments can be used to limit the comparison to specific ranges within `target`and `buf` respectively. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); - * const buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]); - * - * console.log(buf1.compare(buf2, 5, 9, 0, 4)); - * // Prints: 0 - * console.log(buf1.compare(buf2, 0, 6, 4)); - * // Prints: -1 - * console.log(buf1.compare(buf2, 5, 6, 5)); - * // Prints: 1 - * ``` - * - * `ERR_OUT_OF_RANGE` is thrown if `targetStart < 0`, `sourceStart < 0`,`targetEnd > target.byteLength`, or `sourceEnd > source.byteLength`. - * @since v0.11.13 - * @param target A `Buffer` or {@link Uint8Array} with which to compare `buf`. - * @param [targetStart=0] The offset within `target` at which to begin comparison. - * @param [targetEnd=target.length] The offset within `target` at which to end comparison (not inclusive). - * @param [sourceStart=0] The offset within `buf` at which to begin comparison. - * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive). - */ - compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; - /** - * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`. - * - * [`TypedArray.prototype.set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set) performs the same operation, and is available - * for all TypedArrays, including Node.js `Buffer`s, although it takes - * different function arguments. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create two `Buffer` instances. - * const buf1 = Buffer.allocUnsafe(26); - * const buf2 = Buffer.allocUnsafe(26).fill('!'); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * // Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`. - * buf1.copy(buf2, 8, 16, 20); - * // This is equivalent to: - * // buf2.set(buf1.subarray(16, 20), 8); - * - * console.log(buf2.toString('ascii', 0, 25)); - * // Prints: !!!!!!!!qrst!!!!!!!!!!!!! - * ``` - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` and copy data from one region to an overlapping region - * // within the same `Buffer`. - * - * const buf = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf[i] = i + 97; - * } - * - * buf.copy(buf, 0, 4, 10); - * - * console.log(buf.toString()); - * // Prints: efghijghijklmnopqrstuvwxyz - * ``` - * @since v0.1.90 - * @param target A `Buffer` or {@link Uint8Array} to copy into. - * @param [targetStart=0] The offset within `target` at which to begin writing. - * @param [sourceStart=0] The offset within `buf` from which to begin copying. - * @param [sourceEnd=buf.length] The offset within `buf` at which to stop copying (not inclusive). - * @return The number of bytes copied. - */ - copy(target: 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 is the same behavior as `buf.subarray()`. - * - * This method is not compatible with the `Uint8Array.prototype.slice()`, - * which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * const copiedBuf = Uint8Array.prototype.slice.call(buf); - * copiedBuf[0]++; - * console.log(copiedBuf.toString()); - * // Prints: cuffer - * - * console.log(buf.toString()); - * // Prints: buffer - * ``` - * @since v0.3.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - slice(start?: 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. - * - * Specifying `end` greater than `buf.length` will return the same result as - * that of `end` equal to `buf.length`. - * - * This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray). - * - * Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte - * // from the original `Buffer`. - * - * const buf1 = Buffer.allocUnsafe(26); - * - * for (let i = 0; i < 26; i++) { - * // 97 is the decimal ASCII value for 'a'. - * buf1[i] = i + 97; - * } - * - * const buf2 = buf1.subarray(0, 3); - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: abc - * - * buf1[0] = 33; - * - * console.log(buf2.toString('ascii', 0, buf2.length)); - * // Prints: !bc - * ``` - * - * Specifying negative indexes causes the slice to be generated relative to the - * end of `buf` rather than the beginning. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * console.log(buf.subarray(-6, -1).toString()); - * // Prints: buffe - * // (Equivalent to buf.subarray(0, 5).) - * - * console.log(buf.subarray(-6, -2).toString()); - * // Prints: buff - * // (Equivalent to buf.subarray(0, 4).) - * - * console.log(buf.subarray(-5, -2).toString()); - * // Prints: uff - * // (Equivalent to buf.subarray(1, 4).) - * ``` - * @since v3.0.0 - * @param [start=0] Where the new `Buffer` will start. - * @param [end=buf.length] Where the new `Buffer` will end (not inclusive). - */ - subarray(start?: number, end?: number): Buffer; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64BE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigInt64LE(0x0102030405060708n, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigInt64LE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. - * - * This function is also available under the `writeBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64BE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64BE(value: bigint, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeBigUInt64LE(0xdecafafecacefaden, 0); - * - * console.log(buf); - * // Prints: - * ``` - * - * This function is also available under the `writeBigUint64LE` alias. - * @since v12.0.0, v10.20.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeBigUInt64LE(value: bigint, offset?: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than an unsigned integer. - * - * This function is also available under the `writeUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeUIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeUIntBE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined - * when `value` is anything other than a signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntLE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntLE(value: number, offset: number, byteLength: number): number; - /** - * Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a - * signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(6); - * - * buf.writeIntBE(0x1234567890ab, 0, 6); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param offset Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to write. Must satisfy `0 < byteLength <= 6`. - * @return `offset` plus the number of bytes written. - */ - writeIntBE(value: number, offset: number, byteLength: number): number; - /** - * Reads an unsigned, big-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64BE(0)); - * // Prints: 4294967295n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64BE(offset?: number): bigint; - /** - * Reads an unsigned, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readBigUint64LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]); - * - * console.log(buf.readBigUInt64LE(0)); - * // Prints: 18446744069414584320n - * ``` - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigUInt64LE(offset?: number): bigint; - /** - * Reads a signed, big-endian 64-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64BE(offset?: number): bigint; - /** - * Reads a signed, little-endian 64-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed - * values. - * @since v12.0.0, v10.20.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. - */ - readBigInt64LE(offset?: number): bigint; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned, little-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintLE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntLE(0, 6).toString(16)); - * // Prints: ab9078563412 - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as an unsigned big-endian integer supporting - * up to 48 bits of accuracy. - * - * This function is also available under the `readUintBE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readUIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readUIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readUIntBE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a little-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntLE(0, 6).toString(16)); - * // Prints: -546f87a9cbee - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntLE(offset: number, byteLength: number): number; - /** - * Reads `byteLength` number of bytes from `buf` at the specified `offset`and interprets the result as a big-endian, two's complement signed value - * supporting up to 48 bits of accuracy. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]); - * - * console.log(buf.readIntBE(0, 6).toString(16)); - * // Prints: 1234567890ab - * console.log(buf.readIntBE(1, 6).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * console.log(buf.readIntBE(1, 0).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param offset Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`. - * @param byteLength Number of bytes to read. Must satisfy `0 < byteLength <= 6`. - */ - readIntBE(offset: number, byteLength: number): number; - /** - * Reads an unsigned 8-bit integer from `buf` at the specified `offset`. - * - * This function is also available under the `readUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, -2]); - * - * console.log(buf.readUInt8(0)); - * // Prints: 1 - * console.log(buf.readUInt8(1)); - * // Prints: 254 - * console.log(buf.readUInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readUInt8(offset?: number): number; - /** - * Reads an unsigned, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16LE(0).toString(16)); - * // Prints: 3412 - * console.log(buf.readUInt16LE(1).toString(16)); - * // Prints: 5634 - * console.log(buf.readUInt16LE(2).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 16-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56]); - * - * console.log(buf.readUInt16BE(0).toString(16)); - * // Prints: 1234 - * console.log(buf.readUInt16BE(1).toString(16)); - * // Prints: 3456 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readUInt16BE(offset?: number): number; - /** - * Reads an unsigned, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32LE(0).toString(16)); - * // Prints: 78563412 - * console.log(buf.readUInt32LE(1).toString(16)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32LE(offset?: number): number; - /** - * Reads an unsigned, big-endian 32-bit integer from `buf` at the specified`offset`. - * - * This function is also available under the `readUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0x12, 0x34, 0x56, 0x78]); - * - * console.log(buf.readUInt32BE(0).toString(16)); - * // Prints: 12345678 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readUInt32BE(offset?: number): number; - /** - * Reads a signed 8-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([-1, 5]); - * - * console.log(buf.readInt8(0)); - * // Prints: -1 - * console.log(buf.readInt8(1)); - * // Prints: 5 - * console.log(buf.readInt8(2)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.0 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. - */ - readInt8(offset?: number): number; - /** - * Reads a signed, little-endian 16-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16LE(0)); - * // Prints: 1280 - * console.log(buf.readInt16LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16LE(offset?: number): number; - /** - * Reads a signed, big-endian 16-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 5]); - * - * console.log(buf.readInt16BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. - */ - readInt16BE(offset?: number): number; - /** - * Reads a signed, little-endian 32-bit integer from `buf` at the specified`offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32LE(0)); - * // Prints: 83886080 - * console.log(buf.readInt32LE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32LE(offset?: number): number; - /** - * Reads a signed, big-endian 32-bit integer from `buf` at the specified `offset`. - * - * Integers read from a `Buffer` are interpreted as two's complement signed values. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([0, 0, 0, 5]); - * - * console.log(buf.readInt32BE(0)); - * // Prints: 5 - * ``` - * @since v0.5.5 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readInt32BE(offset?: number): number; - /** - * Reads a 32-bit, little-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatLE(0)); - * // Prints: 1.539989614439558e-36 - * console.log(buf.readFloatLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatLE(offset?: number): number; - /** - * Reads a 32-bit, big-endian float from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4]); - * - * console.log(buf.readFloatBE(0)); - * // Prints: 2.387939260590663e-38 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. - */ - readFloatBE(offset?: number): number; - /** - * Reads a 64-bit, little-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleLE(0)); - * // Prints: 5.447603722011605e-270 - * console.log(buf.readDoubleLE(1)); - * // Throws ERR_OUT_OF_RANGE. - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleLE(offset?: number): number; - /** - * Reads a 64-bit, big-endian double from `buf` at the specified `offset`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]); - * - * console.log(buf.readDoubleBE(0)); - * // Prints: 8.20788039913184e-304 - * ``` - * @since v0.11.15 - * @param [offset=0] Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. - */ - readDoubleBE(offset?: number): number; - reverse(): this; - /** - * Interprets `buf` as an array of unsigned 16-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 2. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap16(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap16(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * - * One convenient use of `buf.swap16()` is to perform a fast in-place conversion - * between UTF-16 little-endian and UTF-16 big-endian: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('This is little-endian UTF-16', 'utf16le'); - * buf.swap16(); // Convert to big-endian UTF-16 text. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap16(): Buffer; - /** - * Interprets `buf` as an array of unsigned 32-bit integers and swaps the - * byte order _in-place_. Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 4. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap32(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap32(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v5.10.0 - * @return A reference to `buf`. - */ - swap32(): Buffer; - /** - * Interprets `buf` as an array of 64-bit numbers and swaps byte order _in-place_. - * Throws `ERR_INVALID_BUFFER_SIZE` if `buf.length` is not a multiple of 8. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); - * - * console.log(buf1); - * // Prints: - * - * buf1.swap64(); - * - * console.log(buf1); - * // Prints: - * - * const buf2 = Buffer.from([0x1, 0x2, 0x3]); - * - * buf2.swap64(); - * // Throws ERR_INVALID_BUFFER_SIZE. - * ``` - * @since v6.3.0 - * @return A reference to `buf`. - */ - swap64(): Buffer; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a - * valid unsigned 8-bit integer. Behavior is undefined when `value` is anything - * other than an unsigned 8-bit integer. - * - * This function is also available under the `writeUint8` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt8(0x3, 0); - * buf.writeUInt8(0x4, 1); - * buf.writeUInt8(0x23, 2); - * buf.writeUInt8(0x42, 3); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeUInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 16-bit integer. - * - * This function is also available under the `writeUint16LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16LE(0xdead, 0); - * buf.writeUInt16LE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 16-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 16-bit integer. - * - * This function is also available under the `writeUint16BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt16BE(0xdead, 0); - * buf.writeUInt16BE(0xbeef, 2); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeUInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is - * anything other than an unsigned 32-bit integer. - * - * This function is also available under the `writeUint32LE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32LE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid unsigned 32-bit integer. Behavior is undefined when `value`is anything other than an - * unsigned 32-bit integer. - * - * This function is also available under the `writeUint32BE` alias. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeUInt32BE(0xfeedface, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeUInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset`. `value` must be a valid - * signed 8-bit integer. Behavior is undefined when `value` is anything other than - * a signed 8-bit integer. - * - * `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt8(2, 0); - * buf.writeInt8(-2, 1); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.0 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. - * @return `offset` plus the number of bytes written. - */ - writeInt8(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16LE(0x0304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 16-bit integer. Behavior is undefined when `value` is - * anything other than a signed 16-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(2); - * - * buf.writeInt16BE(0x0102, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. - * @return `offset` plus the number of bytes written. - */ - writeInt16BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32LE(0x05060708, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32LE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a valid signed 32-bit integer. Behavior is undefined when `value` is - * anything other than a signed 32-bit integer. - * - * The `value` is interpreted and written as a two's complement signed integer. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeInt32BE(0x01020304, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.5.5 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeInt32BE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatLE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. Behavior is - * undefined when `value` is anything other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(4); - * - * buf.writeFloatBE(0xcafebabe, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. - * @return `offset` plus the number of bytes written. - */ - writeFloatBE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as little-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleLE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleLE(value: number, offset?: number): number; - /** - * Writes `value` to `buf` at the specified `offset` as big-endian. The `value`must be a JavaScript number. Behavior is undefined when `value` is anything - * other than a JavaScript number. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(8); - * - * buf.writeDoubleBE(123.456, 0); - * - * console.log(buf); - * // Prints: - * ``` - * @since v0.11.15 - * @param value Number to be written to `buf`. - * @param [offset=0] Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. - * @return `offset` plus the number of bytes written. - */ - writeDoubleBE(value: number, offset?: number): number; - /** - * Fills `buf` with the specified `value`. If the `offset` and `end` are not given, - * the entire `buf` will be filled: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with the ASCII character 'h'. - * - * const b = Buffer.allocUnsafe(50).fill('h'); - * - * console.log(b.toString()); - * // Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh - * ``` - * - * `value` is coerced to a `uint32` value if it is not a string, `Buffer`, or - * integer. If the resulting integer is greater than `255` (decimal), `buf` will be - * filled with `value & 255`. - * - * If the final write of a `fill()` operation falls on a multi-byte character, - * then only the bytes of that character that fit into `buf` are written: - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Fill a `Buffer` with character that takes up two bytes in UTF-8. - * - * console.log(Buffer.allocUnsafe(5).fill('\u0222')); - * // Prints: - * ``` - * - * If `value` contains invalid characters, it is truncated; if no valid - * fill data remains, an exception is thrown: - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.allocUnsafe(5); - * - * console.log(buf.fill('a')); - * // Prints: - * console.log(buf.fill('aazz', 'hex')); - * // Prints: - * console.log(buf.fill('zz', 'hex')); - * // Throws an exception. - * ``` - * @since v0.5.0 - * @param value The value with which to fill `buf`. - * @param [offset=0] Number of bytes to skip before starting to fill `buf`. - * @param [end=buf.length] Where to stop filling `buf` (not inclusive). - * @param [encoding='utf8'] The encoding for `value` if `value` is a string. - * @return A reference to `buf`. - */ - fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this; - /** - * If `value` is: - * - * * a string, `value` is interpreted according to the character encoding in`encoding`. - * * a `Buffer` or [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array), `value` will be used in its entirety. - * To compare a partial `Buffer`, use `buf.slice()`. - * * a number, `value` will be interpreted as an unsigned 8-bit integer - * value between `0` and `255`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.indexOf('this')); - * // Prints: 0 - * console.log(buf.indexOf('is')); - * // Prints: 2 - * console.log(buf.indexOf(Buffer.from('a buffer'))); - * // Prints: 8 - * console.log(buf.indexOf(97)); - * // Prints: 8 (97 is the decimal ASCII value for 'a') - * console.log(buf.indexOf(Buffer.from('a buffer example'))); - * // Prints: -1 - * console.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: 8 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.indexOf('\u03a3', 0, 'utf16le')); - * // Prints: 4 - * console.log(utf16Buffer.indexOf('\u03a3', -4, 'utf16le')); - * // Prints: 6 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. If the result - * of coercion is `NaN` or `0`, then the entire buffer will be searched. This - * behavior matches [`String.prototype.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.indexOf(99.9)); - * console.log(b.indexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN or 0. - * // Prints: 1, searching the whole buffer. - * console.log(b.indexOf('b', undefined)); - * console.log(b.indexOf('b', {})); - * console.log(b.indexOf('b', null)); - * console.log(b.indexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer` and `byteOffset` is less - * than `buf.length`, `byteOffset` will be returned. If `value` is empty and`byteOffset` is at least `buf.length`, `buf.length` will be returned. - * @since v1.5.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Identical to `buf.indexOf()`, except the last occurrence of `value` is found - * rather than the first occurrence. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this buffer is a buffer'); - * - * console.log(buf.lastIndexOf('this')); - * // Prints: 0 - * console.log(buf.lastIndexOf('buffer')); - * // Prints: 17 - * console.log(buf.lastIndexOf(Buffer.from('buffer'))); - * // Prints: 17 - * console.log(buf.lastIndexOf(97)); - * // Prints: 15 (97 is the decimal ASCII value for 'a') - * console.log(buf.lastIndexOf(Buffer.from('yolo'))); - * // Prints: -1 - * console.log(buf.lastIndexOf('buffer', 5)); - * // Prints: 5 - * console.log(buf.lastIndexOf('buffer', 4)); - * // Prints: -1 - * - * const utf16Buffer = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'utf16le'); - * - * console.log(utf16Buffer.lastIndexOf('\u03a3', undefined, 'utf16le')); - * // Prints: 6 - * console.log(utf16Buffer.lastIndexOf('\u03a3', -5, 'utf16le')); - * // Prints: 4 - * ``` - * - * If `value` is not a string, number, or `Buffer`, this method will throw a`TypeError`. If `value` is a number, it will be coerced to a valid byte value, - * an integer between 0 and 255. - * - * If `byteOffset` is not a number, it will be coerced to a number. Any arguments - * that coerce to `NaN`, like `{}` or `undefined`, will search the whole buffer. - * This behavior matches [`String.prototype.lastIndexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const b = Buffer.from('abcdef'); - * - * // Passing a value that's a number, but not a valid byte. - * // Prints: 2, equivalent to searching for 99 or 'c'. - * console.log(b.lastIndexOf(99.9)); - * console.log(b.lastIndexOf(256 + 99)); - * - * // Passing a byteOffset that coerces to NaN. - * // Prints: 1, searching the whole buffer. - * console.log(b.lastIndexOf('b', undefined)); - * console.log(b.lastIndexOf('b', {})); - * - * // Passing a byteOffset that coerces to 0. - * // Prints: -1, equivalent to passing 0. - * console.log(b.lastIndexOf('b', null)); - * console.log(b.lastIndexOf('b', [])); - * ``` - * - * If `value` is an empty string or empty `Buffer`, `byteOffset` will be returned. - * @since v6.0.0 - * @param value What to search for. - * @param [byteOffset=buf.length - 1] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. - * @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`. - */ - lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `[index, byte]` pairs from the contents - * of `buf`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * // Log the entire contents of a `Buffer`. - * - * const buf = Buffer.from('buffer'); - * - * for (const pair of buf.entries()) { - * console.log(pair); - * } - * // Prints: - * // [0, 98] - * // [1, 117] - * // [2, 102] - * // [3, 102] - * // [4, 101] - * // [5, 114] - * ``` - * @since v1.1.0 - */ - entries(): IterableIterator<[number, number]>; - /** - * Equivalent to `buf.indexOf() !== -1`. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('this is a buffer'); - * - * console.log(buf.includes('this')); - * // Prints: true - * console.log(buf.includes('is')); - * // Prints: true - * console.log(buf.includes(Buffer.from('a buffer'))); - * // Prints: true - * console.log(buf.includes(97)); - * // Prints: true (97 is the decimal ASCII value for 'a') - * console.log(buf.includes(Buffer.from('a buffer example'))); - * // Prints: false - * console.log(buf.includes(Buffer.from('a buffer example').slice(0, 8))); - * // Prints: true - * console.log(buf.includes('this', 4)); - * // Prints: false - * ``` - * @since v5.3.0 - * @param value What to search for. - * @param [byteOffset=0] Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. - * @param [encoding='utf8'] If `value` is a string, this is its encoding. - * @return `true` if `value` was found in `buf`, `false` otherwise. - */ - includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) of `buf` keys (indices). - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const key of buf.keys()) { - * console.log(key); - * } - * // Prints: - * // 0 - * // 1 - * // 2 - * // 3 - * // 4 - * // 5 - * ``` - * @since v1.1.0 - */ - keys(): IterableIterator; - /** - * Creates and returns an [iterator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) for `buf` values (bytes). This function is - * called automatically when a `Buffer` is used in a `for..of` statement. - * - * ```js - * import { Buffer } from 'buffer'; - * - * const buf = Buffer.from('buffer'); - * - * for (const value of buf.values()) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * - * for (const value of buf) { - * console.log(value); - * } - * // Prints: - * // 98 - * // 117 - * // 102 - * // 102 - * // 101 - * // 114 - * ``` - * @since v1.1.0 - */ - values(): IterableIterator; - } - var Buffer: BufferConstructor; - /** - * Decodes a string of Base64-encoded data into bytes, and encodes those bytes - * into a string using Latin-1 (ISO-8859-1). - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0 - * @deprecated Use `Buffer.from(data, 'base64')` instead. - * @param data The Base64-encoded input string. - */ - function atob(data: string): string; - /** - * Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes - * into a string using Base64. - * - * The `data` may be any JavaScript-value that can be coerced into a string. - * - * **This function is only provided for compatibility with legacy web platform APIs** - * **and should never be used in new code, because they use strings to represent** - * **binary data and predate the introduction of typed arrays in JavaScript.** - * **For code running using Node.js APIs, converting between base64-encoded strings** - * **and binary data should be performed using `Buffer.from(str, 'base64')` and`buf.toString('base64')`.** - * @since v15.13.0 - * @deprecated Use `buf.toString('base64')` instead. - * @param data An ASCII (Latin1) string. - */ - function btoa(data: string): string; - } -} -declare module 'node:buffer' { - export * from 'buffer'; -} diff --git a/JS/node_modules/@types/node/child_process.d.ts b/JS/node_modules/@types/node/child_process.d.ts deleted file mode 100755 index 66540c3..0000000 --- a/JS/node_modules/@types/node/child_process.d.ts +++ /dev/null @@ -1,1355 +0,0 @@ -/** - * The `child_process` module provides the ability to spawn subprocesses in - * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability - * is primarily provided by the {@link spawn} function: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * By default, pipes for `stdin`, `stdout`, and `stderr` are established between - * the parent Node.js process and the spawned subprocess. These pipes have - * limited (and platform-specific) capacity. If the subprocess writes to - * stdout in excess of that limit without the output being captured, the - * subprocess blocks waiting for the pipe buffer to accept more data. This is - * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed. - * - * The command lookup is performed using the `options.env.PATH` environment - * variable if it is in the `options` object. Otherwise, `process.env.PATH` is - * used. - * - * On Windows, environment variables are case-insensitive. Node.js - * lexicographically sorts the `env` keys and uses the first one that - * case-insensitively matches. Only first (in lexicographic order) entry will be - * passed to the subprocess. This might lead to issues on Windows when passing - * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`. - * - * The {@link spawn} method spawns the child process asynchronously, - * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks - * the event loop until the spawned process either exits or is terminated. - * - * For convenience, the `child_process` module provides a handful of synchronous - * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on - * top of {@link spawn} or {@link spawnSync}. - * - * * {@link exec}: spawns a shell and runs a command within that - * shell, passing the `stdout` and `stderr` to a callback function when - * complete. - * * {@link execFile}: similar to {@link exec} except - * that it spawns the command directly without first spawning a shell by - * default. - * * {@link fork}: spawns a new Node.js process and invokes a - * specified module with an IPC communication channel established that allows - * sending messages between parent and child. - * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop. - * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop. - * - * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however, - * the synchronous methods can have significant impact on performance due to - * stalling the event loop while spawned processes complete. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/child_process.js) - */ -declare module 'child_process' { - import { ObjectEncodingOptions } from 'node:fs'; - import { EventEmitter, Abortable } from 'node:events'; - import * as net from 'node:net'; - import { Writable, Readable, Stream, Pipe } from 'node:stream'; - import { URL } from 'node:url'; - type Serializable = string | object | number | boolean | bigint; - type SendHandle = net.Socket | net.Server; - class ChildProcess extends EventEmitter { - /** - * A `Writable Stream` that represents the child process's `stdin`. - * - * If a child process waits to read all of its input, the child will not continue - * until this stream has been closed via `end()`. - * - * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will - * refer to the same value. - * - * The `subprocess.stdin` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdin: Writable | null; - /** - * A `Readable Stream` that represents the child process's `stdout`. - * - * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will - * refer to the same value. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn('ls'); - * - * subprocess.stdout.on('data', (data) => { - * console.log(`Received chunk ${data}`); - * }); - * ``` - * - * The `subprocess.stdout` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stdout: Readable | null; - /** - * A `Readable Stream` that represents the child process's `stderr`. - * - * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`, - * then this will be `null`. - * - * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will - * refer to the same value. - * - * The `subprocess.stderr` property can be `null` if the child process could - * not be successfully spawned. - * @since v0.1.90 - */ - stderr: Readable | null; - /** - * The `subprocess.channel` property is a reference to the child's IPC channel. If - * no IPC channel currently exists, this property is `undefined`. - * @since v7.1.0 - */ - readonly channel?: Pipe | null | undefined; - /** - * A sparse array of pipes to the child process, corresponding with positions in - * the `stdio` option passed to {@link spawn} that have been set - * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`, - * respectively. - * - * In the following example, only the child's fd `1` (stdout) is configured as a - * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values - * in the array are `null`. - * - * ```js - * const assert = require('assert'); - * const fs = require('fs'); - * const child_process = require('child_process'); - * - * const subprocess = child_process.spawn('ls', { - * stdio: [ - * 0, // Use parent's stdin for child. - * 'pipe', // Pipe child's stdout to parent. - * fs.openSync('err.out', 'w'), // Direct child's stderr to a file. - * ] - * }); - * - * assert.strictEqual(subprocess.stdio[0], null); - * assert.strictEqual(subprocess.stdio[0], subprocess.stdin); - * - * assert(subprocess.stdout); - * assert.strictEqual(subprocess.stdio[1], subprocess.stdout); - * - * assert.strictEqual(subprocess.stdio[2], null); - * assert.strictEqual(subprocess.stdio[2], subprocess.stderr); - * ``` - * - * The `subprocess.stdio` property can be `undefined` if the child process could - * not be successfully spawned. - * @since v0.7.10 - */ - readonly stdio: [ - Writable | null, - // stdin - Readable | null, - // stdout - Readable | null, - // stderr - Readable | Writable | null | undefined, - // extra - Readable | Writable | null | undefined // extra - ]; - /** - * The `subprocess.killed` property indicates whether the child process - * successfully received a signal from `subprocess.kill()`. The `killed` property - * does not indicate that the child process has been terminated. - * @since v0.5.10 - */ - readonly killed: boolean; - /** - * Returns the process identifier (PID) of the child process. If the child process - * fails to spawn due to errors, then the value is `undefined` and `error` is - * emitted. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * console.log(`Spawned child pid: ${grep.pid}`); - * grep.stdin.end(); - * ``` - * @since v0.1.90 - */ - readonly pid?: number | undefined; - /** - * The `subprocess.connected` property indicates whether it is still possible to - * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages. - * @since v0.7.2 - */ - readonly connected: boolean; - /** - * The `subprocess.exitCode` property indicates the exit code of the child process. - * If the child process is still running, the field will be `null`. - */ - readonly exitCode: number | null; - /** - * The `subprocess.signalCode` property indicates the signal received by - * the child process if any, else `null`. - */ - readonly signalCode: NodeJS.Signals | null; - /** - * The `subprocess.spawnargs` property represents the full list of command-line - * arguments the child process was launched with. - */ - readonly spawnargs: string[]; - /** - * The `subprocess.spawnfile` property indicates the executable file name of - * the child process that is launched. - * - * For {@link fork}, its value will be equal to `process.execPath`. - * For {@link spawn}, its value will be the name of - * the executable file. - * For {@link exec}, its value will be the name of the shell - * in which the child process is launched. - */ - readonly spawnfile: string; - /** - * The `subprocess.kill()` method sends a signal to the child process. If no - * argument is given, the process will be sent the `'SIGTERM'` signal. See[`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function - * returns `true` if[`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise. - * - * ```js - * const { spawn } = require('child_process'); - * const grep = spawn('grep', ['ssh']); - * - * grep.on('close', (code, signal) => { - * console.log( - * `child process terminated due to receipt of signal ${signal}`); - * }); - * - * // Send SIGHUP to process. - * grep.kill('SIGHUP'); - * ``` - * - * The `ChildProcess` object may emit an `'error'` event if the signal - * cannot be delivered. Sending a signal to a child process that has already exited - * is not an error but may have unforeseen consequences. Specifically, if the - * process identifier (PID) has been reassigned to another process, the signal will - * be delivered to that process instead which can have unexpected results. - * - * While the function is called `kill`, the signal delivered to the child process - * may not actually terminate the process. - * - * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference. - * - * On Windows, where POSIX signals do not exist, the `signal` argument will be - * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`). - * See `Signal Events` for more details. - * - * On Linux, child processes of child processes will not be terminated - * when attempting to kill their parent. This is likely to happen when running a - * new process in a shell or with the use of the `shell` option of `ChildProcess`: - * - * ```js - * 'use strict'; - * const { spawn } = require('child_process'); - * - * const subprocess = spawn( - * 'sh', - * [ - * '-c', - * `node -e "setInterval(() => { - * console.log(process.pid, 'is alive') - * }, 500);"`, - * ], { - * stdio: ['inherit', 'inherit', 'inherit'] - * } - * ); - * - * setTimeout(() => { - * subprocess.kill(); // Does not terminate the Node.js process in the shell. - * }, 2000); - * ``` - * @since v0.1.90 - */ - kill(signal?: NodeJS.Signals | number): boolean; - /** - * When an IPC channel has been established between the parent and child ( - * i.e. when using {@link fork}), the `subprocess.send()` method can - * be used to send messages to the child process. When the child process is a - * Node.js instance, these messages can be received via the `'message'` event. - * - * The message goes through serialization and parsing. The resulting - * message might not be the same as what is originally sent. - * - * For example, in the parent script: - * - * ```js - * const cp = require('child_process'); - * const n = cp.fork(`${__dirname}/sub.js`); - * - * n.on('message', (m) => { - * console.log('PARENT got message:', m); - * }); - * - * // Causes the child to print: CHILD got message: { hello: 'world' } - * n.send({ hello: 'world' }); - * ``` - * - * And then the child script, `'sub.js'` might look like this: - * - * ```js - * process.on('message', (m) => { - * console.log('CHILD got message:', m); - * }); - * - * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null } - * process.send({ foo: 'bar', baz: NaN }); - * ``` - * - * Child Node.js processes will have a `process.send()` method of their own - * that allows the child to send messages back to the parent. - * - * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages - * containing a `NODE_` prefix in the `cmd` property are reserved for use within - * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js. - * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice. - * - * The optional `sendHandle` argument that may be passed to `subprocess.send()` is - * for passing a TCP server or socket object to the child process. The child will - * receive the object as the second argument passed to the callback function - * registered on the `'message'` event. Any data that is received - * and buffered in the socket will not be sent to the child. - * - * The optional `callback` is a function that is invoked after the message is - * sent but before the child may have received it. The function is called with a - * single argument: `null` on success, or an `Error` object on failure. - * - * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can - * happen, for instance, when the child process has already exited. - * - * `subprocess.send()` will return `false` if the channel has closed or when the - * backlog of unsent messages exceeds a threshold that makes it unwise to send - * more. Otherwise, the method returns `true`. The `callback` function can be - * used to implement flow control. - * - * #### Example: sending a server object - * - * The `sendHandle` argument can be used, for instance, to pass the handle of - * a TCP server object to the child process as illustrated in the example below: - * - * ```js - * const subprocess = require('child_process').fork('subprocess.js'); - * - * // Open up the server object and send the handle. - * const server = require('net').createServer(); - * server.on('connection', (socket) => { - * socket.end('handled by parent'); - * }); - * server.listen(1337, () => { - * subprocess.send('server', server); - * }); - * ``` - * - * The child would then receive the server object as: - * - * ```js - * process.on('message', (m, server) => { - * if (m === 'server') { - * server.on('connection', (socket) => { - * socket.end('handled by child'); - * }); - * } - * }); - * ``` - * - * Once the server is now shared between the parent and child, some connections - * can be handled by the parent and some by the child. - * - * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on - * a `'message'` event instead of `'connection'` and using `server.bind()` instead - * of `server.listen()`. This is, however, currently only supported on Unix - * platforms. - * - * #### Example: sending a socket object - * - * Similarly, the `sendHandler` argument can be used to pass the handle of a - * socket to the child process. The example below spawns two children that each - * handle connections with "normal" or "special" priority: - * - * ```js - * const { fork } = require('child_process'); - * const normal = fork('subprocess.js', ['normal']); - * const special = fork('subprocess.js', ['special']); - * - * // Open up the server and send sockets to child. Use pauseOnConnect to prevent - * // the sockets from being read before they are sent to the child process. - * const server = require('net').createServer({ pauseOnConnect: true }); - * server.on('connection', (socket) => { - * - * // If this is special priority... - * if (socket.remoteAddress === '74.125.127.100') { - * special.send('socket', socket); - * return; - * } - * // This is normal priority. - * normal.send('socket', socket); - * }); - * server.listen(1337); - * ``` - * - * The `subprocess.js` would receive the socket handle as the second argument - * passed to the event callback function: - * - * ```js - * process.on('message', (m, socket) => { - * if (m === 'socket') { - * if (socket) { - * // Check that the client socket exists. - * // It is possible for the socket to be closed between the time it is - * // sent and the time it is received in the child process. - * socket.end(`Request handled with ${process.argv[2]} priority`); - * } - * } - * }); - * ``` - * - * Do not use `.maxConnections` on a socket that has been passed to a subprocess. - * The parent cannot track when the socket is destroyed. - * - * Any `'message'` handlers in the subprocess should verify that `socket` exists, - * as the connection may have been closed during the time it takes to send the - * connection to the child. - * @since v0.5.9 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: Serializable, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * Closes the IPC channel between parent and child, allowing the child to exit - * gracefully once there are no other connections keeping it alive. After calling - * this method the `subprocess.connected` and `process.connected` properties in - * both the parent and child (respectively) will be set to `false`, and it will be - * no longer possible to pass messages between the processes. - * - * The `'disconnect'` event will be emitted when there are no messages in the - * process of being received. This will most often be triggered immediately after - * calling `subprocess.disconnect()`. - * - * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked - * within the child process to close the IPC channel as well. - * @since v0.7.2 - */ - disconnect(): void; - /** - * By default, the parent will wait for the detached child to exit. To prevent the - * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not - * include the child in its reference count, allowing the parent to exit - * independently of the child, unless there is an established IPC channel between - * the child and the parent. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * ``` - * @since v0.7.10 - */ - unref(): void; - /** - * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will - * restore the removed reference count for the child process, forcing the parent - * to wait for the child to exit before exiting itself. - * - * ```js - * const { spawn } = require('child_process'); - * - * const subprocess = spawn(process.argv[0], ['child_program.js'], { - * detached: true, - * stdio: 'ignore' - * }); - * - * subprocess.unref(); - * subprocess.ref(); - * ``` - * @since v0.7.10 - */ - ref(): void; - /** - * events.EventEmitter - * 1. close - * 2. disconnect - * 3. error - * 4. exit - * 5. message - * 6. spawn - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'disconnect', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - addListener(event: 'spawn', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'disconnect'): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean; - emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean; - emit(event: 'spawn', listener: () => void): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'disconnect', listener: () => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - on(event: 'spawn', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'disconnect', listener: () => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - once(event: 'spawn', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'disconnect', listener: () => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependListener(event: 'spawn', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'disconnect', listener: () => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this; - prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this; - prependOnceListener(event: 'spawn', listener: () => 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, - Readable, - Readable, - // stderr - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - // return this object when stdio option is a tuple of 3 - interface ChildProcessByStdio extends ChildProcess { - stdin: I; - stdout: O; - stderr: E; - readonly stdio: [ - I, - O, - E, - Readable | Writable | null | undefined, - // extra, no modification - Readable | Writable | null | undefined // extra, no modification - ]; - } - interface MessageOptions { - keepOpen?: boolean | undefined; - } - type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit'; - type StdioOptions = IOType | Array; - type SerializationType = 'json' | 'advanced'; - interface MessagingOptions extends Abortable { - /** - * Specify the kind of serialization used for sending messages between processes. - * @default 'json' - */ - serialization?: SerializationType | undefined; - /** - * The signal value to be used when the spawned process will be killed by the abort signal. - * @default 'SIGTERM' - */ - killSignal?: NodeJS.Signals | number | undefined; - /** - * In milliseconds the maximum amount of time the process is allowed to run. - */ - timeout?: number | undefined; - } - interface ProcessEnvOptions { - uid?: number | undefined; - gid?: number | undefined; - cwd?: string | URL | undefined; - env?: NodeJS.ProcessEnv | undefined; - } - interface CommonOptions extends ProcessEnvOptions { - /** - * @default true - */ - windowsHide?: boolean | undefined; - /** - * @default 0 - */ - timeout?: number | undefined; - } - interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable { - argv0?: string | undefined; - stdio?: StdioOptions | undefined; - shell?: boolean | string | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - interface SpawnOptions extends CommonSpawnOptions { - detached?: boolean | undefined; - } - interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: StdioPipeNamed | StdioPipe[] | undefined; - } - type StdioNull = 'inherit' | 'ignore' | Stream; - type StdioPipeNamed = 'pipe' | 'overlapped'; - type StdioPipe = undefined | null | StdioPipeNamed; - interface SpawnOptionsWithStdioTuple extends SpawnOptions { - stdio: [Stdin, Stdout, Stderr]; - } - /** - * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults - * to an empty array. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * A third argument may be used to specify additional options, with these defaults: - * - * ```js - * const defaults = { - * cwd: undefined, - * env: process.env - * }; - * ``` - * - * Use `cwd` to specify the working directory from which the process is spawned. - * If not given, the default is to inherit the current working directory. If given, - * but the path does not exist, the child process emits an `ENOENT` error - * and exits immediately. `ENOENT` is also emitted when the command - * does not exist. - * - * Use `env` to specify environment variables that will be visible to the new - * process, the default is `process.env`. - * - * `undefined` values in `env` will be ignored. - * - * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the - * exit code: - * - * ```js - * const { spawn } = require('child_process'); - * const ls = spawn('ls', ['-lh', '/usr']); - * - * ls.stdout.on('data', (data) => { - * console.log(`stdout: ${data}`); - * }); - * - * ls.stderr.on('data', (data) => { - * console.error(`stderr: ${data}`); - * }); - * - * ls.on('close', (code) => { - * console.log(`child process exited with code ${code}`); - * }); - * ``` - * - * Example: A very elaborate way to run `ps ax | grep ssh` - * - * ```js - * const { spawn } = require('child_process'); - * const ps = spawn('ps', ['ax']); - * const grep = spawn('grep', ['ssh']); - * - * ps.stdout.on('data', (data) => { - * grep.stdin.write(data); - * }); - * - * ps.stderr.on('data', (data) => { - * console.error(`ps stderr: ${data}`); - * }); - * - * ps.on('close', (code) => { - * if (code !== 0) { - * console.log(`ps process exited with code ${code}`); - * } - * grep.stdin.end(); - * }); - * - * grep.stdout.on('data', (data) => { - * console.log(data.toString()); - * }); - * - * grep.stderr.on('data', (data) => { - * console.error(`grep stderr: ${data}`); - * }); - * - * grep.on('close', (code) => { - * if (code !== 0) { - * console.log(`grep process exited with code ${code}`); - * } - * }); - * ``` - * - * Example of checking for failed `spawn`: - * - * ```js - * const { spawn } = require('child_process'); - * const subprocess = spawn('bad_command'); - * - * subprocess.on('error', (err) => { - * console.error('Failed to start subprocess.'); - * }); - * ``` - * - * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process - * title while others (Windows, SunOS) will use `command`. - * - * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent, - * retrieve it with the`process.argv0` property instead. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { spawn } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const grep = spawn('grep', ['ssh'], { signal }); - * grep.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * ``` - * @since v0.1.90 - * @param command The command to run. - * @param args List of string arguments. - */ - function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, options: SpawnOptions): ChildProcess; - // overloads of spawn with 'args' - function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptionsWithStdioTuple): ChildProcessByStdio; - function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess; - interface ExecOptions extends CommonOptions { - shell?: string | undefined; - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - } - interface ExecOptionsWithStringEncoding extends ExecOptions { - encoding: BufferEncoding; - } - interface ExecOptionsWithBufferEncoding extends ExecOptions { - encoding: BufferEncoding | null; // specify `null`. - } - interface ExecException extends Error { - cmd?: string | undefined; - killed?: boolean | undefined; - code?: number | undefined; - signal?: NodeJS.Signals | undefined; - } - /** - * Spawns a shell then executes the `command` within that shell, buffering any - * generated output. The `command` string passed to the exec function is processed - * directly by the shell and special characters (vary based on[shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters)) - * need to be dealt with accordingly: - * - * ```js - * const { exec } = require('child_process'); - * - * exec('"/path/to/test file/test.sh" arg1 arg2'); - * // Double quotes are used so that the space in the path is not interpreted as - * // a delimiter of multiple arguments. - * - * exec('echo "The \\$HOME variable is $HOME"'); - * // The $HOME variable is escaped in the first instance, but not in the second. - * ``` - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * - * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The - * `error.code` property will be - * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the - * process. - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * ```js - * const { exec } = require('child_process'); - * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => { - * if (error) { - * console.error(`exec error: ${error}`); - * return; - * } - * console.log(`stdout: ${stdout}`); - * console.error(`stderr: ${stderr}`); - * }); - * ``` - * - * If `timeout` is greater than `0`, the parent will send the signal - * identified by the `killSignal` property (the default is `'SIGTERM'`) if the - * child runs longer than `timeout` milliseconds. - * - * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace - * the existing process and uses a shell to execute the command. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const exec = util.promisify(require('child_process').exec); - * - * async function lsExample() { - * const { stdout, stderr } = await exec('ls'); - * console.log('stdout:', stdout); - * console.error('stderr:', stderr); - * } - * lsExample(); - * ``` - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { exec } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = exec('grep ssh', { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.90 - * @param command The command to run, with space-separated arguments. - * @param callback called with the output when process terminates. - */ - 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: BufferEncoding; - } & 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: (ObjectEncodingOptions & ExecOptions) | undefined | null, - callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void - ): ChildProcess; - interface PromiseWithChild extends Promise { - child: ChildProcess; - } - 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?: (ObjectEncodingOptions & ExecOptions) | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ExecFileOptions extends CommonOptions, Abortable { - maxBuffer?: number | undefined; - killSignal?: NodeJS.Signals | number | undefined; - windowsVerbatimArguments?: boolean | undefined; - shell?: boolean | string | undefined; - signal?: AbortSignal | undefined; - } - interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { - encoding: 'buffer' | null; - } - interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { - encoding: BufferEncoding; - } - type ExecFileException = ExecException & NodeJS.ErrnoException; - /** - * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified - * executable `file` is spawned directly as a new process making it slightly more - * efficient than {@link exec}. - * - * The same options as {@link exec} are supported. Since a shell is - * not spawned, behaviors such as I/O redirection and file globbing are not - * supported. - * - * ```js - * const { execFile } = require('child_process'); - * const child = execFile('node', ['--version'], (error, stdout, stderr) => { - * if (error) { - * throw error; - * } - * console.log(stdout); - * }); - * ``` - * - * The `stdout` and `stderr` arguments passed to the callback will contain the - * stdout and stderr output of the child process. By default, Node.js will decode - * the output as UTF-8 and pass strings to the callback. The `encoding` option - * can be used to specify the character encoding used to decode the stdout and - * stderr output. If `encoding` is `'buffer'`, or an unrecognized character - * encoding, `Buffer` objects will be passed to the callback instead. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In - * case of an error (including any error resulting in an exit code other than 0), a - * rejected promise is returned, with the same `error` object given in the - * callback, but with two additional properties `stdout` and `stderr`. - * - * ```js - * const util = require('util'); - * const execFile = util.promisify(require('child_process').execFile); - * async function getVersion() { - * const { stdout } = await execFile('node', ['--version']); - * console.log(stdout); - * } - * getVersion(); - * ``` - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * const { execFile } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = execFile('node', ['--version'], { signal }, (error) => { - * console.log(error); // an AbortError - * }); - * controller.abort(); - * ``` - * @since v0.1.91 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @param callback Called with the output when process terminates. - */ - function execFile(file: string): ChildProcess; - function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - function execFile(file: string, args?: ReadonlyArray | null): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess; - // no `options` definitely means stdout/stderr are `string`. - function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | 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: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithBufferEncoding, - callback: (error: ExecFileException | 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: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithStringEncoding, - callback: (error: ExecFileException | 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: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptionsWithOtherEncoding, - callback: (error: ExecFileException | 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: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: ExecFileOptions, - callback: (error: ExecFileException | null, stdout: string, stderr: string) => void - ): ChildProcess; - // fallback if nothing else matches. Worst case is always `string | Buffer`. - function execFile( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - function execFile( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null, - callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null - ): ChildProcess; - namespace execFile { - function __promisify__(file: string): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: ExecFileOptionsWithBufferEncoding - ): PromiseWithChild<{ - stdout: Buffer; - stderr: Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | 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: ReadonlyArray | 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: ReadonlyArray | 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: ReadonlyArray | undefined | null, - options: ExecFileOptions - ): PromiseWithChild<{ - stdout: string; - stderr: string; - }>; - function __promisify__( - file: string, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - function __promisify__( - file: string, - args: ReadonlyArray | undefined | null, - options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null - ): PromiseWithChild<{ - stdout: string | Buffer; - stderr: string | Buffer; - }>; - } - interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable { - execPath?: string | undefined; - execArgv?: string[] | undefined; - silent?: boolean | undefined; - stdio?: StdioOptions | undefined; - detached?: boolean | undefined; - windowsVerbatimArguments?: boolean | undefined; - } - /** - * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes. - * Like {@link spawn}, a `ChildProcess` object is returned. The - * returned `ChildProcess` will have an additional communication channel - * built-in that allows messages to be passed back and forth between the parent and - * child. See `subprocess.send()` for details. - * - * Keep in mind that spawned Node.js child processes are - * independent of the parent with exception of the IPC communication channel - * that is established between the two. Each process has its own memory, with - * their own V8 instances. Because of the additional resource allocations - * required, spawning a large number of child Node.js processes is not - * recommended. - * - * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative - * execution path to be used. - * - * Node.js processes launched with a custom `execPath` will communicate with the - * parent process using the file descriptor (fd) identified using the - * environment variable `NODE_CHANNEL_FD` on the child process. - * - * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the - * current process. - * - * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except - * the error passed to the callback will be an `AbortError`: - * - * ```js - * if (process.argv[2] === 'child') { - * setTimeout(() => { - * console.log(`Hello from ${process.argv[2]}!`); - * }, 1_000); - * } else { - * const { fork } = require('child_process'); - * const controller = new AbortController(); - * const { signal } = controller; - * const child = fork(__filename, ['child'], { signal }); - * child.on('error', (err) => { - * // This will be called with err being an AbortError if the controller aborts - * }); - * controller.abort(); // Stops the child process - * } - * ``` - * @since v0.5.0 - * @param modulePath The module to run in the child. - * @param args List of string arguments. - */ - function fork(modulePath: string, options?: ForkOptions): ChildProcess; - function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess; - interface SpawnSyncOptions extends CommonSpawnOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { - encoding: BufferEncoding; - } - interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { - encoding?: 'buffer' | null | undefined; - } - interface SpawnSyncReturns { - pid: number; - output: Array; - stdout: T; - stderr: T; - status: number | null; - signal: NodeJS.Signals | null; - error?: Error | undefined; - } - /** - * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the process intercepts and handles the `SIGTERM` signal - * and doesn't exit, the parent process will wait until the child process has - * exited. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @param args List of string arguments. - */ - 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 CommonExecOptions extends CommonOptions { - input?: string | NodeJS.ArrayBufferView | undefined; - stdio?: StdioOptions | undefined; - killSignal?: NodeJS.Signals | number | undefined; - maxBuffer?: number | undefined; - encoding?: BufferEncoding | 'buffer' | null | undefined; - } - interface ExecSyncOptions extends CommonExecOptions { - shell?: string | undefined; - } - interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { - encoding: BufferEncoding; - } - interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { - encoding?: 'buffer' | null | undefined; - } - /** - * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return - * until the child process has fully closed. When a timeout has been encountered - * and `killSignal` is sent, the method won't return until the process has - * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process - * has exited. - * - * If the process times out or has a non-zero exit code, this method will throw. - * The `Error` object will contain the entire result from {@link spawnSync}. - * - * **Never pass unsanitized user input to this function. Any input containing shell** - * **metacharacters may be used to trigger arbitrary command execution.** - * @since v0.11.12 - * @param command The command to run. - * @return The stdout from the command. - */ - 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 CommonExecOptions { - shell?: boolean | string | undefined; - } - interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; - } - interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { - encoding: BufferEncoding; // specify `null`. - } - /** - * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not - * return until the child process has fully closed. When a timeout has been - * encountered and `killSignal` is sent, the method won't return until the process - * has completely exited. - * - * If the child process intercepts and handles the `SIGTERM` signal and - * does not exit, the parent process will still wait until the child process has - * exited. - * - * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}. - * - * **If the `shell` option is enabled, do not pass unsanitized user input to this** - * **function. Any input containing shell metacharacters may be used to trigger** - * **arbitrary command execution.** - * @since v0.11.12 - * @param file The name or path of the executable file to run. - * @param args List of string arguments. - * @return The stdout from the command. - */ - function execFileSync(file: string): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, options?: ExecFileSyncOptions): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithStringEncoding): string; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; - function execFileSync(file: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): Buffer; -} -declare module 'node:child_process' { - export * from 'child_process'; -} diff --git a/JS/node_modules/@types/node/cluster.d.ts b/JS/node_modules/@types/node/cluster.d.ts deleted file mode 100755 index 8c4203b..0000000 --- a/JS/node_modules/@types/node/cluster.d.ts +++ /dev/null @@ -1,414 +0,0 @@ -/** - * A single instance of Node.js runs in a single thread. To take advantage of - * multi-core systems, the user will sometimes want to launch a cluster of Node.js - * processes to handle the load. - * - * The cluster module allows easy creation of child processes that all share - * server ports. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('exit', (worker, code, signal) => { - * console.log(`worker ${worker.process.pid} died`); - * }); - * } else { - * // Workers can share any TCP connection - * // In this case it is an HTTP server - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * - * console.log(`Worker ${process.pid} started`); - * } - * ``` - * - * Running Node.js will now share port 8000 between the workers: - * - * ```console - * $ node server.js - * Primary 3596 is running - * Worker 4324 started - * Worker 4520 started - * Worker 6056 started - * Worker 5644 started - * ``` - * - * On Windows, it is not yet possible to set up a named pipe server in a worker. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/cluster.js) - */ -declare module 'cluster' { - import * as child from 'node:child_process'; - import EventEmitter = require('node:events'); - import * as net from 'node:net'; - export interface ClusterSettings { - execArgv?: string[] | undefined; // default: process.execArgv - exec?: string | undefined; - args?: string[] | undefined; - silent?: boolean | undefined; - stdio?: any[] | undefined; - uid?: number | undefined; - gid?: number | undefined; - inspectPort?: number | (() => number) | undefined; - } - export interface Address { - address: string; - port: number; - addressType: number | 'udp4' | 'udp6'; // 4, 6, -1, "udp4", "udp6" - } - /** - * A `Worker` object contains all public information and method about a worker. - * In the primary it can be obtained using `cluster.workers`. In a worker - * it can be obtained using `cluster.worker`. - * @since v0.7.0 - */ - export class Worker extends EventEmitter { - /** - * Each new worker is given its own unique id, this id is stored in the`id`. - * - * While a worker is alive, this is the key that indexes it in`cluster.workers`. - * @since v0.8.0 - */ - id: number; - /** - * All workers are created using `child_process.fork()`, the returned object - * from this function is stored as `.process`. In a worker, the global `process`is stored. - * - * See: `Child Process module`. - * - * Workers will call `process.exit(0)` if the `'disconnect'` event occurs - * on `process` and `.exitedAfterDisconnect` is not `true`. This protects against - * accidental disconnection. - * @since v0.7.0 - */ - process: child.ChildProcess; - /** - * Send a message to a worker or primary, optionally with a handle. - * - * In the primary this sends a message to a specific worker. It is identical to `ChildProcess.send()`. - * - * In a worker this sends a message to the primary. It is identical to`process.send()`. - * - * This example will echo back all messages from the primary: - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * worker.send('hi there'); - * - * } else if (cluster.isWorker) { - * process.on('message', (msg) => { - * process.send(msg); - * }); - * } - * ``` - * @since v0.7.0 - * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties: - */ - send(message: child.Serializable, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, callback?: (error: Error | null) => void): boolean; - send(message: child.Serializable, sendHandle: child.SendHandle, options?: child.MessageOptions, callback?: (error: Error | null) => void): boolean; - /** - * This function will kill the worker. In the primary, it does this - * by disconnecting the `worker.process`, and once disconnected, killing - * with `signal`. In the worker, it does it by disconnecting the channel, - * and then exiting with code `0`. - * - * Because `kill()` attempts to gracefully disconnect the worker process, it is - * susceptible to waiting indefinitely for the disconnect to complete. For example, - * if the worker enters an infinite loop, a graceful disconnect will never occur. - * If the graceful disconnect behavior is not needed, use `worker.process.kill()`. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * This method is aliased as `worker.destroy()` for backward compatibility. - * - * In a worker, `process.kill()` exists, but it is not this function; - * it is `kill()`. - * @since v0.9.12 - * @param [signal='SIGTERM'] Name of the kill signal to send to the worker process. - */ - kill(signal?: string): void; - destroy(signal?: string): void; - /** - * In a worker, this function will close all servers, wait for the `'close'` event - * on those servers, and then disconnect the IPC channel. - * - * In the primary, an internal message is sent to the worker causing it to call`.disconnect()` on itself. - * - * Causes `.exitedAfterDisconnect` to be set. - * - * After a server is closed, it will no longer accept new connections, - * but connections may be accepted by any other listening worker. Existing - * connections will be allowed to close as usual. When no more connections exist, - * see `server.close()`, the IPC channel to the worker will close allowing it - * to die gracefully. - * - * The above applies _only_ to server connections, client connections are not - * automatically closed by workers, and disconnect does not wait for them to close - * before exiting. - * - * In a worker, `process.disconnect` exists, but it is not this function; - * it is `disconnect()`. - * - * Because long living server connections may block workers from disconnecting, it - * may be useful to send a message, so application specific actions may be taken to - * close them. It also may be useful to implement a timeout, killing a worker if - * the `'disconnect'` event has not been emitted after some time. - * - * ```js - * if (cluster.isPrimary) { - * const worker = cluster.fork(); - * let timeout; - * - * worker.on('listening', (address) => { - * worker.send('shutdown'); - * worker.disconnect(); - * timeout = setTimeout(() => { - * worker.kill(); - * }, 2000); - * }); - * - * worker.on('disconnect', () => { - * clearTimeout(timeout); - * }); - * - * } else if (cluster.isWorker) { - * const net = require('net'); - * const server = net.createServer((socket) => { - * // Connections never end - * }); - * - * server.listen(8000); - * - * process.on('message', (msg) => { - * if (msg === 'shutdown') { - * // Initiate graceful close of any connections to server - * } - * }); - * } - * ``` - * @since v0.7.7 - * @return A reference to `worker`. - */ - disconnect(): void; - /** - * This function returns `true` if the worker is connected to its primary via its - * IPC channel, `false` otherwise. A worker is connected to its primary after it - * has been created. It is disconnected after the `'disconnect'` event is emitted. - * @since v0.11.14 - */ - isConnected(): boolean; - /** - * This function returns `true` if the worker's process has terminated (either - * because of exiting or being signaled). Otherwise, it returns `false`. - * - * ```js - * import cluster from 'cluster'; - * import http from 'http'; - * import { cpus } from 'os'; - * import process from 'process'; - * - * const numCPUs = cpus().length; - * - * if (cluster.isPrimary) { - * console.log(`Primary ${process.pid} is running`); - * - * // Fork workers. - * for (let i = 0; i < numCPUs; i++) { - * cluster.fork(); - * } - * - * cluster.on('fork', (worker) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * - * cluster.on('exit', (worker, code, signal) => { - * console.log('worker is dead:', worker.isDead()); - * }); - * } else { - * // Workers can share any TCP connection. In this case, it is an HTTP server. - * http.createServer((req, res) => { - * res.writeHead(200); - * res.end(`Current process\n ${process.pid}`); - * process.kill(process.pid); - * }).listen(8000); - * } - * ``` - * @since v0.11.14 - */ - isDead(): boolean; - /** - * This property is `true` if the worker exited due to `.kill()` or`.disconnect()`. If the worker exited any other way, it is `false`. If the - * worker has not exited, it is `undefined`. - * - * The boolean `worker.exitedAfterDisconnect` allows distinguishing between - * voluntary and accidental exit, the primary may choose not to respawn a worker - * based on this value. - * - * ```js - * cluster.on('exit', (worker, code, signal) => { - * if (worker.exitedAfterDisconnect === true) { - * console.log('Oh, it was just voluntary – no need to worry'); - * } - * }); - * - * // kill worker - * worker.kill(); - * ``` - * @since v6.0.0 - */ - 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; - } - export interface Cluster extends EventEmitter { - disconnect(callback?: () => void): void; - fork(env?: any): Worker; - /** @deprecated since v16.0.0 - use isPrimary. */ - readonly isMaster: boolean; - readonly isPrimary: boolean; - readonly isWorker: boolean; - schedulingPolicy: number; - readonly settings: ClusterSettings; - /** @deprecated since v16.0.0 - use setupPrimary. */ - setupMaster(settings?: ClusterSettings): void; - /** - * `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings. - */ - setupPrimary(settings?: ClusterSettings): void; - readonly worker?: Worker | undefined; - readonly workers?: NodeJS.Dict | undefined; - readonly SCHED_NONE: number; - readonly SCHED_RR: number; - /** - * 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; - // the handle is a net.Socket or net.Server object, or undefined. - prependListener(event: 'message', listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void): this; - 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; - } - const cluster: Cluster; - export default cluster; -} -declare module 'node:cluster' { - export * from 'cluster'; - export { default as default } from 'cluster'; -} diff --git a/JS/node_modules/@types/node/console.d.ts b/JS/node_modules/@types/node/console.d.ts deleted file mode 100755 index 60a5294..0000000 --- a/JS/node_modules/@types/node/console.d.ts +++ /dev/null @@ -1,407 +0,0 @@ -/** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/console.js) - */ -declare module 'console' { - import console = require('node:console'); - export = console; -} -declare module 'node:console' { - import { InspectOptions } from 'node:util'; - global { - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build - interface Console { - Console: console.ConsoleConstructor; - /** - * `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only - * writes a message and does not otherwise affect execution. The output always - * starts with `"Assertion failed"`. If provided, `message` is formatted using `util.format()`. - * - * If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens. - * - * ```js - * console.assert(true, 'does nothing'); - * - * console.assert(false, 'Whoops %s work', 'didn\'t'); - * // Assertion failed: Whoops didn't work - * - * console.assert(); - * // Assertion failed - * ``` - * @since v0.1.101 - * @param value The value tested for being truthy. - * @param message All arguments besides `value` are used as 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. - * - * The specific operation of `console.clear()` can vary across operating systems - * and terminal types. For most Linux operating systems, `console.clear()`operates similarly to the `clear` shell command. On Windows, `console.clear()`will clear only the output in the - * current terminal viewport for the Node.js - * binary. - * @since v8.3.0 - */ - 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`. - * - * ```js - * > console.count() - * default: 1 - * undefined - * > console.count('default') - * default: 2 - * undefined - * > console.count('abc') - * abc: 1 - * undefined - * > console.count('xyz') - * xyz: 1 - * undefined - * > console.count('abc') - * abc: 2 - * undefined - * > console.count() - * default: 3 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - count(label?: string): void; - /** - * Resets the internal counter specific to `label`. - * - * ```js - * > console.count('abc'); - * abc: 1 - * undefined - * > console.countReset('abc'); - * undefined - * > console.count('abc'); - * abc: 1 - * undefined - * > - * ``` - * @since v8.3.0 - * @param label The display label for the counter. - */ - countReset(label?: string): void; - /** - * The `console.debug()` function is an alias for {@link log}. - * @since v8.0.0 - */ - debug(message?: any, ...optionalParams: any[]): void; - /** - * Uses `util.inspect()` on `obj` and prints the resulting string to `stdout`. - * This function bypasses any custom `inspect()` function defined on `obj`. - * @since v0.1.101 - */ - dir(obj: any, options?: InspectOptions): void; - /** - * This method calls `console.log()` passing it the arguments received. - * This method does not produce any XML formatting. - * @since v8.0.0 - */ - dirxml(...data: any[]): void; - /** - * Prints to `stderr` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const code = 5; - * console.error('error #%d', code); - * // Prints: error #5, to stderr - * console.error('error', code); - * // Prints: error 5, to stderr - * ``` - * - * If formatting elements (e.g. `%d`) are not found in the first string then `util.inspect()` is called on each argument and the resulting string - * values are concatenated. See `util.format()` for more information. - * @since v0.1.100 - */ - error(message?: any, ...optionalParams: any[]): void; - /** - * Increases indentation of subsequent lines by spaces for `groupIndentation`length. - * - * If one or more `label`s are provided, those are printed first without the - * additional indentation. - * @since v8.5.0 - */ - group(...label: any[]): void; - /** - * An alias for {@link group}. - * @since v8.5.0 - */ - groupCollapsed(...label: any[]): void; - /** - * Decreases indentation of subsequent lines by spaces for `groupIndentation`length. - * @since v8.5.0 - */ - groupEnd(): void; - /** - * The `console.info()` function is an alias for {@link log}. - * @since v0.1.100 - */ - info(message?: any, ...optionalParams: any[]): void; - /** - * Prints to `stdout` with newline. Multiple arguments can be passed, with the - * first used as the primary message and all additional used as substitution - * values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html) (the arguments are all passed to `util.format()`). - * - * ```js - * const count = 5; - * console.log('count: %d', count); - * // Prints: count: 5, to stdout - * console.log('count:', count); - * // Prints: count: 5, to stdout - * ``` - * - * See `util.format()` for more information. - * @since v0.1.100 - */ - log(message?: any, ...optionalParams: any[]): void; - /** - * Try to construct a table with the columns of the properties of `tabularData`(or use `properties`) and rows of `tabularData` and log it. Falls back to just - * logging the argument if it can’t be parsed as tabular. - * - * ```js - * // These can't be parsed as tabular data - * console.table(Symbol()); - * // Symbol() - * - * console.table(undefined); - * // undefined - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]); - * // ┌─────────┬─────┬─────┐ - * // │ (index) │ a │ b │ - * // ├─────────┼─────┼─────┤ - * // │ 0 │ 1 │ 'Y' │ - * // │ 1 │ 'Z' │ 2 │ - * // └─────────┴─────┴─────┘ - * - * console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']); - * // ┌─────────┬─────┐ - * // │ (index) │ a │ - * // ├─────────┼─────┤ - * // │ 0 │ 1 │ - * // │ 1 │ 'Z' │ - * // └─────────┴─────┘ - * ``` - * @since v10.0.0 - * @param properties Alternate properties for constructing the table. - */ - table(tabularData: any, properties?: ReadonlyArray): void; - /** - * Starts a timer that can be used to compute the duration of an operation. Timers - * are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in - * suitable time units to `stdout`. For example, if the elapsed - * time is 3869ms, `console.timeEnd()` displays "3.869s". - * @since v0.1.104 - */ - time(label?: string): void; - /** - * Stops a timer that was previously started by calling {@link time} and - * prints the result to `stdout`: - * - * ```js - * console.time('100-elements'); - * for (let i = 0; i < 100; i++) {} - * console.timeEnd('100-elements'); - * // prints 100-elements: 225.438ms - * ``` - * @since v0.1.104 - */ - timeEnd(label?: string): void; - /** - * For a timer that was previously started by calling {@link time}, prints - * the elapsed time and other `data` arguments to `stdout`: - * - * ```js - * console.time('process'); - * const value = expensiveProcess1(); // Returns 42 - * console.timeLog('process', value); - * // Prints "process: 365.227ms 42". - * doExpensiveProcess2(value); - * console.timeEnd('process'); - * ``` - * @since v10.7.0 - */ - timeLog(label?: string, ...data: any[]): void; - /** - * Prints to `stderr` the string `'Trace: '`, followed by the `util.format()` formatted message and stack trace to the current position in the code. - * - * ```js - * console.trace('Show me'); - * // Prints: (stack trace will vary based on where trace is called) - * // Trace: Show me - * // at repl:2:9 - * // at REPLServer.defaultEval (repl.js:248:27) - * // at bound (domain.js:287:14) - * // at REPLServer.runBound [as eval] (domain.js:300:12) - * // at REPLServer. (repl.js:412:12) - * // at emitOne (events.js:82:20) - * // at REPLServer.emit (events.js:169:7) - * // at REPLServer.Interface._onLine (readline.js:210:10) - * // at REPLServer.Interface._line (readline.js:549:8) - * // at REPLServer.Interface._ttyWrite (readline.js:826:14) - * ``` - * @since v0.1.104 - */ - trace(message?: any, ...optionalParams: any[]): void; - /** - * The `console.warn()` function is an alias for {@link error}. - * @since v0.1.100 - */ - warn(message?: any, ...optionalParams: any[]): void; - // --- Inspector mode only --- - /** - * 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; - } - /** - * The `console` module provides a simple debugging console that is similar to the - * JavaScript console mechanism provided by web browsers. - * - * The module exports two specific components: - * - * * A `Console` class with methods such as `console.log()`, `console.error()` and`console.warn()` that can be used to write to any Node.js stream. - * * A global `console` instance configured to write to `process.stdout` and `process.stderr`. The global `console` can be used without calling`require('console')`. - * - * _**Warning**_: The global console object's methods are neither consistently - * synchronous like the browser APIs they resemble, nor are they consistently - * asynchronous like all other Node.js streams. See the `note on process I/O` for - * more information. - * - * Example using the global `console`: - * - * ```js - * console.log('hello world'); - * // Prints: hello world, to stdout - * console.log('hello %s', 'world'); - * // Prints: hello world, to stdout - * console.error(new Error('Whoops, something bad happened')); - * // Prints error message and stack trace to stderr: - * // Error: Whoops, something bad happened - * // at [eval]:5:15 - * // at Script.runInThisContext (node:vm:132:18) - * // at Object.runInThisContext (node:vm:309:38) - * // at node:internal/process/execution:77:19 - * // at [eval]-wrapper:6:22 - * // at evalScript (node:internal/process/execution:76:60) - * // at node:internal/main/eval_string:23:3 - * - * const name = 'Will Robinson'; - * console.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to stderr - * ``` - * - * Example using the `Console` class: - * - * ```js - * const out = getStreamSomehow(); - * const err = getStreamSomehow(); - * const myConsole = new console.Console(out, err); - * - * myConsole.log('hello world'); - * // Prints: hello world, to out - * myConsole.log('hello %s', 'world'); - * // Prints: hello world, to out - * myConsole.error(new Error('Whoops, something bad happened')); - * // Prints: [Error: Whoops, something bad happened], to err - * - * const name = 'Will Robinson'; - * myConsole.warn(`Danger ${name}! Danger!`); - * // Prints: Danger Will Robinson! Danger!, to err - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.4.2/lib/console.js) - */ - namespace console { - interface ConsoleConstructorOptions { - stdout: NodeJS.WritableStream; - stderr?: NodeJS.WritableStream | undefined; - ignoreErrors?: boolean | undefined; - colorMode?: boolean | 'auto' | undefined; - inspectOptions?: InspectOptions | undefined; - } - interface ConsoleConstructor { - prototype: Console; - new (stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console; - new (options: ConsoleConstructorOptions): Console; - } - } - var console: Console; - } - export = globalThis.console; -} diff --git a/JS/node_modules/@types/node/constants.d.ts b/JS/node_modules/@types/node/constants.d.ts deleted file mode 100755 index 208020d..0000000 --- a/JS/node_modules/@types/node/constants.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */ -declare module 'constants' { - import { constants as osConstants, SignalConstants } from 'node:os'; - import { constants as cryptoConstants } from 'node:crypto'; - import { constants as fsConstants } from 'node:fs'; - - const exp: typeof osConstants.errno & - typeof osConstants.priority & - SignalConstants & - typeof cryptoConstants & - typeof fsConstants; - export = exp; -} - -declare module 'node:constants' { - import constants = require('constants'); - export = constants; -} diff --git a/JS/node_modules/@types/node/crypto.d.ts b/JS/node_modules/@types/node/crypto.d.ts deleted file mode 100755 index 8b7c1a3..0000000 --- a/JS/node_modules/@types/node/crypto.d.ts +++ /dev/null @@ -1,3243 +0,0 @@ -/** - * The `crypto` module provides cryptographic functionality that includes a set of - * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. - * - * ```js - * const { createHmac } = await import('crypto'); - * - * const secret = 'abcdefg'; - * const hash = createHmac('sha256', secret) - * .update('I love cupcakes') - * .digest('hex'); - * console.log(hash); - * // Prints: - * // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/crypto.js) - */ -declare module 'crypto' { - import * as stream from 'node:stream'; - import { PeerCertificate } from 'node:tls'; - interface Certificate { - /** - * @deprecated - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @deprecated - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @deprecated - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - } - const Certificate: Certificate & { - /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */ - new (): Certificate; - /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */ - (): Certificate; - /** - * @param spkac - * @returns The challenge component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportChallenge(spkac: BinaryLike): Buffer; - /** - * @param spkac - * @param encoding The encoding of the spkac string. - * @returns The public key component of the `spkac` data structure, - * which includes a public key and a challenge. - */ - exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer; - /** - * @param spkac - * @returns `true` if the given `spkac` data structure is valid, - * `false` otherwise. - */ - verifySpkac(spkac: NodeJS.ArrayBufferView): boolean; - }; - 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; - } - interface HashOptions extends stream.TransformOptions { - /** - * For XOF hash functions such as `shake256`, the - * outputLength option can be used to specify the desired output length in bytes. - */ - outputLength?: number | undefined; - } - /** @deprecated since v10.0.0 */ - const fips: boolean; - /** - * Creates and returns a `Hash` object that can be used to generate hash digests - * using the given `algorithm`. Optional `options` argument controls stream - * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option - * can be used to specify the desired output length in bytes. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms`(`openssl list-message-digest-algorithms` for older versions of OpenSSL) will - * display the available digest algorithms. - * - * Example: generating the sha256 sum of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHash - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hash = createHash('sha256'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hash.update(data); - * else { - * console.log(`${hash.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.92 - * @param options `stream.transform` options - */ - function createHash(algorithm: string, options?: HashOptions): Hash; - /** - * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. - * Optional `options` argument controls stream behavior. - * - * The `algorithm` is dependent on the available algorithms supported by the - * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc. - * On recent releases of OpenSSL, `openssl list -digest-algorithms`(`openssl list-message-digest-algorithms` for older versions of OpenSSL) will - * display the available digest algorithms. - * - * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is - * a `KeyObject`, its type must be `secret`. - * - * Example: generating the sha256 HMAC of a file - * - * ```js - * import { - * createReadStream - * } from 'fs'; - * import { argv } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const filename = argv[2]; - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream(filename); - * input.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = input.read(); - * if (data) - * hmac.update(data); - * else { - * console.log(`${hmac.digest('hex')} ${filename}`); - * } - * }); - * ``` - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac; - // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings - type BinaryToTextEncoding = 'base64' | 'hex'; - type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1'; - type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2'; - type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding; - type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid'; - /** - * The `Hash` class is a utility for creating hash digests of data. It can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed hash digest on the readable side, or - * * Using the `hash.update()` and `hash.digest()` methods to produce the - * computed hash. - * - * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hash` objects as streams: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hash.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * } - * }); - * - * hash.write('some data to hash'); - * hash.end(); - * ``` - * - * Example: Using `Hash` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { createHash } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * const input = createReadStream('test.js'); - * input.pipe(hash).setEncoding('hex').pipe(stdout); - * ``` - * - * Example: Using the `hash.update()` and `hash.digest()` methods: - * - * ```js - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('some data to hash'); - * console.log(hash.digest('hex')); - * // Prints: - * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50 - * ``` - * @since v0.1.92 - */ - class Hash extends stream.Transform { - private constructor(); - /** - * Creates a new `Hash` object that contains a deep copy of the internal state - * of the current `Hash` object. - * - * The optional `options` argument controls stream behavior. For XOF hash - * functions such as `'shake256'`, the `outputLength` option can be used to - * specify the desired output length in bytes. - * - * An error is thrown when an attempt is made to copy the `Hash` object after - * its `hash.digest()` method has been called. - * - * ```js - * // Calculate a rolling hash. - * const { - * createHash - * } = await import('crypto'); - * - * const hash = createHash('sha256'); - * - * hash.update('one'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('two'); - * console.log(hash.copy().digest('hex')); - * - * hash.update('three'); - * console.log(hash.copy().digest('hex')); - * - * // Etc. - * ``` - * @since v13.1.0 - * @param options `stream.transform` options - */ - copy(options?: stream.TransformOptions): Hash; - /** - * Updates the hash content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hash; - update(data: string, inputEncoding: Encoding): Hash; - /** - * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method). - * If `encoding` is provided a string will be returned; otherwise - * a `Buffer` is returned. - * - * The `Hash` object can not be used again after `hash.digest()` method has been - * called. Multiple calls will cause an error to be thrown. - * @since v0.1.92 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - /** - * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can - * be used in one of two ways: - * - * * As a `stream` that is both readable and writable, where data is written - * to produce a computed HMAC digest on the readable side, or - * * Using the `hmac.update()` and `hmac.digest()` methods to produce the - * computed HMAC digest. - * - * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword. - * - * Example: Using `Hmac` objects as streams: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.on('readable', () => { - * // Only one element is going to be produced by the - * // hash stream. - * const data = hmac.read(); - * if (data) { - * console.log(data.toString('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * } - * }); - * - * hmac.write('some data to hash'); - * hmac.end(); - * ``` - * - * Example: Using `Hmac` and piped streams: - * - * ```js - * import { createReadStream } from 'fs'; - * import { stdout } from 'process'; - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * const input = createReadStream('test.js'); - * input.pipe(hmac).pipe(stdout); - * ``` - * - * Example: Using the `hmac.update()` and `hmac.digest()` methods: - * - * ```js - * const { - * createHmac - * } = await import('crypto'); - * - * const hmac = createHmac('sha256', 'a secret'); - * - * hmac.update('some data to hash'); - * console.log(hmac.digest('hex')); - * // Prints: - * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e - * ``` - * @since v0.1.94 - */ - class Hmac extends stream.Transform { - private constructor(); - /** - * Updates the `Hmac` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Hmac; - update(data: string, inputEncoding: Encoding): Hmac; - /** - * Calculates the HMAC digest of all of the data passed using `hmac.update()`. - * If `encoding` is - * provided a string is returned; otherwise a `Buffer` is returned; - * - * The `Hmac` object can not be used again after `hmac.digest()` has been - * called. Multiple calls to `hmac.digest()` will result in an error being thrown. - * @since v0.1.94 - * @param encoding The `encoding` of the return value. - */ - digest(): Buffer; - digest(encoding: BinaryToTextEncoding): string; - } - type KeyObjectType = 'secret' | 'public' | 'private'; - interface KeyExportOptions { - type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1'; - format: T; - cipher?: string | undefined; - passphrase?: string | Buffer | undefined; - } - interface JwkKeyExportOptions { - format: 'jwk'; - } - interface JsonWebKey { - crv?: string | undefined; - d?: string | undefined; - dp?: string | undefined; - dq?: string | undefined; - e?: string | undefined; - k?: string | undefined; - kty?: string | undefined; - n?: string | undefined; - p?: string | undefined; - q?: string | undefined; - qi?: string | undefined; - x?: string | undefined; - y?: string | undefined; - [key: string]: unknown; - } - interface AsymmetricKeyDetails { - /** - * Key size in bits (RSA, DSA). - */ - modulusLength?: number | undefined; - /** - * Public exponent (RSA). - */ - publicExponent?: bigint | undefined; - /** - * Name of the message digest (RSA-PSS). - */ - hashAlgorithm?: string | undefined; - /** - * Name of the message digest used by MGF1 (RSA-PSS). - */ - mgf1HashAlgorithm?: string | undefined; - /** - * Minimal salt length in bytes (RSA-PSS). - */ - saltLength?: number | undefined; - /** - * Size of q in bits (DSA). - */ - divisorLength?: number | undefined; - /** - * Name of the curve (EC). - */ - namedCurve?: string | undefined; - } - interface JwkKeyExportOptions { - format: 'jwk'; - } - /** - * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key, - * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject` - * objects are not to be created directly using the `new`keyword. - * - * Most applications should consider using the new `KeyObject` API instead of - * passing keys as strings or `Buffer`s due to improved security features. - * - * `KeyObject` instances can be passed to other threads via `postMessage()`. - * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to - * be listed in the `transferList` argument. - * @since v11.6.0 - */ - class KeyObject { - private constructor(); - /** - * @since v15.0.0 - */ - static from(key: webcrypto.CryptoKey): KeyObject; - /** - * For asymmetric keys, this property represents the type of the key. Supported key - * types are: - * - * * `'rsa'` (OID 1.2.840.113549.1.1.1) - * * `'rsa-pss'` (OID 1.2.840.113549.1.1.10) - * * `'dsa'` (OID 1.2.840.10040.4.1) - * * `'ec'` (OID 1.2.840.10045.2.1) - * * `'x25519'` (OID 1.3.101.110) - * * `'x448'` (OID 1.3.101.111) - * * `'ed25519'` (OID 1.3.101.112) - * * `'ed448'` (OID 1.3.101.113) - * * `'dh'` (OID 1.2.840.113549.1.3.1) - * - * This property is `undefined` for unrecognized `KeyObject` types and symmetric - * keys. - * @since v11.6.0 - */ - asymmetricKeyType?: KeyType | undefined; - /** - * For asymmetric keys, this property represents the size of the embedded key in - * bytes. This property is `undefined` for symmetric keys. - */ - asymmetricKeySize?: number | undefined; - /** - * This property exists only on asymmetric keys. Depending on the type of the key, - * this object contains information about the key. None of the information obtained - * through this property can be used to uniquely identify a key or to compromise - * the security of the key. - * - * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence, - * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be - * set. - * - * Other key details might be exposed via this API using additional attributes. - * @since v15.7.0 - */ - asymmetricKeyDetails?: AsymmetricKeyDetails | undefined; - /** - * For symmetric keys, the following encoding options can be used: - * - * For public keys, the following encoding options can be used: - * - * For private keys, the following encoding options can be used: - * - * The result type depends on the selected encoding format, when PEM the - * result is a string, when DER it will be a buffer containing the data - * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. - * - * When [JWK](https://tools.ietf.org/html/rfc7517) encoding format was selected, all other encoding options are - * ignored. - * - * PKCS#1, SEC1, and PKCS#8 type keys can be encrypted by using a combination of - * the `cipher` and `format` options. The PKCS#8 `type` can be used with any`format` to encrypt any key algorithm (RSA, EC, or DH) by specifying a`cipher`. PKCS#1 and SEC1 can only be - * encrypted by specifying a `cipher`when the PEM `format` is used. For maximum compatibility, use PKCS#8 for - * encrypted private keys. Since PKCS#8 defines its own - * encryption mechanism, PEM-level encryption is not supported when encrypting - * a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for - * PKCS#1 and SEC1 encryption. - * @since v11.6.0 - */ - export(options: KeyExportOptions<'pem'>): string | Buffer; - export(options?: KeyExportOptions<'der'>): Buffer; - export(options?: JwkKeyExportOptions): JsonWebKey; - /** - * For secret keys, this property represents the size of the key in bytes. This - * property is `undefined` for asymmetric keys. - * @since v11.6.0 - */ - symmetricKeySize?: number | undefined; - /** - * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys - * or `'private'` for private (asymmetric) keys. - * @since v11.6.0 - */ - type: KeyObjectType; - } - type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305'; - type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm'; - type BinaryLike = string | NodeJS.ArrayBufferView; - type CipherKey = BinaryLike | KeyObject; - interface CipherCCMOptions extends stream.TransformOptions { - authTagLength: number; - } - interface CipherGCMOptions extends stream.TransformOptions { - authTagLength?: number | undefined; - } - /** - * Creates and returns a `Cipher` object that uses the given `algorithm` and`password`. - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will - * display the available cipher algorithms. - * - * The `password` is used to derive the cipher key and initialization vector (IV). - * The value must be either a `'latin1'` encoded string, a `Buffer`, a`TypedArray`, or a `DataView`. - * - * The implementation of `crypto.createCipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of[`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createCipheriv} to create the `Cipher` object. Users should not use ciphers with counter mode - * (e.g. CTR, GCM, or CCM) in `crypto.createCipher()`. A warning is emitted when - * they are used in order to avoid the risk of IV reuse that causes - * vulnerabilities. For the case when IV is reused in GCM, see [Nonce-Disrespecting Adversaries](https://github.com/nonce-disrespect/nonce-disrespect) for details. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createCipheriv} instead. - * @param options `stream.transform` options - */ - 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; - /** - * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and - * initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication - * tag that will be returned by `getAuthTag()` and defaults to 16 bytes. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an[initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a - * given IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - 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; - /** - * Instances of the `Cipher` class are used to encrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain unencrypted - * data is written to produce encrypted data on the readable side, or - * * Using the `cipher.update()` and `cipher.final()` methods to produce - * the encrypted data. - * - * The {@link createCipher} or {@link createCipheriv} methods are - * used to create `Cipher` instances. `Cipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Cipher` objects as streams: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * // Once we have the key and iv, we can create and use the cipher... - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = ''; - * cipher.setEncoding('hex'); - * - * cipher.on('data', (chunk) => encrypted += chunk); - * cipher.on('end', () => console.log(encrypted)); - * - * cipher.write('some clear text data'); - * cipher.end(); - * }); - * }); - * ``` - * - * Example: Using `Cipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * - * import { - * pipeline - * } from 'stream'; - * - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.js'); - * const output = createWriteStream('test.enc'); - * - * pipeline(input, cipher, output, (err) => { - * if (err) throw err; - * }); - * }); - * }); - * ``` - * - * Example: Using the `cipher.update()` and `cipher.final()` methods: - * - * ```js - * const { - * scrypt, - * randomFill, - * createCipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * - * // First, we'll generate the key. The key length is dependent on the algorithm. - * // In this case for aes192, it is 24 bytes (192 bits). - * scrypt(password, 'salt', 24, (err, key) => { - * if (err) throw err; - * // Then, we'll generate a random initialization vector - * randomFill(new Uint8Array(16), (err, iv) => { - * if (err) throw err; - * - * const cipher = createCipheriv(algorithm, key, iv); - * - * let encrypted = cipher.update('some clear text data', 'utf8', 'hex'); - * encrypted += cipher.final('hex'); - * console.log(encrypted); - * }); - * }); - * ``` - * @since v0.1.94 - */ - class Cipher extends stream.Transform { - private constructor(); - /** - * Updates the cipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or`DataView`. If `data` is a `Buffer`, - * `TypedArray`, or `DataView`, then`inputEncoding` is ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being - * thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the data. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: BinaryLike): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `cipher.final()` method has been called, the `Cipher` object can no - * longer be used to encrypt data. Attempts to call `cipher.final()` more than - * once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When using block encryption algorithms, the `Cipher` class will automatically - * add padding to the input data to the appropriate block size. To disable the - * default padding call `cipher.setAutoPadding(false)`. - * - * When `autoPadding` is `false`, the length of the entire input data must be a - * multiple of the cipher's block size or `cipher.final()` will throw an error. - * Disabling automatic padding is useful for non-standard padding, for instance - * using `0x0` instead of PKCS padding. - * - * The `cipher.setAutoPadding()` method must be called before `cipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(autoPadding?: boolean): this; - } - interface CipherCCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - interface CipherGCM extends Cipher { - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - getAuthTag(): Buffer; - } - /** - * Creates and returns a `Decipher` object that uses the given `algorithm` and`password` (key). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. - * - * The implementation of `crypto.createDecipher()` derives keys using the OpenSSL - * function [`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) with the digest algorithm set to MD5, one - * iteration, and no salt. The lack of salt allows dictionary attacks as the same - * password always creates the same key. The low iteration count and - * non-cryptographically secure hash algorithm allow passwords to be tested very - * rapidly. - * - * In line with OpenSSL's recommendation to use a more modern algorithm instead of[`EVP_BytesToKey`](https://www.openssl.org/docs/man1.1.0/crypto/EVP_BytesToKey.html) it is recommended that - * developers derive a key and IV on - * their own using {@link scrypt} and to use {@link createDecipheriv} to create the `Decipher` object. - * @since v0.1.94 - * @deprecated Since v10.0.0 - Use {@link createDecipheriv} instead. - * @param options `stream.transform` options - */ - function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM; - /** @deprecated since v10.0.0 use `createDecipheriv()` */ - function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher; - /** - * Creates and returns a `Decipher` object that uses the given `algorithm`, `key`and initialization vector (`iv`). - * - * The `options` argument controls stream behavior and is optional except when a - * cipher in CCM or OCB mode is used (e.g. `'aes-128-ccm'`). In that case, the`authTagLength` option is required and specifies the length of the - * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to restrict accepted authentication tags - * to those with the specified length. - * - * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On - * recent OpenSSL releases, `openssl list -cipher-algorithms`(`openssl list-cipher-algorithms` for older versions of OpenSSL) will - * display the available cipher algorithms. - * - * The `key` is the raw key used by the `algorithm` and `iv` is an[initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded - * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be - * a `KeyObject` of type `secret`. If the cipher does not need - * an initialization vector, `iv` may be `null`. - * - * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * Initialization vectors should be unpredictable and unique; ideally, they will be - * cryptographically random. They do not have to be secret: IVs are typically just - * added to ciphertext messages unencrypted. It may sound contradictory that - * something has to be unpredictable and unique, but does not have to be secret; - * remember that an attacker must not be able to predict ahead of time what a given - * IV will be. - * @since v0.1.94 - * @param options `stream.transform` options - */ - function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike | null, options: CipherCCMOptions): DecipherCCM; - function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike | null, options?: CipherGCMOptions): DecipherGCM; - function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher; - /** - * Instances of the `Decipher` class are used to decrypt data. The class can be - * used in one of two ways: - * - * * As a `stream` that is both readable and writable, where plain encrypted - * data is written to produce unencrypted data on the readable side, or - * * Using the `decipher.update()` and `decipher.final()` methods to - * produce the unencrypted data. - * - * The {@link createDecipher} or {@link createDecipheriv} methods are - * used to create `Decipher` instances. `Decipher` objects are not to be created - * directly using the `new` keyword. - * - * Example: Using `Decipher` objects as streams: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Key length is dependent on the algorithm. In this case for aes192, it is - * // 24 bytes (192 bits). - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * let decrypted = ''; - * decipher.on('readable', () => { - * while (null !== (chunk = decipher.read())) { - * decrypted += chunk.toString('utf8'); - * } - * }); - * decipher.on('end', () => { - * console.log(decrypted); - * // Prints: some clear text data - * }); - * - * // Encrypted with same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * decipher.write(encrypted, 'hex'); - * decipher.end(); - * ``` - * - * Example: Using `Decipher` and piped streams: - * - * ```js - * import { - * createReadStream, - * createWriteStream, - * } from 'fs'; - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * const input = createReadStream('test.enc'); - * const output = createWriteStream('test.js'); - * - * input.pipe(decipher).pipe(output); - * ``` - * - * Example: Using the `decipher.update()` and `decipher.final()` methods: - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * scryptSync, - * createDecipheriv - * } = await import('crypto'); - * - * const algorithm = 'aes-192-cbc'; - * const password = 'Password used to generate key'; - * // Use the async `crypto.scrypt()` instead. - * const key = scryptSync(password, 'salt', 24); - * // The IV is usually passed along with the ciphertext. - * const iv = Buffer.alloc(16, 0); // Initialization vector. - * - * const decipher = createDecipheriv(algorithm, key, iv); - * - * // Encrypted using same algorithm, key and iv. - * const encrypted = - * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa'; - * let decrypted = decipher.update(encrypted, 'hex', 'utf8'); - * decrypted += decipher.final('utf8'); - * console.log(decrypted); - * // Prints: some clear text data - * ``` - * @since v0.1.94 - */ - class Decipher extends stream.Transform { - private constructor(); - /** - * Updates the decipher with `data`. If the `inputEncoding` argument is given, - * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is - * ignored. - * - * The `outputEncoding` specifies the output format of the enciphered - * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned. - * - * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error - * being thrown. - * @since v0.1.94 - * @param inputEncoding The `encoding` of the `data` string. - * @param outputEncoding The `encoding` of the return value. - */ - update(data: NodeJS.ArrayBufferView): Buffer; - update(data: string, inputEncoding: Encoding): Buffer; - update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string; - update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string; - /** - * Once the `decipher.final()` method has been called, the `Decipher` object can - * no longer be used to decrypt data. Attempts to call `decipher.final()` more - * than once will result in an error being thrown. - * @since v0.1.94 - * @param outputEncoding The `encoding` of the return value. - * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned. - */ - final(): Buffer; - final(outputEncoding: BufferEncoding): string; - /** - * When data has been encrypted without standard block padding, calling`decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and - * removing padding. - * - * Turning auto padding off will only work if the input data's length is a - * multiple of the ciphers block size. - * - * The `decipher.setAutoPadding()` method must be called before `decipher.final()`. - * @since v0.7.1 - * @param [autoPadding=true] - * @return for method chaining. - */ - setAutoPadding(auto_padding?: boolean): this; - } - interface DecipherCCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options: { - plaintextLength: number; - } - ): this; - } - interface DecipherGCM extends Decipher { - setAuthTag(buffer: NodeJS.ArrayBufferView): this; - setAAD( - buffer: NodeJS.ArrayBufferView, - options?: { - plaintextLength: number; - } - ): this; - } - interface PrivateKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'pkcs8' | 'sec1' | undefined; - passphrase?: string | Buffer | undefined; - } - interface PublicKeyInput { - key: string | Buffer; - format?: KeyFormat | undefined; - type?: 'pkcs1' | 'spki' | undefined; - } - /** - * Asynchronously generates a new random secret key of the given `length`. The`type` will determine which validations will be performed on the `length`. - * - * ```js - * const { - * generateKey - * } = await import('crypto'); - * - * generateKey('hmac', { length: 64 }, (err, key) => { - * if (err) throw err; - * console.log(key.export().toString('hex')); // 46e..........620 - * }); - * ``` - * @since v15.0.0 - * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`. - */ - function generateKey( - type: 'hmac' | 'aes', - options: { - length: number; - }, - callback: (err: Error | null, key: KeyObject) => void - ): void; - interface JsonWebKeyInput { - key: JsonWebKey; - format: 'jwk'; - } - /** - * Creates and returns a new key object containing a private key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key`must be an object with the properties described above. - * - * If the private key is encrypted, a `passphrase` must be specified. The length - * of the passphrase is limited to 1024 bytes. - * @since v11.6.0 - */ - function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a public key. If `key` is a - * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject`with type `'private'`, the public key is derived from the given private key; - * otherwise, `key` must be an object with the properties described above. - * - * If the format is `'pem'`, the `'key'` may also be an X.509 certificate. - * - * Because public keys can be derived from private keys, a private key may be - * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the - * returned `KeyObject` will be `'public'` and that the private key cannot be - * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type`'private'` is given, a new `KeyObject` with type `'public'` will be returned - * and it will be impossible to extract the private key from the returned object. - * @since v11.6.0 - */ - function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject; - /** - * Creates and returns a new key object containing a secret key for symmetric - * encryption or `Hmac`. - * @since v11.6.0 - * @param encoding The string encoding when `key` is a string. - */ - function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSecretKey(key: string, encoding: BufferEncoding): KeyObject; - /** - * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms. - * Optional `options` argument controls the `stream.Writable` behavior. - * - * In some cases, a `Sign` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createSign(algorithm: string, options?: stream.WritableOptions): Sign; - type DSAEncoding = 'der' | 'ieee-p1363'; - interface SigningOptions { - /** - * @See crypto.constants.RSA_PKCS1_PADDING - */ - padding?: number | undefined; - saltLength?: number | undefined; - dsaEncoding?: DSAEncoding | undefined; - } - interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {} - interface SignKeyObjectInput extends SigningOptions { - key: KeyObject; - } - interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {} - interface VerifyKeyObjectInput extends SigningOptions { - key: KeyObject; - } - type KeyLike = string | Buffer | KeyObject; - /** - * The `Sign` class is a utility for generating signatures. It can be used in one - * of two ways: - * - * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or - * * Using the `sign.update()` and `sign.sign()` methods to produce the - * signature. - * - * The {@link createSign} method is used to create `Sign` instances. The - * argument is the string name of the hash function to use. `Sign` objects are not - * to be created directly using the `new` keyword. - * - * Example: Using `Sign` and `Verify` objects as streams: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('ec', { - * namedCurve: 'sect239k1' - * }); - * - * const sign = createSign('SHA256'); - * sign.write('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey, 'hex'); - * - * const verify = createVerify('SHA256'); - * verify.write('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature, 'hex')); - * // Prints: true - * ``` - * - * Example: Using the `sign.update()` and `verify.update()` methods: - * - * ```js - * const { - * generateKeyPairSync, - * createSign, - * createVerify - * } = await import('crypto'); - * - * const { privateKey, publicKey } = generateKeyPairSync('rsa', { - * modulusLength: 2048, - * }); - * - * const sign = createSign('SHA256'); - * sign.update('some data to sign'); - * sign.end(); - * const signature = sign.sign(privateKey); - * - * const verify = createVerify('SHA256'); - * verify.update('some data to sign'); - * verify.end(); - * console.log(verify.verify(publicKey, signature)); - * // Prints: true - * ``` - * @since v0.1.92 - */ - class Sign extends stream.Writable { - private constructor(); - /** - * Updates the `Sign` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `encoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): this; - update(data: string, inputEncoding: Encoding): this; - /** - * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the following additional properties can be passed: - * - * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. - * - * The `Sign` object can not be again used after `sign.sign()` method has been - * called. Multiple calls to `sign.sign()` will result in an error being thrown. - * @since v0.1.92 - */ - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, outputFormat: BinaryToTextEncoding): string; - } - /** - * Creates and returns a `Verify` object that uses the given algorithm. - * Use {@link getHashes} to obtain an array of names of the available - * signing algorithms. Optional `options` argument controls the`stream.Writable` behavior. - * - * In some cases, a `Verify` instance can be created using the name of a signature - * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use - * the corresponding digest algorithm. This does not work for all signature - * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest - * algorithm names. - * @since v0.1.92 - * @param options `stream.Writable` options - */ - function createVerify(algorithm: string, options?: stream.WritableOptions): Verify; - /** - * The `Verify` class is a utility for verifying signatures. It can be used in one - * of two ways: - * - * * As a writable `stream` where written data is used to validate against the - * supplied signature, or - * * Using the `verify.update()` and `verify.verify()` methods to verify - * the signature. - * - * The {@link createVerify} method is used to create `Verify` instances.`Verify` objects are not to be created directly using the `new` keyword. - * - * See `Sign` for examples. - * @since v0.1.92 - */ - class Verify extends stream.Writable { - private constructor(); - /** - * Updates the `Verify` content with the given `data`, the encoding of which - * is given in `inputEncoding`. - * If `inputEncoding` is not provided, and the `data` is a string, an - * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored. - * - * This can be called many times with new data as it is streamed. - * @since v0.1.92 - * @param inputEncoding The `encoding` of the `data` string. - */ - update(data: BinaryLike): Verify; - update(data: string, inputEncoding: Encoding): Verify; - /** - * Verifies the provided data using the given `object` and `signature`. - * - * If `object` is not a `KeyObject`, this function behaves as if`object` had been passed to {@link createPublicKey}. If it is an - * object, the following additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the data, in - * the `signatureEncoding`. - * If a `signatureEncoding` is specified, the `signature` is expected to be a - * string; otherwise `signature` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * The `verify` object can not be used again after `verify.verify()` has been - * called. Multiple calls to `verify.verify()` will result in an error being - * thrown. - * - * Because public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.1.92 - */ - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean; - } - /** - * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an - * optional specific `generator`. - * - * The `generator` argument can be a number, string, or `Buffer`. If`generator` is not specified, the value `2` is used. - * - * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise - * a `Buffer`, `TypedArray`, or `DataView` is expected. - * - * If `generatorEncoding` is specified, `generator` is expected to be a string; - * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected. - * @since v0.11.12 - * @param primeEncoding The `encoding` of the `prime` string. - * @param [generator=2] - * @param generatorEncoding The `encoding` of the `generator` string. - */ - function createDiffieHellman(primeLength: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman; - function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman; - /** - * The `DiffieHellman` class is a utility for creating Diffie-Hellman key - * exchanges. - * - * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createDiffieHellman - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createDiffieHellman(2048); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator()); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * // OK - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * ``` - * @since v0.5.0 - */ - class DiffieHellman { - private constructor(); - /** - * Generates private and public Diffie-Hellman key values, and returns - * the public key in the specified `encoding`. This key should be - * transferred to the other party. - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using the specified `inputEncoding`, and secret is - * encoded using specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned. - * @since v0.5.0 - * @param inputEncoding The `encoding` of an `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman prime in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrime(): Buffer; - getPrime(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman generator in the specified `encoding`. - * If `encoding` is provided a string is - * returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getGenerator(): Buffer; - getGenerator(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman public key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding): string; - /** - * Returns the Diffie-Hellman private key in the specified `encoding`. - * If `encoding` is provided a - * string is returned; otherwise a `Buffer` is returned. - * @since v0.5.0 - * @param encoding The `encoding` of the return value. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * Sets the Diffie-Hellman public key. If the `encoding` argument is provided,`publicKey` is expected - * to be a string. If no `encoding` is provided, `publicKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `publicKey` string. - */ - setPublicKey(publicKey: NodeJS.ArrayBufferView): void; - setPublicKey(publicKey: string, encoding: BufferEncoding): void; - /** - * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected - * to be a string. If no `encoding` is provided, `privateKey` is expected - * to be a `Buffer`, `TypedArray`, or `DataView`. - * @since v0.5.0 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BufferEncoding): void; - /** - * A bit field containing any warnings and/or errors resulting from a check - * performed during initialization of the `DiffieHellman` object. - * - * The following values are valid for this property (as defined in `constants`module): - * - * * `DH_CHECK_P_NOT_SAFE_PRIME` - * * `DH_CHECK_P_NOT_PRIME` - * * `DH_UNABLE_TO_CHECK_GENERATOR` - * * `DH_NOT_SUITABLE_GENERATOR` - * @since v0.11.12 - */ - verifyError: number; - } - /** - * Creates a predefined `DiffieHellmanGroup` key exchange object. The - * supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in[RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt), but see `Caveats`) and `'modp14'`, `'modp15'`,`'modp16'`, `'modp17'`, - * `'modp18'` (defined in [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt)). The - * returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing - * the keys (with `diffieHellman.setPublicKey()`, for example). The - * advantage of using this method is that the parties do not have to - * generate nor exchange a group modulus beforehand, saving both processor - * and communication time. - * - * Example (obtaining a shared secret): - * - * ```js - * const { - * getDiffieHellman - * } = await import('crypto'); - * const alice = getDiffieHellman('modp14'); - * const bob = getDiffieHellman('modp14'); - * - * alice.generateKeys(); - * bob.generateKeys(); - * - * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex'); - * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex'); - * - * // aliceSecret and bobSecret should be the same - * console.log(aliceSecret === bobSecret); - * ``` - * @since v0.7.5 - */ - function getDiffieHellman(groupName: string): DiffieHellman; - /** - * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an error occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. By default, the successfully generated`derivedKey` will be passed to the callback as a `Buffer`. An error will be - * thrown if any of the input arguments specify invalid values or types. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2 - * } = await import('crypto'); - * - * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * ``` - * - * The `crypto.DEFAULT_ENCODING` property can be used to change the way the`derivedKey` is passed to the callback. This property, however, has been - * deprecated and use should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * crypto.pbkdf2('secret', 'salt', 100000, 512, 'sha512', (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey); // '3745e48...aa39b34' - * }); - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * @since v0.5.5 - */ - function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: Buffer) => void): void; - /** - * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2) - * implementation. A selected HMAC digest algorithm specified by `digest` is - * applied to derive a key of the requested byte length (`keylen`) from the`password`, `salt` and `iterations`. - * - * If an error occurs an `Error` will be thrown, otherwise the derived key will be - * returned as a `Buffer`. - * - * If `digest` is `null`, `'sha1'` will be used. This behavior is deprecated, - * please specify a `digest` explicitly. - * - * The `iterations` argument must be a number set as high as possible. The - * higher the number of iterations, the more secure the derived key will be, - * but will take a longer amount of time to complete. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * ```js - * const { - * pbkdf2Sync - * } = await import('crypto'); - * - * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512'); - * console.log(key.toString('hex')); // '3745e48...08d59ae' - * ``` - * - * The `crypto.DEFAULT_ENCODING` property may be used to change the way the`derivedKey` is returned. This property, however, is deprecated and use - * should be avoided. - * - * ```js - * import crypto from 'crypto'; - * crypto.DEFAULT_ENCODING = 'hex'; - * const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 512, 'sha512'); - * console.log(key); // '3745e48...aa39b34' - * ``` - * - * An array of supported digest functions can be retrieved using {@link getHashes}. - * @since v0.9.3 - */ - function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer; - /** - * Generates cryptographically strong pseudorandom data. The `size` argument - * is a number indicating the number of bytes to generate. - * - * If a `callback` function is provided, the bytes are generated asynchronously - * and the `callback` function is invoked with two arguments: `err` and `buf`. - * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The`buf` argument is a `Buffer` containing the generated bytes. - * - * ```js - * // Asynchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * randomBytes(256, (err, buf) => { - * if (err) throw err; - * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`); - * }); - * ``` - * - * If the `callback` function is not provided, the random bytes are generated - * synchronously and returned as a `Buffer`. An error will be thrown if - * there is a problem generating the bytes. - * - * ```js - * // Synchronous - * const { - * randomBytes - * } = await import('crypto'); - * - * const buf = randomBytes(256); - * console.log( - * `${buf.length} bytes of random data: ${buf.toString('hex')}`); - * ``` - * - * The `crypto.randomBytes()` method will not complete until there is - * sufficient entropy available. - * This should normally never take longer than a few milliseconds. The only time - * when generating the random bytes may conceivably block for a longer period of - * time is right after boot, when the whole system is still low on entropy. - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomBytes()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomBytes` requests when doing so as part of fulfilling a client - * request. - * @since v0.5.8 - * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`. - * @return if the `callback` function is not provided. - */ - 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; - /** - * Return a random integer `n` such that `min <= n < max`. This - * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias). - * - * The range (`max - min`) must be less than 248. `min` and `max` must - * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). - * - * If the `callback` function is not provided, the random integer is - * generated synchronously. - * - * ```js - * // Asynchronous - * const { - * randomInt - * } = await import('crypto'); - * - * randomInt(3, (err, n) => { - * if (err) throw err; - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * }); - * ``` - * - * ```js - * // Synchronous - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(3); - * console.log(`Random number chosen from (0, 1, 2): ${n}`); - * ``` - * - * ```js - * // With `min` argument - * const { - * randomInt - * } = await import('crypto'); - * - * const n = randomInt(1, 7); - * console.log(`The dice rolled: ${n}`); - * ``` - * @since v14.10.0, v12.19.0 - * @param [min=0] Start of random range (inclusive). - * @param max End of random range (exclusive). - * @param callback `function(err, n) {}`. - */ - function randomInt(max: number): number; - function randomInt(min: number, max: number): number; - function randomInt(max: number, callback: (err: Error | null, value: number) => void): void; - function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void; - /** - * Synchronous version of {@link randomFill}. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * console.log(randomFillSync(buf).toString('hex')); - * - * randomFillSync(buf, 5); - * console.log(buf.toString('hex')); - * - * // The above is equivalent to the following: - * randomFillSync(buf, 5, 5); - * console.log(buf.toString('hex')); - * ``` - * - * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFillSync } = await import('crypto'); - * - * const a = new Uint32Array(10); - * console.log(Buffer.from(randomFillSync(a).buffer, - * a.byteOffset, a.byteLength).toString('hex')); - * - * const b = new DataView(new ArrayBuffer(10)); - * console.log(Buffer.from(randomFillSync(b).buffer, - * b.byteOffset, b.byteLength).toString('hex')); - * - * const c = new ArrayBuffer(10); - * console.log(Buffer.from(randomFillSync(c)).toString('hex')); - * ``` - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @return The object passed as `buffer` argument. - */ - function randomFillSync(buffer: T, offset?: number, size?: number): T; - /** - * This function is similar to {@link randomBytes} but requires the first - * argument to be a `Buffer` that will be filled. It also - * requires that a callback is passed in. - * - * If the `callback` function is not provided, an error will be thrown. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const buf = Buffer.alloc(10); - * randomFill(buf, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * randomFill(buf, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * - * // The above is equivalent to the following: - * randomFill(buf, 5, 5, (err, buf) => { - * if (err) throw err; - * console.log(buf.toString('hex')); - * }); - * ``` - * - * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as`buffer`. - * - * While this includes instances of `Float32Array` and `Float64Array`, this - * function should not be used to generate random floating-point numbers. The - * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array - * contains finite numbers only, they are not drawn from a uniform random - * distribution and have no meaningful lower or upper bounds. - * - * ```js - * import { Buffer } from 'buffer'; - * const { randomFill } = await import('crypto'); - * - * const a = new Uint32Array(10); - * randomFill(a, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const b = new DataView(new ArrayBuffer(10)); - * randomFill(b, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength) - * .toString('hex')); - * }); - * - * const c = new ArrayBuffer(10); - * randomFill(c, (err, buf) => { - * if (err) throw err; - * console.log(Buffer.from(buf).toString('hex')); - * }); - * ``` - * - * This API uses libuv's threadpool, which can have surprising and - * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information. - * - * The asynchronous version of `crypto.randomFill()` is carried out in a single - * threadpool request. To minimize threadpool task length variation, partition - * large `randomFill` requests when doing so as part of fulfilling a client - * request. - * @since v7.10.0, v6.13.0 - * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`. - * @param [offset=0] - * @param [size=buffer.length - offset] - * @param callback `function(err, buf) {}`. - */ - 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 { - cost?: number | undefined; - blockSize?: number | undefined; - parallelization?: number | undefined; - N?: number | undefined; - r?: number | undefined; - p?: number | undefined; - maxmem?: number | undefined; - } - /** - * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * The `callback` function is called with two arguments: `err` and `derivedKey`.`err` is an exception object when key derivation fails, otherwise `err` is`null`. `derivedKey` is passed to the - * callback as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scrypt - * } = await import('crypto'); - * - * // Using the factory defaults. - * scrypt('password', 'salt', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae' - * }); - * // Using a custom N parameter. Must be a power of two. - * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => { - * if (err) throw err; - * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34' - * }); - * ``` - * @since v10.5.0 - */ - 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; - /** - * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based - * key derivation function that is designed to be expensive computationally and - * memory-wise in order to make brute-force attacks unrewarding. - * - * The `salt` should be as unique as possible. It is recommended that a salt is - * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details. - * - * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`. - * - * An exception is thrown when key derivation fails, otherwise the derived key is - * returned as a `Buffer`. - * - * An exception is thrown when any of the input arguments specify invalid values - * or types. - * - * ```js - * const { - * scryptSync - * } = await import('crypto'); - * // Using the factory defaults. - * - * const key1 = scryptSync('password', 'salt', 64); - * console.log(key1.toString('hex')); // '3745e48...08d59ae' - * // Using a custom N parameter. Must be a power of two. - * const key2 = scryptSync('password', 'salt', 64, { N: 1024 }); - * console.log(key2.toString('hex')); // '3745e48...aa39b34' - * ``` - * @since v10.5.0 - */ - function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer; - interface RsaPublicKey { - key: KeyLike; - padding?: number | undefined; - } - interface RsaPrivateKey { - key: KeyLike; - passphrase?: string | undefined; - /** - * @default 'sha1' - */ - oaepHash?: string | undefined; - oaepLabel?: NodeJS.TypedArray | undefined; - padding?: number | undefined; - } - /** - * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using - * the corresponding private key, for example using {@link privateDecrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v0.11.14 - */ - function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `key`.`buffer` was previously encrypted using - * the corresponding private key, for example using {@link privateEncrypt}. - * - * If `key` is not a `KeyObject`, this function behaves as if`key` had been passed to {@link createPublicKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * - * Because RSA public keys can be derived from private keys, a private key may - * be passed instead of a public key. - * @since v1.1.0 - */ - function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using - * the corresponding public key, for example using {@link publicEncrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_OAEP_PADDING`. - * @since v0.11.14 - */ - function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using - * the corresponding public key, for example using {@link publicDecrypt}. - * - * If `privateKey` is not a `KeyObject`, this function behaves as if`privateKey` had been passed to {@link createPrivateKey}. If it is an - * object, the `padding` property can be passed. Otherwise, this function uses`RSA_PKCS1_PADDING`. - * @since v1.1.0 - */ - function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer; - /** - * ```js - * const { - * getCiphers - * } = await import('crypto'); - * - * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...] - * ``` - * @since v0.9.3 - * @return An array with the names of the supported cipher algorithms. - */ - function getCiphers(): string[]; - /** - * ```js - * const { - * getCurves - * } = await import('crypto'); - * - * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...] - * ``` - * @since v2.3.0 - * @return An array with the names of the supported elliptic curves. - */ - function getCurves(): string[]; - /** - * @since v10.0.0 - * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}. - */ - function getFips(): 1 | 0; - /** - * ```js - * const { - * getHashes - * } = await import('crypto'); - * - * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...] - * ``` - * @since v0.9.3 - * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms. - */ - function getHashes(): string[]; - /** - * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH) - * key exchanges. - * - * Instances of the `ECDH` class can be created using the {@link createECDH} function. - * - * ```js - * import assert from 'assert'; - * - * const { - * createECDH - * } = await import('crypto'); - * - * // Generate Alice's keys... - * const alice = createECDH('secp521r1'); - * const aliceKey = alice.generateKeys(); - * - * // Generate Bob's keys... - * const bob = createECDH('secp521r1'); - * const bobKey = bob.generateKeys(); - * - * // Exchange and generate the secret... - * const aliceSecret = alice.computeSecret(bobKey); - * const bobSecret = bob.computeSecret(aliceKey); - * - * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); - * // OK - * ``` - * @since v0.11.14 - */ - class ECDH { - private constructor(); - /** - * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the - * format specified by `format`. The `format` argument specifies point encoding - * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is - * interpreted using the specified `inputEncoding`, and the returned key is encoded - * using the specified `outputEncoding`. - * - * Use {@link getCurves} to obtain a list of available curve names. - * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display - * the name and description of each available elliptic curve. - * - * If `format` is not specified the point will be returned in `'uncompressed'`format. - * - * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * Example (uncompressing a key): - * - * ```js - * const { - * createECDH, - * ECDH - * } = await import('crypto'); - * - * const ecdh = createECDH('secp256k1'); - * ecdh.generateKeys(); - * - * const compressedKey = ecdh.getPublicKey('hex', 'compressed'); - * - * const uncompressedKey = ECDH.convertKey(compressedKey, - * 'secp256k1', - * 'hex', - * 'hex', - * 'uncompressed'); - * - * // The converted key and the uncompressed public key should be the same - * console.log(uncompressedKey === ecdh.getPublicKey('hex')); - * ``` - * @since v10.0.0 - * @param inputEncoding The `encoding` of the `key` string. - * @param outputEncoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - static convertKey( - key: BinaryLike, - curve: string, - inputEncoding?: BinaryToTextEncoding, - outputEncoding?: 'latin1' | 'hex' | 'base64', - format?: 'uncompressed' | 'compressed' | 'hybrid' - ): Buffer | string; - /** - * Generates private and public EC Diffie-Hellman key values, and returns - * the public key in the specified `format` and `encoding`. This key should be - * transferred to the other party. - * - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format. - * - * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - */ - generateKeys(): Buffer; - generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Computes the shared secret using `otherPublicKey` as the other - * party's public key and returns the computed shared secret. The supplied - * key is interpreted using specified `inputEncoding`, and the returned secret - * is encoded using the specified `outputEncoding`. - * If the `inputEncoding` is not - * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or`DataView`. - * - * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned. - * - * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey`lies outside of the elliptic curve. Since `otherPublicKey` is - * usually supplied from a remote user over an insecure network, - * be sure to handle this exception accordingly. - * @since v0.11.14 - * @param inputEncoding The `encoding` of the `otherPublicKey` string. - * @param outputEncoding The `encoding` of the return value. - */ - computeSecret(otherPublicKey: NodeJS.ArrayBufferView): Buffer; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): Buffer; - computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string; - computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string; - /** - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @return The EC Diffie-Hellman in the specified `encoding`. - */ - getPrivateKey(): Buffer; - getPrivateKey(encoding: BinaryToTextEncoding): string; - /** - * The `format` argument specifies point encoding and can be `'compressed'` or`'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format. - * - * If `encoding` is specified, a string is returned; otherwise a `Buffer` is - * returned. - * @since v0.11.14 - * @param encoding The `encoding` of the return value. - * @param [format='uncompressed'] - * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`. - */ - getPublicKey(): Buffer; - getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string; - /** - * Sets the EC Diffie-Hellman private key. - * If `encoding` is provided, `privateKey` is expected - * to be a string; otherwise `privateKey` is expected to be a `Buffer`,`TypedArray`, or `DataView`. - * - * If `privateKey` is not valid for the curve specified when the `ECDH` object was - * created, an error is thrown. Upon setting the private key, the associated - * public point (key) is also generated and set in the `ECDH` object. - * @since v0.11.14 - * @param encoding The `encoding` of the `privateKey` string. - */ - setPrivateKey(privateKey: NodeJS.ArrayBufferView): void; - setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void; - } - /** - * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a - * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent - * OpenSSL releases, `openssl ecparam -list_curves` will also display the name - * and description of each available elliptic curve. - * @since v0.11.14 - */ - function createECDH(curveName: string): ECDH; - /** - * This function is based on a constant-time algorithm. - * Returns true if `a` is equal to `b`, without leaking timing information that - * would allow an attacker to guess one of the values. This is suitable for - * comparing HMAC digests or secret values like authentication cookies or[capability urls](https://www.w3.org/TR/capability-urls/). - * - * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they - * must have the same byte length. - * - * If at least one of `a` and `b` is a `TypedArray` with more than one byte per - * entry, such as `Uint16Array`, the result will be computed using the platform - * byte order. - * - * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code - * is timing-safe. Care should be taken to ensure that the surrounding code does - * not introduce timing vulnerabilities. - * @since v6.6.0 - */ - function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; - /** @deprecated since v10.0.0 */ - const DEFAULT_ENCODING: BufferEncoding; - type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; - type KeyFormat = 'pem' | 'der'; - interface BasePrivateKeyEncodingOptions { - format: T; - cipher?: string | undefined; - passphrase?: string | undefined; - } - interface KeyPairKeyObjectResult { - publicKey: KeyObject; - privateKey: KeyObject; - } - interface ED25519KeyPairKeyObjectOptions {} - interface ED448KeyPairKeyObjectOptions {} - interface X25519KeyPairKeyObjectOptions {} - interface X448KeyPairKeyObjectOptions {} - interface ECKeyPairKeyObjectOptions { - /** - * Name of the curve to use. - */ - namedCurve: string; - } - interface RSAKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - interface RSAPSSKeyPairKeyObjectOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number | undefined; - } - 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 | undefined; - publicKeyEncoding: { - type: 'pkcs1' | 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs1' | 'pkcs8'; - }; - } - interface RSAPSSKeyPairOptions { - /** - * Key size in bits - */ - modulusLength: number; - /** - * @default 0x10001 - */ - publicExponent?: number | undefined; - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: '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 ED25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface ED448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X25519KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface X448KeyPairOptions { - publicKeyEncoding: { - type: 'spki'; - format: PubF; - }; - privateKeyEncoding: BasePrivateKeyEncodingOptions & { - type: 'pkcs8'; - }; - } - interface KeyPairSyncResult { - publicKey: T1; - privateKey: T2; - } - /** - * Generates a new asymmetric key pair of the given `type`. RSA, DSA, EC, Ed25519, - * Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * When encoding public keys, it is recommended to use `'spki'`. When encoding - * private keys, it is recommended to use `'pkcs8'` with a strong passphrase, - * and to keep the passphrase confidential. - * - * ```js - * const { - * generateKeyPairSync - * } = await import('crypto'); - * - * const { - * publicKey, - * privateKey, - * } = generateKeyPairSync('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }); - * ``` - * - * The return value `{ publicKey, privateKey }` represents the generated key pair. - * When PEM encoding was selected, the respective key will be a string, otherwise - * it will be a buffer containing the data encoded as DER. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'rsa-pss'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - 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: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): 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 generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options: X448KeyPairOptions<'der', 'der'>): KeyPairSyncResult; - function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult; - /** - * Generates a new asymmetric key pair of the given `type`. RSA, DSA, EC, Ed25519, - * Ed448, X25519, X448, and DH are currently supported. - * - * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function - * behaves as if `keyObject.export()` had been called on its result. Otherwise, - * the respective part of the key is returned as a `KeyObject`. - * - * It is recommended to encode public keys as `'spki'` and private keys as`'pkcs8'` with encryption for long-term storage: - * - * ```js - * const { - * generateKeyPair - * } = await import('crypto'); - * - * generateKeyPair('rsa', { - * modulusLength: 4096, - * publicKeyEncoding: { - * type: 'spki', - * format: 'pem' - * }, - * privateKeyEncoding: { - * type: 'pkcs8', - * format: 'pem', - * cipher: 'aes-256-cbc', - * passphrase: 'top secret' - * } - * }, (err, publicKey, privateKey) => { - * // Handle errors and use the generated key pair. - * }); - * ``` - * - * On completion, `callback` will be called with `err` set to `undefined` and`publicKey` / `privateKey` representing the generated key pair. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a `Promise` for an `Object` with `publicKey` and `privateKey` properties. - * @since v10.12.0 - * @param type Must be `'rsa'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. - */ - 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: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions, 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; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'ed448', options: ED448KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x25519', options: X25519KeyPairKeyObjectOptions | undefined, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void; - function generateKeyPair(type: 'x448', options: X448KeyPairKeyObjectOptions | undefined, 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: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'rsa-pss', - options: RSAPSSKeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'rsa-pss', options: RSAPSSKeyPairKeyObjectOptions): 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; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed25519', - options: ED25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'ed448', - options: ED448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x25519', - options: X25519KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): Promise; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'pem'> - ): Promise<{ - publicKey: string; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'pem', 'der'> - ): Promise<{ - publicKey: string; - privateKey: Buffer; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'pem'> - ): Promise<{ - publicKey: Buffer; - privateKey: string; - }>; - function __promisify__( - type: 'x448', - options: X448KeyPairOptions<'der', 'der'> - ): Promise<{ - publicKey: Buffer; - privateKey: Buffer; - }>; - function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): 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 {@link createPrivateKey}. If it is an object, the following - * additional properties can be passed: - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; - function sign( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, - callback: (error: Error | null, data: Buffer) => void - ): void; - /** - * Verifies the given signature for `data` using the given 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 {@link createPublicKey}. If it is an object, the following - * additional properties can be passed: - * - * The `signature` argument is the previously calculated signature for the `data`. - * - * Because public keys can be derived from private keys, a private key or a public - * key may be passed for `key`. - * - * If the `callback` function is provided this function uses libuv's threadpool. - * @since v12.0.0 - */ - function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, signature: NodeJS.ArrayBufferView): boolean; - function verify( - algorithm: string | null | undefined, - data: NodeJS.ArrayBufferView, - key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput, - signature: NodeJS.ArrayBufferView, - callback: (error: Error | null, result: boolean) => void - ): void; - /** - * Computes the Diffie-Hellman secret based on a `privateKey` and a `publicKey`. - * Both keys must have the same `asymmetricKeyType`, which must be one of `'dh'`(for Diffie-Hellman), `'ec'` (for ECDH), `'x448'`, or `'x25519'` (for ECDH-ES). - * @since v13.9.0, v12.17.0 - */ - function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer; - type CipherMode = 'cbc' | 'ccm' | 'cfb' | 'ctr' | 'ecb' | 'gcm' | 'ocb' | 'ofb' | 'stream' | 'wrap' | 'xts'; - interface CipherInfoOptions { - /** - * A test key length. - */ - keyLength?: number | undefined; - /** - * A test IV length. - */ - ivLength?: number | undefined; - } - interface CipherInfo { - /** - * The name of the cipher. - */ - name: string; - /** - * The nid of the cipher. - */ - nid: number; - /** - * The block size of the cipher in bytes. - * This property is omitted when mode is 'stream'. - */ - blockSize?: number | undefined; - /** - * The expected or default initialization vector length in bytes. - * This property is omitted if the cipher does not use an initialization vector. - */ - ivLength?: number | undefined; - /** - * The expected or default key length in bytes. - */ - keyLength: number; - /** - * The cipher mode. - */ - mode: CipherMode; - } - /** - * Returns information about a given cipher. - * - * Some ciphers accept variable length keys and initialization vectors. By default, - * the `crypto.getCipherInfo()` method will return the default values for these - * ciphers. To test if a given key length or iv length is acceptable for given - * cipher, use the `keyLength` and `ivLength` options. If the given values are - * unacceptable, `undefined` will be returned. - * @since v15.0.0 - * @param nameOrNid The name or nid of the cipher to query. - */ - function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined; - /** - * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`,`salt` and `info` are used with the `digest` to derive a key of `keylen` bytes. - * - * The supplied `callback` function is called with two arguments: `err` and`derivedKey`. If an errors occurs while deriving the key, `err` will be set; - * otherwise `err` will be `null`. The successfully generated `derivedKey` will - * be passed to the callback as an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any - * of the input arguments specify invalid values or types. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdf - * } = await import('crypto'); - * - * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => { - * if (err) throw err; - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * }); - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void; - /** - * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The - * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of`keylen` bytes. - * - * The successfully generated `derivedKey` will be returned as an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). - * - * An error will be thrown if any of the input arguments specify invalid values or - * types, or if the derived key cannot be generated. - * - * ```js - * import { Buffer } from 'buffer'; - * const { - * hkdfSync - * } = await import('crypto'); - * - * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64); - * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653' - * ``` - * @since v15.0.0 - * @param digest The digest algorithm to use. - * @param ikm The input keying material. It must be at least one byte in length. - * @param salt The salt value. Must be provided but can be zero-length. - * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes. - * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` - * generates 64-byte hashes, making the maximum HKDF output 16320 bytes). - */ - function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer; - interface SecureHeapUsage { - /** - * The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag. - */ - total: number; - /** - * The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag. - */ - min: number; - /** - * The total number of bytes currently allocated from the secure heap. - */ - used: number; - /** - * The calculated ratio of `used` to `total` allocated bytes. - */ - utilization: number; - } - /** - * @since v15.6.0 - */ - function secureHeapUsed(): SecureHeapUsage; - interface RandomUUIDOptions { - /** - * By default, to improve performance, - * Node.js will pre-emptively generate and persistently cache enough - * random data to generate up to 128 random UUIDs. To generate a UUID - * without using the cache, set `disableEntropyCache` to `true`. - * - * @default `false` - */ - disableEntropyCache?: boolean | undefined; - } - /** - * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a - * cryptographic pseudorandom number generator. - * @since v15.6.0 - */ - function randomUUID(options?: RandomUUIDOptions): string; - interface X509CheckOptions { - /** - * @default 'always' - */ - subject: 'always' | 'never'; - /** - * @default true - */ - wildcards: boolean; - /** - * @default true - */ - partialWildcards: boolean; - /** - * @default false - */ - multiLabelWildcards: boolean; - /** - * @default false - */ - singleLabelSubdomains: boolean; - } - /** - * Encapsulates an X509 certificate and provides read-only access to - * its information. - * - * ```js - * const { X509Certificate } = await import('crypto'); - * - * const x509 = new X509Certificate('{... pem encoded cert ...}'); - * - * console.log(x509.subject); - * ``` - * @since v15.6.0 - */ - class X509Certificate { - /** - * Will be \`true\` if this is a Certificate Authority (ca) certificate. - * @since v15.6.0 - */ - readonly ca: boolean; - /** - * The SHA-1 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint: string; - /** - * The SHA-256 fingerprint of this certificate. - * @since v15.6.0 - */ - readonly fingerprint256: string; - /** - * The complete subject of this certificate. - * @since v15.6.0 - */ - readonly subject: string; - /** - * The subject alternative name specified for this certificate. - * @since v15.6.0 - */ - readonly subjectAltName: string; - /** - * The information access content of this certificate. - * @since v15.6.0 - */ - readonly infoAccess: string; - /** - * An array detailing the key usages for this certificate. - * @since v15.6.0 - */ - readonly keyUsage: string[]; - /** - * The issuer identification included in this certificate. - * @since v15.6.0 - */ - readonly issuer: string; - /** - * The issuer certificate or `undefined` if the issuer certificate is not - * available. - * @since v15.9.0 - */ - readonly issuerCertificate?: X509Certificate | undefined; - /** - * The public key `KeyObject` for this certificate. - * @since v15.6.0 - */ - readonly publicKey: KeyObject; - /** - * A `Buffer` containing the DER encoding of this certificate. - * @since v15.6.0 - */ - readonly raw: Buffer; - /** - * The serial number of this certificate. - * @since v15.6.0 - */ - readonly serialNumber: string; - /** - * The date/time from which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validFrom: string; - /** - * The date/time until which this certificate is considered valid. - * @since v15.6.0 - */ - readonly validTo: string; - constructor(buffer: BinaryLike); - /** - * Checks whether the certificate matches the given email address. - * @since v15.6.0 - * @return Returns `email` if the certificate matches, `undefined` if it does not. - */ - checkEmail(email: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given host name. - * @since v15.6.0 - * @return Returns `name` if the certificate matches, `undefined` if it does not. - */ - checkHost(name: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether the certificate matches the given IP address (IPv4 or IPv6). - * @since v15.6.0 - * @return Returns `ip` if the certificate matches, `undefined` if it does not. - */ - checkIP(ip: string, options?: X509CheckOptions): string | undefined; - /** - * Checks whether this certificate was issued by the given `otherCert`. - * @since v15.6.0 - */ - checkIssued(otherCert: X509Certificate): boolean; - /** - * Checks whether the public key for this certificate is consistent with - * the given private key. - * @since v15.6.0 - * @param privateKey A private key. - */ - checkPrivateKey(privateKey: KeyObject): boolean; - /** - * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded - * certificate. - * @since v15.6.0 - */ - toJSON(): string; - /** - * Returns information about this certificate using the legacy `certificate object` encoding. - * @since v15.6.0 - */ - toLegacyObject(): PeerCertificate; - /** - * Returns the PEM-encoded certificate. - * @since v15.6.0 - */ - toString(): string; - /** - * Verifies that this certificate was signed by the given public key. - * Does not perform any other validation checks on the certificate. - * @since v15.6.0 - * @param publicKey A public key. - */ - verify(publicKey: KeyObject): boolean; - } - type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint; - interface GeneratePrimeOptions { - add?: LargeNumberLike | undefined; - rem?: LargeNumberLike | undefined; - /** - * @default false - */ - safe?: boolean | undefined; - bigint?: boolean | undefined; - } - interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions { - bigint: true; - } - interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions { - bigint?: false | undefined; - } - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [<bigint>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void; - function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void; - /** - * Generates a pseudorandom prime of `size` bits. - * - * If `options.safe` is `true`, the prime will be a safe prime -- that is,`(prime - 1) / 2` will also be a prime. - * - * The `options.add` and `options.rem` parameters can be used to enforce additional - * requirements, e.g., for Diffie-Hellman: - * - * * If `options.add` and `options.rem` are both set, the prime will satisfy the - * condition that `prime % add = rem`. - * * If only `options.add` is set and `options.safe` is not `true`, the prime will - * satisfy the condition that `prime % add = 1`. - * * If only `options.add` is set and `options.safe` is set to `true`, the prime - * will instead satisfy the condition that `prime % add = 3`. This is necessary - * because `prime % add = 1` for `options.add > 2` would contradict the condition - * enforced by `options.safe`. - * * `options.rem` is ignored if `options.add` is not given. - * - * Both `options.add` and `options.rem` must be encoded as big-endian sequences - * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or`DataView`. - * - * By default, the prime is encoded as a big-endian sequence of octets - * in an [<ArrayBuffer>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a - * [<bigint>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)is provided. - * @since v15.8.0 - * @param size The size (in bits) of the prime to generate. - */ - function generatePrimeSync(size: number): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint; - function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer; - function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint; - interface CheckPrimeOptions { - /** - * The number of Miller-Rabin probabilistic primality iterations to perform. - * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most 2-64 for random input. - * Care must be used when selecting a number of checks. - * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details. - * - * @default 0 - */ - checks?: number | undefined; - } - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - */ - function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void; - function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void; - /** - * Checks the primality of the `candidate`. - * @since v15.8.0 - * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length. - * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`. - */ - function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean; - namespace webcrypto { - class CryptoKey {} // placeholder - } -} -declare module 'node:crypto' { - export * from 'crypto'; -} diff --git a/JS/node_modules/@types/node/dgram.d.ts b/JS/node_modules/@types/node/dgram.d.ts deleted file mode 100755 index 72751d6..0000000 --- a/JS/node_modules/@types/node/dgram.d.ts +++ /dev/null @@ -1,545 +0,0 @@ -/** - * The `dgram` module provides an implementation of UDP datagram sockets. - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/dgram.js) - */ -declare module 'dgram' { - import { AddressInfo } from 'node:net'; - import * as dns from 'node:dns'; - import { EventEmitter, Abortable } from 'node:events'; - interface RemoteInfo { - address: string; - family: 'IPv4' | 'IPv6'; - port: number; - size: number; - } - interface BindOptions { - port?: number | undefined; - address?: string | undefined; - exclusive?: boolean | undefined; - fd?: number | undefined; - } - type SocketType = 'udp4' | 'udp6'; - interface SocketOptions extends Abortable { - type: SocketType; - reuseAddr?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - recvBufferSize?: number | undefined; - sendBufferSize?: number | undefined; - lookup?: ((hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void) | undefined; - } - /** - * Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram - * messages. When `address` and `port` are not passed to `socket.bind()` the - * method will bind the socket to the "all interfaces" address on a random port - * (it does the right thing for both `udp4` and `udp6` sockets). The bound address - * and port can be retrieved using `socket.address().address` and `socket.address().port`. - * - * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.close()` on the socket: - * - * ```js - * const controller = new AbortController(); - * const { signal } = controller; - * const server = dgram.createSocket({ type: 'udp4', signal }); - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * // Later, when you want to close the server. - * controller.abort(); - * ``` - * @since v0.11.13 - * @param options Available options are: - * @param callback Attached as a listener for `'message'` events. Optional. - */ - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; - /** - * Encapsulates the datagram functionality. - * - * New instances of `dgram.Socket` are created using {@link createSocket}. - * The `new` keyword is not to be used to create `dgram.Socket` instances. - * @since v0.1.99 - */ - class Socket extends EventEmitter { - /** - * Tells the kernel to join a multicast group at the given `multicastAddress` and`multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the`multicastInterface` argument is not - * specified, the operating system will choose - * one interface and will add membership to it. To add membership to every - * available interface, call `addMembership` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * - * When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur: - * - * ```js - * import cluster from 'cluster'; - * import dgram from 'dgram'; - * - * if (cluster.isPrimary) { - * cluster.fork(); // Works ok. - * cluster.fork(); // Fails with EADDRINUSE. - * } else { - * const s = dgram.createSocket('udp4'); - * s.bind(1234, () => { - * s.addMembership('224.0.0.114'); - * }); - * } - * ``` - * @since v0.6.9 - */ - addMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * Returns an object containing the address information for a socket. - * For UDP sockets, this object will contain `address`, `family` and `port`properties. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.99 - */ - address(): AddressInfo; - /** - * For UDP sockets, causes the `dgram.Socket` to listen for datagram - * messages on a named `port` and optional `address`. If `port` is not - * specified or is `0`, the operating system will attempt to bind to a - * random port. If `address` is not specified, the operating system will - * attempt to listen on all addresses. Once binding is complete, a`'listening'` event is emitted and the optional `callback` function is - * called. - * - * Specifying both a `'listening'` event listener and passing a`callback` to the `socket.bind()` method is not harmful but not very - * useful. - * - * A bound datagram socket keeps the Node.js process running to receive - * datagram messages. - * - * If binding fails, an `'error'` event is generated. In rare case (e.g. - * attempting to bind with a closed socket), an `Error` may be thrown. - * - * Example of a UDP server listening on port 41234: - * - * ```js - * import dgram from 'dgram'; - * - * const server = dgram.createSocket('udp4'); - * - * server.on('error', (err) => { - * console.log(`server error:\n${err.stack}`); - * server.close(); - * }); - * - * server.on('message', (msg, rinfo) => { - * console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`); - * }); - * - * server.on('listening', () => { - * const address = server.address(); - * console.log(`server listening ${address.address}:${address.port}`); - * }); - * - * server.bind(41234); - * // Prints: server listening 0.0.0.0:41234 - * ``` - * @since v0.1.99 - * @param callback with no parameters. Called when binding is complete. - */ - 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 the underlying socket and stop listening for data on it. If a callback is - * provided, it is added as a listener for the `'close'` event. - * @since v0.1.99 - * @param callback Called when the socket has been closed. - */ - close(callback?: () => void): void; - /** - * Associates the `dgram.Socket` to a remote address and port. Every - * message sent by this handle is automatically sent to that destination. Also, - * the socket will only receive messages from that remote peer. - * Trying to call `connect()` on an already connected socket will result - * in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not - * provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) - * will be used by default. Once the connection is complete, a `'connect'` event - * is emitted and the optional `callback` function is called. In case of failure, - * the `callback` is called or, failing this, an `'error'` event is emitted. - * @since v12.0.0 - * @param callback Called when the connection is completed or on error. - */ - connect(port: number, address?: string, callback?: () => void): void; - connect(port: number, callback: () => void): void; - /** - * A synchronous function that disassociates a connected `dgram.Socket` from - * its remote address. Trying to call `disconnect()` on an unbound or already - * disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception. - * @since v12.0.0 - */ - disconnect(): void; - /** - * Instructs the kernel to leave a multicast group at `multicastAddress` using the`IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the - * kernel when the socket is closed or the process terminates, so most apps will - * never have reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v0.6.9 - */ - dropMembership(multicastAddress: string, multicastInterface?: string): void; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_RCVBUF` socket receive buffer size in bytes. - */ - getRecvBufferSize(): number; - /** - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - * @return the `SO_SNDBUF` socket send buffer size in bytes. - */ - getSendBufferSize(): number; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active. The `socket.ref()` method adds the socket back to the reference - * counting and restores the default behavior. - * - * Calling `socket.ref()` multiples times will have no additional effect. - * - * The `socket.ref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - ref(): this; - /** - * Returns an object containing the `address`, `family`, and `port` of the remote - * endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception - * if the socket is not connected. - * @since v12.0.0 - */ - remoteAddress(): AddressInfo; - /** - * Broadcasts a datagram on the socket. - * For connectionless sockets, the destination `port` and `address` must be - * specified. Connected sockets, on the other hand, will use their associated - * remote endpoint, so the `port` and `address` arguments must not be set. - * - * The `msg` argument contains the message to be sent. - * Depending on its type, different behavior can apply. If `msg` is a `Buffer`, - * any `TypedArray` or a `DataView`, - * the `offset` and `length` specify the offset within the `Buffer` where the - * message begins and the number of bytes in the message, respectively. - * If `msg` is a `String`, then it is automatically converted to a `Buffer`with `'utf8'` encoding. With messages that - * contain multi-byte characters, `offset` and `length` will be calculated with - * respect to `byte length` and not the character position. - * If `msg` is an array, `offset` and `length` must not be specified. - * - * The `address` argument is a string. If the value of `address` is a host name, - * DNS will be used to resolve the address of the host. If `address` is not - * provided or otherwise falsy, `'127.0.0.1'` (for `udp4` sockets) or `'::1'`(for `udp6` sockets) will be used by default. - * - * If the socket has not been previously bound with a call to `bind`, the socket - * is assigned a random port number and is bound to the "all interfaces" address - * (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.) - * - * An optional `callback` function may be specified to as a way of reporting - * DNS errors or for determining when it is safe to reuse the `buf` object. - * DNS lookups delay the time to send for at least one tick of the - * Node.js event loop. - * - * The only way to know for sure that the datagram has been sent is by using a`callback`. If an error occurs and a `callback` is given, the error will be - * passed as the first argument to the `callback`. If a `callback` is not given, - * the error is emitted as an `'error'` event on the `socket` object. - * - * Offset and length are optional but both _must_ be set if either are used. - * They are supported only when the first argument is a `Buffer`, a `TypedArray`, - * or a `DataView`. - * - * This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket. - * - * Example of sending a UDP packet to a port on `localhost`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.send(message, 41234, 'localhost', (err) => { - * client.close(); - * }); - * ``` - * - * Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`; - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const buf1 = Buffer.from('Some '); - * const buf2 = Buffer.from('bytes'); - * const client = dgram.createSocket('udp4'); - * client.send([buf1, buf2], 41234, (err) => { - * client.close(); - * }); - * ``` - * - * Sending multiple buffers might be faster or slower depending on the - * application and operating system. Run benchmarks to - * determine the optimal strategy on a case-by-case basis. Generally speaking, - * however, sending multiple buffers is faster. - * - * Example of sending a UDP packet using a socket connected to a port on`localhost`: - * - * ```js - * import dgram from 'dgram'; - * import { Buffer } from 'buffer'; - * - * const message = Buffer.from('Some bytes'); - * const client = dgram.createSocket('udp4'); - * client.connect(41234, 'localhost', (err) => { - * client.send(message, (err) => { - * client.close(); - * }); - * }); - * ``` - * @since v0.1.99 - * @param msg Message to be sent. - * @param offset Offset in the buffer where the message starts. - * @param length Number of bytes in the message. - * @param port Destination port. - * @param address Destination host name or IP address. - * @param callback Called when the message has been sent. - */ - send(msg: string | Uint8Array | ReadonlyArray, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array | ReadonlyArray, 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; - send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void; - send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void; - /** - * Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP - * packets may be sent to a local interface's broadcast address. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.6.9 - */ - setBroadcast(flag: boolean): void; - /** - * _All references to scope in this section are referring to[IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC - * 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_ - * _with a scope index is written as `'IP%scope'` where scope is an interface name_ - * _or interface number._ - * - * Sets the default outgoing multicast interface of the socket to a chosen - * interface or back to system interface selection. The `multicastInterface` must - * be a valid string representation of an IP from the socket's family. - * - * For IPv4 sockets, this should be the IP configured for the desired physical - * interface. All packets sent to multicast on the socket will be sent on the - * interface determined by the most recent successful use of this call. - * - * For IPv6 sockets, `multicastInterface` should include a scope to indicate the - * interface as in the examples that follow. In IPv6, individual `send` calls can - * also use explicit scope in addresses, so only packets sent to a multicast - * address without specifying an explicit scope are affected by the most recent - * successful use of this call. - * - * This method throws `EBADF` if called on an unbound socket. - * - * #### Example: IPv6 outgoing multicast interface - * - * On most systems, where scope format uses the interface name: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%eth1'); - * }); - * ``` - * - * On Windows, where scope format uses an interface number: - * - * ```js - * const socket = dgram.createSocket('udp6'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('::%2'); - * }); - * ``` - * - * #### Example: IPv4 outgoing multicast interface - * - * All systems use an IP of the host on the desired physical interface: - * - * ```js - * const socket = dgram.createSocket('udp4'); - * - * socket.bind(1234, () => { - * socket.setMulticastInterface('10.0.0.2'); - * }); - * ``` - * @since v8.6.0 - */ - setMulticastInterface(multicastInterface: string): void; - /** - * Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`, - * multicast packets will also be received on the local interface. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastLoopback(flag: boolean): void; - /** - * Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for - * "Time to Live", in this context it specifies the number of IP hops that a - * packet is allowed to travel through, specifically for multicast traffic. Each - * router or gateway that forwards a packet decrements the TTL. If the TTL is - * decremented to 0 by a router, it will not be forwarded. - * - * The `ttl` argument may be between 0 and 255\. The default on most systems is `1`. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.3.8 - */ - setMulticastTTL(ttl: number): void; - /** - * Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setRecvBufferSize(size: number): void; - /** - * Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer - * in bytes. - * - * This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket. - * @since v8.7.0 - */ - setSendBufferSize(size: number): void; - /** - * Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live", - * in this context it specifies the number of IP hops that a packet is allowed to - * travel through. Each router or gateway that forwards a packet decrements the - * TTL. If the TTL is decremented to 0 by a router, it will not be forwarded. - * Changing TTL values is typically done for network probes or when multicasting. - * - * The `ttl` argument may be between between 1 and 255\. The default on most systems - * is 64. - * - * This method throws `EBADF` if called on an unbound socket. - * @since v0.1.101 - */ - setTTL(ttl: number): void; - /** - * By default, binding a socket will cause it to block the Node.js process from - * exiting as long as the socket is open. The `socket.unref()` method can be used - * to exclude the socket from the reference counting that keeps the Node.js - * process active, allowing the process to exit even if the socket is still - * listening. - * - * Calling `socket.unref()` multiple times will have no addition effect. - * - * The `socket.unref()` method returns a reference to the socket so calls can be - * chained. - * @since v0.9.1 - */ - unref(): this; - /** - * Tells the kernel to join a source-specific multicast channel at the given`sourceAddress` and `groupAddress`, using the `multicastInterface` with the`IP_ADD_SOURCE_MEMBERSHIP` socket - * option. If the `multicastInterface` argument - * is not specified, the operating system will choose one interface and will add - * membership to it. To add membership to every available interface, call`socket.addSourceSpecificMembership()` multiple times, once per interface. - * - * When called on an unbound socket, this method will implicitly bind to a random - * port, listening on all interfaces. - * @since v13.1.0, v12.16.0 - */ - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * Instructs the kernel to leave a source-specific multicast channel at the given`sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`socket option. This method is - * automatically called by the kernel when the - * socket is closed or the process terminates, so most apps will never have - * reason to call this. - * - * If `multicastInterface` is not specified, the operating system will attempt to - * drop membership on all valid interfaces. - * @since v13.1.0, v12.16.0 - */ - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void; - /** - * events.EventEmitter - * 1. close - * 2. connect - * 3. error - * 4. listening - * 5. message - */ - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connect', 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: 'connect'): 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: 'connect', 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: 'connect', 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: 'connect', 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: 'connect', 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; - } -} -declare module 'node:dgram' { - export * from 'dgram'; -} diff --git a/JS/node_modules/@types/node/diagnostics_channel.d.ts b/JS/node_modules/@types/node/diagnostics_channel.d.ts deleted file mode 100755 index c27846b..0000000 --- a/JS/node_modules/@types/node/diagnostics_channel.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * The `diagnostics_channel` module provides an API to create named channels - * to report arbitrary message data for diagnostics purposes. - * - * It can be accessed using: - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * ``` - * - * It is intended that a module writer wanting to report diagnostics messages - * will create one or many top-level channels to report messages through. - * Channels may also be acquired at runtime but it is not encouraged - * due to the additional overhead of doing so. Channels may be exported for - * convenience, but as long as the name is known it can be acquired anywhere. - * - * If you intend for your module to produce diagnostics data for others to - * consume it is recommended that you include documentation of what named - * channels are used along with the shape of the message data. Channel names - * should generally include the module name to avoid collisions with data from - * other modules. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/diagnostics_channel.js) - */ -declare module 'diagnostics_channel' { - /** - * Check if there are active subscribers to the named channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * if (diagnostics_channel.hasSubscribers('my-channel')) { - * // There are subscribers, prepare and publish message - * } - * ``` - * @param name The channel name - * @return If there are active subscribers - */ - function hasSubscribers(name: string): boolean; - /** - * This is the primary entry-point for anyone wanting to interact with a named - * channel. It produces a channel object which is optimized to reduce overhead at - * publish time as much as possible. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * ``` - * @param name The channel name - * @return The named channel object - */ - function channel(name: string): Channel; - type ChannelListener = (name: string, message: unknown) => void; - /** - * The class `Channel` represents an individual named channel within the data - * pipeline. It is use to track subscribers and to publish messages when there - * are subscribers present. It exists as a separate object to avoid channel - * lookups at publish time, enabling very fast publish speeds and allowing - * for heavy use while incurring very minimal cost. Channels are created with {@link channel}, constructing a channel directly - * with `new Channel(name)` is not supported. - */ - class Channel { - readonly name: string; - /** - * Check if there are active subscribers to this channel. This is helpful if - * the message you want to send might be expensive to prepare. - * - * This API is optional but helpful when trying to publish messages from very - * performance-sensitive code. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * if (channel.hasSubscribers) { - * // There are subscribers, prepare and publish message - * } - * ``` - */ - readonly hasSubscribers: boolean; - private constructor(name: string); - /** - * Register a message handler to subscribe to this channel. This message handler - * will be run synchronously whenever a message is published to the channel. Any - * errors thrown in the message handler will trigger an `'uncaughtException'`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * channel.subscribe((message, name) => { - * // Received data - * }); - * ``` - * @param onMessage The handler to receive channel messages - */ - subscribe(onMessage: ChannelListener): void; - /** - * Remove a message handler previously registered to this channel with `channel.subscribe(onMessage)`. - * - * ```js - * import diagnostics_channel from 'diagnostics_channel'; - * - * const channel = diagnostics_channel.channel('my-channel'); - * - * function onMessage(message, name) { - * // Received data - * } - * - * channel.subscribe(onMessage); - * - * channel.unsubscribe(onMessage); - * ``` - * @param onMessage The previous subscribed handler to remove - */ - unsubscribe(onMessage: ChannelListener): void; - } -} -declare module 'node:diagnostics_channel' { - export * from 'diagnostics_channel'; -} diff --git a/JS/node_modules/@types/node/dns.d.ts b/JS/node_modules/@types/node/dns.d.ts deleted file mode 100755 index c34f4c1..0000000 --- a/JS/node_modules/@types/node/dns.d.ts +++ /dev/null @@ -1,643 +0,0 @@ -/** - * The `dns` module enables name resolution. For example, use it to look up IP - * addresses of host names. - * - * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the - * DNS protocol for lookups. {@link lookup} uses the operating system - * facilities to perform name resolution. It may not need to perform any network - * communication. To perform name resolution the way other applications on the same - * system do, use {@link lookup}. - * - * ```js - * const dns = require('dns'); - * - * dns.lookup('example.org', (err, address, family) => { - * console.log('address: %j family: IPv%s', address, family); - * }); - * // address: "93.184.216.34" family: IPv4 - * ``` - * - * All other functions in the `dns` module connect to an actual DNS server to - * perform name resolution. They will always use the network to perform DNS - * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform - * DNS queries, bypassing other name-resolution facilities. - * - * ```js - * const dns = require('dns'); - * - * dns.resolve4('archive.org', (err, addresses) => { - * if (err) throw err; - * - * console.log(`addresses: ${JSON.stringify(addresses)}`); - * - * addresses.forEach((a) => { - * dns.reverse(a, (err, hostnames) => { - * if (err) { - * throw err; - * } - * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`); - * }); - * }); - * }); - * ``` - * - * See the `Implementation considerations section` for more information. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/dns.js) - */ -declare module 'dns' { - import * as dnsPromises from 'node:dns/promises'; - // Supported getaddrinfo flags. - export const ADDRCONFIG: number; - export const V4MAPPED: number; - /** - * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as - * well as IPv4 mapped IPv6 addresses. - */ - export const ALL: number; - export interface LookupOptions { - family?: number | undefined; - hints?: number | undefined; - all?: boolean | undefined; - verbatim?: boolean | undefined; - } - export interface LookupOneOptions extends LookupOptions { - all?: false | undefined; - } - export interface LookupAllOptions extends LookupOptions { - all: true; - } - export interface LookupAddress { - address: string; - family: number; - } - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the arguments for `callback` change to`(err, addresses)`, with `addresses` being an array of objects with the - * properties `address` and `family`. - * - * On error, `err` is an `Error` object, where `err.code` is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dns.lookup()` does not necessarily have anything to do with the DNS protocol. - * The implementation uses an operating system facility that can associate names - * with addresses, and vice versa. This implementation can have subtle but - * important consequences on the behavior of any Node.js program. Please take some - * time to consult the `Implementation considerations section` before using`dns.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * dns.lookup('example.com', options, (err, address, family) => - * console.log('address: %j family: IPv%s', address, family)); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dns.lookup('example.com', options, (err, addresses) => - * console.log('addresses: %j', addresses)); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, and `all`is not set to `true`, it returns a `Promise` for an `Object` with `address` and`family` properties. - * @since v0.1.90 - */ - export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void; - export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void; - export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void; - export namespace lookup { - function __promisify__(hostname: string, options: LookupAllOptions): Promise; - function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise; - function __promisify__(hostname: string, options: LookupOptions): Promise; - } - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On an error, `err` is an `Error` object, where `err.code` is the error code. - * - * ```js - * const dns = require('dns'); - * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => { - * console.log(hostname, service); - * // Prints: localhost ssh - * }); - * ``` - * - * If this method is invoked as its `util.promisify()` ed version, it returns a`Promise` for an `Object` with `hostname` and `service` properties. - * @since v0.11.14 - */ - export function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void; - export namespace lookupService { - function __promisify__( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - } - export interface ResolveOptions { - ttl: boolean; - } - export interface ResolveWithTtlOptions extends ResolveOptions { - ttl: true; - } - export interface RecordWithTtl { - address: string; - ttl: number; - } - /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */ - export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord; - export interface AnyARecord extends RecordWithTtl { - type: 'A'; - } - export interface AnyAaaaRecord extends RecordWithTtl { - type: 'AAAA'; - } - export interface CaaRecord { - critial: number; - issue?: string | undefined; - issuewild?: string | undefined; - iodef?: string | undefined; - contactemail?: string | undefined; - contactphone?: string | undefined; - } - export interface MxRecord { - priority: number; - exchange: string; - } - export interface AnyMxRecord extends MxRecord { - type: 'MX'; - } - export interface NaptrRecord { - flags: string; - service: string; - regexp: string; - replacement: string; - order: number; - preference: number; - } - export interface AnyNaptrRecord extends NaptrRecord { - type: 'NAPTR'; - } - export interface SoaRecord { - nsname: string; - hostmaster: string; - serial: number; - refresh: number; - retry: number; - expire: number; - minttl: number; - } - export interface AnySoaRecord extends SoaRecord { - type: 'SOA'; - } - export interface SrvRecord { - priority: number; - weight: number; - port: number; - name: string; - } - export interface AnySrvRecord extends SrvRecord { - type: 'SRV'; - } - export interface AnyTxtRecord { - type: 'TXT'; - entries: string[]; - } - export interface AnyNsRecord { - type: 'NS'; - value: string; - } - export interface AnyPtrRecord { - type: 'PTR'; - value: string; - } - export interface AnyCnameRecord { - type: 'CNAME'; - value: string; - } - export type AnyRecord = AnyARecord | AnyAaaaRecord | AnyCnameRecord | AnyMxRecord | AnyNaptrRecord | AnyNsRecord | AnyPtrRecord | AnySoaRecord | AnySrvRecord | AnyTxtRecord; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. The `callback` function has arguments`(err, records)`. When successful, `records` will be an array of resource - * records. The type and structure of individual results varies based on `rrtype`: - * - * - * - * On error, `err` is an `Error` object, where `err.code` is one of the `DNS error codes`. - * @since v0.1.27 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'A', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'AAAA', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'ANY', callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'CNAME', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'MX', callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NAPTR', callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'NS', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'PTR', callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve(hostname: string, rrtype: 'SOA', callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void; - export function resolve(hostname: string, rrtype: 'SRV', callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export function resolve(hostname: string, rrtype: 'TXT', callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export function resolve( - hostname: string, - rrtype: string, - callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void - ): void; - export 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; - } - /** - * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve4 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve a IPv6 addresses (`AAAA` records) for the`hostname`. The `addresses` argument passed to the `callback` function - * will contain an array of IPv6 addresses. - * @since v0.1.16 - * @param hostname Host name to resolve. - */ - export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void; - export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void; - export namespace resolve6 { - function __promisify__(hostname: string): Promise; - function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; - function __promisify__(hostname: string, options?: ResolveOptions): Promise; - } - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of canonical name records available for the `hostname`(e.g. `['bar.example.com']`). - * @since v0.3.2 - */ - export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveCname { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The`addresses` argument passed to the `callback` function - * will contain an array of certification authority authorization records - * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0 - */ - export function resolveCaa(hostname: string, callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void): void; - export namespace resolveCaa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of objects containing both a `priority` and `exchange`property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v0.1.27 - */ - export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void; - export namespace resolveMx { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. The `addresses` argument passed to the `callback`function will contain an array of - * objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v0.9.12 - */ - export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void; - export namespace resolveNaptr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * contain an array of name server records available for `hostname`(e.g. `['ns1.example.com', 'ns2.example.com']`). - * @since v0.1.90 - */ - export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolveNs { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of strings containing the reply records. - * @since v6.0.0 - */ - export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void; - export namespace resolvePtr { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. The `address` argument passed to the `callback` function will - * be an object with the following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v0.11.10 - */ - export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void; - export namespace resolveSoa { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. The `addresses` argument passed to the `callback` function will - * be an array of objects with the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v0.1.27 - */ - export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void; - export namespace resolveSrv { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. The `records` argument passed to the `callback` function is a - * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v0.1.27 - */ - export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void; - export namespace resolveTxt { - function __promisify__(hostname: string): Promise; - } - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * The `ret` argument passed to the `callback` function will be an array containing - * various types of records. Each object has a property `type` that indicates the - * type of the current record. And depending on the `type`, additional properties - * will be present on the object: - * - * - * - * Here is an example of the `ret` object passed to the callback: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * - * DNS server operators may choose not to respond to `ANY`queries. It may be better to call individual methods like {@link resolve4},{@link resolveMx}, and so on. For more details, see [RFC - * 8482](https://tools.ietf.org/html/rfc8482). - */ - export function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void; - export namespace resolveAny { - function __promisify__(hostname: string): Promise; - } - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, `err` is an `Error` object, where `err.code` is - * one of the `DNS error codes`. - * @since v0.1.16 - */ - export function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dns.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dns.setServers()` method must not be called while a DNS query is in - * progress. - * - * The {@link setServers} method affects only {@link resolve},`dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}). - * - * This method works much like[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v0.11.3 - * @param servers array of `RFC 5952` formatted addresses - */ - export function setServers(servers: ReadonlyArray): void; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v0.11.3 - */ - export function getServers(): string[]; - // Error codes - export const NODATA: string; - export const FORMERR: string; - export const SERVFAIL: string; - export const NOTFOUND: string; - export const NOTIMP: string; - export const REFUSED: string; - export const BADQUERY: string; - export const BADNAME: string; - export const BADFAMILY: string; - export const BADRESP: string; - export const CONNREFUSED: string; - export const TIMEOUT: string; - export const EOF: string; - export const FILE: string; - export const NOMEM: string; - export const DESTRUCTION: string; - export const BADSTR: string; - export const BADFLAGS: string; - export const NONAME: string; - export const BADHINTS: string; - export const NOTINITIALIZED: string; - export const LOADIPHLPAPI: string; - export const ADDRGETNETWORKPARAMS: string; - export const CANCELLED: string; - export interface ResolverOptions { - timeout?: number | undefined; - /** - * @default 4 - */ - tries?: number; - } - /** - * An independent resolver for DNS requests. - * - * Creating a new resolver uses the default server settings. Setting - * the servers used for a resolver using `resolver.setServers()` does not affect - * other resolvers: - * - * ```js - * const { Resolver } = require('dns'); - * const resolver = new Resolver(); - * resolver.setServers(['4.4.4.4']); - * - * // This request will use the server at 4.4.4.4, independent of global settings. - * resolver.resolve4('example.org', (err, addresses) => { - * // ... - * }); - * ``` - * - * The following methods from the `dns` module are available: - * - * * `resolver.getServers()` - * * `resolver.resolve()` - * * `resolver.resolve4()` - * * `resolver.resolve6()` - * * `resolver.resolveAny()` - * * `resolver.resolveCaa()` - * * `resolver.resolveCname()` - * * `resolver.resolveMx()` - * * `resolver.resolveNaptr()` - * * `resolver.resolveNs()` - * * `resolver.resolvePtr()` - * * `resolver.resolveSoa()` - * * `resolver.resolveSrv()` - * * `resolver.resolveTxt()` - * * `resolver.reverse()` - * * `resolver.setServers()` - * @since v8.3.0 - */ - export class Resolver { - constructor(options?: ResolverOptions); - /** - * Cancel all outstanding DNS queries made by this resolver. The corresponding - * callbacks will be called with an error with code `ECANCELLED`. - * @since v8.3.0 - */ - cancel(): void; - 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; - /** - * The resolver instance will send its requests from the specified IP address. - * This allows programs to specify outbound interfaces when used on multi-homed - * systems. - * - * If a v4 or v6 address is not specified, it is set to the default, and the - * operating system will choose a local address automatically. - * - * The resolver will use the v4 local address when making requests to IPv4 DNS - * servers, and the v6 local address when making requests to IPv6 DNS servers. - * The `rrtype` of resolution requests has no impact on the local address used. - * @since v15.1.0 - * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address. - * @param [ipv6='::0'] A string representation of an IPv6 address. - */ - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } - export { dnsPromises as promises }; -} -declare module 'node:dns' { - export * from 'dns'; -} diff --git a/JS/node_modules/@types/node/dns/promises.d.ts b/JS/node_modules/@types/node/dns/promises.d.ts deleted file mode 100755 index 9ce3fd2..0000000 --- a/JS/node_modules/@types/node/dns/promises.d.ts +++ /dev/null @@ -1,357 +0,0 @@ -/** - * The `dns.promises` API provides an alternative set of asynchronous DNS methods - * that return `Promise` objects rather than using callbacks. The API is accessible - * via `require('dns').promises` or `require('dns/promises')`. - * @since v10.6.0 - */ -declare module 'dns/promises' { - import { - LookupAddress, - LookupOneOptions, - LookupAllOptions, - LookupOptions, - AnyRecord, - CaaRecord, - MxRecord, - NaptrRecord, - SoaRecord, - SrvRecord, - ResolveWithTtlOptions, - RecordWithTtl, - ResolveOptions, - ResolverOptions, - } from 'node:dns'; - /** - * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6), - * that are currently configured for DNS resolution. A string will include a port - * section if a custom port is used. - * - * ```js - * [ - * '4.4.4.4', - * '2001:4860:4860::8888', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ] - * ``` - * @since v10.6.0 - */ - function getServers(): string[]; - /** - * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or - * AAAA (IPv6) record. All `option` properties are optional. If `options` is an - * integer, then it must be `4` or `6` – if `options` is not provided, then IPv4 - * and IPv6 addresses are both returned if found. - * - * With the `all` option set to `true`, the `Promise` is resolved with `addresses`being an array of objects with the properties `address` and `family`. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when - * the host name does not exist but also when the lookup fails in other ways - * such as no available file descriptors. - * - * `dnsPromises.lookup()` does not necessarily have anything to do with the DNS - * protocol. The implementation uses an operating system facility that can - * associate names with addresses, and vice versa. This implementation can have - * subtle but important consequences on the behavior of any Node.js program. Please - * take some time to consult the `Implementation considerations section` before - * using `dnsPromises.lookup()`. - * - * Example usage: - * - * ```js - * const dns = require('dns'); - * const dnsPromises = dns.promises; - * const options = { - * family: 6, - * hints: dns.ADDRCONFIG | dns.V4MAPPED, - * }; - * - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('address: %j family: IPv%s', result.address, result.family); - * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6 - * }); - * - * // When options.all is true, the result will be an Array. - * options.all = true; - * dnsPromises.lookup('example.com', options).then((result) => { - * console.log('addresses: %j', result); - * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}] - * }); - * ``` - * @since v10.6.0 - */ - 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; - /** - * Resolves the given `address` and `port` into a host name and service using - * the operating system's underlying `getnameinfo` implementation. - * - * If `address` is not a valid IP address, a `TypeError` will be thrown. - * The `port` will be coerced to a number. If it is not a legal port, a `TypeError`will be thrown. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is the error code. - * - * ```js - * const dnsPromises = require('dns').promises; - * dnsPromises.lookupService('127.0.0.1', 22).then((result) => { - * console.log(result.hostname, result.service); - * // Prints: localhost ssh - * }); - * ``` - * @since v10.6.0 - */ - function lookupService( - address: string, - port: number - ): Promise<{ - hostname: string; - service: string; - }>; - /** - * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array - * of the resource records. When successful, the `Promise` is resolved with an - * array of resource records. The type and structure of individual results vary - * based on `rrtype`: - * - * - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - * @param hostname Host name to resolve. - * @param [rrtype='A'] Resource record type. - */ - 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: 'CAA'): 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; - /** - * Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv4 - * addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`). - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve4(hostname: string): Promise; - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve4(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the`hostname`. On success, the `Promise` is resolved with an array of IPv6 - * addresses. - * @since v10.6.0 - * @param hostname Host name to resolve. - */ - function resolve6(hostname: string): Promise; - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise; - function resolve6(hostname: string, options: ResolveOptions): Promise; - /** - * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query). - * On success, the `Promise` is resolved with an array containing various types of - * records. Each object has a property `type` that indicates the type of the - * current record. And depending on the `type`, additional properties will be - * present on the object: - * - * - * - * Here is an example of the result object: - * - * ```js - * [ { type: 'A', address: '127.0.0.1', ttl: 299 }, - * { type: 'CNAME', value: 'example.com' }, - * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 }, - * { type: 'NS', value: 'ns1.example.com' }, - * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] }, - * { type: 'SOA', - * nsname: 'ns1.example.com', - * hostmaster: 'admin.example.com', - * serial: 156696742, - * refresh: 900, - * retry: 900, - * expire: 1800, - * minttl: 60 } ] - * ``` - * @since v10.6.0 - */ - function resolveAny(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CAA` records for the `hostname`. On success, - * the `Promise` is resolved with an array of objects containing available - * certification authority authorization records available for the `hostname`(e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]`). - * @since v15.0.0 - */ - function resolveCaa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. On success, - * the `Promise` is resolved with an array of canonical name records available for - * the `hostname` (e.g. `['bar.example.com']`). - * @since v10.6.0 - */ - function resolveCname(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects - * containing both a `priority` and `exchange` property (e.g.`[{priority: 10, exchange: 'mx.example.com'}, ...]`). - * @since v10.6.0 - */ - function resolveMx(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve regular expression based records (`NAPTR`records) for the `hostname`. On success, the `Promise` is resolved with an array - * of objects with the following properties: - * - * * `flags` - * * `service` - * * `regexp` - * * `replacement` - * * `order` - * * `preference` - * - * ```js - * { - * flags: 's', - * service: 'SIP+D2U', - * regexp: '', - * replacement: '_sip._udp.example.com', - * order: 30, - * preference: 100 - * } - * ``` - * @since v10.6.0 - */ - function resolveNaptr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve name server records (`NS` records) for the`hostname`. On success, the `Promise` is resolved with an array of name server - * records available for `hostname` (e.g.`['ns1.example.com', 'ns2.example.com']`). - * @since v10.6.0 - */ - function resolveNs(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve pointer records (`PTR` records) for the`hostname`. On success, the `Promise` is resolved with an array of strings - * containing the reply records. - * @since v10.6.0 - */ - function resolvePtr(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for - * the `hostname`. On success, the `Promise` is resolved with an object with the - * following properties: - * - * * `nsname` - * * `hostmaster` - * * `serial` - * * `refresh` - * * `retry` - * * `expire` - * * `minttl` - * - * ```js - * { - * nsname: 'ns.example.com', - * hostmaster: 'root.example.com', - * serial: 2013101809, - * refresh: 10000, - * retry: 2400, - * expire: 604800, - * minttl: 3600 - * } - * ``` - * @since v10.6.0 - */ - function resolveSoa(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve service records (`SRV` records) for the`hostname`. On success, the `Promise` is resolved with an array of objects with - * the following properties: - * - * * `priority` - * * `weight` - * * `port` - * * `name` - * - * ```js - * { - * priority: 10, - * weight: 5, - * port: 21223, - * name: 'service.example.com' - * } - * ``` - * @since v10.6.0 - */ - function resolveSrv(hostname: string): Promise; - /** - * Uses the DNS protocol to resolve text queries (`TXT` records) for the`hostname`. On success, the `Promise` is resolved with a two-dimensional array - * of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of - * one record. Depending on the use case, these could be either joined together or - * treated separately. - * @since v10.6.0 - */ - function resolveTxt(hostname: string): Promise; - /** - * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an - * array of host names. - * - * On error, the `Promise` is rejected with an `Error` object, where `err.code`is one of the `DNS error codes`. - * @since v10.6.0 - */ - function reverse(ip: string): Promise; - /** - * Sets the IP address and port of servers to be used when performing DNS - * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted - * addresses. If the port is the IANA default DNS port (53) it can be omitted. - * - * ```js - * dnsPromises.setServers([ - * '4.4.4.4', - * '[2001:4860:4860::8888]', - * '4.4.4.4:1053', - * '[2001:4860:4860::8888]:1053', - * ]); - * ``` - * - * An error will be thrown if an invalid address is provided. - * - * The `dnsPromises.setServers()` method must not be called while a DNS query is in - * progress. - * - * This method works much like[resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html). - * That is, if attempting to resolve with the first server provided results in a`NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with - * subsequent servers provided. Fallback DNS servers will only be used if the - * earlier ones time out or result in some other error. - * @since v10.6.0 - * @param servers array of `RFC 5952` formatted addresses - */ - function setServers(servers: ReadonlyArray): void; - class Resolver { - constructor(options?: ResolverOptions); - cancel(): void; - 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; - setLocalAddress(ipv4?: string, ipv6?: string): void; - setServers: typeof setServers; - } -} -declare module 'node:dns/promises' { - export * from 'dns/promises'; -} diff --git a/JS/node_modules/@types/node/domain.d.ts b/JS/node_modules/@types/node/domain.d.ts deleted file mode 100755 index 7b3018e..0000000 --- a/JS/node_modules/@types/node/domain.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -/** - * **This module is pending deprecation.** Once a replacement API has been - * finalized, this module will be fully deprecated. Most developers should**not** have cause to use this module. Users who absolutely must have - * the functionality that domains provide may rely on it for the time being - * but should expect to have to migrate to a different solution - * in the future. - * - * Domains provide a way to handle multiple different IO operations as a - * single group. If any of the event emitters or callbacks registered to a - * domain emit an `'error'` event, or throw an error, then the domain object - * will be notified, rather than losing the context of the error in the`process.on('uncaughtException')` handler, or causing the program to - * exit immediately with an error code. - * @deprecated Since v1.4.2 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/domain.js) - */ -declare module 'domain' { - import EventEmitter = require('node:events'); - /** - * The `Domain` class encapsulates the functionality of routing errors and - * uncaught exceptions to the active `Domain` object. - * - * To handle the errors that it catches, listen to its `'error'` event. - */ - class Domain extends EventEmitter { - /** - * An array of timers and event emitters that have been explicitly added - * to the domain. - */ - members: Array; - /** - * The `enter()` method is plumbing used by the `run()`, `bind()`, and`intercept()` methods to set the active domain. It sets `domain.active` and`process.domain` to the domain, and implicitly - * pushes the domain onto the domain - * stack managed by the domain module (see {@link exit} for details on the - * domain stack). The call to `enter()` delimits the beginning of a chain of - * asynchronous calls and I/O operations bound to a domain. - * - * Calling `enter()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - enter(): void; - /** - * The `exit()` method exits the current domain, popping it off the domain stack. - * Any time execution is going to switch to the context of a different chain of - * asynchronous calls, it's important to ensure that the current domain is exited. - * The call to `exit()` delimits either the end of or an interruption to the chain - * of asynchronous calls and I/O operations bound to a domain. - * - * If there are multiple, nested domains bound to the current execution context,`exit()` will exit any domains nested within this domain. - * - * Calling `exit()` changes only the active domain, and does not alter the domain - * itself. `enter()` and `exit()` can be called an arbitrary number of times on a - * single domain. - */ - exit(): void; - /** - * Run the supplied function in the context of the domain, implicitly - * binding all event emitters, timers, and lowlevel requests that are - * created in that context. Optionally, arguments can be passed to - * the function. - * - * This is the most basic way to use a domain. - * - * ```js - * const domain = require('domain'); - * const fs = require('fs'); - * const d = domain.create(); - * d.on('error', (er) => { - * console.error('Caught error!', er); - * }); - * d.run(() => { - * process.nextTick(() => { - * setTimeout(() => { // Simulating some various async stuff - * fs.open('non-existent file', 'r', (er, fd) => { - * if (er) throw er; - * // proceed... - * }); - * }, 100); - * }); - * }); - * ``` - * - * In this example, the `d.on('error')` handler will be triggered, rather - * than crashing the program. - */ - run(fn: (...args: any[]) => T, ...args: any[]): T; - /** - * Explicitly adds an emitter to the domain. If any event handlers called by - * the emitter throw an error, or if the emitter emits an `'error'` event, it - * will be routed to the domain's `'error'` event, just like with implicit - * binding. - * - * This also works with timers that are returned from `setInterval()` and `setTimeout()`. If their callback function throws, it will be caught by - * the domain `'error'` handler. - * - * If the Timer or `EventEmitter` was already bound to a domain, it is removed - * from that one, and bound to this one instead. - * @param emitter emitter or timer to be added to the domain - */ - add(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The opposite of {@link add}. Removes domain handling from the - * specified emitter. - * @param emitter emitter or timer to be removed from the domain - */ - remove(emitter: EventEmitter | NodeJS.Timer): void; - /** - * The returned function will be a wrapper around the supplied callback - * function. When the returned function is called, any errors that are - * thrown will be routed to the domain's `'error'` event. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.bind((er, data) => { - * // If this throws, it will also be passed to the domain. - * return cb(er, data ? JSON.parse(data) : null); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The bound function - */ - bind(callback: T): T; - /** - * This method is almost identical to {@link bind}. However, in - * addition to catching thrown errors, it will also intercept `Error` objects sent as the first argument to the function. - * - * In this way, the common `if (err) return callback(err);` pattern can be replaced - * with a single error handler in a single place. - * - * ```js - * const d = domain.create(); - * - * function readSomeFile(filename, cb) { - * fs.readFile(filename, 'utf8', d.intercept((data) => { - * // Note, the first argument is never passed to the - * // callback since it is assumed to be the 'Error' argument - * // and thus intercepted by the domain. - * - * // If this throws, it will also be passed to the domain - * // so the error-handling logic can be moved to the 'error' - * // event on the domain instead of being repeated throughout - * // the program. - * return cb(null, JSON.parse(data)); - * })); - * } - * - * d.on('error', (er) => { - * // An error occurred somewhere. If we throw it now, it will crash the program - * // with the normal line number and stack message. - * }); - * ``` - * @param callback The callback function - * @return The intercepted function - */ - intercept(callback: T): T; - } - function create(): Domain; -} -declare module 'node:domain' { - export * from 'domain'; -} diff --git a/JS/node_modules/@types/node/events.d.ts b/JS/node_modules/@types/node/events.d.ts deleted file mode 100755 index 97c7055..0000000 --- a/JS/node_modules/@types/node/events.d.ts +++ /dev/null @@ -1,623 +0,0 @@ -/** - * Much of the Node.js core API is built around an idiomatic asynchronous - * event-driven architecture in which certain kinds of objects (called "emitters") - * emit named events that cause `Function` objects ("listeners") to be called. - * - * For instance: a `net.Server` object emits an event each time a peer - * connects to it; a `fs.ReadStream` emits an event when the file is opened; - * a `stream` emits an event whenever data is available to be read. - * - * All objects that emit events are instances of the `EventEmitter` class. These - * objects expose an `eventEmitter.on()` function that allows one or more - * functions to be attached to named events emitted by the object. Typically, - * event names are camel-cased strings but any valid JavaScript property key - * can be used. - * - * When the `EventEmitter` object emits an event, all of the functions attached - * to that specific event are called _synchronously_. Any values returned by the - * called listeners are _ignored_ and discarded. - * - * The following example shows a simple `EventEmitter` instance with a single - * listener. The `eventEmitter.on()` method is used to register listeners, while - * the `eventEmitter.emit()` method is used to trigger the event. - * - * ```js - * const EventEmitter = require('events'); - * - * class MyEmitter extends EventEmitter {} - * - * const myEmitter = new MyEmitter(); - * myEmitter.on('event', () => { - * console.log('an event occurred!'); - * }); - * myEmitter.emit('event'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/events.js) - */ -declare module 'events' { - interface EventEmitterOptions { - /** - * Enables automatic capturing of promise rejection. - */ - captureRejections?: boolean | undefined; - } - interface NodeEventTarget { - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - } - interface DOMEventTarget { - addEventListener( - eventName: string, - listener: (...args: any[]) => void, - opts?: { - once: boolean; - } - ): any; - } - interface StaticEventEmitterOptions { - signal?: AbortSignal | undefined; - } - interface EventEmitter extends NodeJS.EventEmitter {} - /** - * The `EventEmitter` class is defined and exposed by the `events` module: - * - * ```js - * const EventEmitter = require('events'); - * ``` - * - * All `EventEmitter`s emit the event `'newListener'` when new listeners are - * added and `'removeListener'` when existing listeners are removed. - * - * It supports the following option: - * @since v0.1.26 - */ - class EventEmitter { - constructor(options?: EventEmitterOptions); - /** - * Creates a `Promise` that is fulfilled when the `EventEmitter` emits the given - * event or that is rejected if the `EventEmitter` emits `'error'` while waiting. - * The `Promise` will resolve with an array of all the arguments emitted to the - * given event. - * - * This method is intentionally generic and works with the web platform[EventTarget](https://dom.spec.whatwg.org/#interface-eventtarget) interface, which has no special`'error'` event - * semantics and does not listen to the `'error'` event. - * - * ```js - * const { once, EventEmitter } = require('events'); - * - * async function run() { - * const ee = new EventEmitter(); - * - * process.nextTick(() => { - * ee.emit('myevent', 42); - * }); - * - * const [value] = await once(ee, 'myevent'); - * console.log(value); - * - * const err = new Error('kaboom'); - * process.nextTick(() => { - * ee.emit('error', err); - * }); - * - * try { - * await once(ee, 'myevent'); - * } catch (err) { - * console.log('error happened', err); - * } - * } - * - * run(); - * ``` - * - * The special handling of the `'error'` event is only used when `events.once()`is used to wait for another event. If `events.once()` is used to wait for the - * '`error'` event itself, then it is treated as any other kind of event without - * special handling: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * - * once(ee, 'error') - * .then(([err]) => console.log('ok', err.message)) - * .catch((err) => console.log('error', err.message)); - * - * ee.emit('error', new Error('boom')); - * - * // Prints: ok boom - * ``` - * - * An `AbortSignal` can be used to cancel waiting for the event: - * - * ```js - * const { EventEmitter, once } = require('events'); - * - * const ee = new EventEmitter(); - * const ac = new AbortController(); - * - * async function foo(emitter, event, signal) { - * try { - * await once(emitter, event, { signal }); - * console.log('event emitted!'); - * } catch (error) { - * if (error.name === 'AbortError') { - * console.error('Waiting for the event was canceled!'); - * } else { - * console.error('There was an error', error.message); - * } - * } - * } - * - * foo(ee, 'foo', ac.signal); - * ac.abort(); // Abort waiting for the event - * ee.emit('foo'); // Prints: Waiting for the event was canceled! - * ``` - * @since v11.13.0, v10.16.0 - */ - static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise; - static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise; - /** - * ```js - * const { on, EventEmitter } = require('events'); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo')) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * ``` - * - * Returns an `AsyncIterator` that iterates `eventName` events. It will throw - * if the `EventEmitter` emits `'error'`. It removes all listeners when - * exiting the loop. The `value` returned by each iteration is an array - * composed of the emitted event arguments. - * - * An `AbortSignal` can be used to cancel waiting on events: - * - * ```js - * const { on, EventEmitter } = require('events'); - * const ac = new AbortController(); - * - * (async () => { - * const ee = new EventEmitter(); - * - * // Emit later on - * process.nextTick(() => { - * ee.emit('foo', 'bar'); - * ee.emit('foo', 42); - * }); - * - * for await (const event of on(ee, 'foo', { signal: ac.signal })) { - * // The execution of this inner block is synchronous and it - * // processes one event at a time (even with await). Do not use - * // if concurrent execution is required. - * console.log(event); // prints ['bar'] [42] - * } - * // Unreachable here - * })(); - * - * process.nextTick(() => ac.abort()); - * ``` - * @since v13.6.0, v12.16.0 - * @param eventName The name of the event being listened for - * @return that iterates `eventName` events emitted by the `emitter` - */ - static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator; - /** - * A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`. - * - * ```js - * const { EventEmitter, listenerCount } = require('events'); - * const myEmitter = new EventEmitter(); - * myEmitter.on('event', () => {}); - * myEmitter.on('event', () => {}); - * console.log(listenerCount(myEmitter, 'event')); - * // Prints: 2 - * ``` - * @since v0.9.12 - * @deprecated Since v3.2.0 - Use `listenerCount` instead. - * @param emitter The emitter to query - * @param eventName The event name - */ - static listenerCount(emitter: NodeJS.EventEmitter, eventName: string | symbol): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * For `EventEmitter`s this behaves exactly the same as calling `.listeners` on - * the emitter. - * - * For `EventTarget`s this is the only way to get the event listeners for the - * event target. This is useful for debugging and diagnostic purposes. - * - * ```js - * const { getEventListeners, EventEmitter } = require('events'); - * - * { - * const ee = new EventEmitter(); - * const listener = () => console.log('Events are fun'); - * ee.on('foo', listener); - * getEventListeners(ee, 'foo'); // [listener] - * } - * { - * const et = new EventTarget(); - * const listener = () => console.log('Events are fun'); - * et.addEventListener('foo', listener); - * getEventListeners(et, 'foo'); // [listener] - * } - * ``` - * @since v15.2.0 - */ - static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[]; - /** - * This symbol shall be used to install a listener for only monitoring `'error'` - * events. Listeners installed using this symbol are called before the regular - * `'error'` listeners are called. - * - * Installing a listener using this symbol does not change the behavior once an - * `'error'` event is emitted, therefore the process will still crash if no - * regular `'error'` listener is installed. - */ - static readonly errorMonitor: unique symbol; - static readonly captureRejectionSymbol: unique symbol; - /** - * Sets or gets the default captureRejection value for all emitters. - */ - // TODO: These should be described using static getter/setter pairs: - static captureRejections: boolean; - static defaultMaxListeners: number; - } - import internal = require('node:events'); - namespace EventEmitter { - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4 - export { internal as EventEmitter }; - export interface Abortable { - /** - * When provided the corresponding `AbortController` can be used to cancel an asynchronous action. - */ - signal?: AbortSignal | undefined; - } - } - global { - namespace NodeJS { - interface EventEmitter { - /** - * Alias for `emitter.on(eventName, listener)`. - * @since v0.1.26 - */ - addListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds the `listener` function to the end of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.on('foo', () => console.log('a')); - * myEE.prependListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.1.101 - * @param eventName The name of the event. - * @param listener The callback function - */ - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName`. The - * next time `eventName` is triggered, this listener is removed and then invoked. - * - * ```js - * server.once('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * - * By default, event listeners are invoked in the order they are added. The`emitter.prependOnceListener()` method can be used as an alternative to add the - * event listener to the beginning of the listeners array. - * - * ```js - * const myEE = new EventEmitter(); - * myEE.once('foo', () => console.log('a')); - * myEE.prependOnceListener('foo', () => console.log('b')); - * myEE.emit('foo'); - * // Prints: - * // b - * // a - * ``` - * @since v0.3.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - once(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes the specified `listener` from the listener array for the event named`eventName`. - * - * ```js - * const callback = (stream) => { - * console.log('someone connected!'); - * }; - * server.on('connection', callback); - * // ... - * server.removeListener('connection', callback); - * ``` - * - * `removeListener()` will remove, at most, one instance of a listener from the - * listener array. If any single listener has been added multiple times to the - * listener array for the specified `eventName`, then `removeListener()` must be - * called multiple times to remove each instance. - * - * Once an event is emitted, all listeners attached to it at the - * time of emitting are called in order. This implies that any`removeListener()` or `removeAllListeners()` calls _after_ emitting and_before_ the last listener finishes execution will - * not remove them from`emit()` in progress. Subsequent events behave as expected. - * - * ```js - * const myEmitter = new MyEmitter(); - * - * const callbackA = () => { - * console.log('A'); - * myEmitter.removeListener('event', callbackB); - * }; - * - * const callbackB = () => { - * console.log('B'); - * }; - * - * myEmitter.on('event', callbackA); - * - * myEmitter.on('event', callbackB); - * - * // callbackA removes listener callbackB but it will still be called. - * // Internal listener array at time of emit [callbackA, callbackB] - * myEmitter.emit('event'); - * // Prints: - * // A - * // B - * - * // callbackB is now removed. - * // Internal listener array [callbackA] - * myEmitter.emit('event'); - * // Prints: - * // A - * ``` - * - * Because listeners are managed using an internal array, calling this will - * change the position indices of any listener registered _after_ the listener - * being removed. This will not impact the order in which listeners are called, - * but it means that any copies of the listener array as returned by - * the `emitter.listeners()` method will need to be recreated. - * - * When a single function has been added as a handler multiple times for a single - * event (as in the example below), `removeListener()` will remove the most - * recently added instance. In the example the `once('ping')`listener is removed: - * - * ```js - * const ee = new EventEmitter(); - * - * function pong() { - * console.log('pong'); - * } - * - * ee.on('ping', pong); - * ee.once('ping', pong); - * ee.removeListener('ping', pong); - * - * ee.emit('ping'); - * ee.emit('ping'); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Alias for `emitter.removeListener()`. - * @since v10.0.0 - */ - off(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Removes all listeners, or those of the specified `eventName`. - * - * It is bad practice to remove listeners added elsewhere in the code, - * particularly when the `EventEmitter` instance was created by some other - * component or module (e.g. sockets or file streams). - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.1.26 - */ - removeAllListeners(event?: string | symbol): this; - /** - * By default `EventEmitter`s will print a warning if more than `10` listeners are - * added for a particular event. This is a useful default that helps finding - * memory leaks. The `emitter.setMaxListeners()` method allows the limit to be - * modified for this specific `EventEmitter` instance. The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners. - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v0.3.5 - */ - setMaxListeners(n: number): this; - /** - * Returns the current max listener value for the `EventEmitter` which is either - * set by `emitter.setMaxListeners(n)` or defaults to {@link defaultMaxListeners}. - * @since v1.0.0 - */ - getMaxListeners(): number; - /** - * Returns a copy of the array of listeners for the event named `eventName`. - * - * ```js - * server.on('connection', (stream) => { - * console.log('someone connected!'); - * }); - * console.log(util.inspect(server.listeners('connection'))); - * // Prints: [ [Function] ] - * ``` - * @since v0.1.26 - */ - listeners(eventName: string | symbol): Function[]; - /** - * Returns a copy of the array of listeners for the event named `eventName`, - * including any wrappers (such as those created by `.once()`). - * - * ```js - * const emitter = new EventEmitter(); - * emitter.once('log', () => console.log('log once')); - * - * // Returns a new Array with a function `onceWrapper` which has a property - * // `listener` which contains the original listener bound above - * const listeners = emitter.rawListeners('log'); - * const logFnWrapper = listeners[0]; - * - * // Logs "log once" to the console and does not unbind the `once` event - * logFnWrapper.listener(); - * - * // Logs "log once" to the console and removes the listener - * logFnWrapper(); - * - * emitter.on('log', () => console.log('log persistently')); - * // Will return a new Array with a single function bound by `.on()` above - * const newListeners = emitter.rawListeners('log'); - * - * // Logs "log persistently" twice - * newListeners[0](); - * emitter.emit('log'); - * ``` - * @since v9.4.0 - */ - rawListeners(eventName: string | symbol): Function[]; - /** - * Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments - * to each. - * - * Returns `true` if the event had listeners, `false` otherwise. - * - * ```js - * const EventEmitter = require('events'); - * const myEmitter = new EventEmitter(); - * - * // First listener - * myEmitter.on('event', function firstListener() { - * console.log('Helloooo! first listener'); - * }); - * // Second listener - * myEmitter.on('event', function secondListener(arg1, arg2) { - * console.log(`event with parameters ${arg1}, ${arg2} in second listener`); - * }); - * // Third listener - * myEmitter.on('event', function thirdListener(...args) { - * const parameters = args.join(', '); - * console.log(`event with parameters ${parameters} in third listener`); - * }); - * - * console.log(myEmitter.listeners('event')); - * - * myEmitter.emit('event', 1, 2, 3, 4, 5); - * - * // Prints: - * // [ - * // [Function: firstListener], - * // [Function: secondListener], - * // [Function: thirdListener] - * // ] - * // Helloooo! first listener - * // event with parameters 1, 2 in second listener - * // event with parameters 1, 2, 3, 4, 5 in third listener - * ``` - * @since v0.1.26 - */ - emit(eventName: string | symbol, ...args: any[]): boolean; - /** - * Returns the number of listeners listening to the event named `eventName`. - * @since v3.2.0 - * @param eventName The name of the event being listened for - */ - listenerCount(eventName: string | symbol): number; - /** - * Adds the `listener` function to the _beginning_ of the listeners array for the - * event named `eventName`. No checks are made to see if the `listener` has - * already been added. Multiple calls passing the same combination of `eventName`and `listener` will result in the `listener` being added, and called, multiple - * times. - * - * ```js - * server.prependListener('connection', (stream) => { - * console.log('someone connected!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Adds a **one-time**`listener` function for the event named `eventName` to the_beginning_ of the listeners array. The next time `eventName` is triggered, this - * listener is removed, and then invoked. - * - * ```js - * server.prependOnceListener('connection', (stream) => { - * console.log('Ah, we have our first user!'); - * }); - * ``` - * - * Returns a reference to the `EventEmitter`, so that calls can be chained. - * @since v6.0.0 - * @param eventName The name of the event. - * @param listener The callback function - */ - prependOnceListener(eventName: string | symbol, listener: (...args: any[]) => void): this; - /** - * Returns an array listing the events for which the emitter has registered - * listeners. The values in the array are strings or `Symbol`s. - * - * ```js - * const EventEmitter = require('events'); - * const myEE = new EventEmitter(); - * myEE.on('foo', () => {}); - * myEE.on('bar', () => {}); - * - * const sym = Symbol('symbol'); - * myEE.on(sym, () => {}); - * - * console.log(myEE.eventNames()); - * // Prints: [ 'foo', 'bar', Symbol(symbol) ] - * ``` - * @since v6.0.0 - */ - eventNames(): Array; - } - } - } - export = EventEmitter; -} -declare module 'node:events' { - import events = require('events'); - export = events; -} diff --git a/JS/node_modules/@types/node/fs.d.ts b/JS/node_modules/@types/node/fs.d.ts deleted file mode 100755 index d50eade..0000000 --- a/JS/node_modules/@types/node/fs.d.ts +++ /dev/null @@ -1,3723 +0,0 @@ -/** - * The `fs` module enables interacting with the file system in a - * way modeled on standard POSIX functions. - * - * To use the promise-based APIs: - * - * ```js - * import * as fs from 'fs/promises'; - * ``` - * - * To use the callback and sync APIs: - * - * ```js - * import * as fs from 'fs'; - * ``` - * - * All file system operations have synchronous, callback, and promise-based - * forms, and are accessible using both CommonJS syntax and ES6 Modules (ESM). - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/fs.js) - */ -declare module 'fs' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import { URL } from 'node:url'; - import * as promises from 'node:fs/promises'; - export { promises }; - /** - * Valid types for path values in "fs". - */ - export type PathLike = string | Buffer | URL; - export type PathOrFileDescriptor = PathLike | number; - export type TimeLike = string | number | Date; - export type NoParamCallback = (err: NodeJS.ErrnoException | null) => void; - export type BufferEncodingOption = - | 'buffer' - | { - encoding: 'buffer'; - }; - export interface ObjectEncodingOptions { - encoding?: BufferEncoding | null | undefined; - } - export type EncodingOption = ObjectEncodingOptions | BufferEncoding | undefined | null; - export type OpenMode = number | string; - export type Mode = number | string; - export interface StatsBase { - isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: T; - ino: T; - mode: T; - nlink: T; - uid: T; - gid: T; - rdev: T; - size: T; - blksize: T; - blocks: T; - atimeMs: T; - mtimeMs: T; - ctimeMs: T; - birthtimeMs: T; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; - } - export interface Stats extends StatsBase {} - /** - * A `fs.Stats` object provides information about a file. - * - * Objects returned from {@link stat}, {@link lstat} and {@link fstat} and - * their synchronous counterparts are of this type. - * If `bigint` in the `options` passed to those methods is true, the numeric values - * will be `bigint` instead of `number`, and the object will contain additional - * nanosecond-precision properties suffixed with `Ns`. - * - * ```console - * Stats { - * dev: 2114, - * ino: 48064969, - * mode: 33188, - * nlink: 1, - * uid: 85, - * gid: 100, - * rdev: 0, - * size: 527, - * blksize: 4096, - * blocks: 8, - * atimeMs: 1318289051000.1, - * mtimeMs: 1318289051000.1, - * ctimeMs: 1318289051000.1, - * birthtimeMs: 1318289051000.1, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * - * `bigint` version: - * - * ```console - * BigIntStats { - * dev: 2114n, - * ino: 48064969n, - * mode: 33188n, - * nlink: 1n, - * uid: 85n, - * gid: 100n, - * rdev: 0n, - * size: 527n, - * blksize: 4096n, - * blocks: 8n, - * atimeMs: 1318289051000n, - * mtimeMs: 1318289051000n, - * ctimeMs: 1318289051000n, - * birthtimeMs: 1318289051000n, - * atimeNs: 1318289051000000000n, - * mtimeNs: 1318289051000000000n, - * ctimeNs: 1318289051000000000n, - * birthtimeNs: 1318289051000000000n, - * atime: Mon, 10 Oct 2011 23:24:11 GMT, - * mtime: Mon, 10 Oct 2011 23:24:11 GMT, - * ctime: Mon, 10 Oct 2011 23:24:11 GMT, - * birthtime: Mon, 10 Oct 2011 23:24:11 GMT } - * ``` - * @since v0.1.21 - */ - export class Stats {} - /** - * A representation of a directory entry, which can be a file or a subdirectory - * within the directory, as returned by reading from an `fs.Dir`. The - * directory entry is a combination of the file name and file type pairs. - * - * Additionally, when {@link readdir} or {@link readdirSync} is called with - * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s. - * @since v10.10.0 - */ - export class Dirent { - /** - * Returns `true` if the `fs.Dirent` object describes a regular file. - * @since v10.10.0 - */ - isFile(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a file system - * directory. - * @since v10.10.0 - */ - isDirectory(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a block device. - * @since v10.10.0 - */ - isBlockDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a character device. - * @since v10.10.0 - */ - isCharacterDevice(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a symbolic link. - * @since v10.10.0 - */ - isSymbolicLink(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a first-in-first-out - * (FIFO) pipe. - * @since v10.10.0 - */ - isFIFO(): boolean; - /** - * Returns `true` if the `fs.Dirent` object describes a socket. - * @since v10.10.0 - */ - isSocket(): boolean; - /** - * The file name that this `fs.Dirent` object refers to. The type of this - * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}. - * @since v10.10.0 - */ - name: string; - } - /** - * A class representing a directory stream. - * - * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - */ - export class Dir implements AsyncIterable { - /** - * The read-only path of this directory as was provided to {@link opendir},{@link opendirSync}, or `fsPromises.opendir()`. - * @since v12.12.0 - */ - readonly path: string; - /** - * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read. - */ - [Symbol.asyncIterator](): AsyncIterableIterator; - /** - * Asynchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * - * A promise is returned that will be resolved after the resource has been - * closed. - * @since v12.12.0 - */ - close(): Promise; - close(cb: NoParamCallback): void; - /** - * Synchronously close the directory's underlying resource handle. - * Subsequent reads will result in errors. - * @since v12.12.0 - */ - closeSync(): void; - /** - * Asynchronously read the next directory entry via [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) as an `fs.Dirent`. - * - * A promise is returned that will be resolved with an `fs.Dirent`, or `null`if there are no more directory entries to read. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - * @return containing {fs.Dirent|null} - */ - read(): Promise; - read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void; - /** - * Synchronously read the next directory entry as an `fs.Dirent`. See the - * POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more detail. - * - * If there are no more directory entries to read, `null` will be returned. - * - * Directory entries returned by this function are in no particular order as - * provided by the operating system's underlying directory mechanisms. - * Entries added or removed while iterating over the directory might not be - * included in the iteration results. - * @since v12.12.0 - */ - readSync(): Dirent | null; - } - export interface FSWatcher extends EventEmitter { - /** - * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable. - * @since v0.5.8 - */ - 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; - addListener(event: 'close', listener: () => 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; - on(event: 'close', listener: () => 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; - once(event: 'close', listener: () => 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; - prependListener(event: 'close', listener: () => 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; - prependOnceListener(event: 'close', listener: () => void): this; - } - /** - * Instances of `fs.ReadStream` are created and returned using the {@link createReadStream} function. - * @since v0.1.93 - */ - export class ReadStream extends stream.Readable { - close(): void; - /** - * The number of bytes that have been read so far. - * @since v6.4.0 - */ - bytesRead: number; - /** - * The path to the file the stream is reading from as specified in the first - * argument to `fs.createReadStream()`. If `path` is passed as a string, then`readStream.path` will be a string. If `path` is passed as a `Buffer`, then`readStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0, v10.16.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: Buffer | string) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'open', listener: (fd: number) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'resume', listener: () => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => 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: 'error', listener: (err: Error) => void): this; - on(event: 'open', listener: (fd: number) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'ready', listener: () => void): this; - on(event: 'resume', listener: () => void): this; - on(event: string | symbol, listener: (...args: any[]) => 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: 'error', listener: (err: Error) => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'ready', listener: () => void): this; - once(event: 'resume', listener: () => void): this; - once(event: string | symbol, listener: (...args: any[]) => 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: 'error', listener: (err: Error) => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'ready', listener: () => void): this; - prependListener(event: 'resume', listener: () => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => 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: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * * Extends `stream.Writable` - * - * Instances of `fs.WriteStream` are created and returned using the {@link createWriteStream} function. - * @since v0.1.93 - */ - export class WriteStream extends stream.Writable { - /** - * Closes `writeStream`. Optionally accepts a - * callback that will be executed once the `writeStream`is closed. - * @since v0.9.4 - */ - close(): void; - /** - * The number of bytes written so far. Does not include data that is still queued - * for writing. - * @since v0.4.7 - */ - bytesWritten: number; - /** - * The path to the file the stream is writing to as specified in the first - * argument to {@link createWriteStream}. If `path` is passed as a string, then`writeStream.path` will be a string. If `path` is passed as a `Buffer`, then`writeStream.path` will be a - * `Buffer`. - * @since v0.1.93 - */ - path: string | Buffer; - /** - * This property is `true` if the underlying file has not been opened yet, - * i.e. before the `'ready'` event is emitted. - * @since v11.2.0 - */ - pending: boolean; - /** - * events.EventEmitter - * 1. open - * 2. close - * 3. ready - */ - 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: 'open', listener: (fd: number) => void): this; - addListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - addListener(event: 'ready', listener: () => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - 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: 'open', listener: (fd: number) => void): this; - on(event: 'pipe', listener: (src: stream.Readable) => void): this; - on(event: 'ready', listener: () => 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: (err: Error) => void): this; - once(event: 'finish', listener: () => void): this; - once(event: 'open', listener: (fd: number) => void): this; - once(event: 'pipe', listener: (src: stream.Readable) => void): this; - once(event: 'ready', listener: () => 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: (err: Error) => void): this; - prependListener(event: 'finish', listener: () => void): this; - prependListener(event: 'open', listener: (fd: number) => void): this; - prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependListener(event: 'ready', listener: () => 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: (err: Error) => void): this; - prependOnceListener(event: 'finish', listener: () => void): this; - prependOnceListener(event: 'open', listener: (fd: number) => void): this; - prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: 'ready', listener: () => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * Asynchronously rename file at `oldPath` to the pathname provided - * as `newPath`. In the case that `newPath` already exists, it will - * be overwritten. If there is a directory at `newPath`, an error will - * be raised instead. No arguments other than a possible exception are - * given to the completion callback. - * - * See also: [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html). - * - * ```js - * import { rename } from 'fs'; - * - * rename('oldFile.txt', 'newFile.txt', (err) => { - * if (err) throw err; - * console.log('Rename complete!'); - * }); - * ``` - * @since v0.0.2 - */ - export function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export 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; - } - /** - * Renames the file from `oldPath` to `newPath`. Returns `undefined`. - * - * See the POSIX [`rename(2)`](http://man7.org/linux/man-pages/man2/rename.2.html) documentation for more details. - * @since v0.1.21 - */ - export function renameSync(oldPath: PathLike, newPath: PathLike): void; - /** - * Truncates the file. No arguments other than a possible exception are - * given to the completion callback. A file descriptor can also be passed as the - * first argument. In this case, `fs.ftruncate()` is called. - * - * ```js - * import { truncate } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * truncate('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was truncated'); - * }); - * ``` - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * - * See the POSIX [`truncate(2)`](http://man7.org/linux/man-pages/man2/truncate.2.html) documentation for more details. - * @since v0.8.6 - * @param [len=0] - */ - export function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): 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. - */ - export function truncate(path: PathLike, callback: NoParamCallback): void; - export 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; - } - /** - * Truncates the file. Returns `undefined`. A file descriptor can also be - * passed as the first argument. In this case, `fs.ftruncateSync()` is called. - * - * Passing a file descriptor is deprecated and may result in an error being thrown - * in the future. - * @since v0.8.6 - * @param [len=0] - */ - export function truncateSync(path: PathLike, len?: number | null): void; - /** - * Truncates the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`ftruncate(2)`](http://man7.org/linux/man-pages/man2/ftruncate.2.html) documentation for more detail. - * - * If the file referred to by the file descriptor was larger than `len` bytes, only - * the first `len` bytes will be retained in the file. - * - * For example, the following program retains only the first four bytes of the - * file: - * - * ```js - * import { open, close, ftruncate } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('temp.txt', 'r+', (err, fd) => { - * if (err) throw err; - * - * try { - * ftruncate(fd, 4, (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * if (err) throw err; - * } - * }); - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void; - /** - * Asynchronous ftruncate(2) - Truncate a file to a specified length. - * @param fd A file descriptor. - */ - export function ftruncate(fd: number, callback: NoParamCallback): void; - export 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; - } - /** - * Truncates the file descriptor. Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link ftruncate}. - * @since v0.8.6 - * @param [len=0] - */ - export function ftruncateSync(fd: number, len?: number | null): void; - /** - * Asynchronously changes owner and group of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export 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; - } - /** - * Synchronously changes owner and group of a file. Returns `undefined`. - * This is the synchronous version of {@link chown}. - * - * See the POSIX [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html) documentation for more detail. - * @since v0.1.97 - */ - export function chownSync(path: PathLike, uid: number, gid: number): void; - /** - * Sets the owner of the file. No arguments other than a possible exception are - * given to the completion callback. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void; - export namespace fchown { - /** - * Asynchronous fchown(2) - Change ownership of a file. - * @param fd A file descriptor. - */ - function __promisify__(fd: number, uid: number, gid: number): Promise; - } - /** - * Sets the owner of the file. Returns `undefined`. - * - * See the POSIX [`fchown(2)`](http://man7.org/linux/man-pages/man2/fchown.2.html) documentation for more detail. - * @since v0.4.7 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function fchownSync(fd: number, uid: number, gid: number): void; - /** - * Set the owner of the symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more detail. - */ - export function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void; - export 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; - } - /** - * Set the owner for the path. Returns `undefined`. - * - * See the POSIX [`lchown(2)`](http://man7.org/linux/man-pages/man2/lchown.2.html) documentation for more details. - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - */ - export function lchownSync(path: PathLike, uid: number, gid: number): void; - /** - * Changes the access and modification times of a file in the same way as {@link utimes}, with the difference that if the path refers to a symbolic - * link, then the link is not dereferenced: instead, the timestamps of the - * symbolic link itself are changed. - * - * No arguments other than a possible exception are given to the completion - * callback. - * @since v14.5.0, v12.19.0 - */ - export function lutimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export namespace lutimes { - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, - * with the difference that if the path refers to a symbolic link, then the link is not - * dereferenced: instead, the timestamps of the symbolic link itself are changed. - * @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: TimeLike, mtime: TimeLike): Promise; - } - /** - * Change the file system timestamps of the symbolic link referenced by `path`. - * Returns `undefined`, or throws an exception when parameters are incorrect or - * the operation fails. This is the synchronous version of {@link lutimes}. - * @since v14.5.0, v12.19.0 - */ - export function lutimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Asynchronously changes the permissions of a file. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * - * ```js - * import { chmod } from 'fs'; - * - * chmod('my_file.txt', 0o775, (err) => { - * if (err) throw err; - * console.log('The permissions for file "my_file.txt" have been changed!'); - * }); - * ``` - * @since v0.1.30 - */ - export function chmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export 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: Mode): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link chmod}. - * - * See the POSIX [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html) documentation for more detail. - * @since v0.6.7 - */ - export function chmodSync(path: PathLike, mode: Mode): void; - /** - * Sets the permissions on the file. No arguments other than a possible exception - * are given to the completion callback. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmod(fd: number, mode: Mode, callback: NoParamCallback): void; - export 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: Mode): Promise; - } - /** - * Sets the permissions on the file. Returns `undefined`. - * - * See the POSIX [`fchmod(2)`](http://man7.org/linux/man-pages/man2/fchmod.2.html) documentation for more detail. - * @since v0.4.7 - */ - export function fchmodSync(fd: number, mode: Mode): void; - /** - * Changes the permissions on a symbolic link. No arguments other than a possible - * exception are given to the completion callback. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmod(path: PathLike, mode: Mode, callback: NoParamCallback): void; - export 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: Mode): Promise; - } - /** - * Changes the permissions on a symbolic link. Returns `undefined`. - * - * This method is only implemented on macOS. - * - * See the POSIX [`lchmod(2)`](https://www.freebsd.org/cgi/man.cgi?query=lchmod&sektion=2) documentation for more detail. - * @deprecated Since v0.4.7 - */ - export function lchmodSync(path: PathLike, mode: Mode): void; - /** - * Asynchronous [`stat(2)`](http://man7.org/linux/man-pages/man2/stat.2.html). The callback gets two arguments `(err, stats)` where`stats` is an `fs.Stats` object. - * - * In case of an error, the `err.code` will be one of `Common System Errors`. - * - * Using `fs.stat()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. - * Instead, user code should open/read/write the file directly and handle the - * error raised if the file is not available. - * - * To check if a file exists without manipulating it afterwards, {@link access} is recommended. - * - * For example, given the following directory structure: - * - * ```text - * - txtDir - * -- file.txt - * - app.js - * ``` - * - * The next program will check for the stats of the given paths: - * - * ```js - * import { stat } from 'fs'; - * - * const pathsToCheck = ['./txtDir', './txtDir/file.txt']; - * - * for (let i = 0; i < pathsToCheck.length; i++) { - * stat(pathsToCheck[i], (err, stats) => { - * console.log(stats.isDirectory()); - * console.log(stats); - * }); - * } - * ``` - * - * The resulting output will resemble: - * - * ```console - * true - * Stats { - * dev: 16777220, - * mode: 16877, - * nlink: 3, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214262, - * size: 96, - * blocks: 0, - * atimeMs: 1561174653071.963, - * mtimeMs: 1561174614583.3518, - * ctimeMs: 1561174626623.5366, - * birthtimeMs: 1561174126937.2893, - * atime: 2019-06-22T03:37:33.072Z, - * mtime: 2019-06-22T03:36:54.583Z, - * ctime: 2019-06-22T03:37:06.624Z, - * birthtime: 2019-06-22T03:28:46.937Z - * } - * false - * Stats { - * dev: 16777220, - * mode: 33188, - * nlink: 1, - * uid: 501, - * gid: 20, - * rdev: 0, - * blksize: 4096, - * ino: 14214074, - * size: 8, - * blocks: 8, - * atimeMs: 1561174616618.8555, - * mtimeMs: 1561174614584, - * ctimeMs: 1561174614583.8145, - * birthtimeMs: 1561174007710.7478, - * atime: 2019-06-22T03:36:56.619Z, - * mtime: 2019-06-22T03:36:54.584Z, - * ctime: 2019-06-22T03:36:54.584Z, - * birthtime: 2019-06-22T03:26:47.711Z - * } - * ``` - * @since v0.0.2 - */ - export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function stat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function stat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export 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, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): Promise; - } - export interface StatSyncFn extends Function { - (path: TDescriptor, options?: undefined): Stats; - ( - path: TDescriptor, - options?: StatOptions & { - bigint?: false | undefined; - throwIfNoEntry: false; - } - ): Stats | undefined; - ( - path: TDescriptor, - options: StatOptions & { - bigint: true; - throwIfNoEntry: false; - } - ): BigIntStats | undefined; - ( - path: TDescriptor, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Stats; - ( - path: TDescriptor, - options: StatOptions & { - bigint: true; - } - ): BigIntStats; - ( - path: TDescriptor, - options: StatOptions & { - bigint: boolean; - throwIfNoEntry?: false | undefined; - } - ): Stats | BigIntStats; - (path: TDescriptor, options?: StatOptions): Stats | BigIntStats | undefined; - } - /** - * Synchronous stat(2) - Get file status. - * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. - */ - export const statSync: StatSyncFn; - /** - * Invokes the callback with the `fs.Stats` for the file descriptor. - * - * See the POSIX [`fstat(2)`](http://man7.org/linux/man-pages/man2/fstat.2.html) documentation for more detail. - * @since v0.1.95 - */ - export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function fstat( - fd: number, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function fstat( - fd: number, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export namespace fstat { - /** - * Asynchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - function __promisify__( - fd: number, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - fd: number, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(fd: number, options?: StatOptions): Promise; - } - /** - * Synchronous fstat(2) - Get file status. - * @param fd A file descriptor. - */ - export const fstatSync: StatSyncFn; - /** - * Retrieves the `fs.Stats` for the symbolic link referred to by the path. - * The callback gets two arguments `(err, stats)` where `stats` is a `fs.Stats` object. `lstat()` is identical to `stat()`, except that if `path` is a symbolic - * link, then the link itself is stat-ed, not the file that it refers to. - * - * See the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) documentation for more details. - * @since v0.1.30 - */ - export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void; - export function lstat( - path: PathLike, - options: - | (StatOptions & { - bigint?: false | undefined; - }) - | undefined, - callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void - ): void; - export function lstat( - path: PathLike, - options: StatOptions & { - bigint: true; - }, - callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void - ): void; - export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void; - export 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, - options?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function __promisify__( - path: PathLike, - options: StatOptions & { - bigint: true; - } - ): Promise; - function __promisify__(path: PathLike, options?: StatOptions): 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. - */ - export const lstatSync: StatSyncFn; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. No arguments other than a - * possible - * exception are given to the completion callback. - * @since v0.1.31 - */ - export function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void; - export 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 __promisify__(existingPath: PathLike, newPath: PathLike): Promise; - } - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.31 - */ - export function linkSync(existingPath: PathLike, newPath: PathLike): void; - /** - * Creates the link called `path` pointing to `target`. No arguments other than a - * possible exception are given to the completion callback. - * - * See the POSIX [`symlink(2)`](http://man7.org/linux/man-pages/man2/symlink.2.html) documentation for more details. - * - * The `type` argument is only available on Windows and ignored on other platforms. - * It can be set to `'dir'`, `'file'`, or `'junction'`. If the `type` argument is - * not set, Node.js will autodetect `target` type and use `'file'` or `'dir'`. If - * the `target` does not exist, `'file'` will be used. Windows junction points - * require the destination path to be absolute. When using `'junction'`, the`target` argument will automatically be normalized to absolute path. - * - * Relative targets are relative to the link’s parent directory. - * - * ```js - * import { symlink } from 'fs'; - * - * symlink('./mew', './example/mewtwo', callback); - * ``` - * - * The above example creates a symbolic link `mewtwo` in the `example` which points - * to `mew` in the same directory: - * - * ```bash - * $ tree example/ - * example/ - * ├── mew - * └── mewtwo -> ./mew - * ``` - * @since v0.1.31 - */ - export function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): 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. - */ - export function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void; - export 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'; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link symlink}. - * @since v0.1.31 - */ - export function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void; - /** - * Reads the contents of the symbolic link referred to by `path`. The callback gets - * two arguments `(err, linkString)`. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path passed to the callback. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlink(path: PathLike, options: EncodingOption, 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. - */ - export function readlink(path: PathLike, options: BufferEncodingOption, 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. - */ - export function readlink(path: PathLike, options: EncodingOption, 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. - */ - export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void; - export 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?: EncodingOption): 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: BufferEncodingOption): 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?: EncodingOption): Promise; - } - /** - * Returns the symbolic link's string value. - * - * See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, - * the link path returned will be passed as a `Buffer` object. - * @since v0.1.31 - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): 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. - */ - export function readlinkSync(path: PathLike, options: BufferEncodingOption): 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. - */ - export function readlinkSync(path: PathLike, options?: EncodingOption): string | Buffer; - /** - * Asynchronously computes the canonical pathname by resolving `.`, `..` and - * symbolic links. - * - * A canonical pathname is not necessarily unique. Hard links and bind mounts can - * expose a file system entity through many pathnames. - * - * This function behaves like [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html), with some exceptions: - * - * 1. No case conversion is performed on case-insensitive file systems. - * 2. The maximum number of symbolic links is platform-independent and generally - * (much) higher than what the native [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html) implementation supports. - * - * The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd`to resolve relative paths. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * If `path` resolves to a socket or a pipe, the function will return a system - * dependent name for that object. - * @since v0.1.31 - */ - export function realpath(path: PathLike, options: EncodingOption, 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. - */ - export function realpath(path: PathLike, options: BufferEncodingOption, 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. - */ - export function realpath(path: PathLike, options: EncodingOption, 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. - */ - export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - export 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?: EncodingOption): 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: BufferEncodingOption): 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?: EncodingOption): Promise; - /** - * Asynchronous [`realpath(3)`](http://man7.org/linux/man-pages/man3/realpath.3.html). - * - * The `callback` gets two arguments `(err, resolvedPath)`. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path passed to the callback. If the `encoding` is set to `'buffer'`, - * the path returned will be passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v9.2.0 - */ - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - function native(path: PathLike, options: BufferEncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void; - function native(path: PathLike, options: EncodingOption, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void; - function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void; - } - /** - * Returns the resolved pathname. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link realpath}. - * @since v0.1.31 - */ - export function realpathSync(path: PathLike, options?: EncodingOption): 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. - */ - export function realpathSync(path: PathLike, options: BufferEncodingOption): 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. - */ - export function realpathSync(path: PathLike, options?: EncodingOption): string | Buffer; - export namespace realpathSync { - function native(path: PathLike, options?: EncodingOption): string; - function native(path: PathLike, options: BufferEncodingOption): Buffer; - function native(path: PathLike, options?: EncodingOption): string | Buffer; - } - /** - * Asynchronously removes a file or symbolic link. No arguments other than a - * possible exception are given to the completion callback. - * - * ```js - * import { unlink } from 'fs'; - * // Assuming that 'path/file.txt' is a regular file. - * unlink('path/file.txt', (err) => { - * if (err) throw err; - * console.log('path/file.txt was deleted'); - * }); - * ``` - * - * `fs.unlink()` will not work on a directory, empty or otherwise. To remove a - * directory, use {@link rmdir}. - * - * See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html) documentation for more details. - * @since v0.0.2 - */ - export function unlink(path: PathLike, callback: NoParamCallback): void; - export 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)`](http://man7.org/linux/man-pages/man2/unlink.2.html). Returns `undefined`. - * @since v0.1.21 - */ - export function unlinkSync(path: PathLike): void; - export interface RmDirOptions { - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * @deprecated since v14.14.0 In future versions of Node.js and will trigger a warning - * `fs.rmdir(path, { recursive: true })` will throw if `path` does not exist or is a file. - * Use `fs.rm(path, { recursive: true, force: true })` instead. - * - * If `true`, perform a recursive directory removal. In - * recursive mode soperations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). No arguments other than a possible exception are given - * to the completion callback. - * - * Using `fs.rmdir()` on a file (not a directory) results in an `ENOENT` error on - * Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rm} with options `{ recursive: true, force: true }`. - * @since v0.0.2 - */ - export function rmdir(path: PathLike, callback: NoParamCallback): void; - export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void; - export 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, options?: RmDirOptions): Promise; - } - /** - * Synchronous [`rmdir(2)`](http://man7.org/linux/man-pages/man2/rmdir.2.html). Returns `undefined`. - * - * Using `fs.rmdirSync()` on a file (not a directory) results in an `ENOENT` error - * on Windows and an `ENOTDIR` error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use {@link rmSync} with options `{ recursive: true, force: true }`. - * @since v0.1.21 - */ - export function rmdirSync(path: PathLike, options?: RmDirOptions): void; - export interface RmOptions { - /** - * When `true`, exceptions will be ignored if `path` does not exist. - * @default false - */ - force?: boolean | undefined; - /** - * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or - * `EPERM` error is encountered, Node.js will retry the operation with a linear - * backoff wait of `retryDelay` ms longer on each try. This option represents the - * number of retries. This option is ignored if the `recursive` option is not - * `true`. - * @default 0 - */ - maxRetries?: number | undefined; - /** - * If `true`, perform a recursive directory removal. In - * recursive mode, operations are retried on failure. - * @default false - */ - recursive?: boolean | undefined; - /** - * The amount of time in milliseconds to wait between retries. - * This option is ignored if the `recursive` option is not `true`. - * @default 100 - */ - retryDelay?: number | undefined; - } - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm`utility). No arguments other than a possible exception are given to the - * completion callback. - * @since v14.14.0 - */ - export function rm(path: PathLike, callback: NoParamCallback): void; - export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void; - export namespace rm { - /** - * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility). - */ - function __promisify__(path: PathLike, options?: RmOptions): Promise; - } - /** - * Synchronously removes files and directories (modeled on the standard POSIX `rm`utility). Returns `undefined`. - * @since v14.14.0 - */ - export function rmSync(path: PathLike, options?: RmOptions): void; - export interface MakeDirectoryOptions { - /** - * Indicates whether parent folders should be created. - * If a folder was created, the path to the first created folder will be returned. - * @default false - */ - recursive?: boolean | undefined; - /** - * A file mode. If a string is passed, it is parsed as an octal integer. If not specified - * @default 0o777 - */ - mode?: Mode | undefined; - } - /** - * Asynchronously creates a directory. - * - * The callback is given a possible exception and, if `recursive` is `true`, the - * first directory path created, `(err, [path])`.`path` can still be `undefined` when `recursive` is `true`, if no directory was - * created. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fs.mkdir()` when `path` is a directory that - * exists results in an error only - * when `recursive` is false. - * - * ```js - * import { mkdir } from 'fs'; - * - * // Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist. - * mkdir('/tmp/a/apple', { recursive: true }, (err) => { - * if (err) throw err; - * }); - * ``` - * - * On Windows, using `fs.mkdir()` on the root directory even with recursion will - * result in an error: - * - * ```js - * import { mkdir } from 'fs'; - * - * mkdir('/', { recursive: true }, (err) => { - * // => [Error: EPERM: operation not permitted, mkdir 'C:\'] - * }); - * ``` - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.8 - */ - export function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - }, - callback: (err: NodeJS.ErrnoException | null, path?: string) => void - ): void; - /** - * 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`. - */ - export function mkdir( - path: PathLike, - options: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - | undefined, - callback: NoParamCallback - ): void; - /** - * 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`. - */ - export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => 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. - */ - export function mkdir(path: PathLike, callback: NoParamCallback): void; - export 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: MakeDirectoryOptions & { - recursive: true; - } - ): 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 __promisify__( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): 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 __promisify__(path: PathLike, options?: Mode | MakeDirectoryOptions | null): Promise; - } - /** - * Synchronously creates a directory. Returns `undefined`, or if `recursive` is`true`, the first directory path created. - * This is the synchronous version of {@link mkdir}. - * - * See the POSIX [`mkdir(2)`](http://man7.org/linux/man-pages/man2/mkdir.2.html) documentation for more details. - * @since v0.1.21 - */ - export function mkdirSync( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): string | undefined; - /** - * 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`. - */ - export function mkdirSync( - path: PathLike, - options?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): void; - /** - * 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`. - */ - export function mkdirSync(path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined; - /** - * Creates a unique temporary directory. - * - * Generates six random characters to be appended behind a required`prefix` to create a unique temporary directory. Due to platform - * inconsistencies, avoid trailing `X` characters in `prefix`. Some platforms, - * notably the BSDs, can return more than six random characters, and replace - * trailing `X` characters in `prefix` with random characters. - * - * The created directory path is passed as a string to the callback's second - * parameter. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs'; - * - * mkdtemp(path.join(os.tmpdir(), 'foo-'), (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Prints: /tmp/foo-itXde2 or C:\Users\...\AppData\Local\Temp\foo-itXde2 - * }); - * ``` - * - * The `fs.mkdtemp()` method will append the six randomly selected characters - * directly to the `prefix` string. For instance, given a directory `/tmp`, if the - * intention is to create a temporary directory _within_`/tmp`, the `prefix`must end with a trailing platform-specific path separator - * (`require('path').sep`). - * - * ```js - * import { tmpdir } from 'os'; - * import { mkdtemp } from 'fs'; - * - * // The parent directory for the new temporary directory - * const tmpDir = tmpdir(); - * - * // This method is *INCORRECT*: - * mkdtemp(tmpDir, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmpabc123`. - * // A new temporary directory is created at the file system root - * // rather than *within* the /tmp directory. - * }); - * - * // This method is *CORRECT*: - * import { sep } from 'path'; - * mkdtemp(`${tmpDir}${sep}`, (err, directory) => { - * if (err) throw err; - * console.log(directory); - * // Will print something similar to `/tmp/abc123`. - * // A new temporary directory is created within - * // the /tmp directory. - * }); - * ``` - * @since v5.10.0 - */ - export function mkdtemp(prefix: string, options: EncodingOption, 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. - */ - export 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. - */ - export function mkdtemp(prefix: string, options: EncodingOption, 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. - */ - export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void; - export 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?: EncodingOption): 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: BufferEncodingOption): 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?: EncodingOption): Promise; - } - /** - * Returns the created directory path. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link mkdtemp}. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * @since v5.10.0 - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): 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. - */ - export function mkdtempSync(prefix: string, options: BufferEncodingOption): 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. - */ - export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer; - /** - * Reads the contents of a directory. The callback gets two arguments `(err, files)`where `files` is an array of the names of the files in the directory excluding`'.'` and `'..'`. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames passed to the callback. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the `files` array will contain `fs.Dirent` objects. - * @since v0.1.8 - */ - export function readdir( - path: PathLike, - options: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | 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. - */ - export function readdir( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | '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. - */ - export function readdir( - path: PathLike, - options: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | 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. - */ - export 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. - */ - export function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - }, - callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void - ): void; - export 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 | undefined; - } - | 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 | undefined; - } - ): 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?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | 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 If called with `withFileTypes: true` the result data will be an array of Dirent - */ - function __promisify__( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - } - /** - * Reads the contents of the directory. - * - * See the POSIX [`readdir(3)`](http://man7.org/linux/man-pages/man3/readdir.3.html) documentation for more details. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames returned. If the `encoding` is set to `'buffer'`, - * the filenames returned will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the result will contain `fs.Dirent` objects. - * @since v0.1.21 - */ - export function readdirSync( - path: PathLike, - options?: - | { - encoding: BufferEncoding | null; - withFileTypes?: false | undefined; - } - | 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. - */ - export function readdirSync( - path: PathLike, - options: - | { - encoding: 'buffer'; - withFileTypes?: false | undefined; - } - | '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. - */ - export function readdirSync( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | BufferEncoding - | 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. - */ - export function readdirSync( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Dirent[]; - /** - * Closes the file descriptor. No arguments other than a possible exception are - * given to the completion callback. - * - * Calling `fs.close()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.0.2 - */ - export function close(fd: number, callback?: NoParamCallback): void; - export namespace close { - /** - * Asynchronous close(2) - close a file descriptor. - * @param fd A file descriptor. - */ - function __promisify__(fd: number): Promise; - } - /** - * Closes the file descriptor. Returns `undefined`. - * - * Calling `fs.closeSync()` on any file descriptor (`fd`) that is currently in use - * through any other `fs` operation may lead to undefined behavior. - * - * See the POSIX [`close(2)`](http://man7.org/linux/man-pages/man2/close.2.html) documentation for more detail. - * @since v0.1.21 - */ - export function closeSync(fd: number): void; - /** - * Asynchronous file open. See the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more details. - * - * `mode` sets the file mode (permission and sticky bits), but only if the file was - * created. On Windows, only the write permission can be manipulated; see {@link chmod}. - * - * The callback gets two arguments `(err, fd)`. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * - * Functions based on `fs.open()` exhibit this behavior as well:`fs.writeFile()`, `fs.readFile()`, etc. - * @since v0.0.2 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] - */ - export function open(path: PathLike, flags: OpenMode, mode: Mode | 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. - */ - export function open(path: PathLike, flags: OpenMode, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void; - export 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: OpenMode, mode?: Mode | null): Promise; - } - /** - * Returns an integer representing the file descriptor. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link open}. - * @since v0.1.21 - * @param [flags='r'] - * @param [mode=0o666] - */ - export function openSync(path: PathLike, flags: OpenMode, mode?: Mode | null): number; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time in seconds,`Date`s, or a numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v0.4.2 - */ - export function utimes(path: PathLike, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export 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: TimeLike, mtime: TimeLike): Promise; - } - /** - * Returns `undefined`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link utimes}. - * @since v0.4.2 - */ - export function utimesSync(path: PathLike, atime: TimeLike, mtime: TimeLike): void; - /** - * Change the file system timestamps of the object referenced by the supplied file - * descriptor. See {@link utimes}. - * @since v0.4.2 - */ - export function futimes(fd: number, atime: TimeLike, mtime: TimeLike, callback: NoParamCallback): void; - export 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: TimeLike, mtime: TimeLike): Promise; - } - /** - * Synchronous version of {@link futimes}. Returns `undefined`. - * @since v0.4.2 - */ - export function futimesSync(fd: number, atime: TimeLike, mtime: TimeLike): void; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. No arguments other - * than a possible exception are given to the completion callback. - * @since v0.1.96 - */ - export function fsync(fd: number, callback: NoParamCallback): void; - export 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; - } - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. Returns `undefined`. - * @since v0.1.96 - */ - export function fsyncSync(fd: number): void; - /** - * Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it - * must have an own `toString` function property. - * - * `offset` determines the part of the buffer to be written, and `length` is - * an integer specifying the number of bytes to write. - * - * `position` refers to the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. See [`pwrite(2)`](http://man7.org/linux/man-pages/man2/pwrite.2.html). - * - * The callback will be given three arguments `(err, bytesWritten, buffer)` where`bytesWritten` specifies how many _bytes_ were written from `buffer`. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesWritten` and `buffer` properties. - * - * It is unsafe to use `fs.write()` multiple times on the same file without waiting - * for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v0.0.2 - */ - export 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`. - */ - export 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`. - */ - export 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. - */ - export 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. - * @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. - */ - export function write( - fd: number, - string: string, - position: number | undefined | null, - encoding: BufferEncoding | 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. - * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. - */ - export function write(fd: number, string: string, 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. - */ - export function write(fd: number, string: string, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void; - export 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. - * @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: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - } - /** - * If `buffer` is a plain object, it must have an own (not inherited) `toString`function property. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link write}. - * @since v0.1.21 - * @return The number of bytes written. - */ - export function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, 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. - * @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. - */ - export function writeSync(fd: number, string: string, position?: number | null, encoding?: BufferEncoding | null): number; - export type ReadPosition = number | bigint; - /** - * Read data from the file specified by `fd`. - * - * The callback is given the three arguments, `(err, bytesRead, buffer)`. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffer` properties. - * @since v0.0.2 - * @param [buffer=Buffer.alloc(16384)] The buffer that the data will be written to. - * @param [offset=0] The position in `buffer` to write the data to. - * @param [length=buffer.byteLength] The number of bytes to read. - * @param position Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If - * `position` is an integer, the file position will be unchanged. - */ - export function read( - fd: number, - buffer: TBuffer, - offset: number, - length: number, - position: ReadPosition | null, - callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void - ): void; - export 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; - }>; - } - export interface ReadSyncOptions { - /** - * @default 0 - */ - offset?: number | undefined; - /** - * @default `length of buffer` - */ - length?: number | undefined; - /** - * @default null - */ - position?: ReadPosition | null | undefined; - } - /** - * Returns the number of `bytesRead`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link read}. - * @since v0.1.21 - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: ReadPosition | null): number; - /** - * Similar to the above `fs.readSync` function, this version takes an optional `options` object. - * If no `options` object is specified, it will default with the above values. - */ - export function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number; - /** - * Asynchronously reads the entire contents of a file. - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', (err, data) => { - * if (err) throw err; - * console.log(data); - * }); - * ``` - * - * The callback is passed two arguments `(err, data)`, where `data` is the - * contents of the file. - * - * If no encoding is specified, then the raw buffer is returned. - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { readFile } from 'fs'; - * - * readFile('/etc/passwd', 'utf8', callback); - * ``` - * - * When the path is a directory, the behavior of `fs.readFile()` and {@link readFileSync} is platform-specific. On macOS, Linux, and Windows, an - * error will be returned. On FreeBSD, a representation of the directory's contents - * will be returned. - * - * ```js - * import { readFile } from 'fs'; - * - * // macOS, Linux, and Windows - * readFile('', (err, data) => { - * // => [Error: EISDIR: illegal operation on a directory, read ] - * }); - * - * // FreeBSD - * readFile('', (err, data) => { - * // => null, - * }); - * ``` - * - * It is possible to abort an ongoing request using an `AbortSignal`. If a - * request is aborted the callback is called with an `AbortError`: - * - * ```js - * import { readFile } from 'fs'; - * - * const controller = new AbortController(); - * const signal = controller.signal; - * readFile(fileInfo[0].name, { signal }, (err, buf) => { - * // ... - * }); - * // When you want to abort the request - * controller.abort(); - * ``` - * - * The `fs.readFile()` function buffers the entire file. To minimize memory costs, - * when possible prefer streaming via `fs.createReadStream()`. - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * @since v0.1.29 - * @param path filename or file descriptor - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding?: null | undefined; - flag?: string | undefined; - } & Abortable) - | 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. - * 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'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | ({ - encoding: BufferEncoding; - flag?: string | undefined; - } & Abortable) - | BufferEncoding, - 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. - * 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'`. - */ - export function readFile( - path: PathOrFileDescriptor, - options: - | (ObjectEncodingOptions & { - flag?: string | undefined; - } & Abortable) - | BufferEncoding - | 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. - */ - export function readFile(path: PathOrFileDescriptor, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void; - export 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: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | 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: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | 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. - * 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: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): Promise; - } - /** - * Returns the contents of the `path`. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readFile}. - * - * If the `encoding` option is specified then this function returns a - * string. Otherwise it returns a buffer. - * - * Similar to {@link readFile}, when the path is a directory, the behavior of`fs.readFileSync()` is platform-specific. - * - * ```js - * import { readFileSync } from 'fs'; - * - * // macOS, Linux, and Windows - * readFileSync(''); - * // => [Error: EISDIR: illegal operation on a directory, read ] - * - * // FreeBSD - * readFileSync(''); // => - * ``` - * @since v0.1.8 - * @param path filename or file descriptor - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: { - encoding?: null | undefined; - flag?: string | undefined; - } | 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. - * 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'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options: - | { - encoding: BufferEncoding; - flag?: string | undefined; - } - | BufferEncoding - ): 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. - * 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'`. - */ - export function readFileSync( - path: PathOrFileDescriptor, - options?: - | (ObjectEncodingOptions & { - flag?: string | undefined; - }) - | BufferEncoding - | null - ): string | Buffer; - export type WriteFileOptions = - | (ObjectEncodingOptions & - Abortable & { - mode?: Mode | undefined; - flag?: string | undefined; - }) - | BufferEncoding - | null; - /** - * When `file` is a filename, asynchronously writes data to the file, replacing the - * file if it already exists. `data` can be a string or a buffer. - * - * When `file` is a file descriptor, the behavior is similar to calling`fs.write()` directly (which is recommended). See the notes below on using - * a file descriptor. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `data` is a plain object, it must have an own (not inherited) `toString`function property. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, (err) => { - * if (err) throw err; - * console.log('The file has been saved!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { writeFile } from 'fs'; - * - * writeFile('message.txt', 'Hello Node.js', 'utf8', callback); - * ``` - * - * It is unsafe to use `fs.writeFile()` multiple times on the same file without - * waiting for the callback. For this scenario, {@link createWriteStream} is - * recommended. - * - * Similarly to `fs.readFile` \- `fs.writeFile` is a convenience method that - * performs multiple `write` calls internally to write the buffer passed to it. - * For performance sensitive code consider using {@link createWriteStream}. - * - * It is possible to use an `AbortSignal` to cancel an `fs.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs'; - * import { Buffer } from 'buffer'; - * - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * writeFile('message.txt', data, { signal }, (err) => { - * // When a request is aborted - the callback is called with an AbortError - * }); - * // When the request should be aborted - * controller.abort(); - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFile(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): 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. - * 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. - */ - export function writeFile(path: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void; - export 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: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): Promise; - } - /** - * Returns `undefined`. - * - * If `data` is a plain object, it must have an own (not inherited) `toString`function property. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writeFile}. - * @since v0.1.29 - * @param file filename or file descriptor - */ - export function writeFileSync(file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: WriteFileOptions): void; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', (err) => { - * if (err) throw err; - * console.log('The "data to append" was appended to file!'); - * }); - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFile } from 'fs'; - * - * appendFile('message.txt', 'data to append', 'utf8', callback); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { open, close, appendFile } from 'fs'; - * - * function closeFd(fd) { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * - * open('message.txt', 'a', (err, fd) => { - * if (err) throw err; - * - * try { - * appendFile(fd, 'data to append', 'utf8', (err) => { - * closeFd(fd); - * if (err) throw err; - * }); - * } catch (err) { - * closeFd(fd); - * throw err; - * } - * }); - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFile(path: PathOrFileDescriptor, data: string | Uint8Array, options: WriteFileOptions, callback: NoParamCallback): 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. - * 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. - */ - export function appendFile(file: PathOrFileDescriptor, data: string | Uint8Array, callback: NoParamCallback): void; - export 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: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): Promise; - } - /** - * Synchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * ```js - * import { appendFileSync } from 'fs'; - * - * try { - * appendFileSync('message.txt', 'data to append'); - * console.log('The "data to append" was appended to file!'); - * } catch (err) { - * // Handle the error - * } - * ``` - * - * If `options` is a string, then it specifies the encoding: - * - * ```js - * import { appendFileSync } from 'fs'; - * - * appendFileSync('message.txt', 'data to append', 'utf8'); - * ``` - * - * The `path` may be specified as a numeric file descriptor that has been opened - * for appending (using `fs.open()` or `fs.openSync()`). The file descriptor will - * not be closed automatically. - * - * ```js - * import { openSync, closeSync, appendFileSync } from 'fs'; - * - * let fd; - * - * try { - * fd = openSync('message.txt', 'a'); - * appendFileSync(fd, 'data to append', 'utf8'); - * } catch (err) { - * // Handle the error - * } finally { - * if (fd !== undefined) - * closeSync(fd); - * } - * ``` - * @since v0.6.7 - * @param path filename or file descriptor - */ - export function appendFileSync(path: PathOrFileDescriptor, data: string | Uint8Array, options?: WriteFileOptions): void; - /** - * Watch for changes on `filename`. The callback `listener` will be called each - * time the file is accessed. - * - * The `options` argument may be omitted. If provided, it should be an object. The`options` object may contain a boolean named `persistent` that indicates - * whether the process should continue to run as long as files are being watched. - * The `options` object may specify an `interval` property indicating how often the - * target should be polled in milliseconds. - * - * The `listener` gets two arguments the current stat object and the previous - * stat object: - * - * ```js - * import { watchFile } from 'fs'; - * - * watchFile('message.text', (curr, prev) => { - * console.log(`the current mtime is: ${curr.mtime}`); - * console.log(`the previous mtime was: ${prev.mtime}`); - * }); - * ``` - * - * These stat objects are instances of `fs.Stat`. If the `bigint` option is `true`, - * the numeric values in these objects are specified as `BigInt`s. - * - * To be notified when the file was modified, not just accessed, it is necessary - * to compare `curr.mtime` and `prev.mtime`. - * - * When an `fs.watchFile` operation results in an `ENOENT` error, it - * will invoke the listener once, with all the fields zeroed (or, for dates, the - * Unix Epoch). If the file is created later on, the listener will be called - * again, with the latest stat objects. This is a change in functionality since - * v0.10. - * - * Using {@link watch} is more efficient than `fs.watchFile` and`fs.unwatchFile`. `fs.watch` should be used instead of `fs.watchFile` and`fs.unwatchFile` when possible. - * - * When a file being watched by `fs.watchFile()` disappears and reappears, - * then the contents of `previous` in the second callback event (the file's - * reappearance) will be the same as the contents of `previous` in the first - * callback event (its disappearance). - * - * This happens when: - * - * * the file is deleted, followed by a restore - * * the file is renamed and then renamed a second time back to its original name - * @since v0.1.31 - */ - export function watchFile( - filename: PathLike, - options: - | { - persistent?: boolean | undefined; - interval?: number | undefined; - } - | 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. - */ - export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; - /** - * Stop watching for changes on `filename`. If `listener` is specified, only that - * particular listener is removed. Otherwise, _all_ listeners are removed, - * effectively stopping watching of `filename`. - * - * Calling `fs.unwatchFile()` with a filename that is not being watched is a - * no-op, not an error. - * - * Using {@link watch} is more efficient than `fs.watchFile()` and`fs.unwatchFile()`. `fs.watch()` should be used instead of `fs.watchFile()`and `fs.unwatchFile()` when possible. - * @since v0.1.31 - * @param listener Optional, a listener previously attached using `fs.watchFile()` - */ - export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; - export interface WatchOptions extends Abortable { - encoding?: BufferEncoding | 'buffer' | undefined; - persistent?: boolean | undefined; - recursive?: boolean | undefined; - } - export type WatchEventType = 'rename' | 'change'; - export type WatchListener = (event: WatchEventType, filename: T) => void; - /** - * Watch for changes on `filename`, where `filename` is either a file or a - * directory. - * - * The second argument is optional. If `options` is provided as a string, it - * specifies the `encoding`. Otherwise `options` should be passed as an object. - * - * The listener callback gets two arguments `(eventType, filename)`. `eventType`is either `'rename'` or `'change'`, and `filename` is the name of the file - * which triggered the event. - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * The listener callback is attached to the `'change'` event fired by `fs.FSWatcher`, but it is not the same thing as the `'change'` value of`eventType`. - * - * If a `signal` is passed, aborting the corresponding AbortController will close - * the returned `fs.FSWatcher`. - * @since v0.5.10 - * @param listener - */ - export function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer', - listener?: WatchListener - ): 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. - * @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. - */ - export function watch(filename: PathLike, options?: WatchOptions | BufferEncoding | null, listener?: WatchListener): 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. - * @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. - */ - export function watch(filename: PathLike, options: WatchOptions | string, listener?: WatchListener): 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. - */ - export function watch(filename: PathLike, listener?: WatchListener): FSWatcher; - /** - * Test whether or not the given path exists by checking with the file system. - * Then call the `callback` argument with either true or false: - * - * ```js - * import { exists } from 'fs'; - * - * exists('/etc/passwd', (e) => { - * console.log(e ? 'it exists' : 'no passwd!'); - * }); - * ``` - * - * **The parameters for this callback are not consistent with other Node.js** - * **callbacks.** Normally, the first parameter to a Node.js callback is an `err`parameter, optionally followed by other parameters. The `fs.exists()` callback - * has only one boolean parameter. This is one reason `fs.access()` is recommended - * instead of `fs.exists()`. - * - * Using `fs.exists()` to check for the existence of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file does not exist. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { exists, open, close } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * console.error('myfile already exists'); - * } else { - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { open, close, exists } from 'fs'; - * - * exists('myfile', (e) => { - * if (e) { - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * } else { - * console.error('myfile does not exist'); - * } - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for existence and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the existence of a file only if the file won’t be - * used directly, for example when its existence is a signal from another - * process. - * @since v0.0.2 - * @deprecated Since v1.0.0 - Use {@link stat} or {@link access} instead. - */ - export function exists(path: PathLike, callback: (exists: boolean) => void): void; - export 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; - } - /** - * Returns `true` if the path exists, `false` otherwise. - * - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link exists}. - * - * `fs.exists()` is deprecated, but `fs.existsSync()` is not. The `callback`parameter to `fs.exists()` accepts parameters that are inconsistent with other - * Node.js callbacks. `fs.existsSync()` does not use a callback. - * - * ```js - * import { existsSync } from 'fs'; - * - * if (existsSync('/etc/passwd')) - * console.log('The path exists.'); - * ``` - * @since v0.1.21 - */ - export function existsSync(path: PathLike): boolean; - export 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; - /** - * When set, a memory file mapping is used to access the file. This flag - * is available on Windows operating systems only. On other operating systems, - * this flag is ignored. - */ - const UV_FS_O_FILEMAP: number; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. Check `File access constants` for possible values - * of `mode`. It is possible to create a mask consisting of the bitwise OR of - * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`). - * - * The final argument, `callback`, is a callback function that is invoked with - * a possible error argument. If any of the accessibility checks fail, the error - * argument will be an `Error` object. The following examples check if`package.json` exists, and if it is readable or writable. - * - * ```js - * import { access, constants } from 'fs'; - * - * const file = 'package.json'; - * - * // Check if the file exists in the current directory. - * access(file, constants.F_OK, (err) => { - * console.log(`${file} ${err ? 'does not exist' : 'exists'}`); - * }); - * - * // Check if the file is readable. - * access(file, constants.R_OK, (err) => { - * console.log(`${file} ${err ? 'is not readable' : 'is readable'}`); - * }); - * - * // Check if the file is writable. - * access(file, constants.W_OK, (err) => { - * console.log(`${file} ${err ? 'is not writable' : 'is writable'}`); - * }); - * - * // Check if the file exists in the current directory, and if it is writable. - * access(file, constants.F_OK | constants.W_OK, (err) => { - * if (err) { - * console.error( - * `${file} ${err.code === 'ENOENT' ? 'does not exist' : 'is read-only'}`); - * } else { - * console.log(`${file} exists, and it is writable`); - * } - * }); - * ``` - * - * Do not use `fs.access()` to check for the accessibility of a file before calling`fs.open()`, `fs.readFile()` or `fs.writeFile()`. Doing - * so introduces a race condition, since other processes may change the file's - * state between the two calls. Instead, user code should open/read/write the - * file directly and handle the error raised if the file is not accessible. - * - * **write (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * - * access('myfile', (err) => { - * if (!err) { - * console.error('myfile already exists'); - * return; - * } - * - * open('myfile', 'wx', (err, fd) => { - * if (err) throw err; - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **write (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'wx', (err, fd) => { - * if (err) { - * if (err.code === 'EEXIST') { - * console.error('myfile already exists'); - * return; - * } - * - * throw err; - * } - * - * try { - * writeMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * **read (NOT RECOMMENDED)** - * - * ```js - * import { access, open, close } from 'fs'; - * access('myfile', (err) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * open('myfile', 'r', (err, fd) => { - * if (err) throw err; - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * }); - * ``` - * - * **read (RECOMMENDED)** - * - * ```js - * import { open, close } from 'fs'; - * - * open('myfile', 'r', (err, fd) => { - * if (err) { - * if (err.code === 'ENOENT') { - * console.error('myfile does not exist'); - * return; - * } - * - * throw err; - * } - * - * try { - * readMyData(fd); - * } finally { - * close(fd, (err) => { - * if (err) throw err; - * }); - * } - * }); - * ``` - * - * The "not recommended" examples above check for accessibility and then use the - * file; the "recommended" examples are better because they use the file directly - * and handle the error, if any. - * - * In general, check for the accessibility of a file only if the file will not be - * used directly, for example when its accessibility is a signal from another - * process. - * - * On Windows, access-control policies (ACLs) on a directory may limit access to - * a file or directory. The `fs.access()` function, however, does not check the - * ACL and therefore may report that a path is accessible even if the ACL restricts - * the user from reading or writing to it. - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): 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. - */ - export function access(path: PathLike, callback: NoParamCallback): void; - export 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 or directory specified - * by `path`. The `mode` argument is an optional integer that specifies the - * accessibility checks to be performed. Check `File access constants` for - * possible values of `mode`. It is possible to create a mask consisting of - * the bitwise OR of two or more values - * (e.g. `fs.constants.W_OK | fs.constants.R_OK`). - * - * If any of the accessibility checks fail, an `Error` will be thrown. Otherwise, - * the method will return `undefined`. - * - * ```js - * import { accessSync, constants } from 'fs'; - * - * try { - * accessSync('etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can read/write'); - * } catch (err) { - * console.error('no access!'); - * } - * ``` - * @since v0.11.15 - * @param [mode=fs.constants.F_OK] - */ - export function accessSync(path: PathLike, mode?: number): void; - interface StreamOptions { - flags?: string | undefined; - encoding?: BufferEncoding | undefined; - fd?: number | promises.FileHandle | undefined; - mode?: number | undefined; - autoClose?: boolean | undefined; - /** - * @default false - */ - emitClose?: boolean | undefined; - start?: number | undefined; - highWaterMark?: number | undefined; - } - interface ReadStreamOptions extends StreamOptions { - end?: number | undefined; - } - /** - * Unlike the 16 kb default `highWaterMark` for a readable stream, the stream - * returned by this method has a default `highWaterMark` of 64 kb. - * - * `options` can include `start` and `end` values to read a range of bytes from - * the file instead of the entire file. Both `start` and `end` are inclusive and - * start counting at 0, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `fd` is specified and `start` is - * omitted or `undefined`, `fs.createReadStream()` reads sequentially from the - * current file position. The `encoding` can be any one of those accepted by `Buffer`. - * - * If `fd` is specified, `ReadStream` will ignore the `path` argument and will use - * the specified file descriptor. This means that no `'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s should be passed to `net.Socket`. - * - * If `fd` points to a character device that only supports blocking reads - * (such as keyboard or sound card), read operations do not finish until data is - * available. This can prevent the process from exiting and the stream from - * closing naturally. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed, like most `Readable` streams. Set the `emitClose` option to`false` to change this behavior. - * - * By providing the `fs` option, it is possible to override the corresponding `fs`implementations for `open`, `read`, and `close`. When providing the `fs` option, - * overrides for `open`, `read`, and `close` are required. - * - * ```js - * import { createReadStream } from 'fs'; - * - * // Create a stream from some character device. - * const stream = createReadStream('/dev/input/event0'); - * setTimeout(() => { - * stream.close(); // This may not close the stream. - * // Artificially marking end-of-stream, as if the underlying resource had - * // indicated end-of-file by itself, allows the stream to close. - * // This does not cancel pending read operations, and if there is such an - * // operation, the process may still not be able to exit successfully - * // until it finishes. - * stream.push(null); - * stream.read(0); - * }, 100); - * ``` - * - * If `autoClose` is false, then the file descriptor won't be closed, even if - * there's an error. It is the application's responsibility to close it and make - * sure there's no file descriptor leak. If `autoClose` is set to true (default - * behavior), on `'error'` or `'end'` the file descriptor will be closed - * automatically. - * - * `mode` sets the file mode (permission and sticky bits), but only if the - * file was created. - * - * An example to read the last 10 bytes of a file which is 100 bytes long: - * - * ```js - * import { createReadStream } from 'fs'; - * - * createReadStream('sample.txt', { start: 90, end: 99 }); - * ``` - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - * @return See `Readable Stream`. - */ - export function createReadStream(path: PathLike, options?: BufferEncoding | ReadStreamOptions): ReadStream; - /** - * `options` may also include a `start` option to allow writing data at some - * position past the beginning of the file, allowed values are in the - * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than replacing - * it may require the `flags` option to be set to `r+` rather than the default `w`. - * The `encoding` can be any one of those accepted by `Buffer`. - * - * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false, - * then the file descriptor won't be closed, even if there's an error. - * It is the application's responsibility to close it and make sure there's no - * file descriptor leak. - * - * By default, the stream will emit a `'close'` event after it has been - * destroyed, like most `Writable` streams. Set the `emitClose` option to`false` to change this behavior. - * - * By providing the `fs` option it is possible to override the corresponding `fs`implementations for `open`, `write`, `writev` and `close`. Overriding `write()`without `writev()` can reduce - * performance as some optimizations (`_writev()`) - * will be disabled. When providing the `fs` option, overrides for `open`,`close`, and at least one of `write` and `writev` are required. - * - * Like `fs.ReadStream`, if `fd` is specified, `fs.WriteStream` will ignore the`path` argument and will use the specified file descriptor. This means that no`'open'` event will be - * emitted. `fd` should be blocking; non-blocking `fd`s - * should be passed to `net.Socket`. - * - * If `options` is a string, then it specifies the encoding. - * @since v0.1.31 - * @return See `Writable Stream`. - */ - export function createWriteStream(path: PathLike, options?: BufferEncoding | StreamOptions): WriteStream; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. No arguments other - * than a possible - * exception are given to the completion callback. - * @since v0.1.96 - */ - export function fdatasync(fd: number, callback: NoParamCallback): void; - export 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; - } - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. Returns `undefined`. - * @since v0.1.96 - */ - export 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. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFile, constants } from 'fs'; - * - * function callback(err) { - * if (err) throw err; - * console.log('source.txt was copied to destination.txt'); - * } - * - * // destination.txt will be created or overwritten by default. - * copyFile('source.txt', 'destination.txt', callback); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void; - export function copyFile(src: PathLike, dest: PathLike, mode: number, callback: NoParamCallback): void; - export namespace copyFile { - function __promisify__(src: PathLike, dst: PathLike, mode?: number): Promise; - } - /** - * Synchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. Returns `undefined`. 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. - * - * `mode` is an optional integer that specifies the behavior - * of the copy operation. It is possible to create a mask consisting of the bitwise - * OR of two or more values (e.g.`fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`). - * - * * `fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already - * exists. - * * `fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a - * copy-on-write reflink. If the platform does not support copy-on-write, then a - * fallback copy mechanism is used. - * * `fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to - * create a copy-on-write reflink. If the platform does not support - * copy-on-write, then the operation will fail. - * - * ```js - * import { copyFileSync, constants } from 'fs'; - * - * // destination.txt will be created or overwritten by default. - * copyFileSync('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * copyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * ``` - * @since v8.5.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] modifiers for copy operation. - */ - export function copyFileSync(src: PathLike, dest: PathLike, mode?: number): void; - /** - * Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`. - * - * `position` is the offset from the beginning of the file where this data - * should be written. If `typeof position !== 'number'`, the data will be written - * at the current position. - * - * The callback will be given three arguments: `err`, `bytesWritten`, and`buffers`. `bytesWritten` is how many bytes were written from `buffers`. - * - * If this method is `util.promisify()` ed, it returns a promise for an`Object` with `bytesWritten` and `buffers` properties. - * - * It is unsafe to use `fs.writev()` multiple times on the same file without - * waiting for the callback. For this scenario, use {@link createWriteStream}. - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - */ - export function writev(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function writev( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface WriteVResult { - bytesWritten: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace writev { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link writev}. - * @since v12.9.0 - * @return The number of bytes written. - */ - export function writevSync(fd: number, buffers: ReadonlyArray, position?: number): number; - /** - * Read from a file specified by `fd` and write to an array of `ArrayBufferView`s - * using `readv()`. - * - * `position` is the offset from the beginning of the file from where data - * should be read. If `typeof position !== 'number'`, the data will be read - * from the current position. - * - * The callback will be given three arguments: `err`, `bytesRead`, and`buffers`. `bytesRead` is how many bytes were read from the file. - * - * If this method is invoked as its `util.promisify()` ed version, it returns - * a promise for an `Object` with `bytesRead` and `buffers` properties. - * @since v13.13.0, v12.17.0 - */ - export function readv(fd: number, buffers: ReadonlyArray, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void): void; - export function readv( - fd: number, - buffers: ReadonlyArray, - position: number, - cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void - ): void; - export interface ReadVResult { - bytesRead: number; - buffers: NodeJS.ArrayBufferView[]; - } - export namespace readv { - function __promisify__(fd: number, buffers: ReadonlyArray, position?: number): Promise; - } - /** - * For detailed information, see the documentation of the asynchronous version of - * this API: {@link readv}. - * @since v13.13.0, v12.17.0 - * @return The number of bytes read. - */ - export function readvSync(fd: number, buffers: ReadonlyArray, position?: number): number; - export interface OpenDirOptions { - encoding?: BufferEncoding | undefined; - /** - * Number of directory entries that are buffered - * internally when reading from the directory. Higher values lead to better - * performance but higher memory usage. - * @default 32 - */ - bufferSize?: number | undefined; - } - /** - * Synchronously open a directory. See [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html). - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendirSync(path: string, options?: OpenDirOptions): Dir; - /** - * Asynchronously open a directory. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for - * more details. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * @since v12.12.0 - */ - export function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export function opendir(path: string, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void; - export namespace opendir { - function __promisify__(path: string, options?: OpenDirOptions): Promise; - } - export interface BigIntStats extends StatsBase { - atimeNs: bigint; - mtimeNs: bigint; - ctimeNs: bigint; - birthtimeNs: bigint; - } - export interface BigIntOptions { - bigint: true; - } - export interface StatOptions { - bigint?: boolean | undefined; - throwIfNoEntry?: boolean | undefined; - } - export interface CopyOptions { - /** - * Dereference symlinks - * @default false - */ - dereference?: boolean; - /** - * When `force` is `false`, and the destination - * exists, throw an error. - * @default false - */ - errorOnExist?: boolean; - /** - * Function to filter copied files/directories. Return - * `true` to copy the item, `false` to ignore it. - */ - filter?(source: string, destination: string): boolean; - /** - * Overwrite existing file or directory. _The copy - * operation will ignore errors if you set this to false and the destination - * exists. Use the `errorOnExist` option to change this behavior. - * @default true - */ - force?: boolean; - /** - * When `true` timestamps from `src` will - * be preserved. - * @default false - */ - preserveTimestamps?: boolean; - /** - * Copy directories recursively. - * @default false - */ - recursive?: boolean; - } - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cp(source: string, destination: string, callback: (err: NodeJS.ErrnoException | null) => void): void; - export function cp(source: string, destination: string, opts: CopyOptions, callback: (err: NodeJS.ErrnoException | null) => void): void; - /** - * Synchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - */ - export function cpSync(source: string, destination: string, opts?: CopyOptions): void; -} -declare module 'node:fs' { - export * from 'fs'; -} diff --git a/JS/node_modules/@types/node/fs/promises.d.ts b/JS/node_modules/@types/node/fs/promises.d.ts deleted file mode 100755 index ea65b7d..0000000 --- a/JS/node_modules/@types/node/fs/promises.d.ts +++ /dev/null @@ -1,997 +0,0 @@ -/** - * The `fs/promises` API provides asynchronous file system methods that return - * promises. - * - * The promise APIs use the underlying Node.js threadpool to perform file - * system operations off the event loop thread. These operations are not - * synchronized or threadsafe. Care must be taken when performing multiple - * concurrent modifications on the same file or data corruption may occur. - * @since v10.0.0 - */ -declare module 'fs/promises' { - import { Abortable } from 'node:events'; - import { Stream } from 'node:stream'; - import { - Stats, - BigIntStats, - StatOptions, - WriteVResult, - ReadVResult, - PathLike, - RmDirOptions, - RmOptions, - MakeDirectoryOptions, - Dirent, - OpenDirOptions, - Dir, - ObjectEncodingOptions, - BufferEncodingOption, - OpenMode, - Mode, - WatchOptions, - WatchEventType, - CopyOptions, - } from 'node:fs'; - interface FileChangeInfo { - eventType: WatchEventType; - filename: T; - } - interface FlagAndOpenMode { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } - interface FileReadResult { - bytesRead: number; - buffer: T; - } - interface FileReadOptions { - /** - * @default `Buffer.alloc(0xffff)` - */ - buffer?: T; - /** - * @default 0 - */ - offset?: number | null; - /** - * @default `buffer.byteLength` - */ - length?: number | null; - position?: number | null; - } - // TODO: Add `EventEmitter` close - interface FileHandle { - /** - * The numeric file descriptor managed by the {FileHandle} object. - * @since v10.0.0 - */ - readonly fd: number; - /** - * Alias of `filehandle.writeFile()`. - * - * When operating on file handles, the mode cannot be changed from what it was set - * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - appendFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html). - * @since v10.0.0 - * @param uid The file's new owner's user id. - * @param gid The file's new group's group id. - * @return Fulfills with `undefined` upon success. - */ - chown(uid: number, gid: number): Promise; - /** - * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html). - * @since v10.0.0 - * @param mode the file mode bit mask. - * @return Fulfills with `undefined` upon success. - */ - chmod(mode: Mode): Promise; - /** - * Forces all currently queued I/O operations associated with the file to the - * operating system's synchronized I/O completion state. Refer to the POSIX[`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details. - * - * Unlike `filehandle.sync` this method does not flush modified metadata. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - datasync(): Promise; - /** - * Request that all data for the open file descriptor is flushed to the storage - * device. The specific implementation is operating system and device specific. - * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fufills with `undefined` upon success. - */ - sync(): Promise; - /** - * Reads data from the file and stores that in the given buffer. - * - * If the file is not modified concurrently, the end-of-file is reached when the - * number of bytes read is zero. - * @since v10.0.0 - * @param buffer A buffer that will be filled with the file data read. - * @param [offset=0] The location in the buffer at which to start filling. - * @param [length=buffer.byteLength] The number of bytes to read. - * @param position The location where to begin reading data from the file. If `null`, data will be read from the current file position, and the position will be updated. If `position` is an - * integer, the current file position will remain unchanged. - * @return Fulfills upon success with an object with two properties: - */ - read(buffer: T, offset?: number | null, length?: number | null, position?: number | null): Promise>; - read(options?: FileReadOptions): Promise>; - /** - * Asynchronously reads the entire contents of a file. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support reading. - * - * If one or more `filehandle.read()` calls are made on a file handle and then a`filehandle.readFile()` call is made, the data will be read from the current - * position till the end of the file. It doesn't always read from the beginning - * of the file. - * @since v10.0.0 - * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the - * data will be a string. - */ - readFile( - options?: { - encoding?: null | undefined; - flag?: OpenMode | undefined; - } | 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?: OpenMode | undefined; - } - | 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?: - | (ObjectEncodingOptions & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * @since v10.0.0 - * @return Fulfills with an {fs.Stats} for the file. - */ - stat( - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - stat( - opts: StatOptions & { - bigint: true; - } - ): Promise; - stat(opts?: StatOptions): Promise; - /** - * Truncates the file. - * - * If the file was larger than `len` bytes, only the first `len` bytes will be - * retained in the file. - * - * The following example retains only the first four bytes of the file: - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle = null; - * try { - * filehandle = await open('temp.txt', 'r+'); - * await filehandle.truncate(4); - * } finally { - * await filehandle?.close(); - * } - * ``` - * - * If the file previously was shorter than `len` bytes, it is extended, and the - * extended part is filled with null bytes (`'\0'`): - * - * If `len` is negative then `0` will be used. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - truncate(len?: number): Promise; - /** - * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success. - * @since v10.0.0 - */ - utimes(atime: string | number | Date, mtime: string | number | Date): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, or an object with an own `toString` function - * property. The promise is resolved with no arguments upon success. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `FileHandle` has to support writing. - * - * It is unsafe to use `filehandle.writeFile()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). - * - * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the - * current position till the end of the file. It doesn't always write from the - * beginning of the file. - * @since v10.0.0 - */ - writeFile(data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode & Abortable) | BufferEncoding | null): Promise; - /** - * Write `buffer` to the file. - * - * If `buffer` is a plain object, it must have an own (not inherited) `toString`function property. - * - * The promise is resolved with an object containing two properties: - * - * It is unsafe to use `filehandle.write()` multiple times on the same file - * without waiting for the promise to be resolved (or rejected). For this - * scenario, use `fs.createWriteStream()`. - * - * On Linux, positional writes do not work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v10.0.0 - * @param [offset=0] The start position from within `buffer` where the data to write begins. - * @param [length=buffer.byteLength] The number of bytes from `buffer` to write. - * @param position The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. - * See the POSIX pwrite(2) documentation for more detail. - */ - write( - buffer: TBuffer, - offset?: number | null, - length?: number | null, - position?: number | null - ): Promise<{ - bytesWritten: number; - buffer: TBuffer; - }>; - write( - data: string, - position?: number | null, - encoding?: BufferEncoding | null - ): Promise<{ - bytesWritten: number; - buffer: string; - }>; - /** - * Write an array of [<ArrayBufferView>](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView)s to the file. - * - * The promise is resolved with an object containing a two properties: - * - * It is unsafe to call `writev()` multiple times on the same file without waiting - * for the promise to be resolved (or rejected). - * - * On Linux, positional writes don't work when the file is opened in append mode. - * The kernel ignores the position argument and always appends the data to - * the end of the file. - * @since v12.9.0 - * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current - * position. - */ - writev(buffers: ReadonlyArray, position?: number): Promise; - /** - * Read from a file and write to an array of [<ArrayBufferView>](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView)s - * @since v13.13.0, v12.17.0 - * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. - * @return Fulfills upon success an object containing two properties: - */ - readv(buffers: ReadonlyArray, position?: number): Promise; - /** - * Closes the file handle after waiting for any pending operation on the handle to - * complete. - * - * ```js - * import { open } from 'fs/promises'; - * - * let filehandle; - * try { - * filehandle = await open('thefile.txt', 'r'); - * } finally { - * await filehandle?.close(); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - close(): Promise; - } - /** - * Tests a user's permissions for the file or directory specified by `path`. - * The `mode` argument is an optional integer that specifies the accessibility - * checks to be performed. Check `File access constants` for possible values - * of `mode`. It is possible to create a mask consisting of the bitwise OR of - * two or more values (e.g. `fs.constants.W_OK | fs.constants.R_OK`). - * - * If the accessibility check is successful, the promise is resolved with no - * value. If any of the accessibility checks fail, the promise is rejected - * with an [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object. The following example checks if the file`/etc/passwd` can be read and - * written by the current process. - * - * ```js - * import { access } from 'fs/promises'; - * import { constants } from 'fs'; - * - * try { - * await access('/etc/passwd', constants.R_OK | constants.W_OK); - * console.log('can access'); - * } catch { - * console.error('cannot access'); - * } - * ``` - * - * Using `fsPromises.access()` to check for the accessibility of a file before - * calling `fsPromises.open()` is not recommended. Doing so introduces a race - * condition, since other processes may change the file's state between the two - * calls. Instead, user code should open/read/write the file directly and handle - * the error raised if the file is not accessible. - * @since v10.0.0 - * @param [mode=fs.constants.F_OK] - * @return Fulfills with `undefined` upon success. - */ - function access(path: PathLike, mode?: number): Promise; - /** - * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it - * already exists. - * - * No guarantees are made about the atomicity of the copy operation. If an - * error occurs after the destination file has been opened for writing, an attempt - * will be made to remove the destination. - * - * ```js - * import { constants } from 'fs'; - * import { copyFile } from 'fs/promises'; - * - * try { - * await copyFile('source.txt', 'destination.txt'); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * - * // By using COPYFILE_EXCL, the operation will fail if destination.txt exists. - * try { - * await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL); - * console.log('source.txt was copied to destination.txt'); - * } catch { - * console.log('The file could not be copied'); - * } - * ``` - * @since v10.0.0 - * @param src source filename to copy - * @param dest destination filename of the copy operation - * @param [mode=0] Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. - * `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) - * @return Fulfills with `undefined` upon success. - */ - function copyFile(src: PathLike, dest: PathLike, mode?: number): Promise; - /** - * Opens a `FileHandle`. - * - * Refer to the POSIX [`open(2)`](http://man7.org/linux/man-pages/man2/open.2.html) documentation for more detail. - * - * Some characters (`< > : " / \ | ? *`) are reserved under Windows as documented - * by [Naming Files, Paths, and Namespaces](https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file). Under NTFS, if the filename contains - * a colon, Node.js will open a file system stream, as described by[this MSDN page](https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams). - * @since v10.0.0 - * @param [flags='r'] See `support of file system `flags``. - * @param [mode=0o666] Sets the file mode (permission and sticky bits) if the file is created. - * @return Fulfills with a {FileHandle} object. - */ - function open(path: PathLike, flags: string | number, mode?: Mode): Promise; - /** - * Renames `oldPath` to `newPath`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rename(oldPath: PathLike, newPath: PathLike): Promise; - /** - * Truncates (shortens or extends the length) of the content at `path` to `len`bytes. - * @since v10.0.0 - * @param [len=0] - * @return Fulfills with `undefined` upon success. - */ - function truncate(path: PathLike, len?: number): Promise; - /** - * Removes the directory identified by `path`. - * - * Using `fsPromises.rmdir()` on a file (not a directory) results in the - * promise being rejected with an `ENOENT` error on Windows and an `ENOTDIR`error on POSIX. - * - * To get a behavior similar to the `rm -rf` Unix command, use `fsPromises.rm()` with options `{ recursive: true, force: true }`. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function rmdir(path: PathLike, options?: RmDirOptions): Promise; - /** - * Removes files and directories (modeled on the standard POSIX `rm` utility). - * @since v14.14.0 - * @return Fulfills with `undefined` upon success. - */ - function rm(path: PathLike, options?: RmOptions): Promise; - /** - * Asynchronously creates a directory. - * - * The optional `options` argument can be an integer specifying `mode` (permission - * and sticky bits), or an object with a `mode` property and a `recursive`property indicating whether parent directories should be created. Calling`fsPromises.mkdir()` when `path` is a directory - * that exists results in a - * rejection only when `recursive` is false. - * @since v10.0.0 - * @return Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`. - */ - function mkdir( - path: PathLike, - options: MakeDirectoryOptions & { - recursive: true; - } - ): 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?: - | Mode - | (MakeDirectoryOptions & { - recursive?: false | undefined; - }) - | null - ): 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?: Mode | MakeDirectoryOptions | null): Promise; - /** - * Reads the contents of a directory. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the filenames. If the `encoding` is set to `'buffer'`, the filenames returned - * will be passed as `Buffer` objects. - * - * If `options.withFileTypes` is set to `true`, the resolved array will contain `fs.Dirent` objects. - * - * ```js - * import { readdir } from 'fs/promises'; - * - * try { - * const files = await readdir(path); - * for (const file of files) - * console.log(file); - * } catch (err) { - * console.error(err); - * } - * ``` - * @since v10.0.0 - * @return Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`. - */ - function readdir( - path: PathLike, - options?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | 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 | undefined; - } - | '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?: - | (ObjectEncodingOptions & { - withFileTypes?: false | undefined; - }) - | 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 If called with `withFileTypes: true` the result data will be an array of Dirent. - */ - function readdir( - path: PathLike, - options: ObjectEncodingOptions & { - withFileTypes: true; - } - ): Promise; - /** - * Reads the contents of the symbolic link referred to by `path`. See the POSIX[`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is - * resolved with the`linkString` upon success. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the link path returned. If the `encoding` is set to `'buffer'`, the link path - * returned will be passed as a `Buffer` object. - * @since v10.0.0 - * @return Fulfills with the `linkString` upon success. - */ - function readlink(path: PathLike, options?: ObjectEncodingOptions | 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: BufferEncodingOption): 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?: ObjectEncodingOptions | string | null): Promise; - /** - * Creates a symbolic link. - * - * The `type` argument is only used on Windows platforms and can be one of `'dir'`,`'file'`, or `'junction'`. Windows junction points require the destination path - * to be absolute. When using `'junction'`, the `target` argument will - * automatically be normalized to absolute path. - * @since v10.0.0 - * @param [type='file'] - * @return Fulfills with `undefined` upon success. - */ - function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; - /** - * Equivalent to `fsPromises.stat()` unless `path` refers to a symbolic link, - * in which case the link itself is stat-ed, not the file that it refers to. - * Refer to the POSIX [`lstat(2)`](http://man7.org/linux/man-pages/man2/lstat.2.html) document for more detail. - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given symbolic link `path`. - */ - function lstat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function lstat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function lstat(path: PathLike, opts?: StatOptions): Promise; - /** - * @since v10.0.0 - * @return Fulfills with the {fs.Stats} object for the given `path`. - */ - function stat( - path: PathLike, - opts?: StatOptions & { - bigint?: false | undefined; - } - ): Promise; - function stat( - path: PathLike, - opts: StatOptions & { - bigint: true; - } - ): Promise; - function stat(path: PathLike, opts?: StatOptions): Promise; - /** - * Creates a new link from the `existingPath` to the `newPath`. See the POSIX[`link(2)`](http://man7.org/linux/man-pages/man2/link.2.html) documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function link(existingPath: PathLike, newPath: PathLike): Promise; - /** - * If `path` refers to a symbolic link, then the link is removed without affecting - * the file or directory to which that link refers. If the `path` refers to a file - * path that is not a symbolic link, the file is deleted. See the POSIX [`unlink(2)`](http://man7.org/linux/man-pages/man2/unlink.2.html)documentation for more detail. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function unlink(path: PathLike): Promise; - /** - * Changes the permissions of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the permissions on a symbolic link. - * - * This method is only implemented on macOS. - * @deprecated Since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchmod(path: PathLike, mode: Mode): Promise; - /** - * Changes the ownership on a symbolic link. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function lchown(path: PathLike, uid: number, gid: number): Promise; - /** - * Changes the access and modification times of a file in the same way as `fsPromises.utimes()`, with the difference that if the path refers to a - * symbolic link, then the link is not dereferenced: instead, the timestamps of - * the symbolic link itself are changed. - * @since v14.5.0, v12.19.0 - * @return Fulfills with `undefined` upon success. - */ - function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; - /** - * Changes the ownership of a file. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function chown(path: PathLike, uid: number, gid: number): Promise; - /** - * Change the file system timestamps of the object referenced by `path`. - * - * The `atime` and `mtime` arguments follow these rules: - * - * * Values can be either numbers representing Unix epoch time, `Date`s, or a - * numeric string like `'123456789.0'`. - * * If the value can not be converted to a number, or is `NaN`, `Infinity` or`-Infinity`, an `Error` will be thrown. - * @since v10.0.0 - * @return Fulfills with `undefined` upon success. - */ - function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; - /** - * Determines the actual location of `path` using the same semantics as the`fs.realpath.native()` function. - * - * Only paths that can be converted to UTF8 strings are supported. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use for - * the path. If the `encoding` is set to `'buffer'`, the path returned will be - * passed as a `Buffer` object. - * - * On Linux, when Node.js is linked against musl libc, the procfs file system must - * be mounted on `/proc` in order for this function to work. Glibc does not have - * this restriction. - * @since v10.0.0 - * @return Fulfills with the resolved path upon success. - */ - function realpath(path: PathLike, options?: ObjectEncodingOptions | 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: BufferEncodingOption): 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?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Creates a unique temporary directory. A unique directory name is generated by - * appending six random characters to the end of the provided `prefix`. Due to - * platform inconsistencies, avoid trailing `X` characters in `prefix`. Some - * platforms, notably the BSDs, can return more than six random characters, and - * replace trailing `X` characters in `prefix` with random characters. - * - * The optional `options` argument can be a string specifying an encoding, or an - * object with an `encoding` property specifying the character encoding to use. - * - * ```js - * import { mkdtemp } from 'fs/promises'; - * - * try { - * await mkdtemp(path.join(os.tmpdir(), 'foo-')); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * The `fsPromises.mkdtemp()` method will append the six randomly selected - * characters directly to the `prefix` string. For instance, given a directory`/tmp`, if the intention is to create a temporary directory _within_`/tmp`, the`prefix` must end with a trailing - * platform-specific path separator - * (`require('path').sep`). - * @since v10.0.0 - * @return Fulfills with a string containing the filesystem path of the newly created temporary directory. - */ - function mkdtemp(prefix: string, options?: ObjectEncodingOptions | 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: BufferEncodingOption): 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?: ObjectEncodingOptions | BufferEncoding | null): Promise; - /** - * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a `Buffer`, or, an object with an own (not inherited)`toString` function property. - * - * The `encoding` option is ignored if `data` is a buffer. - * - * If `options` is a string, then it specifies the encoding. - * - * Any specified `FileHandle` has to support writing. - * - * It is unsafe to use `fsPromises.writeFile()` multiple times on the same file - * without waiting for the promise to be settled. - * - * Similarly to `fsPromises.readFile` \- `fsPromises.writeFile` is a convenience - * method that performs multiple `write` calls internally to write the buffer - * passed to it. For performance sensitive code consider using `fs.createWriteStream()`. - * - * It is possible to use an `AbortSignal` to cancel an `fsPromises.writeFile()`. - * Cancelation is "best effort", and some amount of data is likely still - * to be written. - * - * ```js - * import { writeFile } from 'fs/promises'; - * import { Buffer } from 'buffer'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const data = new Uint8Array(Buffer.from('Hello Node.js')); - * const promise = writeFile('message.txt', data, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.writeFile` performs. - * @since v10.0.0 - * @param file filename or `FileHandle` - * @return Fulfills with `undefined` upon success. - */ - function writeFile( - file: PathLike | FileHandle, - data: string | NodeJS.ArrayBufferView | Iterable | AsyncIterable | Stream, - options?: - | (ObjectEncodingOptions & { - mode?: Mode | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously append data to a file, creating the file if it does not yet - * exist. `data` can be a string or a `Buffer`. - * - * If `options` is a string, then it specifies the `encoding`. - * - * The `path` may be specified as a `FileHandle` that has been opened - * for appending (using `fsPromises.open()`). - * @since v10.0.0 - * @param path filename or {FileHandle} - * @return Fulfills with `undefined` upon success. - */ - function appendFile(path: PathLike | FileHandle, data: string | Uint8Array, options?: (ObjectEncodingOptions & FlagAndOpenMode) | BufferEncoding | null): Promise; - /** - * Asynchronously reads the entire contents of a file. - * - * If no encoding is specified (using `options.encoding`), the data is returned - * as a `Buffer` object. Otherwise, the data will be a string. - * - * If `options` is a string, then it specifies the encoding. - * - * When the `path` is a directory, the behavior of `fsPromises.readFile()` is - * platform-specific. On macOS, Linux, and Windows, the promise will be rejected - * with an error. On FreeBSD, a representation of the directory's contents will be - * returned. - * - * It is possible to abort an ongoing `readFile` using an `AbortSignal`. If a - * request is aborted the promise returned is rejected with an `AbortError`: - * - * ```js - * import { readFile } from 'fs/promises'; - * - * try { - * const controller = new AbortController(); - * const { signal } = controller; - * const promise = readFile(fileName, { signal }); - * - * // Abort the request before the promise settles. - * controller.abort(); - * - * await promise; - * } catch (err) { - * // When a request is aborted - err is an AbortError - * console.error(err); - * } - * ``` - * - * Aborting an ongoing request does not abort individual operating - * system requests but rather the internal buffering `fs.readFile` performs. - * - * Any specified `FileHandle` has to support reading. - * @since v10.0.0 - * @param path filename or `FileHandle` - * @return Fulfills with the contents of the file. - */ - function readFile( - path: PathLike | FileHandle, - options?: - | ({ - encoding?: null | undefined; - flag?: OpenMode | undefined; - } & Abortable) - | 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?: OpenMode | undefined; - } & Abortable) - | 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?: - | (ObjectEncodingOptions & - Abortable & { - flag?: OpenMode | undefined; - }) - | BufferEncoding - | null - ): Promise; - /** - * Asynchronously open a directory for iterative scanning. See the POSIX[`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail. - * - * Creates an `fs.Dir`, which contains all further functions for reading from - * and cleaning up the directory. - * - * The `encoding` option sets the encoding for the `path` while opening the - * directory and subsequent read operations. - * - * Example using async iteration: - * - * ```js - * import { opendir } from 'fs/promises'; - * - * try { - * const dir = await opendir('./'); - * for await (const dirent of dir) - * console.log(dirent.name); - * } catch (err) { - * console.error(err); - * } - * ``` - * - * When using the async iterator, the `fs.Dir` object will be automatically - * closed after the iterator exits. - * @since v12.12.0 - * @return Fulfills with an {fs.Dir}. - */ - function opendir(path: string, options?: OpenDirOptions): Promise; - /** - * Returns an async iterator that watches for changes on `filename`, where `filename`is either a file or a directory. - * - * ```js - * const { watch } = require('fs/promises'); - * - * const ac = new AbortController(); - * const { signal } = ac; - * setTimeout(() => ac.abort(), 10000); - * - * (async () => { - * try { - * const watcher = watch(__filename, { signal }); - * for await (const event of watcher) - * console.log(event); - * } catch (err) { - * if (err.name === 'AbortError') - * return; - * throw err; - * } - * })(); - * ``` - * - * On most platforms, `'rename'` is emitted whenever a filename appears or - * disappears in the directory. - * - * All the `caveats` for `fs.watch()` also apply to `fsPromises.watch()`. - * @since v15.9.0 - * @return of objects with the properties: - */ - function watch( - filename: PathLike, - options: - | (WatchOptions & { - encoding: 'buffer'; - }) - | 'buffer' - ): AsyncIterable>; - /** - * 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. - * @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?: WatchOptions | BufferEncoding): AsyncIterable>; - /** - * 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. - * @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: WatchOptions | string): AsyncIterable> | AsyncIterable>; - /** - * Asynchronously copies the entire directory structure from `src` to `dest`, - * including subdirectories and files. - * - * When copying a directory to another directory, globs are not supported and - * behavior is similar to `cp dir1/ dir2/`. - * @since v16.7.0 - * @experimental - * @param src source path to copy. - * @param dest destination path to copy to. - * @return Fulfills with `undefined` upon success. - */ - function cp(source: string, destination: string, opts?: CopyOptions): Promise; -} -declare module 'node:fs/promises' { - export * from 'fs/promises'; -} diff --git a/JS/node_modules/@types/node/globals.d.ts b/JS/node_modules/@types/node/globals.d.ts deleted file mode 100755 index ae974db..0000000 --- a/JS/node_modules/@types/node/globals.d.ts +++ /dev/null @@ -1,284 +0,0 @@ -// 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://v8.dev/docs/stack-trace-api#customizing-stack-traces - */ - prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; - - stackTraceLimit: number; -} - -/*-----------------------------------------------* - * * - * GLOBAL * - * * - ------------------------------------------------*/ - -// For backwards compability -interface NodeRequire extends NodeJS.Require { } -interface RequireResolve extends NodeJS.RequireResolve { } -interface NodeModule extends NodeJS.Module { } - -declare var process: NodeJS.Process; -declare var console: Console; - -declare var __filename: string; -declare var __dirname: string; - -declare var require: NodeRequire; -declare var module: NodeModule; - -// Same as module.exports -declare var exports: any; - -/** - * Only available if `--expose-gc` is passed to the process. - */ -declare var gc: undefined | (() => void); - -//#region borrowed -// from https://github.com/microsoft/TypeScript/blob/38da7c600c83e7b31193a62495239a0fe478cb67/lib/lib.webworker.d.ts#L633 until moved to separate lib -/** A controller object that allows you to abort one or more DOM requests as and when desired. */ -interface AbortController { - /** - * Returns the AbortSignal object associated with this object. - */ - - readonly signal: AbortSignal; - /** - * Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. - */ - abort(): void; -} - -/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ -interface AbortSignal { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. - */ - readonly aborted: boolean; -} - -declare var AbortController: { - prototype: AbortController; - new(): AbortController; -}; - -declare var AbortSignal: { - prototype: AbortSignal; - new(): AbortSignal; - // TODO: Add abort() static -}; -//#endregion borrowed - -//#region ArrayLike.at() -interface RelativeIndexable { - /** - * Takes an integer value and returns the item at that index, - * allowing for positive and negative integers. - * Negative integers count back from the last item in the array. - */ - at(index: number): T | undefined; -} -interface String extends RelativeIndexable {} -interface Array extends RelativeIndexable {} -interface Int8Array extends RelativeIndexable {} -interface Uint8Array extends RelativeIndexable {} -interface Uint8ClampedArray extends RelativeIndexable {} -interface Int16Array extends RelativeIndexable {} -interface Uint16Array extends RelativeIndexable {} -interface Int32Array extends RelativeIndexable {} -interface Uint32Array extends RelativeIndexable {} -interface Float32Array extends RelativeIndexable {} -interface Float64Array extends RelativeIndexable {} -interface BigInt64Array extends RelativeIndexable {} -interface BigUint64Array extends RelativeIndexable {} -//#endregion ArrayLike.at() end - -/*----------------------------------------------* -* * -* GLOBAL INTERFACES * -* * -*-----------------------------------------------*/ -declare namespace NodeJS { - interface CallSite { - /** - * Value of "this" - */ - getThis(): unknown; - - /** - * 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 | undefined; - code?: string | undefined; - path?: string | undefined; - syscall?: string | undefined; - } - - interface ReadableStream extends EventEmitter { - readable: boolean; - read(size?: number): string | Buffer; - setEncoding(encoding: BufferEncoding): this; - pause(): this; - resume(): this; - isPaused(): boolean; - pipe(destination: T, options?: { end?: boolean | undefined; }): 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?: BufferEncoding, cb?: (err?: Error | null) => void): boolean; - end(cb?: () => void): void; - end(data: string | Uint8Array, cb?: () => void): void; - end(str: string, encoding?: BufferEncoding, cb?: () => void): void; - } - - interface ReadWriteStream extends ReadableStream, WritableStream { } - - interface RefCounted { - ref(): this; - unref(): this; - } - - type TypedArray = - | Uint8Array - | Uint8ClampedArray - | Uint16Array - | Uint32Array - | Int8Array - | Int16Array - | Int32Array - | BigUint64Array - | BigInt64Array - | Float32Array - | Float64Array; - type ArrayBufferView = TypedArray | DataView; - - interface Require { - (id: string): any; - resolve: RequireResolve; - cache: Dict; - /** - * @deprecated - */ - extensions: RequireExtensions; - main: Module | undefined; - } - - interface RequireResolve { - (id: string, options?: { paths?: string[] | undefined; }): string; - paths(request: string): string[] | null; - } - - interface RequireExtensions extends Dict<(m: Module, filename: string) => any> { - '.js': (m: Module, filename: string) => any; - '.json': (m: Module, filename: string) => any; - '.node': (m: Module, filename: string) => any; - } - interface Module { - /** - * `true` if the module is running during the Node.js preload - */ - isPreloading: boolean; - exports: any; - require: Require; - id: string; - filename: string; - loaded: boolean; - /** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */ - parent: Module | null | undefined; - children: Module[]; - /** - * @since 11.14.0 - * - * The directory name of the module. This is usually the same as the path.dirname() of the module.id. - */ - path: string; - paths: string[]; - } - - interface Dict { - [key: string]: T | undefined; - } - - interface ReadOnlyDict { - readonly [key: string]: T | undefined; - } -} diff --git a/JS/node_modules/@types/node/globals.global.d.ts b/JS/node_modules/@types/node/globals.global.d.ts deleted file mode 100755 index ef1198c..0000000 --- a/JS/node_modules/@types/node/globals.global.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare var global: typeof globalThis; diff --git a/JS/node_modules/@types/node/http.d.ts b/JS/node_modules/@types/node/http.d.ts deleted file mode 100755 index 4f01253..0000000 --- a/JS/node_modules/@types/node/http.d.ts +++ /dev/null @@ -1,1358 +0,0 @@ -/** - * To use the HTTP server and client one must `require('http')`. - * - * The HTTP interfaces in Node.js are designed to support many features - * of the protocol which have been traditionally difficult to use. - * In particular, large, possibly chunk-encoded, messages. The interface is - * careful to never buffer entire requests or responses, so the - * user is able to stream data. - * - * HTTP message headers are represented by an object like this: - * - * ```js - * { 'content-length': '123', - * 'content-type': 'text/plain', - * 'connection': 'keep-alive', - * 'host': 'mysite.com', - * 'accept': '*' } - * ``` - * - * Keys are lowercased. Values are not modified. - * - * In order to support the full spectrum of possible HTTP applications, the Node.js - * HTTP API is very low-level. It deals with stream handling and message - * parsing only. It parses a message into headers and body but it does not - * parse the actual headers or the body. - * - * See `message.headers` for details on how duplicate headers are handled. - * - * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For - * example, the previous message header object might have a `rawHeaders`list like the following: - * - * ```js - * [ 'ConTent-Length', '123456', - * 'content-LENGTH', '123', - * 'content-type', 'text/plain', - * 'CONNECTION', 'keep-alive', - * 'Host', 'mysite.com', - * 'accepT', '*' ] - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/http.js) - */ -declare module 'http' { - import * as stream from 'node:stream'; - import { URL } from 'node:url'; - import { Socket, Server as NetServer } from 'node:net'; - // incoming headers will never contain number - interface IncomingHttpHeaders extends NodeJS.Dict { - accept?: string | undefined; - 'accept-language'?: string | undefined; - 'accept-patch'?: string | undefined; - 'accept-ranges'?: string | undefined; - 'access-control-allow-credentials'?: string | undefined; - 'access-control-allow-headers'?: string | undefined; - 'access-control-allow-methods'?: string | undefined; - 'access-control-allow-origin'?: string | undefined; - 'access-control-expose-headers'?: string | undefined; - 'access-control-max-age'?: string | undefined; - 'access-control-request-headers'?: string | undefined; - 'access-control-request-method'?: string | undefined; - age?: string | undefined; - allow?: string | undefined; - 'alt-svc'?: string | undefined; - authorization?: string | undefined; - 'cache-control'?: string | undefined; - connection?: string | undefined; - 'content-disposition'?: string | undefined; - 'content-encoding'?: string | undefined; - 'content-language'?: string | undefined; - 'content-length'?: string | undefined; - 'content-location'?: string | undefined; - 'content-range'?: string | undefined; - 'content-type'?: string | undefined; - cookie?: string | undefined; - date?: string | undefined; - etag?: string | undefined; - expect?: string | undefined; - expires?: string | undefined; - forwarded?: string | undefined; - from?: string | undefined; - host?: string | undefined; - 'if-match'?: string | undefined; - 'if-modified-since'?: string | undefined; - 'if-none-match'?: string | undefined; - 'if-unmodified-since'?: string | undefined; - 'last-modified'?: string | undefined; - location?: string | undefined; - origin?: string | undefined; - pragma?: string | undefined; - 'proxy-authenticate'?: string | undefined; - 'proxy-authorization'?: string | undefined; - 'public-key-pins'?: string | undefined; - range?: string | undefined; - referer?: string | undefined; - 'retry-after'?: string | undefined; - 'sec-websocket-accept'?: string | undefined; - 'sec-websocket-extensions'?: string | undefined; - 'sec-websocket-key'?: string | undefined; - 'sec-websocket-protocol'?: string | undefined; - 'sec-websocket-version'?: string | undefined; - 'set-cookie'?: string[] | undefined; - 'strict-transport-security'?: string | undefined; - tk?: string | undefined; - trailer?: string | undefined; - 'transfer-encoding'?: string | undefined; - upgrade?: string | undefined; - 'user-agent'?: string | undefined; - vary?: string | undefined; - via?: string | undefined; - warning?: string | undefined; - 'www-authenticate'?: string | undefined; - } - // outgoing headers allows numbers (as they are converted internally to strings) - type OutgoingHttpHeader = number | string | string[]; - interface OutgoingHttpHeaders extends NodeJS.Dict {} - interface ClientRequestArgs { - abort?: AbortSignal | undefined; - protocol?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - family?: number | undefined; - port?: number | string | null | undefined; - defaultPort?: number | string | undefined; - localAddress?: string | undefined; - socketPath?: string | undefined; - /** - * @default 8192 - */ - maxHeaderSize?: number | undefined; - method?: string | undefined; - path?: string | null | undefined; - headers?: OutgoingHttpHeaders | undefined; - auth?: string | null | undefined; - agent?: Agent | boolean | undefined; - _defaultAgent?: Agent | undefined; - timeout?: number | undefined; - setHost?: boolean | undefined; - // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 - createConnection?: ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) | undefined; - } - interface ServerOptions { - IncomingMessage?: typeof IncomingMessage | undefined; - ServerResponse?: typeof ServerResponse | undefined; - /** - * Optionally overrides the value of - * `--max-http-header-size` for requests received by this server, i.e. - * the maximum length of request headers in bytes. - * @default 8192 - */ - maxHeaderSize?: number | undefined; - /** - * Use an insecure HTTP parser that accepts invalid HTTP headers when true. - * Using the insecure parser should be avoided. - * See --insecure-http-parser for more information. - * @default false - */ - insecureHTTPParser?: boolean | undefined; - } - type RequestListener = (req: IncomingMessage, res: ServerResponse) => void; - /** - * @since v0.1.17 - */ - class Server extends NetServer { - constructor(requestListener?: RequestListener); - constructor(options: ServerOptions, requestListener?: RequestListener); - /** - * Sets the timeout value for sockets, and emits a `'timeout'` event on - * the Server object, passing the socket as an argument, if a timeout - * occurs. - * - * If there is a `'timeout'` event listener on the Server object, then it - * will be called with the timed-out socket as an argument. - * - * By default, the Server does not timeout sockets. However, if a callback - * is assigned to the Server's `'timeout'` event, timeouts must be handled - * explicitly. - * @since v0.9.12 - * @param [msecs=0 (no timeout)] - */ - setTimeout(msecs?: number, callback?: () => void): this; - setTimeout(callback: () => void): this; - /** - * Limits maximum incoming headers count. If set to 0, no limit will be applied. - * @since v0.7.0 - */ - maxHeadersCount: number | null; - /** - * The number of milliseconds of inactivity before a socket is presumed - * to have timed out. - * - * A value of `0` will disable the timeout behavior on incoming connections. - * - * The socket timeout logic is set up on connection, so changing this - * value only affects new connections to the server, not any existing connections. - * @since v0.9.12 - */ - timeout: number; - /** - * Limit the amount of time the parser will wait to receive the complete HTTP - * headers. - * - * In case of inactivity, the rules defined in `server.timeout` apply. However, - * that inactivity based timeout would still allow the connection to be kept open - * if the headers are being sent very slowly (by default, up to a byte per 2 - * minutes). In order to prevent this, whenever header data arrives an additional - * check is made that more than `server.headersTimeout` milliseconds has not - * passed since the connection was established. If the check fails, a `'timeout'`event is emitted on the server object, and (by default) the socket is destroyed. - * See `server.timeout` for more information on how timeout behavior can be - * customized. - * @since v11.3.0, v10.14.0 - */ - headersTimeout: number; - /** - * The number of milliseconds of inactivity a server needs to wait for additional - * incoming data, after it has finished writing the last response, before a socket - * will be destroyed. If the server receives new data before the keep-alive - * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`. - * - * A value of `0` will disable the keep-alive timeout behavior on incoming - * connections. - * A value of `0` makes the http server behave similarly to Node.js versions prior - * to 8.0.0, which did not have a keep-alive timeout. - * - * The socket timeout logic is set up on connection, so changing this value only - * affects new connections to the server, not any existing connections. - * @since v8.0.0 - */ - keepAliveTimeout: number; - /** - * Sets the timeout value in milliseconds for receiving the entire request from - * the client. - * - * If the timeout expires, the server responds with status 408 without - * forwarding the request to the request listener and then closes the connection. - * - * It must be set to a non-zero value (e.g. 120 seconds) to protect against - * potential Denial-of-Service attacks in case the server is deployed without a - * reverse proxy in front. - * @since v14.11.0 - */ - requestTimeout: number; - 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; - addListener(event: 'checkContinue', listener: RequestListener): this; - addListener(event: 'checkExpectation', listener: RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - addListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - addListener(event: 'request', listener: RequestListener): this; - addListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Socket): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'checkContinue', req: IncomingMessage, res: ServerResponse): boolean; - emit(event: 'checkExpectation', req: IncomingMessage, res: ServerResponse): boolean; - emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean; - emit(event: 'connect', req: IncomingMessage, socket: stream.Duplex, head: Buffer): boolean; - emit(event: 'request', req: IncomingMessage, res: ServerResponse): boolean; - emit(event: 'upgrade', req: IncomingMessage, socket: stream.Duplex, head: Buffer): 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; - on(event: 'checkContinue', listener: RequestListener): this; - on(event: 'checkExpectation', listener: RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - on(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - on(event: 'request', listener: RequestListener): this; - on(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => 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; - once(event: 'checkContinue', listener: RequestListener): this; - once(event: 'checkExpectation', listener: RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - once(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - once(event: 'request', listener: RequestListener): this; - once(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => 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; - prependListener(event: 'checkContinue', listener: RequestListener): this; - prependListener(event: 'checkExpectation', listener: RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - prependListener(event: 'request', listener: RequestListener): this; - prependListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => 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; - prependOnceListener(event: 'checkContinue', listener: RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this; - prependOnceListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - prependOnceListener(event: 'request', listener: RequestListener): this; - prependOnceListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this; - } - /** - * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from - * the perspective of the participants of HTTP transaction. - * @since v0.1.17 - */ - class OutgoingMessage extends stream.Writable { - readonly req: IncomingMessage; - chunkedEncoding: boolean; - shouldKeepAlive: boolean; - useChunkedEncodingByDefault: boolean; - sendDate: boolean; - /** - * @deprecated Use `writableEnded` instead. - */ - finished: boolean; - /** - * Read-only. `true` if the headers were sent, otherwise `false`. - * @since v0.9.3 - */ - readonly headersSent: boolean; - /** - * Aliases of `outgoingMessage.socket` - * @since v0.3.0 - * @deprecated Since v15.12.0 - Use `socket` instead. - */ - readonly connection: Socket | null; - /** - * Reference to the underlying socket. Usually, users will not want to access - * this property. - * - * After calling `outgoingMessage.end()`, this property will be nulled. - * @since v0.3.0 - */ - readonly socket: Socket | null; - constructor(); - /** - * occurs, Same as binding to the `timeout` event. - * - * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter. - * @since v0.9.12 - * @param callback Optional function to be called when a timeout - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * Sets a single header value for the header object. - * @since v0.4.0 - * @param name Header name - * @param value Header value - */ - setHeader(name: string, value: number | string | ReadonlyArray): this; - /** - * Gets the value of HTTP header with the given name. If such a name doesn't - * exist in message, it will be `undefined`. - * @since v0.4.0 - * @param name Name of header - */ - getHeader(name: string): number | string | string[] | undefined; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow - * copy is used, array values may be mutated without additional calls to - * various header-related HTTP module methods. The keys of the returned - * object are the header names and the values are the respective header - * values. All header names are lowercase. - * - * The object returned by the `outgoingMessage.getHeaders()` method does - * not prototypically inherit from the JavaScript Object. This means that - * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`, - * and others are not defined and will not work. - * - * ```js - * outgoingMessage.setHeader('Foo', 'bar'); - * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = outgoingMessage.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.0.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns an array of names of headers of the outgoing outgoingMessage. All - * names are lowercase. - * @since v8.0.0 - */ - getHeaderNames(): string[]; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name is case-insensitive. - * - * ```js - * const hasContentType = outgoingMessage.hasHeader('content-type'); - * ``` - * @since v8.0.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that is queued for implicit sending. - * - * ```js - * outgoingMessage.removeHeader('Content-Encoding'); - * ``` - * @since v0.4.0 - */ - removeHeader(name: string): void; - /** - * Adds HTTP trailers (headers but at the end of the message) to the message. - * - * Trailers are **only** be emitted if the message is chunked encoded. If not, - * the trailer will be silently discarded. - * - * HTTP requires the `Trailer` header to be sent to emit trailers, - * with a list of header fields in its value, e.g. - * - * ```js - * message.writeHead(200, { 'Content-Type': 'text/plain', - * 'Trailer': 'Content-MD5' }); - * message.write(fileData); - * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' }); - * message.end(); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.3.0 - */ - addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void; - /** - * Compulsorily flushes the message headers - * - * For efficiency reason, Node.js normally buffers the message headers - * until `outgoingMessage.end()` is called or the first chunk of message data - * is written. It then tries to pack the headers and data into a single TCP - * packet. - * - * It is usually desired (it saves a TCP round-trip), but not when the first - * data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the request. - * @since v1.6.0 - */ - flushHeaders(): void; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v0.1.17 - */ - class ServerResponse extends OutgoingMessage { - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v0.4.0 - */ - statusCode: number; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status message that will be sent to the client when - * the headers get flushed. If this is left as `undefined` then the standard - * message for the status code will be used. - * - * ```js - * response.statusMessage = 'Not found'; - * ``` - * - * After response header was sent to the client, this property indicates the - * status message which was sent out. - * @since v0.11.8 - */ - statusMessage: string; - constructor(req: IncomingMessage); - assignSocket(socket: Socket): void; - detachSocket(socket: Socket): void; - /** - * Sends a HTTP/1.1 100 Continue message to the client, indicating that - * the request body should be sent. See the `'checkContinue'` event on`Server`. - * @since v0.3.0 - */ - writeContinue(callback?: () => void): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * Optionally one can give a human-readable `statusMessage` as the second - * argument. - * - * `headers` may be an `Array` where the keys and values are in the same list. - * It is _not_ a list of tuples. So, the even-numbered offsets are key values, - * and the odd-numbered offsets are the associated values. The array is in the same - * format as `request.rawHeaders`. - * - * Returns a reference to the `ServerResponse`, so that calls can be chained. - * - * ```js - * const body = 'hello world'; - * response - * .writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain' - * }) - * .end(body); - * ``` - * - * This method must only be called once on a message and it must - * be called before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * If this method is called and `response.setHeader()` has not been called, - * it will directly write the supplied header values onto the network channel - * without caching internally, and the `response.getHeader()` on the header - * will not yield the expected result. If progressive population of headers is - * desired with potential future retrieval and modification, use `response.setHeader()` instead. - * - * ```js - * // Returns content-type = text/plain - * const server = http.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain' }); - * res.end('ok'); - * }); - * ``` - * - * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js - * does not check whether `Content-Length` and the length of the body which has - * been transmitted are equal or not. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v0.1.30 - */ - writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this; - /** - * Sends a HTTP/1.1 102 Processing message to the client, indicating that - * the request body should be sent. - * @since v10.0.0 - */ - writeProcessing(): void; - } - interface InformationEvent { - statusCode: number; - statusMessage: string; - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - headers: IncomingHttpHeaders; - rawHeaders: string[]; - } - /** - * This object is created internally and returned from {@link request}. It - * represents an _in-progress_ request whose header has already been queued. The - * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will - * be sent along with the first data chunk or when calling `request.end()`. - * - * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response - * headers have been received. The `'response'` event is executed with one - * argument which is an instance of {@link IncomingMessage}. - * - * During the `'response'` event, one can add listeners to the - * response object; particularly to listen for the `'data'` event. - * - * If no `'response'` handler is added, then the response will be - * entirely discarded. However, if a `'response'` event handler is added, - * then the data from the response object **must** be consumed, either by - * calling `response.read()` whenever there is a `'readable'` event, or - * by adding a `'data'` handler, or by calling the `.resume()` method. - * Until the data is consumed, the `'end'` event will not fire. Also, until - * the data is read it will consume memory that can eventually lead to a - * 'process out of memory' error. - * - * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered. - * - * Node.js does not check whether Content-Length and the length of the - * body which has been transmitted are equal or not. - * @since v0.1.17 - */ - class ClientRequest extends OutgoingMessage { - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v0.11.14 - */ - aborted: boolean; - /** - * The request host. - * @since v14.5.0, v12.19.0 - */ - host: string; - /** - * The request protocol. - * @since v14.5.0, v12.19.0 - */ - protocol: string; - constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); - /** - * The request method. - * @since v0.1.97 - */ - method: string; - /** - * The request path. - * @since v0.4.0 - */ - path: string; - /** - * Marks the request as aborting. Calling this will cause remaining data - * in the response to be dropped and the socket to be destroyed. - * @since v0.3.8 - * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead. - */ - abort(): void; - onSocket(socket: Socket): void; - /** - * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called. - * @since v0.5.9 - * @param timeout Milliseconds before a request times out. - * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called. - * @since v0.5.9 - */ - setNoDelay(noDelay?: boolean): void; - /** - * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called. - * @since v0.5.9 - */ - setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; - /** - * Returns an array containing the unique names of the current outgoing raw - * headers. Header names are returned with their exact casing being set. - * - * ```js - * request.setHeader('Foo', 'bar'); - * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = request.getRawHeaderNames(); - * // headerNames === ['Foo', 'Set-Cookie'] - * ``` - * @since v15.13.0 - */ - getRawHeaderNames(): string[]; - addListener(event: 'abort', listener: () => void): this; - addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - addListener(event: 'continue', listener: () => void): this; - addListener(event: 'information', listener: (info: InformationEvent) => void): this; - addListener(event: 'response', listener: (response: IncomingMessage) => void): this; - addListener(event: 'socket', listener: (socket: Socket) => void): this; - addListener(event: 'timeout', listener: () => void): this; - addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - 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: stream.Readable) => void): this; - addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - addListener(event: string | symbol, listener: (...args: any[]) => void): this; - on(event: 'abort', listener: () => void): this; - on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - on(event: 'continue', listener: () => void): this; - on(event: 'information', listener: (info: InformationEvent) => void): this; - on(event: 'response', listener: (response: IncomingMessage) => void): this; - on(event: 'socket', listener: (socket: Socket) => void): this; - on(event: 'timeout', listener: () => void): this; - on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - 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: stream.Readable) => void): this; - on(event: 'unpipe', listener: (src: stream.Readable) => void): this; - on(event: string | symbol, listener: (...args: any[]) => void): this; - once(event: 'abort', listener: () => void): this; - once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - once(event: 'continue', listener: () => void): this; - once(event: 'information', listener: (info: InformationEvent) => void): this; - once(event: 'response', listener: (response: IncomingMessage) => void): this; - once(event: 'socket', listener: (socket: Socket) => void): this; - once(event: 'timeout', listener: () => void): this; - once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => 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: stream.Readable) => void): this; - once(event: 'unpipe', listener: (src: stream.Readable) => void): this; - once(event: string | symbol, listener: (...args: any[]) => void): this; - prependListener(event: 'abort', listener: () => void): this; - prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependListener(event: 'continue', listener: () => void): this; - prependListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependListener(event: 'socket', listener: (socket: Socket) => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => 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: stream.Readable) => void): this; - prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependListener(event: string | symbol, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'abort', listener: () => void): this; - prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this; - prependOnceListener(event: 'continue', listener: () => void): this; - prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this; - prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this; - prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => 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: stream.Readable) => void): this; - prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this; - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; - } - /** - * An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to - * access response - * status, headers and data. - * - * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to - * parse and emit the incoming HTTP headers and payload, as the underlying socket - * may be reused multiple times in case of keep-alive. - * @since v0.1.17 - */ - class IncomingMessage extends stream.Readable { - constructor(socket: Socket); - /** - * The `message.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - aborted: boolean; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. - * Probably either `'1.1'` or `'1.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v0.1.1 - */ - httpVersion: string; - httpVersionMajor: number; - httpVersionMinor: number; - /** - * The `message.complete` property will be `true` if a complete HTTP message has - * been received and successfully parsed. - * - * This property is particularly useful as a means of determining if a client or - * server fully transmitted a message before a connection was terminated: - * - * ```js - * const req = http.request({ - * host: '127.0.0.1', - * port: 8080, - * method: 'POST' - * }, (res) => { - * res.resume(); - * res.on('end', () => { - * if (!res.complete) - * console.error( - * 'The connection was terminated while the message was still being sent'); - * }); - * }); - * ``` - * @since v0.3.0 - */ - complete: boolean; - /** - * Alias for `message.socket`. - * @since v0.1.90 - * @deprecated Since v16.0.0 - Use `socket`. - */ - connection: Socket; - /** - * The `net.Socket` object associated with the connection. - * - * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the - * client's authentication details. - * - * This property is guaranteed to be an instance of the `net.Socket` class, - * a subclass of `stream.Duplex`, unless the user specified a socket - * type other than `net.Socket`. - * @since v0.3.0 - */ - socket: Socket; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * Duplicates in raw headers are handled in the following ways, depending on the - * header name: - * - * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`, - * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded. - * * `set-cookie` is always an array. Duplicates are added to the array. - * * For duplicate `cookie` headers, the values are joined together with '; '. - * * For all other headers, the values are joined together with ', '. - * @since v0.1.5 - */ - headers: IncomingHttpHeaders; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v0.11.6 - */ - rawHeaders: string[]; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v0.3.0 - */ - trailers: NodeJS.Dict; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v0.11.6 - */ - rawTrailers: string[]; - /** - * Calls `message.socket.setTimeout(msecs, callback)`. - * @since v0.5.9 - */ - setTimeout(msecs: number, callback?: () => void): this; - /** - * **Only valid for request obtained from {@link Server}.** - * - * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`. - * @since v0.1.1 - */ - method?: string | undefined; - /** - * **Only valid for request obtained from {@link Server}.** - * - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. Take the following request: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * To parse the URL into its parts: - * - * ```js - * new URL(request.url, `http://${request.headers.host}`); - * ``` - * - * When `request.url` is `'/status?name=ryan'` and`request.headers.host` is `'localhost:3000'`: - * - * ```console - * $ node - * > new URL(request.url, `http://${request.headers.host}`) - * URL { - * href: 'http://localhost:3000/status?name=ryan', - * origin: 'http://localhost:3000', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'localhost:3000', - * hostname: 'localhost', - * port: '3000', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v0.1.90 - */ - url?: string | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The 3-digit HTTP response status code. E.G. `404`. - * @since v0.1.1 - */ - statusCode?: number | undefined; - /** - * **Only valid for response obtained from {@link ClientRequest}.** - * - * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`. - * @since v0.11.10 - */ - statusMessage?: string | undefined; - /** - * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed - * as an argument to any listeners on the event. - * @since v0.3.0 - */ - 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 | undefined; - /** - * 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 | undefined; - /** - * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity - */ - maxSockets?: number | undefined; - /** - * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity. - */ - maxTotalSockets?: number | undefined; - /** - * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. - */ - maxFreeSockets?: number | undefined; - /** - * Socket timeout in milliseconds. This will set the timeout after the socket is connected. - */ - timeout?: number | undefined; - /** - * Scheduling strategy to apply when picking the next free socket to use. - * @default `lifo` - */ - scheduling?: 'fifo' | 'lifo' | undefined; - } - /** - * An `Agent` is responsible for managing connection persistence - * and reuse for HTTP clients. It maintains a queue of pending requests - * for a given host and port, reusing a single socket connection for each - * until the queue is empty, at which time the socket is either destroyed - * or put into a pool where it is kept to be used again for requests to the - * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`. - * - * Pooled connections have TCP Keep-Alive enabled for them, but servers may - * still close idle connections, in which case they will be removed from the - * pool and a new connection will be made when a new HTTP request is made for - * that host and port. Servers may also refuse to allow multiple requests - * over the same connection, in which case the connection will have to be - * remade for every request and cannot be pooled. The `Agent` will still make - * the requests to that server, but each one will occur over a new connection. - * - * When a connection is closed by the client or the server, it is removed - * from the pool. Any unused sockets in the pool will be unrefed so as not - * to keep the Node.js process running when there are no outstanding requests. - * (see `socket.unref()`). - * - * It is good practice, to `destroy()` an `Agent` instance when it is no - * longer in use, because unused sockets consume OS resources. - * - * Sockets are removed from an agent when the socket emits either - * a `'close'` event or an `'agentRemove'` event. When intending to keep one - * HTTP request open for a long time without keeping it in the agent, something - * like the following may be done: - * - * ```js - * http.get(options, (res) => { - * // Do stuff - * }).on('socket', (socket) => { - * socket.emit('agentRemove'); - * }); - * ``` - * - * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options - * will be used - * for the client connection. - * - * `agent:false`: - * - * ```js - * http.get({ - * hostname: 'localhost', - * port: 80, - * path: '/', - * agent: false // Create a new agent just for this one request - * }, (res) => { - * // Do stuff with response - * }); - * ``` - * @since v0.3.4 - */ - class Agent { - /** - * By default set to 256\. For agents with `keepAlive` enabled, this - * sets the maximum number of sockets that will be left open in the free - * state. - * @since v0.11.7 - */ - maxFreeSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open per origin. Origin is the returned value of `agent.getName()`. - * @since v0.3.6 - */ - maxSockets: number; - /** - * By default set to `Infinity`. Determines how many concurrent sockets the agent - * can have open. Unlike `maxSockets`, this parameter applies across all origins. - * @since v14.5.0, v12.19.0 - */ - maxTotalSockets: number; - /** - * An object which contains arrays of sockets currently awaiting use by - * the agent when `keepAlive` is enabled. Do not modify. - * - * Sockets in the `freeSockets` list will be automatically destroyed and - * removed from the array on `'timeout'`. - * @since v0.11.4 - */ - readonly freeSockets: NodeJS.ReadOnlyDict; - /** - * An object which contains arrays of sockets currently in use by the - * agent. Do not modify. - * @since v0.3.6 - */ - readonly sockets: NodeJS.ReadOnlyDict; - /** - * An object which contains queues of requests that have not yet been assigned to - * sockets. Do not modify. - * @since v0.5.9 - */ - readonly requests: NodeJS.ReadOnlyDict; - constructor(opts?: AgentOptions); - /** - * Destroy any sockets that are currently in use by the agent. - * - * It is usually not necessary to do this. However, if using an - * agent with `keepAlive` enabled, then it is best to explicitly shut down - * the agent when it is no longer needed. Otherwise, - * sockets might stay open for quite a long time before the server - * terminates them. - * @since v0.11.4 - */ - destroy(): void; - } - const METHODS: string[]; - const STATUS_CODES: { - [errorCode: number]: string | undefined; - [errorCode: string]: string | undefined; - }; - /** - * Returns a new instance of {@link Server}. - * - * The `requestListener` is a function which is automatically - * added to the `'request'` event. - * @since v0.1.13 - */ - 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 {} - /** - * Node.js maintains several connections per server to make HTTP requests. - * This function allows one to transparently issue requests. - * - * `url` can be a string or a `URL` object. If `url` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence. - * - * The optional `callback` parameter will be added as a one-time listener for - * the `'response'` event. - * - * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const http = require('http'); - * - * const postData = JSON.stringify({ - * 'msg': 'Hello World!' - * }); - * - * const options = { - * hostname: 'www.google.com', - * port: 80, - * path: '/upload', - * method: 'POST', - * headers: { - * 'Content-Type': 'application/json', - * 'Content-Length': Buffer.byteLength(postData) - * } - * }; - * - * const req = http.request(options, (res) => { - * console.log(`STATUS: ${res.statusCode}`); - * console.log(`HEADERS: ${JSON.stringify(res.headers)}`); - * res.setEncoding('utf8'); - * res.on('data', (chunk) => { - * console.log(`BODY: ${chunk}`); - * }); - * res.on('end', () => { - * console.log('No more data in response.'); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(`problem with request: ${e.message}`); - * }); - * - * // Write data to request body - * req.write(postData); - * req.end(); - * ``` - * - * In the example `req.end()` was called. With `http.request()` one - * must always call `req.end()` to signify the end of the request - - * even if there is no data being written to the request body. - * - * If any error is encountered during the request (be that with DNS resolution, - * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted - * on the returned request object. As with all `'error'` events, if no listeners - * are registered the error will be thrown. - * - * There are a few special headers that should be noted. - * - * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to - * the server should be persisted until the next request. - * * Sending a 'Content-Length' header will disable the default chunked encoding. - * * Sending an 'Expect' header will immediately send the request headers. - * Usually, when sending 'Expect: 100-continue', both a timeout and a listener - * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more - * information. - * * Sending an Authorization header will override using the `auth` option - * to compute basic authentication. - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('http://abc:xyz@example.com'); - * - * const req = http.request(options, (res) => { - * // ... - * }); - * ``` - * - * In a successful request, the following events will be emitted in the following - * order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * (`'data'` will not be emitted at all if the response body is empty, for - * instance, in most redirects) - * * `'end'` on the `res` object - * * `'close'` - * - * In the case of a connection error, the following events will be emitted: - * - * * `'socket'` - * * `'error'` - * * `'close'` - * - * In the case of a premature connection close before the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * In the case of a premature connection close after the response is received, - * the following events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (connection closed here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.destroy()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.destroy()` called here) - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.destroy()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.destroy()` called here) - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * If `req.abort()` is called before a socket is assigned, the following - * events will be emitted in the following order: - * - * * (`req.abort()` called here) - * * `'abort'` - * * `'close'` - * - * If `req.abort()` is called before the connection succeeds, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * (`req.abort()` called here) - * * `'abort'` - * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'` - * * `'close'` - * - * If `req.abort()` is called after the response is received, the following - * events will be emitted in the following order: - * - * * `'socket'` - * * `'response'` - * * `'data'` any number of times, on the `res` object - * * (`req.abort()` called here) - * * `'abort'` - * * `'aborted'` on the `res` object - * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`. - * * `'close'` - * * `'close'` on the `res` object - * - * Setting the `timeout` option or using the `setTimeout()` function will - * not abort the request or do anything besides add a `'timeout'` event. - * - * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the - * request itself. - * @since v0.3.6 - */ - function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; - function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest; - /** - * Since most requests are GET requests without bodies, Node.js provides this - * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the - * response - * data for reasons stated in {@link ClientRequest} section. - * - * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}. - * - * JSON fetching example: - * - * ```js - * http.get('http://localhost:8000/', (res) => { - * const { statusCode } = res; - * const contentType = res.headers['content-type']; - * - * let error; - * // Any 2xx status code signals a successful response but - * // here we're only checking for 200. - * if (statusCode !== 200) { - * error = new Error('Request Failed.\n' + - * `Status Code: ${statusCode}`); - * } else if (!/^application\/json/.test(contentType)) { - * error = new Error('Invalid content-type.\n' + - * `Expected application/json but received ${contentType}`); - * } - * if (error) { - * console.error(error.message); - * // Consume response data to free up memory - * res.resume(); - * return; - * } - * - * res.setEncoding('utf8'); - * let rawData = ''; - * res.on('data', (chunk) => { rawData += chunk; }); - * res.on('end', () => { - * try { - * const parsedData = JSON.parse(rawData); - * console.log(parsedData); - * } catch (e) { - * console.error(e.message); - * } - * }); - * }).on('error', (e) => { - * console.error(`Got error: ${e.message}`); - * }); - * - * // Create a local server to receive data from - * const server = http.createServer((req, res) => { - * res.writeHead(200, { 'Content-Type': 'application/json' }); - * res.end(JSON.stringify({ - * data: 'Hello World!' - * })); - * }); - * - * server.listen(8000); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored. - */ - 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 16KB. Configurable using the `--max-http-header-size` CLI option. - */ - const maxHeaderSize: number; -} -declare module 'node:http' { - export * from 'http'; -} diff --git a/JS/node_modules/@types/node/http2.d.ts b/JS/node_modules/@types/node/http2.d.ts deleted file mode 100755 index bf0ae2d..0000000 --- a/JS/node_modules/@types/node/http2.d.ts +++ /dev/null @@ -1,2100 +0,0 @@ -/** - * The `http2` module provides an implementation of the [HTTP/2](https://tools.ietf.org/html/rfc7540) protocol. It - * can be accessed using: - * - * ```js - * const http2 = require('http2'); - * ``` - * @since v8.4.0 - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/http2.js) - */ -declare module 'http2' { - import EventEmitter = require('node:events'); - import * as fs from 'node:fs'; - import * as net from 'node:net'; - import * as stream from 'node:stream'; - import * as tls from 'node:tls'; - import * as url from 'node:url'; - import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; - export { OutgoingHttpHeaders } from 'node:http'; - export interface IncomingHttpStatusHeader { - ':status'?: number | undefined; - } - export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders { - ':path'?: string | undefined; - ':method'?: string | undefined; - ':authority'?: string | undefined; - ':scheme'?: string | undefined; - } - // Http2Stream - export interface StreamPriorityOptions { - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - silent?: boolean | undefined; - } - export interface StreamState { - localWindowSize?: number | undefined; - state?: number | undefined; - localClose?: number | undefined; - remoteClose?: number | undefined; - sumDependencyWeight?: number | undefined; - weight?: number | undefined; - } - export interface ServerStreamResponseOptions { - endStream?: boolean | undefined; - waitForTrailers?: boolean | undefined; - } - export interface StatOptions { - offset: number; - length: number; - } - export interface ServerStreamFileResponseOptions { - statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean; - waitForTrailers?: boolean | undefined; - offset?: number | undefined; - length?: number | undefined; - } - export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { - onError?(err: NodeJS.ErrnoException): void; - } - export interface Http2Stream extends stream.Duplex { - /** - * Set to `true` if the `Http2Stream` instance was aborted abnormally. When set, - * the `'aborted'` event will have been emitted. - * @since v8.4.0 - */ - readonly aborted: boolean; - /** - * This property shows the number of characters currently buffered to be written. - * See `net.Socket.bufferSize` for details. - * @since v11.2.0, v10.16.0 - */ - readonly bufferSize: number; - /** - * Set to `true` if the `Http2Stream` instance has been closed. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Set to `true` if the `Http2Stream` instance has been destroyed and is no longer - * usable. - * @since v8.4.0 - */ - 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. - * @since v10.11.0 - */ - readonly endAfterHeaders: boolean; - /** - * The numeric stream identifier of this `Http2Stream` instance. Set to `undefined`if the stream identifier has not yet been assigned. - * @since v8.4.0 - */ - readonly id?: number | undefined; - /** - * Set to `true` if the `Http2Stream` instance has not yet been assigned a - * numeric stream identifier. - * @since v9.4.0 - */ - readonly pending: boolean; - /** - * Set to the `RST_STREAM` `error code` reported when the `Http2Stream` is - * destroyed after either receiving an `RST_STREAM` frame from the connected peer, - * calling `http2stream.close()`, or `http2stream.destroy()`. Will be`undefined` if the `Http2Stream` has not been closed. - * @since v8.4.0 - */ - readonly rstCode: number; - /** - * An object containing the outbound headers sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentHeaders: OutgoingHttpHeaders; - /** - * An array of objects containing the outbound informational (additional) headers - * sent for this `Http2Stream`. - * @since v9.5.0 - */ - readonly sentInfoHeaders?: OutgoingHttpHeaders[] | undefined; - /** - * An object containing the outbound trailers sent for this `HttpStream`. - * @since v9.5.0 - */ - readonly sentTrailers?: OutgoingHttpHeaders | undefined; - /** - * A reference to the `Http2Session` instance that owns this `Http2Stream`. The - * value will be `undefined` after the `Http2Stream` instance is destroyed. - * @since v8.4.0 - */ - readonly session: Http2Session; - /** - * Provides miscellaneous information about the current state of the`Http2Stream`. - * - * A current state of this `Http2Stream`. - * @since v8.4.0 - */ - readonly state: StreamState; - /** - * Closes the `Http2Stream` instance by sending an `RST_STREAM` frame to the - * connected HTTP/2 peer. - * @since v8.4.0 - * @param [code=http2.constants.NGHTTP2_NO_ERROR] Unsigned 32-bit integer identifying the error code. - * @param callback An optional function registered to listen for the `'close'` event. - */ - close(code?: number, callback?: () => void): void; - /** - * Updates the priority for this `Http2Stream` instance. - * @since v8.4.0 - */ - priority(options: StreamPriorityOptions): void; - /** - * ```js - * const http2 = require('http2'); - * const client = http2.connect('http://example.org:8000'); - * const { NGHTTP2_CANCEL } = http2.constants; - * const req = client.request({ ':path': '/' }); - * - * // Cancel the stream if there's no activity after 5 seconds - * req.setTimeout(5000, () => req.close(NGHTTP2_CANCEL)); - * ``` - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Sends a trailing `HEADERS` frame to the connected HTTP/2 peer. This method - * will cause the `Http2Stream` to be immediately closed and must only be - * called after the `'wantTrailers'` event has been emitted. When sending a - * request or sending a response, the `options.waitForTrailers` option must be set - * in order to keep the `Http2Stream` open after the final `DATA` frame so that - * trailers can be sent. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond(undefined, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ xyz: 'abc' }); - * }); - * stream.end('Hello World'); - * }); - * ``` - * - * The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header - * fields (e.g. `':method'`, `':path'`, etc). - * @since v10.0.0 - */ - 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 interface ClientHttp2Stream extends Http2Stream { - 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 interface ServerHttp2Stream extends Http2Stream { - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * Read-only property mapped to the `SETTINGS_ENABLE_PUSH` flag of the remote - * client's most recent `SETTINGS` frame. Will be `true` if the remote peer - * accepts push streams, `false` otherwise. Settings are the same for every`Http2Stream` in the same `Http2Session`. - * @since v8.4.0 - */ - readonly pushAllowed: boolean; - /** - * Sends an additional informational `HEADERS` frame to the connected HTTP/2 peer. - * @since v8.4.0 - */ - additionalHeaders(headers: OutgoingHttpHeaders): void; - /** - * Initiates a push stream. The callback is invoked with the new `Http2Stream`instance created for the push stream passed as the second argument, or an`Error` passed as the first argument. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => { - * if (err) throw err; - * pushStream.respond({ ':status': 200 }); - * pushStream.end('some pushed data'); - * }); - * stream.end('some data'); - * }); - * ``` - * - * Setting the weight of a push stream is not allowed in the `HEADERS` frame. Pass - * a `weight` value to `http2stream.priority` with the `silent` option set to`true` to enable server-side bandwidth balancing between concurrent streams. - * - * Calling `http2stream.pushStream()` from within a pushed stream is not permitted - * and will throw an error. - * @since v8.4.0 - * @param callback Callback that is called once the push stream has been initiated. - */ - 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; - /** - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }); - * stream.end('some data'); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respond({ ':status': 200 }, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * stream.end('some data'); - * }); - * ``` - * @since v8.4.0 - */ - respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; - /** - * Initiates a response whose data is read from the given file descriptor. No - * validation is performed on the given file descriptor. If an error occurs while - * attempting to read data using the file descriptor, the `Http2Stream` will be - * closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR` code. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers); - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given fd. If the `statCheck` function is provided, the`http2stream.respondWithFD()` method will perform an `fs.fstat()` call to - * collect details on the provided file descriptor. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The file descriptor or `FileHandle` is not closed when the stream is closed, - * so it will need to be closed manually once it is no longer needed. - * Using the same file descriptor concurrently for multiple streams - * is not supported and may result in data loss. Re-using a file descriptor - * after a stream has finished is supported. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code _must_ call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * const fd = fs.openSync('/some/file', 'r'); - * - * const stat = fs.fstatSync(fd); - * const headers = { - * 'content-length': stat.size, - * 'last-modified': stat.mtime.toUTCString(), - * 'content-type': 'text/plain; charset=utf-8' - * }; - * stream.respondWithFD(fd, headers, { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * - * stream.on('close', () => fs.closeSync(fd)); - * }); - * ``` - * @since v8.4.0 - * @param fd A readable file descriptor. - */ - respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; - /** - * Sends a regular file as the response. The `path` must specify a regular file - * or an `'error'` event will be emitted on the `Http2Stream` object. - * - * When used, the `Http2Stream` object's `Duplex` interface will be closed - * automatically. - * - * The optional `options.statCheck` function may be specified to give user code - * an opportunity to set additional content headers based on the `fs.Stat` details - * of the given file: - * - * If an error occurs while attempting to read the file data, the `Http2Stream`will be closed using an `RST_STREAM` frame using the standard `INTERNAL_ERROR`code. If the `onError` callback is - * defined, then it will be called. Otherwise - * the stream will be destroyed. - * - * Example using a file path: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * headers['last-modified'] = stat.mtime.toUTCString(); - * } - * - * function onError(err) { - * // stream.respond() can throw if the stream has been destroyed by - * // the other side. - * try { - * if (err.code === 'ENOENT') { - * stream.respond({ ':status': 404 }); - * } else { - * stream.respond({ ':status': 500 }); - * } - * } catch (err) { - * // Perform actual error handling. - * console.log(err); - * } - * stream.end(); - * } - * - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck, onError }); - * }); - * ``` - * - * The `options.statCheck` function may also be used to cancel the send operation - * by returning `false`. For instance, a conditional request may check the stat - * results to determine if the file has been modified to return an appropriate`304` response: - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * function statCheck(stat, headers) { - * // Check the stat here... - * stream.respond({ ':status': 304 }); - * return false; // Cancel the send operation - * } - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { statCheck }); - * }); - * ``` - * - * The `content-length` header field will be automatically set. - * - * The `offset` and `length` options may be used to limit the response to a - * specific range subset. This can be used, for instance, to support HTTP Range - * requests. - * - * The `options.onError` function may also be used to handle all the errors - * that could happen before the delivery of the file is initiated. The - * default behavior is to destroy the stream. - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * will be emitted immediately after queuing the last chunk of payload data to be - * sent. The `http2stream.sendTrailers()` method can then be used to sent trailing - * header fields to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer(); - * server.on('stream', (stream) => { - * stream.respondWithFile('/some/file', - * { 'content-type': 'text/plain; charset=utf-8' }, - * { waitForTrailers: true }); - * stream.on('wantTrailers', () => { - * stream.sendTrailers({ ABC: 'some value to send' }); - * }); - * }); - * ``` - * @since v8.4.0 - */ - respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; - } - // Http2Session - export interface Settings { - headerTableSize?: number | undefined; - enablePush?: boolean | undefined; - initialWindowSize?: number | undefined; - maxFrameSize?: number | undefined; - maxConcurrentStreams?: number | undefined; - maxHeaderListSize?: number | undefined; - enableConnectProtocol?: boolean | undefined; - } - export interface ClientSessionRequestOptions { - endStream?: boolean | undefined; - exclusive?: boolean | undefined; - parent?: number | undefined; - weight?: number | undefined; - waitForTrailers?: boolean | undefined; - } - export interface SessionState { - effectiveLocalWindowSize?: number | undefined; - effectiveRecvDataLength?: number | undefined; - nextStreamID?: number | undefined; - localWindowSize?: number | undefined; - lastProcStreamID?: number | undefined; - remoteWindowSize?: number | undefined; - outboundQueueSize?: number | undefined; - deflateDynamicTableSize?: number | undefined; - inflateDynamicTableSize?: number | undefined; - } - export interface Http2Session extends EventEmitter { - /** - * Value will be `undefined` if the `Http2Session` is not yet connected to a - * socket, `h2c` if the `Http2Session` is not connected to a `TLSSocket`, or - * will return the value of the connected `TLSSocket`'s own `alpnProtocol`property. - * @since v9.4.0 - */ - readonly alpnProtocol?: string | undefined; - /** - * Will be `true` if this `Http2Session` instance has been closed, otherwise`false`. - * @since v9.4.0 - */ - readonly closed: boolean; - /** - * Will be `true` if this `Http2Session` instance is still connecting, will be set - * to `false` before emitting `connect` event and/or calling the `http2.connect`callback. - * @since v10.0.0 - */ - readonly connecting: boolean; - /** - * Will be `true` if this `Http2Session` instance has been destroyed and must no - * longer be used, otherwise `false`. - * @since v8.4.0 - */ - readonly destroyed: boolean; - /** - * Value is `undefined` if the `Http2Session` session socket has not yet been - * connected, `true` if the `Http2Session` is connected with a `TLSSocket`, - * and `false` if the `Http2Session` is connected to any other kind of socket - * or stream. - * @since v9.4.0 - */ - readonly encrypted?: boolean | undefined; - /** - * A prototype-less object describing the current local settings of this`Http2Session`. The local settings are local to _this_`Http2Session` instance. - * @since v8.4.0 - */ - readonly localSettings: Settings; - /** - * If the `Http2Session` is connected to a `TLSSocket`, the `originSet` property - * will return an `Array` of origins for which the `Http2Session` may be - * considered authoritative. - * - * The `originSet` property is only available when using a secure TLS connection. - * @since v9.4.0 - */ - readonly originSet?: string[] | undefined; - /** - * Indicates whether the `Http2Session` is currently waiting for acknowledgment of - * a sent `SETTINGS` frame. Will be `true` after calling the`http2session.settings()` method. Will be `false` once all sent `SETTINGS`frames have been acknowledged. - * @since v8.4.0 - */ - readonly pendingSettingsAck: boolean; - /** - * A prototype-less object describing the current remote settings of this`Http2Session`. The remote settings are set by the _connected_ HTTP/2 peer. - * @since v8.4.0 - */ - readonly remoteSettings: Settings; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * limits available methods to ones safe to use with HTTP/2. - * - * `destroy`, `emit`, `end`, `pause`, `read`, `resume`, and `write` will throw - * an error with code `ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for more information. - * - * `setTimeout` method will be called on this `Http2Session`. - * - * All other interactions will be routed directly to the socket. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * Provides miscellaneous information about the current state of the`Http2Session`. - * - * An object describing the current status of this `Http2Session`. - * @since v8.4.0 - */ - readonly state: SessionState; - /** - * The `http2session.type` will be equal to`http2.constants.NGHTTP2_SESSION_SERVER` if this `Http2Session` instance is a - * server, and `http2.constants.NGHTTP2_SESSION_CLIENT` if the instance is a - * client. - * @since v8.4.0 - */ - readonly type: number; - /** - * Gracefully closes the `Http2Session`, allowing any existing streams to - * complete on their own and preventing new `Http2Stream` instances from being - * created. Once closed, `http2session.destroy()`_might_ be called if there - * are no open `Http2Stream` instances. - * - * If specified, the `callback` function is registered as a handler for the`'close'` event. - * @since v9.4.0 - */ - close(callback?: () => void): void; - /** - * Immediately terminates the `Http2Session` and the associated `net.Socket` or`tls.TLSSocket`. - * - * Once destroyed, the `Http2Session` will emit the `'close'` event. If `error`is not undefined, an `'error'` event will be emitted immediately before the`'close'` event. - * - * If there are any remaining open `Http2Streams` associated with the`Http2Session`, those will also be destroyed. - * @since v8.4.0 - * @param error An `Error` object if the `Http2Session` is being destroyed due to an error. - * @param code The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`. - */ - destroy(error?: Error, code?: number): void; - /** - * Transmits a `GOAWAY` frame to the connected peer _without_ shutting down the`Http2Session`. - * @since v9.4.0 - * @param code An HTTP/2 error code - * @param lastStreamID The numeric ID of the last processed `Http2Stream` - * @param opaqueData A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame. - */ - goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void; - /** - * Sends a `PING` frame to the connected HTTP/2 peer. A `callback` function must - * be provided. The method will return `true` if the `PING` was sent, `false`otherwise. - * - * The maximum number of outstanding (unacknowledged) pings is determined by the`maxOutstandingPings` configuration option. The default maximum is 10. - * - * If provided, the `payload` must be a `Buffer`, `TypedArray`, or `DataView`containing 8 bytes of data that will be transmitted with the `PING` and - * returned with the ping acknowledgment. - * - * The callback will be invoked with three arguments: an error argument that will - * be `null` if the `PING` was successfully acknowledged, a `duration` argument - * that reports the number of milliseconds elapsed since the ping was sent and the - * acknowledgment was received, and a `Buffer` containing the 8-byte `PING`payload. - * - * ```js - * session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => { - * if (!err) { - * console.log(`Ping acknowledged in ${duration} milliseconds`); - * console.log(`With payload '${payload.toString()}'`); - * } - * }); - * ``` - * - * If the `payload` argument is not specified, the default payload will be the - * 64-bit timestamp (little endian) marking the start of the `PING` duration. - * @since v8.9.3 - * @param payload Optional ping payload. - */ - ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean; - /** - * Calls `ref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - ref(): void; - /** - * Sets the local endpoint's window size. - * The `windowSize` is the total window size to set, not - * the delta. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * const expectedWindowSize = 2 ** 20; - * server.on('connect', (session) => { - * - * // Set local window size to be 2 ** 20 - * session.setLocalWindowSize(expectedWindowSize); - * }); - * ``` - * @since v15.3.0 - */ - setLocalWindowSize(windowSize: number): void; - /** - * Used to set a callback function that is called when there is no activity on - * the `Http2Session` after `msecs` milliseconds. The given `callback` is - * registered as a listener on the `'timeout'` event. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * Updates the current local settings for this `Http2Session` and sends a new`SETTINGS` frame to the connected HTTP/2 peer. - * - * Once called, the `http2session.pendingSettingsAck` property will be `true`while the session is waiting for the remote peer to acknowledge the new - * settings. - * - * The new settings will not become effective until the `SETTINGS` acknowledgment - * is received and the `'localSettings'` event is emitted. It is possible to send - * multiple `SETTINGS` frames while acknowledgment is still pending. - * @since v8.4.0 - * @param callback Callback that is called once the session is connected or right away if the session is already connected. - */ - settings(settings: Settings): void; - /** - * Calls `unref()` on this `Http2Session`instance's underlying `net.Socket`. - * @since v9.4.0 - */ - 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 interface ClientHttp2Session extends Http2Session { - /** - * For HTTP/2 Client `Http2Session` instances only, the `http2session.request()`creates and returns an `Http2Stream` instance that can be used to send an - * HTTP/2 request to the connected server. - * - * This method is only available if `http2session.type` is equal to`http2.constants.NGHTTP2_SESSION_CLIENT`. - * - * ```js - * const http2 = require('http2'); - * const clientSession = http2.connect('https://localhost:1234'); - * const { - * HTTP2_HEADER_PATH, - * HTTP2_HEADER_STATUS - * } = http2.constants; - * - * const req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' }); - * req.on('response', (headers) => { - * console.log(headers[HTTP2_HEADER_STATUS]); - * req.on('data', (chunk) => { // .. }); - * req.on('end', () => { // .. }); - * }); - * ``` - * - * When the `options.waitForTrailers` option is set, the `'wantTrailers'` event - * is emitted immediately after queuing the last chunk of payload data to be sent. - * The `http2stream.sendTrailers()` method can then be called to send trailing - * headers to the peer. - * - * When `options.waitForTrailers` is set, the `Http2Stream` will not automatically - * close when the final `DATA` frame is transmitted. User code must call either`http2stream.sendTrailers()` or `http2stream.close()` to close the`Http2Stream`. - * - * When `options.signal` is set with an `AbortSignal` and then `abort` on the - * corresponding `AbortController` is called, the request will emit an `'error'`event with an `AbortError` error. - * - * The `:method` and `:path` pseudo-headers are not specified within `headers`, - * they respectively default to: - * - * * `:method` \= `'GET'` - * * `:path` \= `/` - * @since v8.4.0 - */ - 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: ReadonlyArray): 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 interface ServerHttp2Session extends Http2Session { - readonly server: Http2Server | Http2SecureServer; - /** - * Submits an `ALTSVC` frame (as defined by [RFC 7838](https://tools.ietf.org/html/rfc7838)) to the connected client. - * - * ```js - * const http2 = require('http2'); - * - * const server = http2.createServer(); - * server.on('session', (session) => { - * // Set altsvc for origin https://example.org:80 - * session.altsvc('h2=":8000"', 'https://example.org:80'); - * }); - * - * server.on('stream', (stream) => { - * // Set altsvc for a specific stream - * stream.session.altsvc('h2=":8000"', stream.id); - * }); - * ``` - * - * Sending an `ALTSVC` frame with a specific stream ID indicates that the alternate - * service is associated with the origin of the given `Http2Stream`. - * - * The `alt` and origin string _must_ contain only ASCII bytes and are - * strictly interpreted as a sequence of ASCII bytes. The special value `'clear'`may be passed to clear any previously set alternative service for a given - * domain. - * - * When a string is passed for the `originOrStream` argument, it will be parsed as - * a URL and the origin will be derived. For instance, the origin for the - * HTTP URL `'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as`originOrStream`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * @since v9.4.0 - * @param alt A description of the alternative service configuration as defined by `RFC 7838`. - * @param originOrStream Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the - * `http2stream.id` property. - */ - altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; - /** - * Submits an `ORIGIN` frame (as defined by [RFC 8336](https://tools.ietf.org/html/rfc8336)) to the connected client - * to advertise the set of origins for which the server is capable of providing - * authoritative responses. - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * server.on('session', (session) => { - * session.origin('https://example.com', 'https://example.org'); - * }); - * ``` - * - * When a string is passed as an `origin`, it will be parsed as a URL and the - * origin will be derived. For instance, the origin for the HTTP URL`'https://example.org/foo/bar'` is the ASCII string`'https://example.org'`. An error will be thrown if either the given - * string - * cannot be parsed as a URL or if a valid origin cannot be derived. - * - * A `URL` object, or any object with an `origin` property, may be passed as - * an `origin`, in which case the value of the `origin` property will be - * used. The value of the `origin` property _must_ be a properly serialized - * ASCII origin. - * - * Alternatively, the `origins` option may be used when creating a new HTTP/2 - * server using the `http2.createSecureServer()` method: - * - * ```js - * const http2 = require('http2'); - * const options = getSecureOptionsSomehow(); - * options.origins = ['https://example.com', 'https://example.org']; - * const server = http2.createSecureServer(options); - * server.on('stream', (stream) => { - * stream.respond(); - * stream.end('ok'); - * }); - * ``` - * @since v10.12.0 - * @param origins One or more URL Strings passed as separate arguments. - */ - origin( - ...origins: Array< - | string - | url.URL - | { - origin: string; - } - > - ): void; - 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 | undefined; - maxSessionMemory?: number | undefined; - maxHeaderListPairs?: number | undefined; - maxOutstandingPings?: number | undefined; - maxSendHeaderBlockLength?: number | undefined; - paddingStrategy?: number | undefined; - peerMaxConcurrentStreams?: number | undefined; - settings?: Settings | undefined; - /** - * Specifies a timeout in milliseconds that - * a server should wait when an [`'unknownProtocol'`][] is emitted. If the - * socket has not been destroyed by that time the server will destroy it. - * @default 100000 - */ - unknownProtocolTimeout?: number | undefined; - selectPadding?(frameLen: number, maxFrameLen: number): number; - createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex; - } - export interface ClientSessionOptions extends SessionOptions { - maxReservedRemoteStreams?: number | undefined; - createConnection?: ((authority: url.URL, option: SessionOptions) => stream.Duplex) | undefined; - protocol?: 'http:' | 'https:' | undefined; - } - export interface ServerSessionOptions extends SessionOptions { - Http1IncomingMessage?: typeof IncomingMessage | undefined; - Http1ServerResponse?: typeof ServerResponse | undefined; - Http2ServerRequest?: typeof Http2ServerRequest | undefined; - Http2ServerResponse?: typeof Http2ServerResponse | undefined; - } - 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 | undefined; - origins?: string[] | undefined; - } - interface HTTP2ServerCommon { - setTimeout(msec?: number, callback?: () => void): this; - /** - * Throws ERR_HTTP2_INVALID_SETTING_VALUE for invalid settings values. - * Throws ERR_INVALID_ARG_TYPE for invalid settings argument. - */ - updateSettings(settings: Settings): void; - } - export interface Http2Server extends net.Server, HTTP2ServerCommon { - 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; - } - export interface Http2SecureServer extends tls.Server, HTTP2ServerCommon { - 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; - } - /** - * A `Http2ServerRequest` object is created by {@link Server} or {@link SecureServer} and passed as the first argument to the `'request'` event. It may be used to access a request status, - * headers, and - * data. - * @since v8.4.0 - */ - export class Http2ServerRequest extends stream.Readable { - constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray); - /** - * The `request.aborted` property will be `true` if the request has - * been aborted. - * @since v10.1.0 - */ - readonly aborted: boolean; - /** - * The request authority pseudo header field. Because HTTP/2 allows requests - * to set either `:authority` or `host`, this value is derived from`req.headers[':authority']` if present. Otherwise, it is derived from`req.headers['host']`. - * @since v8.4.0 - */ - readonly authority: string; - /** - * See `request.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * The `request.complete` property will be `true` if the request has - * been completed, aborted, or destroyed. - * @since v12.10.0 - */ - readonly complete: boolean; - /** - * The request/response headers object. - * - * Key-value pairs of header names and values. Header names are lower-cased. - * - * ```js - * // Prints something like: - * // - * // { 'user-agent': 'curl/7.22.0', - * // host: '127.0.0.1:8000', - * // accept: '*' } - * console.log(request.headers); - * ``` - * - * See `HTTP/2 Headers Object`. - * - * In HTTP/2, the request path, host name, protocol, and method are represented as - * special headers prefixed with the `:` character (e.g. `':path'`). These special - * headers will be included in the `request.headers` object. Care must be taken not - * to inadvertently modify these special headers or errors may occur. For instance, - * removing all headers from the request will cause errors to occur: - * - * ```js - * removeAllHeaders(request.headers); - * assert(request.url); // Fails because the :path header has been removed - * ``` - * @since v8.4.0 - */ - readonly headers: IncomingHttpHeaders; - /** - * In case of server request, the HTTP version sent by the client. In the case of - * client response, the HTTP version of the connected-to server. Returns`'2.0'`. - * - * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second. - * @since v8.4.0 - */ - readonly httpVersion: string; - readonly httpVersionMinor: number; - readonly httpVersionMajor: number; - /** - * The request method as a string. Read-only. Examples: `'GET'`, `'DELETE'`. - * @since v8.4.0 - */ - readonly method: string; - /** - * The raw request/response headers list exactly as they were received. - * - * The keys and values are in the same list. It is _not_ a - * list of tuples. So, the even-numbered offsets are key values, and the - * odd-numbered offsets are the associated values. - * - * Header names are not lowercased, and duplicates are not merged. - * - * ```js - * // Prints something like: - * // - * // [ 'user-agent', - * // 'this is invalid because there can be only one', - * // 'User-Agent', - * // 'curl/7.22.0', - * // 'Host', - * // '127.0.0.1:8000', - * // 'ACCEPT', - * // '*' ] - * console.log(request.rawHeaders); - * ``` - * @since v8.4.0 - */ - readonly rawHeaders: string[]; - /** - * The raw request/response trailer keys and values exactly as they were - * received. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly rawTrailers: string[]; - /** - * The request scheme pseudo header field indicating the scheme - * portion of the target URL. - * @since v8.4.0 - */ - readonly scheme: string; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `request.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`request.stream`. - * - * `setTimeout` method will be called on `request.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. With TLS support, - * use `request.socket.getPeerCertificate()` to obtain the client's - * authentication details. - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the request. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * The request/response trailers object. Only populated at the `'end'` event. - * @since v8.4.0 - */ - readonly trailers: IncomingHttpHeaders; - /** - * Request URL string. This contains only the URL that is present in the actual - * HTTP request. If the request is: - * - * ```http - * GET /status?name=ryan HTTP/1.1 - * Accept: text/plain - * ``` - * - * Then `request.url` will be: - * - * ```js - * '/status?name=ryan' - * ``` - * - * To parse the url into its parts, `new URL()` can be used: - * - * ```console - * $ node - * > new URL('/status?name=ryan', 'http://example.com') - * URL { - * href: 'http://example.com/status?name=ryan', - * origin: 'http://example.com', - * protocol: 'http:', - * username: '', - * password: '', - * host: 'example.com', - * hostname: 'example.com', - * port: '', - * pathname: '/status', - * search: '?name=ryan', - * searchParams: URLSearchParams { 'name' => 'ryan' }, - * hash: '' - * } - * ``` - * @since v8.4.0 - */ - readonly url: string; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - 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; - } - /** - * This object is created internally by an HTTP server, not by the user. It is - * passed as the second parameter to the `'request'` event. - * @since v8.4.0 - */ - export class Http2ServerResponse extends stream.Writable { - constructor(stream: ServerHttp2Stream); - /** - * See `response.socket`. - * @since v8.4.0 - * @deprecated Since v13.0.0 - Use `socket`. - */ - readonly connection: net.Socket | tls.TLSSocket; - /** - * Boolean value that indicates whether the response has completed. Starts - * as `false`. After `response.end()` executes, the value will be `true`. - * @since v8.4.0 - * @deprecated Since v13.4.0,v12.16.0 - Use `writableEnded`. - */ - readonly finished: boolean; - /** - * True if headers were sent, false otherwise (read-only). - * @since v8.4.0 - */ - readonly headersSent: boolean; - /** - * A reference to the original HTTP2 request object. - * @since v15.7.0 - */ - readonly req: Http2ServerRequest; - /** - * Returns a `Proxy` object that acts as a `net.Socket` (or `tls.TLSSocket`) but - * applies getters, setters, and methods based on HTTP/2 logic. - * - * `destroyed`, `readable`, and `writable` properties will be retrieved from and - * set on `response.stream`. - * - * `destroy`, `emit`, `end`, `on` and `once` methods will be called on`response.stream`. - * - * `setTimeout` method will be called on `response.stream.session`. - * - * `pause`, `read`, `resume`, and `write` will throw an error with code`ERR_HTTP2_NO_SOCKET_MANIPULATION`. See `Http2Session and Sockets` for - * more information. - * - * All other interactions will be routed directly to the socket. - * - * ```js - * const http2 = require('http2'); - * const server = http2.createServer((req, res) => { - * const ip = req.socket.remoteAddress; - * const port = req.socket.remotePort; - * res.end(`Your IP address is ${ip} and your source port is ${port}.`); - * }).listen(3000); - * ``` - * @since v8.4.0 - */ - readonly socket: net.Socket | tls.TLSSocket; - /** - * The `Http2Stream` object backing the response. - * @since v8.4.0 - */ - readonly stream: ServerHttp2Stream; - /** - * When true, the Date header will be automatically generated and sent in - * the response if it is not already present in the headers. Defaults to true. - * - * This should only be disabled for testing; HTTP requires the Date header - * in responses. - * @since v8.4.0 - */ - sendDate: boolean; - /** - * When using implicit headers (not calling `response.writeHead()` explicitly), - * this property controls the status code that will be sent to the client when - * the headers get flushed. - * - * ```js - * response.statusCode = 404; - * ``` - * - * After response header was sent to the client, this property indicates the - * status code which was sent out. - * @since v8.4.0 - */ - statusCode: number; - /** - * Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns - * an empty string. - * @since v8.4.0 - */ - statusMessage: ''; - /** - * This method adds HTTP trailing headers (a header but at the end of the - * message) to the response. - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - addTrailers(trailers: OutgoingHttpHeaders): void; - /** - * This method signals to the server that all of the response headers and body - * have been sent; that server should consider this message complete. - * The method, `response.end()`, MUST be called on each response. - * - * If `data` is specified, it is equivalent to calling `response.write(data, encoding)` followed by `response.end(callback)`. - * - * If `callback` is specified, it will be called when the response stream - * is finished. - * @since v8.4.0 - */ - end(callback?: () => void): void; - end(data: string | Uint8Array, callback?: () => void): void; - end(data: string | Uint8Array, encoding: BufferEncoding, callback?: () => void): void; - /** - * Reads out a header that has already been queued but not sent to the client. - * The name is case-insensitive. - * - * ```js - * const contentType = response.getHeader('content-type'); - * ``` - * @since v8.4.0 - */ - getHeader(name: string): string; - /** - * Returns an array containing the unique names of the current outgoing headers. - * All header names are lowercase. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headerNames = response.getHeaderNames(); - * // headerNames === ['foo', 'set-cookie'] - * ``` - * @since v8.4.0 - */ - getHeaderNames(): string[]; - /** - * Returns a shallow copy of the current outgoing headers. Since a shallow copy - * is used, array values may be mutated without additional calls to various - * header-related http module methods. The keys of the returned object are the - * header names and the values are the respective header values. All header names - * are lowercase. - * - * The object returned by the `response.getHeaders()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * ```js - * response.setHeader('Foo', 'bar'); - * response.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']); - * - * const headers = response.getHeaders(); - * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] } - * ``` - * @since v8.4.0 - */ - getHeaders(): OutgoingHttpHeaders; - /** - * Returns `true` if the header identified by `name` is currently set in the - * outgoing headers. The header name matching is case-insensitive. - * - * ```js - * const hasContentType = response.hasHeader('content-type'); - * ``` - * @since v8.4.0 - */ - hasHeader(name: string): boolean; - /** - * Removes a header that has been queued for implicit sending. - * - * ```js - * response.removeHeader('Content-Encoding'); - * ``` - * @since v8.4.0 - */ - removeHeader(name: string): void; - /** - * Sets a single header value for implicit headers. If this header already exists - * in the to-be-sent headers, its value will be replaced. Use an array of strings - * here to send multiple headers with the same name. - * - * ```js - * response.setHeader('Content-Type', 'text/html; charset=utf-8'); - * ``` - * - * or - * - * ```js - * response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * @since v8.4.0 - */ - setHeader(name: string, value: number | string | ReadonlyArray): void; - /** - * Sets the `Http2Stream`'s timeout value to `msecs`. If a callback is - * provided, then it is added as a listener on the `'timeout'` event on - * the response object. - * - * If no `'timeout'` listener is added to the request, the response, or - * the server, then `Http2Stream` s are destroyed when they time out. If a - * handler is assigned to the request, the response, or the server's `'timeout'`events, timed out sockets must be handled explicitly. - * @since v8.4.0 - */ - setTimeout(msecs: number, callback?: () => void): void; - /** - * If this method is called and `response.writeHead()` has not been called, - * it will switch to implicit header mode and flush the implicit headers. - * - * This sends a chunk of the response body. This method may - * be called multiple times to provide successive parts of the body. - * - * In the `http` module, the response body is omitted when the - * request is a HEAD request. Similarly, the `204` and `304` responses_must not_ include a message body. - * - * `chunk` can be a string or a buffer. If `chunk` is a string, - * the second parameter specifies how to encode it into a byte stream. - * By default the `encoding` is `'utf8'`. `callback` will be called when this chunk - * of data is flushed. - * - * This is the raw HTTP body and has nothing to do with higher-level multi-part - * body encodings that may be used. - * - * The first time `response.write()` is called, it will send the buffered - * header information and the first chunk of the body to the client. The second - * time `response.write()` is called, Node.js assumes data will be streamed, - * and sends the new data separately. That is, the response is buffered up to the - * first chunk of the body. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is free again. - * @since v8.4.0 - */ - write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean; - write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean; - /** - * Sends a status `100 Continue` to the client, indicating that the request body - * should be sent. See the `'checkContinue'` event on `Http2Server` and`Http2SecureServer`. - * @since v8.4.0 - */ - writeContinue(): void; - /** - * Sends a response header to the request. The status code is a 3-digit HTTP - * status code, like `404`. The last argument, `headers`, are the response headers. - * - * Returns a reference to the `Http2ServerResponse`, so that calls can be chained. - * - * For compatibility with `HTTP/1`, a human-readable `statusMessage` may be - * passed as the second argument. However, because the `statusMessage` has no - * meaning within HTTP/2, the argument will have no effect and a process warning - * will be emitted. - * - * ```js - * const body = 'hello world'; - * response.writeHead(200, { - * 'Content-Length': Buffer.byteLength(body), - * 'Content-Type': 'text/plain; charset=utf-8', - * }); - * ``` - * - * `Content-Length` is given in bytes not characters. The`Buffer.byteLength()` API may be used to determine the number of bytes in a - * given encoding. On outbound messages, Node.js does not check if Content-Length - * and the length of the body being transmitted are equal or not. However, when - * receiving messages, Node.js will automatically reject messages when the`Content-Length` does not match the actual payload size. - * - * This method may be called at most one time on a message before `response.end()` is called. - * - * If `response.write()` or `response.end()` are called before calling - * this, the implicit/mutable headers will be calculated and call this function. - * - * When headers have been set with `response.setHeader()`, they will be merged - * with any headers passed to `response.writeHead()`, with the headers passed - * to `response.writeHead()` given precedence. - * - * ```js - * // Returns content-type = text/plain - * const server = http2.createServer((req, res) => { - * res.setHeader('Content-Type', 'text/html; charset=utf-8'); - * res.setHeader('X-Foo', 'bar'); - * res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); - * res.end('ok'); - * }); - * ``` - * - * Attempting to set a header field name or value that contains invalid characters - * will result in a `TypeError` being thrown. - * @since v8.4.0 - */ - writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; - writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; - /** - * Call `http2stream.pushStream()` with the given headers, and wrap the - * given `Http2Stream` on a newly created `Http2ServerResponse` as the callback - * parameter if successful. When `Http2ServerRequest` is closed, the callback is - * called with an error `ERR_HTTP2_INVALID_STREAM`. - * @since v8.4.0 - * @param headers An object describing the headers - * @param callback Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of - * `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method - */ - 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; - } - 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; - } - /** - * This symbol can be set as a property on the HTTP/2 headers object with - * an array value in order to provide a list of headers considered sensitive. - */ - export const sensitiveHeaders: symbol; - /** - * Returns an object containing the default settings for an `Http2Session`instance. This method returns a new object instance every time it is called - * so instances returned may be safely modified for use. - * @since v8.4.0 - */ - export function getDefaultSettings(): Settings; - /** - * Returns a `Buffer` instance containing serialized representation of the given - * HTTP/2 settings as specified in the [HTTP/2](https://tools.ietf.org/html/rfc7540) specification. This is intended - * for use with the `HTTP2-Settings` header field. - * - * ```js - * const http2 = require('http2'); - * - * const packed = http2.getPackedSettings({ enablePush: false }); - * - * console.log(packed.toString('base64')); - * // Prints: AAIAAAAA - * ``` - * @since v8.4.0 - */ - export function getPackedSettings(settings: Settings): Buffer; - /** - * Returns a `HTTP/2 Settings Object` containing the deserialized settings from - * the given `Buffer` as generated by `http2.getPackedSettings()`. - * @since v8.4.0 - * @param buf The packed settings. - */ - export function getUnpackedSettings(buf: Uint8Array): Settings; - /** - * Returns a `net.Server` instance that creates and manages `Http2Session`instances. - * - * Since there are no browsers known that support[unencrypted HTTP/2](https://http2.github.io/faq/#does-http2-require-encryption), the use of {@link createSecureServer} is necessary when - * communicating - * with browser clients. - * - * ```js - * const http2 = require('http2'); - * - * // Create an unencrypted HTTP/2 server. - * // Since there are no browsers known that support - * // unencrypted HTTP/2, the use of `http2.createSecureServer()` - * // is necessary when communicating with browser clients. - * const server = http2.createServer(); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; - /** - * Returns a `tls.Server` instance that creates and manages `Http2Session`instances. - * - * ```js - * const http2 = require('http2'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem') - * }; - * - * // Create a secure HTTP/2 server - * const server = http2.createSecureServer(options); - * - * server.on('stream', (stream, headers) => { - * stream.respond({ - * 'content-type': 'text/html; charset=utf-8', - * ':status': 200 - * }); - * stream.end('

Hello World

'); - * }); - * - * server.listen(80); - * ``` - * @since v8.4.0 - * @param onRequestHandler See `Compatibility API` - */ - export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; - /** - * Returns a `ClientHttp2Session` instance. - * - * ```js - * const http2 = require('http2'); - * const client = http2.connect('https://localhost:1234'); - * - * // Use the client - * - * client.close(); - * ``` - * @since v8.4.0 - * @param authority The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port - * is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored. - * @param listener Will be registered as a one-time listener of the {@link 'connect'} event. - */ - 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; -} -declare module 'node:http2' { - export * from 'http2'; -} diff --git a/JS/node_modules/@types/node/https.d.ts b/JS/node_modules/@types/node/https.d.ts deleted file mode 100755 index 4b74017..0000000 --- a/JS/node_modules/@types/node/https.d.ts +++ /dev/null @@ -1,391 +0,0 @@ -/** - * HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a - * separate module. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/https.js) - */ -declare module 'https' { - import { Duplex } from 'node:stream'; - import * as tls from 'node:tls'; - import * as http from 'node:http'; - import { URL } from 'node:url'; - type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions; - type RequestOptions = http.RequestOptions & - tls.SecureContextOptions & { - rejectUnauthorized?: boolean | undefined; // Defaults to true - servername?: string | undefined; // SNI TLS Extension - }; - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { - rejectUnauthorized?: boolean | undefined; - maxCachedSessions?: number | undefined; - } - /** - * An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information. - * @since v0.4.5 - */ - class Agent extends http.Agent { - constructor(options?: AgentOptions); - options: AgentOptions; - } - interface Server extends http.Server {} - /** - * See `http.Server` for more information. - * @since v0.3.4 - */ - class Server extends tls.Server { - constructor(requestListener?: http.RequestListener); - constructor(options: ServerOptions, requestListener?: http.RequestListener); - addListener(event: string, listener: (...args: any[]) => void): this; - addListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.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: tls.TLSSocket) => void): this; - addListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - addListener(event: 'close', listener: () => void): this; - addListener(event: 'connection', listener: (socket: Duplex) => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'listening', listener: () => void): this; - addListener(event: 'checkContinue', listener: http.RequestListener): this; - addListener(event: 'checkExpectation', listener: http.RequestListener): this; - addListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - addListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - addListener(event: 'request', listener: http.RequestListener): this; - addListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - emit(event: string, ...args: any[]): boolean; - emit(event: 'keylog', line: Buffer, tlsSocket: tls.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: tls.TLSSocket): boolean; - emit(event: 'tlsClientError', err: Error, tlsSocket: tls.TLSSocket): boolean; - emit(event: 'close'): boolean; - emit(event: 'connection', socket: Duplex): boolean; - emit(event: 'error', err: Error): boolean; - emit(event: 'listening'): boolean; - emit(event: 'checkContinue', req: http.IncomingMessage, res: http.ServerResponse): boolean; - emit(event: 'checkExpectation', req: http.IncomingMessage, res: http.ServerResponse): boolean; - emit(event: 'clientError', err: Error, socket: Duplex): boolean; - emit(event: 'connect', req: http.IncomingMessage, socket: Duplex, head: Buffer): boolean; - emit(event: 'request', req: http.IncomingMessage, res: http.ServerResponse): boolean; - emit(event: 'upgrade', req: http.IncomingMessage, socket: Duplex, head: Buffer): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.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: tls.TLSSocket) => void): this; - on(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - on(event: 'close', listener: () => void): this; - on(event: 'connection', listener: (socket: Duplex) => void): this; - on(event: 'error', listener: (err: Error) => void): this; - on(event: 'listening', listener: () => void): this; - on(event: 'checkContinue', listener: http.RequestListener): this; - on(event: 'checkExpectation', listener: http.RequestListener): this; - on(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - on(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - on(event: 'request', listener: http.RequestListener): this; - on(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.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: tls.TLSSocket) => void): this; - once(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - once(event: 'close', listener: () => void): this; - once(event: 'connection', listener: (socket: Duplex) => void): this; - once(event: 'error', listener: (err: Error) => void): this; - once(event: 'listening', listener: () => void): this; - once(event: 'checkContinue', listener: http.RequestListener): this; - once(event: 'checkExpectation', listener: http.RequestListener): this; - once(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - once(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - once(event: 'request', listener: http.RequestListener): this; - once(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.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: tls.TLSSocket) => void): this; - prependListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependListener(event: 'close', listener: () => void): this; - prependListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependListener(event: 'error', listener: (err: Error) => void): this; - prependListener(event: 'listening', listener: () => void): this; - prependListener(event: 'checkContinue', listener: http.RequestListener): this; - prependListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependListener(event: 'request', listener: http.RequestListener): this; - prependListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'keylog', listener: (line: Buffer, tlsSocket: tls.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: tls.TLSSocket) => void): this; - prependOnceListener(event: 'tlsClientError', listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this; - prependOnceListener(event: 'close', listener: () => void): this; - prependOnceListener(event: 'connection', listener: (socket: Duplex) => void): this; - prependOnceListener(event: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'listening', listener: () => void): this; - prependOnceListener(event: 'checkContinue', listener: http.RequestListener): this; - prependOnceListener(event: 'checkExpectation', listener: http.RequestListener): this; - prependOnceListener(event: 'clientError', listener: (err: Error, socket: Duplex) => void): this; - prependOnceListener(event: 'connect', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - prependOnceListener(event: 'request', listener: http.RequestListener): this; - prependOnceListener(event: 'upgrade', listener: (req: http.IncomingMessage, socket: Duplex, head: Buffer) => void): this; - } - /** - * ```js - * // curl -k https://localhost:8000/ - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * - * Or - * - * ```js - * const https = require('https'); - * const fs = require('fs'); - * - * const options = { - * pfx: fs.readFileSync('test/fixtures/test_cert.pfx'), - * passphrase: 'sample' - * }; - * - * https.createServer(options, (req, res) => { - * res.writeHead(200); - * res.end('hello world\n'); - * }).listen(8000); - * ``` - * @since v0.3.4 - * @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`. - * @param requestListener A listener to be added to the `'request'` event. - */ - function createServer(requestListener?: http.RequestListener): Server; - function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server; - /** - * Makes a request to a secure web server. - * - * The following additional `options` from `tls.connect()` are also accepted:`ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`,`honorCipherOrder`, `key`, `passphrase`, - * `pfx`, `rejectUnauthorized`,`secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`,`highWaterMark`. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to - * upload a file with a POST request, then write to the `ClientRequest` object. - * - * ```js - * const https = require('https'); - * - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET' - * }; - * - * const req = https.request(options, (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * }); - * - * req.on('error', (e) => { - * console.error(e); - * }); - * req.end(); - * ``` - * - * Example using options from `tls.connect()`: - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') - * }; - * options.agent = new https.Agent(options); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Alternatively, opt out of connection pooling by not using an `Agent`. - * - * ```js - * const options = { - * hostname: 'encrypted.google.com', - * port: 443, - * path: '/', - * method: 'GET', - * key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), - * cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'), - * agent: false - * }; - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example using a `URL` as `options`: - * - * ```js - * const options = new URL('https://abc:xyz@example.com'); - * - * const req = https.request(options, (res) => { - * // ... - * }); - * ``` - * - * Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`): - * - * ```js - * const tls = require('tls'); - * const https = require('https'); - * const crypto = require('crypto'); - * - * function sha256(s) { - * return crypto.createHash('sha256').update(s).digest('base64'); - * } - * const options = { - * hostname: 'github.com', - * port: 443, - * path: '/', - * method: 'GET', - * checkServerIdentity: function(host, cert) { - * // Make sure the certificate is issued to the host we are connected to - * const err = tls.checkServerIdentity(host, cert); - * if (err) { - * return err; - * } - * - * // Pin the public key, similar to HPKP pin-sha25 pinning - * const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU='; - * if (sha256(cert.pubkey) !== pubkey256) { - * const msg = 'Certificate verification error: ' + - * `The public key of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // Pin the exact certificate, rather than the pub key - * const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' + - * 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16'; - * if (cert.fingerprint256 !== cert256) { - * const msg = 'Certificate verification error: ' + - * `The certificate of '${cert.subject.CN}' ` + - * 'does not match our pinned fingerprint'; - * return new Error(msg); - * } - * - * // This loop is informational only. - * // Print the certificate and public key fingerprints of all certs in the - * // chain. Its common to pin the public key of the issuer on the public - * // internet, while pinning the public key of the service in sensitive - * // environments. - * do { - * console.log('Subject Common Name:', cert.subject.CN); - * console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256); - * - * hash = crypto.createHash('sha256'); - * console.log(' Public key ping-sha256:', sha256(cert.pubkey)); - * - * lastprint256 = cert.fingerprint256; - * cert = cert.issuerCertificate; - * } while (cert.fingerprint256 !== lastprint256); - * - * }, - * }; - * - * options.agent = new https.Agent(options); - * const req = https.request(options, (res) => { - * console.log('All OK. Server matched our pinned cert or public key'); - * console.log('statusCode:', res.statusCode); - * // Print the HPKP values - * console.log('headers:', res.headers['public-key-pins']); - * - * res.on('data', (d) => {}); - * }); - * - * req.on('error', (e) => { - * console.error(e.message); - * }); - * req.end(); - * ``` - * - * Outputs for example: - * - * ```text - * Subject Common Name: github.com - * Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16 - * Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU= - * Subject Common Name: DigiCert SHA2 Extended Validation Server CA - * Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A - * Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho= - * Subject Common Name: DigiCert High Assurance EV Root CA - * Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF - * Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18= - * All OK. Server matched our pinned cert or public key - * statusCode: 200 - * headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho="; - * pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4="; - * pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains - * ``` - * @since v0.3.6 - * @param options Accepts all `options` from `request`, with some differences in default values: - */ - 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; - /** - * Like `http.get()` but for HTTPS. - * - * `options` can be an object, a string, or a `URL` object. If `options` is a - * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object. - * - * ```js - * const https = require('https'); - * - * https.get('https://encrypted.google.com/', (res) => { - * console.log('statusCode:', res.statusCode); - * console.log('headers:', res.headers); - * - * res.on('data', (d) => { - * process.stdout.write(d); - * }); - * - * }).on('error', (e) => { - * console.error(e); - * }); - * ``` - * @since v0.3.6 - * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. - */ - 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; -} -declare module 'node:https' { - export * from 'https'; -} diff --git a/JS/node_modules/@types/node/index.d.ts b/JS/node_modules/@types/node/index.d.ts deleted file mode 100755 index 9636fae..0000000 --- a/JS/node_modules/@types/node/index.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -// Type definitions for non-npm package Node.js 16.9 -// Project: https://nodejs.org/ -// Definitions by: Microsoft TypeScript -// DefinitelyTyped -// Alberto Schiabel -// Alvis HT Tang -// Andrew Makarov -// Benjamin Toueg -// Chigozirim C. -// David Junger -// Deividas Bakanas -// Eugene Y. Q. Shen -// Hannes Magnusson -// Huw -// Kelvin Jin -// Klaus Meinhardt -// Lishude -// Mariusz Wiktorczyk -// Mohsen Azimi -// Nicolas Even -// Nikita Galkin -// Parambir Singh -// Sebastian Silbermann -// Simon Schick -// Thomas den Hollander -// Wilco Bakker -// wwwy3y3 -// Samuel Ainsworth -// Kyle Uehlein -// Thanik Bhongbhibhat -// Marcin Kopacz -// Trivikram Kamat -// Minh Son Nguyen -// Junxiao Shi -// Ilia Baryshnikov -// ExE Boss -// Surasak Chaisurin -// Piotr Błażejewicz -// Anna Henningsen -// Jason Kwok -// Victor Perin -// Yongsheng Zhang -// NodeJS Contributors -// Linus Unnebäck -// wafuwafu13 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/** - * License for programmatically and manually incorporated - * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc - * - * Copyright Node.js contributors. 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. - */ - -// NOTE: These definitions support NodeJS and TypeScript 3.7+. - -// Reference required types from the default lib: -/// -/// -/// -/// - -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -/// diff --git a/JS/node_modules/@types/node/inspector.d.ts b/JS/node_modules/@types/node/inspector.d.ts deleted file mode 100755 index 0317192..0000000 --- a/JS/node_modules/@types/node/inspector.d.ts +++ /dev/null @@ -1,2738 +0,0 @@ -// 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. - -// tslint:disable:max-line-length - -/** - * The `inspector` module provides an API for interacting with the V8 inspector. - * - * It can be accessed using: - * - * ```js - * const inspector = require('inspector'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/inspector.js) - */ -declare module 'inspector' { - import EventEmitter = require('node:events'); - interface InspectorNotification { - method: string; - params: T; - } - 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 Runtime { - /** - * Unique script identifier. - */ - type ScriptId = string; - /** - * Unique object identifier. - */ - type RemoteObjectId = string; - /** - * Primitive value which cannot be JSON-stringified. - */ - 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 | undefined; - /** - * Object class (constructor) name. Specified for object type values only. - */ - className?: string | undefined; - /** - * 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 | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * Unique object identifier (for non-primitive values). - */ - objectId?: RemoteObjectId | undefined; - /** - * Preview containing abbreviated property values. Specified for object type values only. - * @experimental - */ - preview?: ObjectPreview | undefined; - /** - * @experimental - */ - customPreview?: CustomPreview | undefined; - } - /** - * @experimental - */ - interface CustomPreview { - header: string; - hasBody: boolean; - formatterObjectId: RemoteObjectId; - bindRemoteObjectFunctionId: RemoteObjectId; - configObjectId?: RemoteObjectId | undefined; - } - /** - * Object containing abbreviated remote object value. - * @experimental - */ - interface ObjectPreview { - /** - * Object type. - */ - type: string; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - /** - * String representation of the object. - */ - description?: string | undefined; - /** - * 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[] | undefined; - } - /** - * @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 | undefined; - /** - * Nested value preview. - */ - valuePreview?: ObjectPreview | undefined; - /** - * Object subtype hint. Specified for object type values only. - */ - subtype?: string | undefined; - } - /** - * @experimental - */ - interface EntryPreview { - /** - * Preview of the key. Specified for map-like collection entries. - */ - key?: ObjectPreview | undefined; - /** - * 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 | undefined; - /** - * True if the value associated with the property may be changed (data descriptors only). - */ - writable?: boolean | undefined; - /** - * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). - */ - get?: RemoteObject | undefined; - /** - * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). - */ - set?: RemoteObject | undefined; - /** - * 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 | undefined; - /** - * True if the property is owned for the object. - */ - isOwn?: boolean | undefined; - /** - * Property symbol object, if the property is of the symbol type. - */ - symbol?: RemoteObject | undefined; - } - /** - * 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 | undefined; - } - /** - * 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 | undefined; - /** - * Remote object handle. - */ - objectId?: RemoteObjectId | undefined; - } - /** - * 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?: {} | undefined; - } - /** - * 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 | undefined; - /** - * URL of the exception location, to be used when the script was not reported. - */ - url?: string | undefined; - /** - * JavaScript stack trace if available. - */ - stackTrace?: StackTrace | undefined; - /** - * Exception object if available. - */ - exception?: RemoteObject | undefined; - /** - * Identifier of the context where exception happened. - */ - executionContextId?: ExecutionContextId | undefined; - } - /** - * Number of milliseconds since epoch. - */ - type Timestamp = 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 | undefined; - /** - * JavaScript function name. - */ - callFrames: CallFrame[]; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - */ - parent?: StackTrace | undefined; - /** - * Asynchronous JavaScript stack trace that preceded this stack, if available. - * @experimental - */ - parentId?: StackTraceId | undefined; - } - /** - * 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 | undefined; - } - interface EvaluateParameterType { - /** - * Expression to evaluate. - */ - expression: string; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * 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 | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - 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 | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - } - 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 | undefined; - /** - * Call arguments. All call arguments must belong to the same JavaScript world as the target object. - */ - arguments?: CallArgument[] | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should be treated as initiated by user in the UI. - */ - userGesture?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - /** - * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. - */ - executionContextId?: ExecutionContextId | undefined; - /** - * 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 | undefined; - } - 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 | undefined; - /** - * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. - * @experimental - */ - accessorPropertiesOnly?: boolean | undefined; - /** - * Whether preview should be generated for the results. - * @experimental - */ - generatePreview?: boolean | undefined; - } - interface ReleaseObjectParameterType { - /** - * Identifier of the object to release. - */ - objectId: RemoteObjectId; - } - interface ReleaseObjectGroupParameterType { - /** - * Symbolic object group name. - */ - objectGroup: string; - } - interface SetCustomObjectFormatterEnabledParameterType { - enabled: boolean; - } - 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 | undefined; - } - 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 | undefined; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Determines whether Command Line API should be available during the evaluation. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object which should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - */ - generatePreview?: boolean | undefined; - /** - * Whether execution should await for resulting value and return once awaited promise is resolved. - */ - awaitPromise?: boolean | undefined; - } - interface QueryObjectsParameterType { - /** - * Identifier of the prototype to return objects for. - */ - prototypeObjectId: RemoteObjectId; - } - interface GlobalLexicalScopeNamesParameterType { - /** - * Specifies in which execution context to lookup global scope variables. - */ - executionContextId?: ExecutionContextId | undefined; - } - interface EvaluateReturnType { - /** - * Evaluation result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface AwaitPromiseReturnType { - /** - * Promise result. Will contain rejected value if promise was rejected. - */ - result: RemoteObject; - /** - * Exception details if stack strace is available. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CallFunctionOnReturnType { - /** - * Call result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface GetPropertiesReturnType { - /** - * Object properties. - */ - result: PropertyDescriptor[]; - /** - * Internal object properties (only of the element itself). - */ - internalProperties?: InternalPropertyDescriptor[] | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface CompileScriptReturnType { - /** - * Id of the script. - */ - scriptId?: ScriptId | undefined; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface RunScriptReturnType { - /** - * Run result. - */ - result: RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: ExceptionDetails | undefined; - } - interface QueryObjectsReturnType { - /** - * Array with objects. - */ - objects: RemoteObject; - } - interface GlobalLexicalScopeNamesReturnType { - names: string[]; - } - interface ExecutionContextCreatedEventDataType { - /** - * A newly created execution context. - */ - context: ExecutionContextDescription; - } - interface ExecutionContextDestroyedEventDataType { - /** - * Id of the destroyed context - */ - executionContextId: ExecutionContextId; - } - interface ExceptionThrownEventDataType { - /** - * Timestamp of the exception. - */ - timestamp: Timestamp; - exceptionDetails: ExceptionDetails; - } - interface ExceptionRevokedEventDataType { - /** - * Reason describing why exception was revoked. - */ - reason: string; - /** - * The id of revoked exception, as reported in exceptionThrown. - */ - exceptionId: number; - } - 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 | undefined; - /** - * 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 | undefined; - } - interface InspectRequestedEventDataType { - object: RemoteObject; - hints: {}; - } - } - 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 | undefined; - } - /** - * 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 | undefined; - /** - * 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 | undefined; - } - /** - * 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 | undefined; - /** - * Location in the source code where scope starts - */ - startLocation?: Location | undefined; - /** - * Location in the source code where scope ends - */ - endLocation?: Location | undefined; - } - /** - * 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 | undefined; - type?: string | undefined; - } - interface SetBreakpointsActiveParameterType { - /** - * New value for breakpoints active state. - */ - active: boolean; - } - interface SetSkipAllPausesParameterType { - /** - * New value for skip pauses state. - */ - skip: boolean; - } - interface SetBreakpointByUrlParameterType { - /** - * Line number to set breakpoint at. - */ - lineNumber: number; - /** - * URL of the resources to set breakpoint on. - */ - url?: string | undefined; - /** - * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. - */ - urlRegex?: string | undefined; - /** - * Script hash of the resources to set breakpoint on. - */ - scriptHash?: string | undefined; - /** - * Offset in the line to set breakpoint at. - */ - columnNumber?: number | undefined; - /** - * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. - */ - condition?: string | undefined; - } - 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 | undefined; - } - interface RemoveBreakpointParameterType { - breakpointId: BreakpointId; - } - 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 | undefined; - /** - * Only consider locations which are in the same (non-nested) function as start. - */ - restrictToFunction?: boolean | undefined; - } - interface ContinueToLocationParameterType { - /** - * Location to continue to. - */ - location: Location; - targetCallFrames?: string | undefined; - } - interface PauseOnAsyncCallParameterType { - /** - * Debugger will pause when async call with given stack trace is started. - */ - parentStackTraceId: Runtime.StackTraceId; - } - interface StepIntoParameterType { - /** - * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause. - * @experimental - */ - breakOnAsyncCall?: boolean | undefined; - } - interface GetStackTraceParameterType { - stackTraceId: Runtime.StackTraceId; - } - 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 | undefined; - /** - * If true, treats string parameter as regex. - */ - isRegex?: boolean | undefined; - } - 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 | undefined; - } - interface RestartFrameParameterType { - /** - * Call frame identifier to evaluate on. - */ - callFrameId: CallFrameId; - } - interface GetScriptSourceParameterType { - /** - * Id of the script to get source for. - */ - scriptId: Runtime.ScriptId; - } - interface SetPauseOnExceptionsParameterType { - /** - * Pause on exceptions mode. - */ - state: 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 | undefined; - /** - * Specifies whether command line API should be available to the evaluated expression, defaults to false. - */ - includeCommandLineAPI?: boolean | undefined; - /** - * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. - */ - silent?: boolean | undefined; - /** - * Whether the result is expected to be a JSON object that should be sent by value. - */ - returnByValue?: boolean | undefined; - /** - * Whether preview should be generated for the result. - * @experimental - */ - generatePreview?: boolean | undefined; - /** - * Whether to throw an exception if side effect cannot be ruled out during evaluation. - */ - throwOnSideEffect?: boolean | undefined; - } - 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 SetReturnValueParameterType { - /** - * New return value. - */ - newValue: Runtime.CallArgument; - } - 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 EnableReturnType { - /** - * Unique identifier of the debugger. - * @experimental - */ - debuggerId: Runtime.UniqueDebuggerId; - } - 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 SetBreakpointReturnType { - /** - * Id of the created breakpoint for further reference. - */ - breakpointId: BreakpointId; - /** - * Location this breakpoint resolved into. - */ - actualLocation: Location; - } - interface GetPossibleBreakpointsReturnType { - /** - * List of the possible breakpoint locations. - */ - locations: BreakLocation[]; - } - interface GetStackTraceReturnType { - stackTrace: Runtime.StackTrace; - } - interface SearchInContentReturnType { - /** - * List of search matches. - */ - result: SearchMatch[]; - } - interface SetScriptSourceReturnType { - /** - * New stack trace in case editing has happened while VM was stopped. - */ - callFrames?: CallFrame[] | undefined; - /** - * Whether current call stack was modified after applying the changes. - */ - stackChanged?: boolean | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * Exception details if any. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - interface RestartFrameReturnType { - /** - * New stack trace. - */ - callFrames: CallFrame[]; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - } - interface GetScriptSourceReturnType { - /** - * Script source. - */ - scriptSource: string; - } - interface EvaluateOnCallFrameReturnType { - /** - * Object wrapper for the evaluation result. - */ - result: Runtime.RemoteObject; - /** - * Exception details. - */ - exceptionDetails?: Runtime.ExceptionDetails | undefined; - } - 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?: {} | undefined; - /** - * True, if this script is generated as a result of the live edit operation. - * @experimental - */ - isLiveEdit?: boolean | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - 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?: {} | undefined; - /** - * URL of source map associated with script (if any). - */ - sourceMapURL?: string | undefined; - /** - * True, if this script has sourceURL. - */ - hasSourceURL?: boolean | undefined; - /** - * True, if this script is ES6 module. - */ - isModule?: boolean | undefined; - /** - * This script length. - */ - length?: number | undefined; - /** - * JavaScript top stack frame of where the script parsed event was triggered if available. - * @experimental - */ - stackTrace?: Runtime.StackTrace | undefined; - } - 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?: {} | undefined; - /** - * Hit breakpoints IDs - */ - hitBreakpoints?: string[] | undefined; - /** - * Async stack trace, if any. - */ - asyncStackTrace?: Runtime.StackTrace | undefined; - /** - * Async stack trace, if any. - * @experimental - */ - asyncStackTraceId?: Runtime.StackTraceId | undefined; - /** - * 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 | undefined; - } - } - 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 | undefined; - /** - * Line number in the resource that generated this message (1-based). - */ - line?: number | undefined; - /** - * Column number in the resource that generated this message (1-based). - */ - column?: number | undefined; - } - interface MessageAddedEventDataType { - /** - * Console message that has been added. - */ - message: ConsoleMessage; - } - } - 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 | undefined; - /** - * Child node ids. - */ - children?: number[] | undefined; - /** - * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. - */ - deoptReason?: string | undefined; - /** - * An array of source position ticks. - */ - positionTicks?: PositionTickInfo[] | undefined; - } - /** - * 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[] | undefined; - /** - * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. - */ - timeDeltas?: number[] | undefined; - } - /** - * 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 | undefined; - /** - * Collect block-based coverage. - */ - detailed?: boolean | undefined; - } - interface StopReturnType { - /** - * Recorded profile. - */ - profile: Profile; - } - interface TakePreciseCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface GetBestEffortCoverageReturnType { - /** - * Coverage data for the current isolate. - */ - result: ScriptCoverage[]; - } - interface TakeTypeProfileReturnType { - /** - * Type profile for all scripts since startTypeProfile() was turned on. - */ - result: ScriptTypeProfile[]; - } - interface ConsoleProfileStartedEventDataType { - id: string; - /** - * Location of console.profile(). - */ - location: Debugger.Location; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - interface ConsoleProfileFinishedEventDataType { - id: string; - /** - * Location of console.profileEnd(). - */ - location: Debugger.Location; - profile: Profile; - /** - * Profile title passed as an argument to console.profile(). - */ - title?: string | undefined; - } - } - 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 StartTrackingHeapObjectsParameterType { - trackAllocations?: boolean | undefined; - } - interface StopTrackingHeapObjectsParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. - */ - reportProgress?: boolean | undefined; - } - interface TakeHeapSnapshotParameterType { - /** - * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. - */ - reportProgress?: boolean | undefined; - } - interface GetObjectByHeapObjectIdParameterType { - objectId: HeapSnapshotObjectId; - /** - * Symbolic group name that can be used to release multiple objects. - */ - objectGroup?: string | undefined; - } - 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 StartSamplingParameterType { - /** - * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. - */ - samplingInterval?: number | undefined; - } - interface GetObjectByHeapObjectIdReturnType { - /** - * Evaluation result. - */ - result: Runtime.RemoteObject; - } - interface GetHeapObjectIdReturnType { - /** - * Id of the heap snapshot object corresponding to the passed remote object id. - */ - heapSnapshotObjectId: HeapSnapshotObjectId; - } - interface StopSamplingReturnType { - /** - * Recorded sampling heap profile. - */ - profile: SamplingHeapProfile; - } - interface GetSamplingProfileReturnType { - /** - * Return the sampling profile being collected. - */ - profile: SamplingHeapProfile; - } - interface AddHeapSnapshotChunkEventDataType { - chunk: string; - } - interface ReportHeapSnapshotProgressEventDataType { - done: number; - total: number; - finished?: boolean | undefined; - } - interface LastSeenObjectIdEventDataType { - lastSeenObjectId: number; - timestamp: number; - } - 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[]; - } - } - 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 DetachParameterType { - sessionId: SessionID; - } - 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; - } - } - namespace NodeRuntime { - interface NotifyWhenWaitingForDisconnectParameterType { - enabled: boolean; - } - } - /** - * 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. - * @since v8.0.0 - */ - 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. - * @since v8.0.0 - */ - 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. - * - * ```js - * session.post('Runtime.evaluate', { expression: '2 + 2' }, - * (error, { result }) => console.log(result)); - * // Output: { type: 'number', value: 4, description: '4' } - * ``` - * - * The latest version of the V8 inspector protocol is published on the[Chrome DevTools Protocol Viewer](https://chromedevtools.github.io/devtools-protocol/v8/). - * - * Node.js inspector supports all the Chrome DevTools Protocol domains declared - * by V8\. Chrome DevTools Protocol domain provides an interface for interacting - * with one of the runtime agents used to inspect the application state and listen - * to the run-time events. - * - * ## Example usage - * - * Apart from the debugger, various V8 Profilers are available through the DevTools - * protocol. - * @since v8.0.0 - */ - post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; - post(method: string, callback?: (err: Error | null, params?: {}) => void): void; - /** - * Returns supported domains. - */ - post(method: 'Schema.getDomains', callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * @experimental - */ - post(method: 'Runtime.setCustomObjectFormatterEnabled', params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Runtime.setCustomObjectFormatterEnabled', callback?: (err: Error | null) => 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; - /** - * 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; - 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; - /** - * 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; - /** - * 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; - /** - * Disables debugger for given page. - */ - post(method: 'Debugger.disable', callback?: (err: Error | null) => 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; - /** - * 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; - /** - * 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 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * @experimental - */ - post(method: 'Debugger.pauseOnAsyncCall', params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void; - post(method: 'Debugger.pauseOnAsyncCall', callback?: (err: Error | null) => void): void; - /** - * Steps over the statement. - */ - post(method: 'Debugger.stepOver', 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; - /** - * Stops on the next JavaScript statement. - */ - post(method: 'Debugger.pause', 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; - /** - * Resumes JavaScript execution. - */ - post(method: 'Debugger.resume', callback?: (err: Error | null) => 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * 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; - /** - * Disables console domain, prevents further console messages from being reported to the client. - */ - post(method: 'Console.disable', callback?: (err: Error | null) => void): void; - /** - * Does nothing. - */ - post(method: 'Console.clearMessages', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'Profiler.disable', callback?: (err: Error | null) => 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; - post(method: 'Profiler.stop', callback?: (err: Error | null, params: Profiler.StopReturnType) => 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; - /** - * 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; - /** - * 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 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; - /** - * Enable type profile. - * @experimental - */ - post(method: 'Profiler.startTypeProfile', 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 type profile. - * @experimental - */ - post(method: 'Profiler.takeTypeProfile', callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void; - post(method: 'HeapProfiler.enable', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.disable', 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.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: 'HeapProfiler.collectGarbage', callback?: (err: Error | null) => 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; - /** - * 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.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.startSampling', params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.startSampling', callback?: (err: Error | null) => void): void; - post(method: 'HeapProfiler.stopSampling', callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; - post(method: 'HeapProfiler.getSamplingProfile', callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => 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; - /** - * Detached from the worker with given sessionId. - */ - post(method: 'NodeWorker.detach', params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeWorker.detach', callback?: (err: Error | null) => void): void; - /** - * Enable the `NodeRuntime.waitingForDisconnect`. - */ - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void; - post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', 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 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 exception was thrown and unhandled. - */ - addListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - addListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - addListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => 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; - /** - * 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; - /** - * Fired when virtual machine fails to parse the script. - */ - addListener(event: 'Debugger.scriptFailedToParse', 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; - /** - * Issued when new console message is added. - */ - addListener(event: 'Console.messageAdded', 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; - addListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - addListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - addListener(event: 'HeapProfiler.reportHeapSnapshotProgress', 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; - /** - * 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; - /** - * 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; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - addListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'inspectorNotification', 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.exceptionThrown', message: InspectorNotification): boolean; - emit(event: 'Runtime.exceptionRevoked', message: InspectorNotification): boolean; - emit(event: 'Runtime.consoleAPICalled', message: InspectorNotification): boolean; - emit(event: 'Runtime.inspectRequested', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptParsed', message: InspectorNotification): boolean; - emit(event: 'Debugger.scriptFailedToParse', message: InspectorNotification): boolean; - emit(event: 'Debugger.breakpointResolved', message: InspectorNotification): boolean; - emit(event: 'Debugger.paused', message: InspectorNotification): boolean; - emit(event: 'Debugger.resumed'): boolean; - emit(event: 'Console.messageAdded', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileStarted', message: InspectorNotification): boolean; - emit(event: 'Profiler.consoleProfileFinished', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.addHeapSnapshotChunk', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.resetProfiles'): boolean; - emit(event: 'HeapProfiler.reportHeapSnapshotProgress', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.lastSeenObjectId', message: InspectorNotification): boolean; - emit(event: 'HeapProfiler.heapStatsUpdate', 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; - emit(event: 'NodeRuntime.waitingForDisconnect'): 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 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 exception was thrown and unhandled. - */ - on(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - on(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - on(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => 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; - /** - * 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; - /** - * Fired when virtual machine fails to parse the script. - */ - on(event: 'Debugger.scriptFailedToParse', 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; - /** - * Issued when new console message is added. - */ - on(event: 'Console.messageAdded', 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; - on(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - on(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - on(event: 'HeapProfiler.reportHeapSnapshotProgress', 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; - /** - * 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; - /** - * 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; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - on(event: 'NodeRuntime.waitingForDisconnect', listener: () => 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 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 exception was thrown and unhandled. - */ - once(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - once(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - once(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => 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; - /** - * 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; - /** - * Fired when virtual machine fails to parse the script. - */ - once(event: 'Debugger.scriptFailedToParse', 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; - /** - * Issued when new console message is added. - */ - once(event: 'Console.messageAdded', 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; - once(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - once(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - once(event: 'HeapProfiler.reportHeapSnapshotProgress', 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; - /** - * 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; - /** - * 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; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - once(event: 'NodeRuntime.waitingForDisconnect', listener: () => 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 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 exception was thrown and unhandled. - */ - prependListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => 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; - /** - * 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; - /** - * Fired when virtual machine fails to parse the script. - */ - prependListener(event: 'Debugger.scriptFailedToParse', 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; - /** - * Issued when new console message is added. - */ - prependListener(event: 'Console.messageAdded', 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; - prependListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependListener(event: 'HeapProfiler.reportHeapSnapshotProgress', 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; - /** - * 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; - /** - * 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; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => 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 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 exception was thrown and unhandled. - */ - prependOnceListener(event: 'Runtime.exceptionThrown', listener: (message: InspectorNotification) => void): this; - /** - * Issued when unhandled exception was revoked. - */ - prependOnceListener(event: 'Runtime.exceptionRevoked', listener: (message: InspectorNotification) => void): this; - /** - * Issued when console API was called. - */ - prependOnceListener(event: 'Runtime.consoleAPICalled', listener: (message: InspectorNotification) => 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; - /** - * 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; - /** - * Fired when virtual machine fails to parse the script. - */ - prependOnceListener(event: 'Debugger.scriptFailedToParse', 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; - /** - * Issued when new console message is added. - */ - prependOnceListener(event: 'Console.messageAdded', 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; - prependOnceListener(event: 'Profiler.consoleProfileFinished', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.addHeapSnapshotChunk', listener: (message: InspectorNotification) => void): this; - prependOnceListener(event: 'HeapProfiler.resetProfiles', listener: () => void): this; - prependOnceListener(event: 'HeapProfiler.reportHeapSnapshotProgress', 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; - /** - * 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; - /** - * 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; - /** - * This event is fired instead of `Runtime.executionContextDestroyed` when - * enabled. - * It is fired when the Node process finished all code execution and is - * waiting for all frontends to disconnect. - */ - prependOnceListener(event: 'NodeRuntime.waitingForDisconnect', listener: () => void): this; - } - /** - * Activate inspector on host and port. Equivalent to `node --inspect=[[host:]port]`, but can be done programmatically 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. - * - * See the `security warning` regarding the `host`parameter usage. - * @param [port='what was specified on the CLI'] Port to listen on for inspector connections. Optional. - * @param [host='what was specified on the CLI'] Host to listen on for inspector connections. Optional. - * @param [wait=false] Block until a client has connected. Optional. - */ - 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. - * - * ```console - * $ node --inspect -p 'inspector.url()' - * Debugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * For help see https://nodejs.org/en/docs/inspector - * ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34 - * - * $ node --inspect=localhost:3000 -p 'inspector.url()' - * Debugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * For help see https://nodejs.org/en/docs/inspector - * ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a - * - * $ node -p 'inspector.url()' - * undefined - * ``` - */ - function url(): string | undefined; - /** - * Blocks until a client (existing or connected later) has sent`Runtime.runIfWaitingForDebugger` command. - * - * An exception will be thrown if there is no active inspector. - * @since v12.7.0 - */ - function waitForDebugger(): void; -} -declare module 'node:inspector' { - import EventEmitter = require('inspector'); - export = EventEmitter; -} diff --git a/JS/node_modules/@types/node/module.d.ts b/JS/node_modules/@types/node/module.d.ts deleted file mode 100755 index d83aec9..0000000 --- a/JS/node_modules/@types/node/module.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * @since v0.3.7 - */ -declare module 'module' { - import { URL } from 'node:url'; - namespace Module { - /** - * The `module.syncBuiltinESMExports()` method updates all the live bindings for - * builtin `ES Modules` to match the properties of the `CommonJS` exports. It - * does not add or remove exported names from the `ES Modules`. - * - * ```js - * const fs = require('fs'); - * const assert = require('assert'); - * const { syncBuiltinESMExports } = require('module'); - * - * fs.readFile = newAPI; - * - * delete fs.readFileSync; - * - * function newAPI() { - * // ... - * } - * - * fs.newAPI = newAPI; - * - * syncBuiltinESMExports(); - * - * import('fs').then((esmFS) => { - * // It syncs the existing readFile property with the new value - * assert.strictEqual(esmFS.readFile, newAPI); - * // readFileSync has been deleted from the required fs - * assert.strictEqual('readFileSync' in fs, false); - * // syncBuiltinESMExports() does not remove readFileSync from esmFS - * assert.strictEqual('readFileSync' in esmFS, true); - * // syncBuiltinESMExports() does not add names - * assert.strictEqual(esmFS.newAPI, undefined); - * }); - * ``` - * @since v12.12.0 - */ - function syncBuiltinESMExports(): void; - /** - * `path` is the resolved path for the file for which a corresponding source map - * should be fetched. - * @since v13.7.0, v12.17.0 - */ - function findSourceMap(path: string, error?: Error): SourceMap; - interface SourceMapPayload { - file: string; - version: number; - sources: string[]; - sourcesContent: string[]; - names: string[]; - mappings: string; - sourceRoot: string; - } - interface SourceMapping { - generatedLine: number; - generatedColumn: number; - originalSource: string; - originalLine: number; - originalColumn: number; - } - /** - * @since v13.7.0, v12.17.0 - */ - class SourceMap { - /** - * Getter for the payload used to construct the `SourceMap` instance. - */ - readonly payload: SourceMapPayload; - constructor(payload: SourceMapPayload); - /** - * Given a line number and column number in the generated source file, returns - * an object representing the position in the original file. The object returned - * consists of the following keys: - */ - findEntry(line: number, column: number): SourceMapping; - } - } - interface Module extends NodeModule {} - class Module { - static runMain(): void; - static wrap(code: string): string; - static createRequire(path: string | URL): NodeRequire; - static builtinModules: string[]; - static Module: typeof Module; - constructor(id: string, parent?: Module); - } - global { - interface ImportMeta { - url: string; - /** - * @experimental - * This feature is only available with the `--experimental-import-meta-resolve` - * command flag enabled. - * - * Provides a module-relative resolution function scoped to each module, returning - * the URL string. - * - * @param specified The module specifier to resolve relative to `parent`. - * @param parent The absolute parent module URL to resolve from. If none - * is specified, the value of `import.meta.url` is used as the default. - */ - resolve?(specified: string, parent?: string | URL): Promise; - } - } - export = Module; -} -declare module 'node:module' { - import module = require('module'); - export = module; -} diff --git a/JS/node_modules/@types/node/net.d.ts b/JS/node_modules/@types/node/net.d.ts deleted file mode 100755 index a704b5f..0000000 --- a/JS/node_modules/@types/node/net.d.ts +++ /dev/null @@ -1,783 +0,0 @@ -/** - * > Stability: 2 - Stable - * - * The `net` module provides an asynchronous network API for creating stream-based - * TCP or `IPC` servers ({@link createServer}) and clients - * ({@link createConnection}). - * - * It can be accessed using: - * - * ```js - * const net = require('net'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/net.js) - */ -declare module 'net' { - import * as stream from 'node:stream'; - import { Abortable, EventEmitter } from 'node:events'; - import * as dns from 'node: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 | undefined; - allowHalfOpen?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - interface OnReadOpts { - buffer: Uint8Array | (() => Uint8Array); - /** - * This function is called for every chunk of incoming data. - * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer. - * Return false from this function to implicitly pause() the socket. - */ - callback(bytesWritten: number, buf: Uint8Array): boolean; - } - interface ConnectOpts { - /** - * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket. - * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will - * still be emitted as normal and methods like pause() and resume() will also behave as expected. - */ - onread?: OnReadOpts | undefined; - } - interface TcpSocketConnectOpts extends ConnectOpts { - port: number; - host?: string | undefined; - localAddress?: string | undefined; - localPort?: number | undefined; - hints?: number | undefined; - family?: number | undefined; - lookup?: LookupFunction | undefined; - } - interface IpcSocketConnectOpts extends ConnectOpts { - path: string; - } - type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; - /** - * This class is an abstraction of a TCP socket or a streaming `IPC` endpoint - * (uses named pipes on Windows, and Unix domain sockets otherwise). It is also - * an `EventEmitter`. - * - * A `net.Socket` can be created by the user and used directly to interact with - * a server. For example, it is returned by {@link createConnection}, - * so the user can use it to talk to the server. - * - * It can also be created by Node.js and passed to the user when a connection - * is received. For example, it is passed to the listeners of a `'connection'` event emitted on a {@link Server}, so the user can use - * it to interact with the client. - * @since v0.3.4 - */ - class Socket extends stream.Duplex { - constructor(options?: SocketConstructorOpts); - /** - * Sends data on the socket. The second parameter specifies the encoding in the - * case of a string. It defaults to UTF8 encoding. - * - * Returns `true` if the entire data was flushed successfully to the kernel - * buffer. Returns `false` if all or part of the data was queued in user memory.`'drain'` will be emitted when the buffer is again free. - * - * The optional `callback` parameter will be executed when the data is finally - * written out, which may not be immediately. - * - * See `Writable` stream `write()` method for more - * information. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - */ - write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean; - write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean; - /** - * Initiate a connection on a given socket. - * - * Possible signatures: - * - * * `socket.connect(options[, connectListener])` - * * `socket.connect(path[, connectListener])` for `IPC` connections. - * * `socket.connect(port[, host][, connectListener])` for TCP connections. - * * Returns: `net.Socket` The socket itself. - * - * This function is asynchronous. When the connection is established, the `'connect'` event will be emitted. If there is a problem connecting, - * instead of a `'connect'` event, an `'error'` event will be emitted with - * the error passed to the `'error'` listener. - * The last parameter `connectListener`, if supplied, will be added as a listener - * for the `'connect'` event **once**. - * - * This function should only be used for reconnecting a socket after`'close'` has been emitted or otherwise it may lead to undefined - * behavior. - */ - 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; - /** - * Set the encoding for the socket as a `Readable Stream`. See `readable.setEncoding()` for more information. - * @since v0.1.90 - * @return The socket itself. - */ - setEncoding(encoding?: BufferEncoding): this; - /** - * Pauses the reading of data. That is, `'data'` events will not be emitted. - * Useful to throttle back an upload. - * @return The socket itself. - */ - pause(): this; - /** - * Resumes reading after a call to `socket.pause()`. - * @return The socket itself. - */ - resume(): this; - /** - * Sets the socket to timeout after `timeout` milliseconds of inactivity on - * the socket. By default `net.Socket` do not have a timeout. - * - * When an idle timeout is triggered the socket will receive a `'timeout'` event but the connection will not be severed. The user must manually call `socket.end()` or `socket.destroy()` to - * end the connection. - * - * ```js - * socket.setTimeout(3000); - * socket.on('timeout', () => { - * console.log('socket timeout'); - * socket.end(); - * }); - * ``` - * - * If `timeout` is 0, then the existing idle timeout is disabled. - * - * The optional `callback` parameter will be added as a one-time listener for the `'timeout'` event. - * @since v0.1.90 - * @return The socket itself. - */ - setTimeout(timeout: number, callback?: () => void): this; - /** - * Enable/disable the use of Nagle's algorithm. - * - * When a TCP connection is created, it will have Nagle's algorithm enabled. - * - * Nagle's algorithm delays data before it is sent via the network. It attempts - * to optimize throughput at the expense of latency. - * - * Passing `true` for `noDelay` or not passing an argument will disable Nagle's - * algorithm for the socket. Passing `false` for `noDelay` will enable Nagle's - * algorithm. - * @since v0.1.90 - * @param [noDelay=true] - * @return The socket itself. - */ - setNoDelay(noDelay?: boolean): this; - /** - * Enable/disable keep-alive functionality, and optionally set the initial - * delay before the first keepalive probe is sent on an idle socket. - * - * Set `initialDelay` (in milliseconds) to set the delay between the last - * data packet received and the first keepalive probe. Setting `0` for`initialDelay` will leave the value unchanged from the default - * (or previous) setting. - * - * Enabling the keep-alive functionality will set the following socket options: - * - * * `SO_KEEPALIVE=1` - * * `TCP_KEEPIDLE=initialDelay` - * * `TCP_KEEPCNT=10` - * * `TCP_KEEPINTVL=1` - * @since v0.1.92 - * @param [enable=false] - * @param [initialDelay=0] - * @return The socket itself. - */ - setKeepAlive(enable?: boolean, initialDelay?: number): this; - /** - * Returns the bound `address`, the address `family` name and `port` of the - * socket as reported by the operating system:`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }` - * @since v0.1.90 - */ - address(): AddressInfo | {}; - /** - * Calling `unref()` on a socket will allow the program to exit if this is the only - * active socket in the event system. If the socket is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - unref(): this; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed socket will_not_ let the program exit if it's the only socket left (the default behavior). - * If the socket is `ref`ed calling `ref` again will have no effect. - * @since v0.9.1 - * @return The socket itself. - */ - ref(): this; - /** - * This property shows the number of characters buffered for writing. The buffer - * may contain strings whose length after encoding is not yet known. So this number - * is only an approximation of the number of bytes in the buffer. - * - * `net.Socket` has the property that `socket.write()` always works. This is to - * help users get up and running quickly. The computer cannot always keep up - * with the amount of data that is written to a socket. The network connection - * simply might be too slow. Node.js will internally queue up the data written to a - * socket and send it out over the wire when it is possible. - * - * The consequence of this internal buffering is that memory may grow. - * Users who experience large or growing `bufferSize` should attempt to - * "throttle" the data flows in their program with `socket.pause()` and `socket.resume()`. - * @since v0.3.8 - * @deprecated Since v14.6.0 - Use `writableLength` instead. - */ - readonly bufferSize: number; - /** - * The amount of received bytes. - * @since v0.5.3 - */ - readonly bytesRead: number; - /** - * The amount of bytes sent. - * @since v0.5.3 - */ - readonly bytesWritten: number; - /** - * If `true`,`socket.connect(options[, connectListener])` was - * called and has not yet finished. It will stay `true` until the socket becomes - * connected, then it is set to `false` and the `'connect'` event is emitted. Note - * that the `socket.connect(options[, connectListener])` callback is a listener for the `'connect'` event. - * @since v6.1.0 - */ - readonly connecting: boolean; - /** - * See `writable.destroyed` for further details. - */ - readonly destroyed: boolean; - /** - * The string representation of the local IP address the remote client is - * connecting on. For example, in a server listening on `'0.0.0.0'`, if a client - * connects on `'192.168.1.1'`, the value of `socket.localAddress` would be`'192.168.1.1'`. - * @since v0.9.6 - */ - readonly localAddress: string; - /** - * The numeric representation of the local port. For example, `80` or `21`. - * @since v0.9.6 - */ - readonly localPort: number; - /** - * The string representation of the remote IP address. For example,`'74.125.127.100'` or `'2001:4860:a005::68'`. Value may be `undefined` if - * the socket is destroyed (for example, if the client disconnected). - * @since v0.5.10 - */ - readonly remoteAddress?: string | undefined; - /** - * The string representation of the remote IP family. `'IPv4'` or `'IPv6'`. - * @since v0.11.14 - */ - readonly remoteFamily?: string | undefined; - /** - * The numeric representation of the remote port. For example, `80` or `21`. - * @since v0.5.10 - */ - readonly remotePort?: number | undefined; - /** - * Half-closes the socket. i.e., it sends a FIN packet. It is possible the - * server will still send some data. - * - * See `writable.end()` for further details. - * @since v0.1.90 - * @param [encoding='utf8'] Only used when data is `string`. - * @param callback Optional callback for when the socket is finished. - * @return The socket itself. - */ - end(callback?: () => void): void; - end(buffer: Uint8Array | string, callback?: () => void): void; - end(str: Uint8Array | string, encoding?: BufferEncoding, callback?: () => 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: (hadError: 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: 'ready', listener: () => void): this; - addListener(event: 'timeout', listener: () => void): this; - emit(event: string | symbol, ...args: any[]): boolean; - emit(event: 'close', hadError: 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: 'ready'): boolean; - emit(event: 'timeout'): boolean; - on(event: string, listener: (...args: any[]) => void): this; - on(event: 'close', listener: (hadError: 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: 'ready', listener: () => void): this; - on(event: 'timeout', listener: () => void): this; - once(event: string, listener: (...args: any[]) => void): this; - once(event: 'close', listener: (hadError: 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: 'ready', listener: () => void): this; - once(event: 'timeout', listener: () => void): this; - prependListener(event: string, listener: (...args: any[]) => void): this; - prependListener(event: 'close', listener: (hadError: 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: 'ready', listener: () => void): this; - prependListener(event: 'timeout', listener: () => void): this; - prependOnceListener(event: string, listener: (...args: any[]) => void): this; - prependOnceListener(event: 'close', listener: (hadError: 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: 'ready', listener: () => void): this; - prependOnceListener(event: 'timeout', listener: () => void): this; - } - interface ListenOptions extends Abortable { - port?: number | undefined; - host?: string | undefined; - backlog?: number | undefined; - path?: string | undefined; - exclusive?: boolean | undefined; - readableAll?: boolean | undefined; - writableAll?: boolean | undefined; - /** - * @default false - */ - ipv6Only?: boolean | undefined; - } - interface ServerOpts { - /** - * Indicates whether half-opened TCP connections are allowed. - * @default false - */ - allowHalfOpen?: boolean | undefined; - /** - * Indicates whether the socket should be paused on incoming connections. - * @default false - */ - pauseOnConnect?: boolean | undefined; - } - /** - * This class is used to create a TCP or `IPC` server. - * @since v0.1.90 - */ - class Server extends EventEmitter { - constructor(connectionListener?: (socket: Socket) => void); - constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void); - /** - * Start a server listening for connections. A `net.Server` can be a TCP or - * an `IPC` server depending on what it listens to. - * - * Possible signatures: - * - * * `server.listen(handle[, backlog][, callback])` - * * `server.listen(options[, callback])` - * * `server.listen(path[, backlog][, callback])` for `IPC` servers - * * `server.listen([port[, host[, backlog]]][, callback])` for TCP servers - * - * This function is asynchronous. When the server starts listening, the `'listening'` event will be emitted. The last parameter `callback`will be added as a listener for the `'listening'` - * event. - * - * All `listen()` methods can take a `backlog` parameter to specify the maximum - * length of the queue of pending connections. The actual length will be determined - * by the OS through sysctl settings such as `tcp_max_syn_backlog` and `somaxconn`on Linux. The default value of this parameter is 511 (not 512). - * - * All {@link Socket} are set to `SO_REUSEADDR` (see [`socket(7)`](https://man7.org/linux/man-pages/man7/socket.7.html) for - * details). - * - * The `server.listen()` method can be called again if and only if there was an - * error during the first `server.listen()` call or `server.close()` has been - * called. Otherwise, an `ERR_SERVER_ALREADY_LISTEN` error will be thrown. - * - * One of the most common errors raised when listening is `EADDRINUSE`. - * This happens when another server is already listening on the requested`port`/`path`/`handle`. One way to handle this would be to retry - * after a certain amount of time: - * - * ```js - * server.on('error', (e) => { - * if (e.code === 'EADDRINUSE') { - * console.log('Address in use, retrying...'); - * setTimeout(() => { - * server.close(); - * server.listen(PORT, HOST); - * }, 1000); - * } - * }); - * ``` - */ - 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; - /** - * Stops the server from accepting new connections and keeps existing - * connections. This function is asynchronous, the server is finally closed - * when all connections are ended and the server emits a `'close'` event. - * The optional `callback` will be called once the `'close'` event occurs. Unlike - * that event, it will be called with an `Error` as its only argument if the server - * was not open when it was closed. - * @since v0.1.90 - * @param callback Called when the server is closed. - */ - close(callback?: (err?: Error) => void): this; - /** - * Returns the bound `address`, the address `family` name, and `port` of the server - * as reported by the operating system if listening on an IP socket - * (useful to find which port was assigned when getting an OS-assigned address):`{ port: 12346, family: 'IPv4', address: '127.0.0.1' }`. - * - * For a server listening on a pipe or Unix domain socket, the name is returned - * as a string. - * - * ```js - * const server = net.createServer((socket) => { - * socket.end('goodbye\n'); - * }).on('error', (err) => { - * // Handle errors here. - * throw err; - * }); - * - * // Grab an arbitrary unused port. - * server.listen(() => { - * console.log('opened server on', server.address()); - * }); - * ``` - * - * `server.address()` returns `null` before the `'listening'` event has been - * emitted or after calling `server.close()`. - * @since v0.1.90 - */ - address(): AddressInfo | string | null; - /** - * Asynchronously get the number of concurrent connections on the server. Works - * when sockets were sent to forks. - * - * Callback should take two arguments `err` and `count`. - * @since v0.9.7 - */ - getConnections(cb: (error: Error | null, count: number) => void): void; - /** - * Opposite of `unref()`, calling `ref()` on a previously `unref`ed server will_not_ let the program exit if it's the only server left (the default behavior). - * If the server is `ref`ed calling `ref()` again will have no effect. - * @since v0.9.1 - */ - ref(): this; - /** - * Calling `unref()` on a server will allow the program to exit if this is the only - * active server in the event system. If the server is already `unref`ed calling`unref()` again will have no effect. - * @since v0.9.1 - */ - unref(): this; - /** - * Set this property to reject connections when the server's connection count gets - * high. - * - * It is not recommended to use this option once a socket has been sent to a child - * with `child_process.fork()`. - * @since v0.2.0 - */ - maxConnections: number; - connections: number; - /** - * Indicates whether or not the server is listening for connections. - * @since v5.7.0 - */ - 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; - } - type IPVersion = 'ipv4' | 'ipv6'; - /** - * The `BlockList` object can be used with some network APIs to specify rules for - * disabling inbound or outbound access to specific IP addresses, IP ranges, or - * IP subnets. - * @since v15.0.0 - */ - class BlockList { - /** - * Adds a rule to block the given IP address. - * @since v15.0.0 - * @param address An IPv4 or IPv6 address. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addAddress(address: string, type?: IPVersion): void; - addAddress(address: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses from `start` (inclusive) to`end` (inclusive). - * @since v15.0.0 - * @param start The starting IPv4 or IPv6 address in the range. - * @param end The ending IPv4 or IPv6 address in the range. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addRange(start: string, end: string, type?: IPVersion): void; - addRange(start: SocketAddress, end: SocketAddress): void; - /** - * Adds a rule to block a range of IP addresses specified as a subnet mask. - * @since v15.0.0 - * @param net The network IPv4 or IPv6 address. - * @param prefix The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`. - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - addSubnet(net: SocketAddress, prefix: number): void; - addSubnet(net: string, prefix: number, type?: IPVersion): void; - /** - * Returns `true` if the given IP address matches any of the rules added to the`BlockList`. - * - * ```js - * const blockList = new net.BlockList(); - * blockList.addAddress('123.123.123.123'); - * blockList.addRange('10.0.0.1', '10.0.0.10'); - * blockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6'); - * - * console.log(blockList.check('123.123.123.123')); // Prints: true - * console.log(blockList.check('10.0.0.3')); // Prints: true - * console.log(blockList.check('222.111.111.222')); // Prints: false - * - * // IPv6 notation for IPv4 addresses works: - * console.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true - * console.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true - * ``` - * @since v15.0.0 - * @param address The IP address to check - * @param [type='ipv4'] Either `'ipv4'` or `'ipv6'`. - */ - check(address: SocketAddress): boolean; - check(address: string, type?: IPVersion): boolean; - } - interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { - timeout?: number | undefined; - } - type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; - /** - * Creates a new TCP or `IPC` server. - * - * If `allowHalfOpen` is set to `true`, when the other end of the socket - * signals the end of transmission, the server will only send back the end of - * transmission when `socket.end()` is explicitly called. For example, in the - * context of TCP, when a FIN packed is received, a FIN packed is sent - * back only when `socket.end()` is explicitly called. Until then the - * connection is half-closed (non-readable but still writable). See `'end'` event and [RFC 1122](https://tools.ietf.org/html/rfc1122) (section 4.2.2.13) for more information. - * - * If `pauseOnConnect` is set to `true`, then the socket associated with each - * incoming connection will be paused, and no data will be read from its handle. - * This allows connections to be passed between processes without any data being - * read by the original process. To begin reading data from a paused socket, call `socket.resume()`. - * - * The server can be a TCP server or an `IPC` server, depending on what it `listen()` to. - * - * Here is an example of an TCP echo server which listens for connections - * on port 8124: - * - * ```js - * const net = require('net'); - * const server = net.createServer((c) => { - * // 'connection' listener. - * console.log('client connected'); - * c.on('end', () => { - * console.log('client disconnected'); - * }); - * c.write('hello\r\n'); - * c.pipe(c); - * }); - * server.on('error', (err) => { - * throw err; - * }); - * server.listen(8124, () => { - * console.log('server bound'); - * }); - * ``` - * - * Test this by using `telnet`: - * - * ```console - * $ telnet localhost 8124 - * ``` - * - * To listen on the socket `/tmp/echo.sock`: - * - * ```js - * server.listen('/tmp/echo.sock', () => { - * console.log('server bound'); - * }); - * ``` - * - * Use `nc` to connect to a Unix domain socket server: - * - * ```console - * $ nc -U /tmp/echo.sock - * ``` - * @since v0.5.0 - * @param connectionListener Automatically set as a listener for the {@link 'connection'} event. - */ - function createServer(connectionListener?: (socket: Socket) => void): Server; - function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server; - /** - * Aliases to {@link createConnection}. - * - * Possible signatures: - * - * * {@link connect} - * * {@link connect} for `IPC` connections. - * * {@link connect} for TCP connections. - */ - function connect(options: NetConnectOpts, connectionListener?: () => void): Socket; - function connect(port: number, host?: string, connectionListener?: () => void): Socket; - function connect(path: string, connectionListener?: () => void): Socket; - /** - * A factory function, which creates a new {@link Socket}, - * immediately initiates connection with `socket.connect()`, - * then returns the `net.Socket` that starts the connection. - * - * When the connection is established, a `'connect'` event will be emitted - * on the returned socket. The last parameter `connectListener`, if supplied, - * will be added as a listener for the `'connect'` event **once**. - * - * Possible signatures: - * - * * {@link createConnection} - * * {@link createConnection} for `IPC` connections. - * * {@link createConnection} for TCP connections. - * - * The {@link connect} function is an alias to this function. - */ - function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket; - function createConnection(port: number, host?: string, connectionListener?: () => void): Socket; - function createConnection(path: string, connectionListener?: () => void): Socket; - /** - * Tests if input is an IP address. Returns `0` for invalid strings, - * returns `4` for IP version 4 addresses, and returns `6` for IP version 6 - * addresses. - * @since v0.3.0 - */ - function isIP(input: string): number; - /** - * Returns `true` if input is a version 4 IP address, otherwise returns `false`. - * @since v0.3.0 - */ - function isIPv4(input: string): boolean; - /** - * Returns `true` if input is a version 6 IP address, otherwise returns `false`. - * @since v0.3.0 - */ - function isIPv6(input: string): boolean; - interface SocketAddressInitOptions { - /** - * The network address as either an IPv4 or IPv6 string. - * @default 127.0.0.1 - */ - address?: string | undefined; - /** - * @default `'ipv4'` - */ - family?: IPVersion | undefined; - /** - * An IPv6 flow-label used only if `family` is `'ipv6'`. - * @default 0 - */ - flowlabel?: number | undefined; - /** - * An IP port. - * @default 0 - */ - port?: number | undefined; - } - /** - * @since v15.14.0 - */ - class SocketAddress { - constructor(options: SocketAddressInitOptions); - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0 - */ - readonly address: string; - /** - * Either \`'ipv4'\` or \`'ipv6'\`. - * @since v15.14.0 - */ - readonly family: IPVersion; - /** - * @since v15.14.0 - */ - readonly port: number; - /** - * @since v15.14.0 - */ - readonly flowlabel: number; - } -} -declare module 'node:net' { - export * from 'net'; -} diff --git a/JS/node_modules/@types/node/os.d.ts b/JS/node_modules/@types/node/os.d.ts deleted file mode 100755 index 000fa5e..0000000 --- a/JS/node_modules/@types/node/os.d.ts +++ /dev/null @@ -1,455 +0,0 @@ -/** - * The `os` module provides operating system-related utility methods and - * properties. It can be accessed using: - * - * ```js - * const os = require('os'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/os.js) - */ -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; - /** - * Returns the host name of the operating system as a string. - * @since v0.3.3 - */ - function hostname(): string; - /** - * Returns an array containing the 1, 5, and 15 minute load averages. - * - * The load average is a measure of system activity calculated by the operating - * system and expressed as a fractional number. - * - * The load average is a Unix-specific concept. On Windows, the return value is - * always `[0, 0, 0]`. - * @since v0.3.3 - */ - function loadavg(): number[]; - /** - * Returns the system uptime in number of seconds. - * @since v0.3.3 - */ - function uptime(): number; - /** - * Returns the amount of free system memory in bytes as an integer. - * @since v0.3.3 - */ - function freemem(): number; - /** - * Returns the total amount of system memory in bytes as an integer. - * @since v0.3.3 - */ - function totalmem(): number; - /** - * Returns an array of objects containing information about each logical CPU core. - * - * The properties included on each object include: - * - * ```js - * [ - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 252020, - * nice: 0, - * sys: 30340, - * idle: 1070356870, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 306960, - * nice: 0, - * sys: 26980, - * idle: 1071569080, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 248450, - * nice: 0, - * sys: 21750, - * idle: 1070919370, - * irq: 0 - * } - * }, - * { - * model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz', - * speed: 2926, - * times: { - * user: 256880, - * nice: 0, - * sys: 19430, - * idle: 1070905480, - * irq: 20 - * } - * }, - * ] - * ``` - * - * `nice` values are POSIX-only. On Windows, the `nice` values of all processors - * are always 0. - * @since v0.3.3 - */ - function cpus(): CpuInfo[]; - /** - * Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it - * returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows. - * - * See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information - * about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems. - * @since v0.3.3 - */ - function type(): string; - /** - * Returns the operating system as a string. - * - * On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. - * See[https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v0.3.3 - */ - function release(): string; - /** - * Returns an object containing network interfaces that have been assigned a - * network address. - * - * Each key on the returned object identifies a network interface. The associated - * value is an array of objects that each describe an assigned network address. - * - * The properties available on the assigned network address object include: - * - * ```js - * { - * lo: [ - * { - * address: '127.0.0.1', - * netmask: '255.0.0.0', - * family: 'IPv4', - * mac: '00:00:00:00:00:00', - * internal: true, - * cidr: '127.0.0.1/8' - * }, - * { - * address: '::1', - * netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', - * family: 'IPv6', - * mac: '00:00:00:00:00:00', - * scopeid: 0, - * internal: true, - * cidr: '::1/128' - * } - * ], - * eth0: [ - * { - * address: '192.168.1.108', - * netmask: '255.255.255.0', - * family: 'IPv4', - * mac: '01:02:03:0a:0b:0c', - * internal: false, - * cidr: '192.168.1.108/24' - * }, - * { - * address: 'fe80::a00:27ff:fe4e:66a1', - * netmask: 'ffff:ffff:ffff:ffff::', - * family: 'IPv6', - * mac: '01:02:03:0a:0b:0c', - * scopeid: 1, - * internal: false, - * cidr: 'fe80::a00:27ff:fe4e:66a1/64' - * } - * ] - * } - * ``` - * @since v0.6.0 - */ - function networkInterfaces(): NodeJS.Dict; - /** - * Returns the string path of the current user's home directory. - * - * On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it - * uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory. - * - * On Windows, it uses the `USERPROFILE` environment variable if defined. - * Otherwise it uses the path to the profile directory of the current user. - * @since v2.3.0 - */ - function homedir(): string; - /** - * Returns information about the currently effective user. On POSIX platforms, - * this is typically a subset of the password file. The returned object includes - * the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`. - * - * The value of `homedir` returned by `os.userInfo()` is provided by the operating - * system. This differs from the result of `os.homedir()`, which queries - * environment variables for the home directory before falling back to the - * operating system response. - * - * Throws a `SystemError` if a user has no `username` or `homedir`. - * @since v6.0.0 - */ - function userInfo(options: { encoding: 'buffer' }): UserInfo; - function userInfo(options?: { encoding: BufferEncoding }): UserInfo; - type SignalConstants = { - [key in NodeJS.Signals]: number; - }; - namespace constants { - const UV_UDP_REUSEADDR: number; - namespace signals {} - const signals: SignalConstants; - namespace errno { - 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 EDQUOT: 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 EMULTIHOP: 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 ESTALE: 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; - } - namespace priority { - const PRIORITY_LOW: number; - const PRIORITY_BELOW_NORMAL: number; - const PRIORITY_NORMAL: number; - const PRIORITY_ABOVE_NORMAL: number; - const PRIORITY_HIGH: number; - const PRIORITY_HIGHEST: number; - } - } - const devNull: string; - const EOL: string; - /** - * Returns the operating system CPU architecture for which the Node.js binary was - * compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`. - * - * The return value is equivalent to `process.arch`. - * @since v0.5.0 - */ - function arch(): string; - /** - * Returns a string identifying the kernel version. - * - * On POSIX systems, the operating system release is determined by calling[`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not - * available, `GetVersionExW()` will be used. See[https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information. - * @since v13.11.0, v12.17.0 - */ - function version(): string; - /** - * Returns a string identifying the operating system platform. The value is set - * at compile time. Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`, `'openbsd'`, `'sunos'`, and `'win32'`. - * - * The return value is equivalent to `process.platform`. - * - * The value `'android'` may also be returned if Node.js is built on the Android - * operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.5.0 - */ - function platform(): NodeJS.Platform; - /** - * Returns the operating system's default directory for temporary files as a - * string. - * @since v0.9.9 - */ - function tmpdir(): string; - /** - * Returns a string identifying the endianness of the CPU for which the Node.js - * binary was compiled. - * - * Possible values are `'BE'` for big endian and `'LE'` for little endian. - * @since v0.9.4 - */ - function endianness(): 'BE' | 'LE'; - /** - * Returns the scheduling priority for the process specified by `pid`. If `pid` is - * not provided or is `0`, the priority of the current process is returned. - * @since v10.10.0 - * @param [pid=0] The process ID to retrieve scheduling priority for. - */ - function getPriority(pid?: number): number; - /** - * Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used. - * - * The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows - * priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range - * mapping may cause the return value to be slightly different on Windows. To avoid - * confusion, set `priority` to one of the priority constants. - * - * On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user - * privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`. - * @since v10.10.0 - * @param [pid=0] The process ID to set scheduling priority for. - * @param priority The scheduling priority to assign to the process. - */ - function setPriority(priority: number): void; - function setPriority(pid: number, priority: number): void; -} -declare module 'node:os' { - export * from 'os'; -} diff --git a/JS/node_modules/@types/node/package.json b/JS/node_modules/@types/node/package.json deleted file mode 100755 index 9319db3..0000000 --- a/JS/node_modules/@types/node/package.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "name": "@types/node", - "version": "16.9.1", - "description": "TypeScript definitions for Node.js", - "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", - "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": "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": "Chigozirim C.", - "url": "https://github.com/smac89", - "githubUsername": "smac89" - }, - { - "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": "Hannes Magnusson", - "url": "https://github.com/Hannes-Magnusson-CK", - "githubUsername": "Hannes-Magnusson-CK" - }, - { - "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": "Mohsen Azimi", - "url": "https://github.com/mohsen1", - "githubUsername": "mohsen1" - }, - { - "name": "Nicolas Even", - "url": "https://github.com/n-e", - "githubUsername": "n-e" - }, - { - "name": "Nikita Galkin", - "url": "https://github.com/galkin", - "githubUsername": "galkin" - }, - { - "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": "Samuel Ainsworth", - "url": "https://github.com/samuela", - "githubUsername": "samuela" - }, - { - "name": "Kyle Uehlein", - "url": "https://github.com/kuehlein", - "githubUsername": "kuehlein" - }, - { - "name": "Thanik Bhongbhibhat", - "url": "https://github.com/bhongy", - "githubUsername": "bhongy" - }, - { - "name": "Marcin Kopacz", - "url": "https://github.com/chyzwar", - "githubUsername": "chyzwar" - }, - { - "name": "Trivikram Kamat", - "url": "https://github.com/trivikr", - "githubUsername": "trivikr" - }, - { - "name": "Minh Son Nguyen", - "url": "https://github.com/nguymin4", - "githubUsername": "nguymin4" - }, - { - "name": "Junxiao Shi", - "url": "https://github.com/yoursunny", - "githubUsername": "yoursunny" - }, - { - "name": "Ilia Baryshnikov", - "url": "https://github.com/qwelias", - "githubUsername": "qwelias" - }, - { - "name": "ExE Boss", - "url": "https://github.com/ExE-Boss", - "githubUsername": "ExE-Boss" - }, - { - "name": "Surasak Chaisurin", - "url": "https://github.com/Ryan-Willpower", - "githubUsername": "Ryan-Willpower" - }, - { - "name": "Piotr Błażejewicz", - "url": "https://github.com/peterblazejewicz", - "githubUsername": "peterblazejewicz" - }, - { - "name": "Anna Henningsen", - "url": "https://github.com/addaleax", - "githubUsername": "addaleax" - }, - { - "name": "Jason Kwok", - "url": "https://github.com/JasonHK", - "githubUsername": "JasonHK" - }, - { - "name": "Victor Perin", - "url": "https://github.com/victorperin", - "githubUsername": "victorperin" - }, - { - "name": "Yongsheng Zhang", - "url": "https://github.com/ZYSzys", - "githubUsername": "ZYSzys" - }, - { - "name": "NodeJS Contributors", - "url": "https://github.com/NodeJS", - "githubUsername": "NodeJS" - }, - { - "name": "Linus Unnebäck", - "url": "https://github.com/LinusU", - "githubUsername": "LinusU" - }, - { - "name": "wafuwafu13", - "url": "https://github.com/wafuwafu13", - "githubUsername": "wafuwafu13" - } - ], - "main": "", - "types": "index.d.ts", - "repository": { - "type": "git", - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", - "directory": "types/node" - }, - "scripts": {}, - "dependencies": {}, - "typesPublisherContentHash": "2d4a0159d689896e5538afa996ef597df6922b3b716729c273148522b74b9f6c", - "typeScriptVersion": "3.7" -} \ No newline at end of file diff --git a/JS/node_modules/@types/node/path.d.ts b/JS/node_modules/@types/node/path.d.ts deleted file mode 100755 index 58712be..0000000 --- a/JS/node_modules/@types/node/path.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -declare module 'path/posix' { - import path = require('path'); - export = path; -} -declare module 'path/win32' { - import path = require('path'); - export = path; -} -/** - * The `path` module provides utilities for working with file and directory paths. - * It can be accessed using: - * - * ```js - * const path = require('path'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/path.js) - */ -declare module 'path' { - namespace 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 | undefined; - /** - * The full directory path such as '/home/user/dir' or 'c:\path\dir' - */ - dir?: string | undefined; - /** - * The file name including extension (if any) such as 'index.html' - */ - base?: string | undefined; - /** - * The file extension (if any) such as '.html' - */ - ext?: string | undefined; - /** - * The file name without extension (if any) such as 'index' - */ - name?: string | undefined; - } - interface PlatformPath { - /** - * 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. - */ - 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. - */ - 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. - */ - 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. - */ - isAbsolute(p: 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. - */ - 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. - */ - 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. - */ - 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. - */ - extname(p: string): string; - /** - * The platform-specific file separator. '\\' or '/'. - */ - readonly sep: string; - /** - * The platform-specific file delimiter. ';' or ':'. - */ - readonly delimiter: string; - /** - * Returns an object from a path string - the opposite of format(). - * - * @param pathString path to evaluate. - */ - parse(p: string): ParsedPath; - /** - * Returns a path string from an object - the opposite of parse(). - * - * @param pathString path to evaluate. - */ - format(pP: FormatInputPathObject): string; - /** - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path. - * If path is not a string, path will be returned without modifications. - * This method is meaningful only on Windows system. - * On POSIX systems, the method is non-operational and always returns path without modifications. - */ - toNamespacedPath(path: string): string; - /** - * Posix specific pathing. - * Same as parent object on posix. - */ - readonly posix: PlatformPath; - /** - * Windows specific pathing. - * Same as parent object on windows - */ - readonly win32: PlatformPath; - } - } - const path: path.PlatformPath; - export = path; -} -declare module 'node:path' { - import path = require('path'); - export = path; -} diff --git a/JS/node_modules/@types/node/perf_hooks.d.ts b/JS/node_modules/@types/node/perf_hooks.d.ts deleted file mode 100755 index 02f330c..0000000 --- a/JS/node_modules/@types/node/perf_hooks.d.ts +++ /dev/null @@ -1,555 +0,0 @@ -/** - * This module provides an implementation of a subset of the W3C[Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for - * Node.js-specific performance measurements. - * - * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/): - * - * * [High Resolution Time](https://www.w3.org/TR/hr-time-2) - * * [Performance Timeline](https://w3c.github.io/performance-timeline/) - * * [User Timing](https://www.w3.org/TR/user-timing/) - * - * ```js - * const { PerformanceObserver, performance } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((items) => { - * console.log(items.getEntries()[0].duration); - * performance.clearMarks(); - * }); - * obs.observe({ type: 'measure' }); - * performance.measure('Start to Now'); - * - * performance.mark('A'); - * doSomeLongRunningProcess(() => { - * performance.measure('A to Now', 'A'); - * - * performance.mark('B'); - * performance.measure('A to B', 'A', 'B'); - * }); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/perf_hooks.js) - */ -declare module 'perf_hooks' { - import { AsyncResource } from 'node:async_hooks'; - type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http'; - interface NodeGCPerformanceDetail { - /** - * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies - * the type of garbage collection operation that occurred. - * See perf_hooks.constants for valid values. - */ - readonly kind?: number | undefined; - /** - * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags` - * property contains additional information about garbage collection operation. - * See perf_hooks.constants for valid values. - */ - readonly flags?: number | undefined; - } - /** - * @since v8.5.0 - */ - class PerformanceEntry { - protected constructor(); - /** - * The total number of milliseconds elapsed for this entry. This value will not - * be meaningful for all Performance Entry types. - * @since v8.5.0 - */ - readonly duration: number; - /** - * The name of the performance entry. - * @since v8.5.0 - */ - readonly name: string; - /** - * The high resolution millisecond timestamp marking the starting time of the - * Performance Entry. - * @since v8.5.0 - */ - readonly startTime: number; - /** - * The type of the performance entry. It may be one of: - * - * * `'node'` (Node.js only) - * * `'mark'` (available on the Web) - * * `'measure'` (available on the Web) - * * `'gc'` (Node.js only) - * * `'function'` (Node.js only) - * * `'http2'` (Node.js only) - * * `'http'` (Node.js only) - * @since v8.5.0 - */ - readonly entryType: EntryType; - /** - * Additional detail specific to the `entryType`. - * @since v16.0.0 - */ - readonly details?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type. - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Provides timing details for Node.js itself. The constructor of this class - * is not exposed to users. - * @since v8.5.0 - */ - class PerformanceNodeTiming extends PerformanceEntry { - /** - * The high resolution millisecond timestamp at which the Node.js process - * completed bootstrapping. If bootstrapping has not yet finished, the property - * has the value of -1. - * @since v8.5.0 - */ - readonly bootstrapComplete: number; - /** - * The high resolution millisecond timestamp at which the Node.js environment was - * initialized. - * @since v8.5.0 - */ - readonly environment: number; - /** - * The high resolution millisecond timestamp of the amount of time the event loop - * has been idle within the event loop's event provider (e.g. `epoll_wait`). This - * does not take CPU usage into consideration. If the event loop has not yet - * started (e.g., in the first tick of the main script), the property has the - * value of 0. - * @since v14.10.0, v12.19.0 - */ - readonly idleTime: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * exited. If the event loop has not yet exited, the property has the value of -1\. - * It can only have a value of not -1 in a handler of the `'exit'` event. - * @since v8.5.0 - */ - readonly loopExit: number; - /** - * The high resolution millisecond timestamp at which the Node.js event loop - * started. If the event loop has not yet started (e.g., in the first tick of the - * main script), the property has the value of -1. - * @since v8.5.0 - */ - readonly loopStart: number; - /** - * The high resolution millisecond timestamp at which the V8 platform was - * initialized. - * @since v8.5.0 - */ - readonly v8Start: number; - } - interface EventLoopUtilization { - idle: number; - active: number; - utilization: number; - } - /** - * @param util1 The result of a previous call to eventLoopUtilization() - * @param util2 The result of a previous call to eventLoopUtilization() prior to util1 - */ - type EventLoopUtilityFunction = (util1?: EventLoopUtilization, util2?: EventLoopUtilization) => EventLoopUtilization; - interface MarkOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * An optional timestamp to be used as the mark time. - * @default `performance.now()`. - */ - startTime?: number | undefined; - } - interface MeasureOptions { - /** - * Additional optional detail to include with the mark. - */ - detail?: unknown | undefined; - /** - * Duration between start and end times. - */ - duration?: number | undefined; - /** - * Timestamp to be used as the end time, or a string identifying a previously recorded mark. - */ - end?: number | string | undefined; - /** - * Timestamp to be used as the start time, or a string identifying a previously recorded mark. - */ - start?: number | string | undefined; - } - interface TimerifyOptions { - /** - * A histogram object created using - * `perf_hooks.createHistogram()` that will record runtime durations in - * nanoseconds. - */ - histogram?: RecordableHistogram | undefined; - } - interface Performance { - /** - * 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; - /** - * 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, options?: MarkOptions): 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; - measure(name: string, options: MeasureOptions): 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, options?: TimerifyOptions): T; - /** - * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. - * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). - * No other CPU idle time is taken into consideration. - */ - eventLoopUtilization: EventLoopUtilityFunction; - } - interface PerformanceObserverEntryList { - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntries()); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 81.465639, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 81.860064, - * * duration: 0 - * * } - * * ] - * - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntries(): PerformanceEntry[]; - /** - * Returns 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`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByName('meow')); - * - * * [ - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 98.545991, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('nope')); // [] - * - * console.log(perfObserverList.getEntriesByName('test', 'mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 63.518931, - * * duration: 0 - * * } - * * ] - * - * console.log(perfObserverList.getEntriesByName('test', 'measure')); // [] - * observer.disconnect(); - * }); - * obs.observe({ entryTypes: ['mark', 'measure'] }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByName(name: string, type?: EntryType): PerformanceEntry[]; - /** - * Returns a list of `PerformanceEntry` objects in chronological order - * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`. - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((perfObserverList, observer) => { - * console.log(perfObserverList.getEntriesByType('mark')); - * - * * [ - * * PerformanceEntry { - * * name: 'test', - * * entryType: 'mark', - * * startTime: 55.897834, - * * duration: 0 - * * }, - * * PerformanceEntry { - * * name: 'meow', - * * entryType: 'mark', - * * startTime: 56.350146, - * * duration: 0 - * * } - * * ] - * - * observer.disconnect(); - * }); - * obs.observe({ type: 'mark' }); - * - * performance.mark('test'); - * performance.mark('meow'); - * ``` - * @since v8.5.0 - */ - getEntriesByType(type: EntryType): PerformanceEntry[]; - } - type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - class PerformanceObserver extends AsyncResource { - constructor(callback: PerformanceObserverCallback); - /** - * Disconnects the `PerformanceObserver` instance from all notifications. - * @since v8.5.0 - */ - disconnect(): void; - /** - * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`: - * - * ```js - * const { - * performance, - * PerformanceObserver - * } = require('perf_hooks'); - * - * const obs = new PerformanceObserver((list, observer) => { - * // Called three times synchronously. `list` contains one item. - * }); - * obs.observe({ type: 'mark' }); - * - * for (let n = 0; n < 3; n++) - * performance.mark(`test${n}`); - * ``` - * @since v8.5.0 - */ - observe( - options: - | { - entryTypes: ReadonlyArray; - } - | { - type: EntryType; - } - ): 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 NODE_PERFORMANCE_GC_FLAGS_NO: number; - const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number; - const NODE_PERFORMANCE_GC_FLAGS_FORCED: number; - const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number; - const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number; - const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number; - } - const performance: Performance; - interface EventLoopMonitorOptions { - /** - * The sampling rate in milliseconds. - * Must be greater than zero. - * @default 10 - */ - resolution?: number | undefined; - } - interface Histogram { - /** - * Returns a `Map` object detailing the accumulated percentile distribution. - * @since v11.10.0 - */ - readonly percentiles: Map; - /** - * The number of times the event loop delay exceeded the maximum 1 hour event - * loop delay threshold. - * @since v11.10.0 - */ - readonly exceeds: number; - /** - * The minimum recorded event loop delay. - * @since v11.10.0 - */ - readonly min: number; - /** - * The maximum recorded event loop delay. - * @since v11.10.0 - */ - readonly max: number; - /** - * The mean of the recorded event loop delays. - * @since v11.10.0 - */ - readonly mean: number; - /** - * The standard deviation of the recorded event loop delays. - * @since v11.10.0 - */ - readonly stddev: number; - /** - * Resets the collected histogram data. - * @since v11.10.0 - */ - reset(): void; - /** - * Returns the value at the given percentile. - * @since v11.10.0 - * @param percentile A percentile value in the range (0, 100]. - */ - percentile(percentile: number): number; - } - interface IntervalHistogram extends Histogram { - /** - * Enables the update interval timer. Returns `true` if the timer was - * started, `false` if it was already started. - * @since v11.10.0 - */ - enable(): boolean; - /** - * Disables the update interval timer. Returns `true` if the timer was - * stopped, `false` if it was already stopped. - * @since v11.10.0 - */ - disable(): boolean; - } - interface RecordableHistogram extends Histogram { - /** - * @since v15.9.0 - * @param val The amount to record in the histogram. - */ - record(val: number | bigint): void; - /** - * Calculates the amount of time (in nanoseconds) that has passed since the - * previous call to `recordDelta()` and records that amount in the histogram. - * - * ## Examples - * @since v15.9.0 - */ - recordDelta(): void; - } - /** - * _This property is an extension by Node.js. It is not available in Web browsers._ - * - * Creates an `IntervalHistogram` object that samples and reports the event loop - * delay over time. The delays will be reported in nanoseconds. - * - * Using a timer to detect approximate event loop delay works because the - * execution of timers is tied specifically to the lifecycle of the libuv - * event loop. That is, a delay in the loop will cause a delay in the execution - * of the timer, and those delays are specifically what this API is intended to - * detect. - * - * ```js - * const { monitorEventLoopDelay } = require('perf_hooks'); - * const h = monitorEventLoopDelay({ resolution: 20 }); - * h.enable(); - * // Do something. - * h.disable(); - * console.log(h.min); - * console.log(h.max); - * console.log(h.mean); - * console.log(h.stddev); - * console.log(h.percentiles); - * console.log(h.percentile(50)); - * console.log(h.percentile(99)); - * ``` - * @since v11.10.0 - */ - function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram; - interface CreateHistogramOptions { - /** - * The minimum recordable value. Must be an integer value greater than 0. - * @default 1 - */ - min?: number | bigint | undefined; - /** - * The maximum recordable value. Must be an integer value greater than min. - * @default Number.MAX_SAFE_INTEGER - */ - max?: number | bigint | undefined; - /** - * The number of accuracy digits. Must be a number between 1 and 5. - * @default 3 - */ - figures?: number | undefined; - } - /** - * Returns a `RecordableHistogram`. - * @since v15.9.0 - */ - function createHistogram(options?: CreateHistogramOptions): RecordableHistogram; -} -declare module 'node:perf_hooks' { - export * from 'perf_hooks'; -} diff --git a/JS/node_modules/@types/node/process.d.ts b/JS/node_modules/@types/node/process.d.ts deleted file mode 100755 index 1f0d144..0000000 --- a/JS/node_modules/@types/node/process.d.ts +++ /dev/null @@ -1,1477 +0,0 @@ -declare module 'process' { - import * as tty from 'node:tty'; - import { Worker } from 'node:worker_threads'; - global { - var process: NodeJS.Process; - namespace NodeJS { - // this namespace merge is here because these are specifically used - // as the type for process.stdin, process.stdout, and process.stderr. - // they can't live in tty.d.ts because we need to disambiguate the imported name. - interface ReadStream extends tty.ReadStream {} - interface WriteStream extends tty.WriteStream {} - interface MemoryUsageFn { - /** - * The `process.memoryUsage()` method iterate over each page to gather informations about memory - * usage which can be slow depending on the program memory allocations. - */ - (): MemoryUsage; - /** - * method returns an integer representing the Resident Set Size (RSS) in bytes. - */ - rss(): number; - } - interface MemoryUsage { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; - arrayBuffers: number; - } - interface CpuUsage { - user: number; - system: number; - } - interface ProcessRelease { - name: string; - sourceUrl?: string | undefined; - headersUrl?: string | undefined; - libUrl?: string | undefined; - lts?: string | undefined; - } - interface ProcessVersions extends Dict { - http_parser: string; - node: string; - v8: string; - ares: string; - uv: string; - zlib: string; - modules: string; - openssl: string; - } - type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; - 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 UncaughtExceptionOrigin = 'uncaughtException' | 'unhandledRejection'; - 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, origin: UncaughtExceptionOrigin) => void; - type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise) => void; - type WarningListener = (warning: Error) => void; - type MessageListener = (message: unknown, sendHandle: unknown) => void; - type SignalsListener = (signal: Signals) => void; - type MultipleResolveListener = (type: MultipleResolveType, promise: Promise, value: unknown) => void; - type WorkerListener = (worker: Worker) => void; - interface Socket extends ReadWriteStream { - isTTY?: true | undefined; - } - // Alias for compatibility - interface ProcessEnv extends Dict { - /** - * Can be used to change the default timezone at runtime - */ - TZ?: string; - } - interface HRTime { - (time?: [number, number]): [number, number]; - bigint(): bigint; - } - 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 EmitWarningOptions { - /** - * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted. - * - * @default 'Warning' - */ - type?: string | undefined; - /** - * A unique identifier for the warning instance being emitted. - */ - code?: string | undefined; - /** - * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace. - * - * @default process.emitWarning - */ - ctor?: Function | undefined; - /** - * Additional text to include with the error. - */ - detail?: string | undefined; - } - interface ProcessConfig { - readonly target_defaults: { - readonly cflags: any[]; - readonly default_configuration: string; - readonly defines: string[]; - readonly include_dirs: string[]; - readonly libraries: string[]; - }; - readonly variables: { - readonly clang: number; - readonly host_arch: string; - readonly node_install_npm: boolean; - readonly node_install_waf: boolean; - readonly node_prefix: string; - readonly node_shared_openssl: boolean; - readonly node_shared_v8: boolean; - readonly node_shared_zlib: boolean; - readonly node_use_dtrace: boolean; - readonly node_use_etw: boolean; - readonly node_use_openssl: boolean; - readonly target_arch: string; - readonly v8_no_strict_aliasing: number; - readonly v8_use_snapshot: boolean; - readonly visibility: string; - }; - } - interface Process extends EventEmitter { - /** - * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is - * a `Writable` stream. - * - * For example, to copy `process.stdin` to `process.stdout`: - * - * ```js - * import { stdin, stdout } from 'process'; - * - * stdin.pipe(stdout); - * ``` - * - * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stdout: WriteStream & { - fd: 1; - }; - /** - * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is - * a `Writable` stream. - * - * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information. - */ - stderr: WriteStream & { - fd: 2; - }; - /** - * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is - * a `Readable` stream. - * - * For details of how to read from `stdin` see `readable.read()`. - * - * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that - * is compatible with scripts written for Node.js prior to v0.10\. - * For more information see `Stream compatibility`. - * - * In "old" streams mode the `stdin` stream is paused by default, so one - * must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode. - */ - stdin: ReadStream & { - fd: 0; - }; - openStdin(): Socket; - /** - * The `process.argv` property returns an array containing the command-line - * arguments passed when the Node.js process was launched. The first element will - * be {@link execPath}. See `process.argv0` if access to the original value - * of `argv[0]` is needed. The second element will be the path to the JavaScript - * file being executed. The remaining elements will be any additional command-line - * arguments. - * - * For example, assuming the following script for `process-args.js`: - * - * ```js - * import { argv } from 'process'; - * - * // print process.argv - * argv.forEach((val, index) => { - * console.log(`${index}: ${val}`); - * }); - * ``` - * - * Launching the Node.js process as: - * - * ```console - * $ node process-args.js one two=three four - * ``` - * - * Would generate the output: - * - * ```text - * 0: /usr/local/bin/node - * 1: /Users/mjr/work/node/process-args.js - * 2: one - * 3: two=three - * 4: four - * ``` - * @since v0.1.27 - */ - argv: string[]; - /** - * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts. - * - * ```console - * $ bash -c 'exec -a customArgv0 ./node' - * > process.argv[0] - * '/Volumes/code/external/node/out/Release/node' - * > process.argv0 - * 'customArgv0' - * ``` - * @since v6.4.0 - */ - argv0: string; - /** - * The `process.execArgv` property returns the set of Node.js-specific command-line - * options passed when the Node.js process was launched. These options do not - * appear in the array returned by the {@link argv} property, and do not - * include the Node.js executable, the name of the script, or any options following - * the script name. These options are useful in order to spawn child processes with - * the same execution environment as the parent. - * - * ```console - * $ node --harmony script.js --version - * ``` - * - * Results in `process.execArgv`: - * - * ```js - * ['--harmony'] - * ``` - * - * And `process.argv`: - * - * ```js - * ['/usr/local/bin/node', 'script.js', '--version'] - * ``` - * - * Refer to `Worker constructor` for the detailed behavior of worker - * threads with this property. - * @since v0.7.7 - */ - execArgv: string[]; - /** - * The `process.execPath` property returns the absolute pathname of the executable - * that started the Node.js process. Symbolic links, if any, are resolved. - * - * ```js - * '/usr/local/bin/node' - * ``` - * @since v0.1.100 - */ - execPath: string; - /** - * The `process.abort()` method causes the Node.js process to exit immediately and - * generate a core file. - * - * This feature is not available in `Worker` threads. - * @since v0.7.0 - */ - abort(): never; - /** - * The `process.chdir()` method changes the current working directory of the - * Node.js process or throws an exception if doing so fails (for instance, if - * the specified `directory` does not exist). - * - * ```js - * import { chdir, cwd } from 'process'; - * - * console.log(`Starting directory: ${cwd()}`); - * try { - * chdir('/tmp'); - * console.log(`New directory: ${cwd()}`); - * } catch (err) { - * console.error(`chdir: ${err}`); - * } - * ``` - * - * This feature is not available in `Worker` threads. - * @since v0.1.17 - */ - chdir(directory: string): void; - /** - * The `process.cwd()` method returns the current working directory of the Node.js - * process. - * - * ```js - * import { cwd } from 'process'; - * - * console.log(`Current directory: ${cwd()}`); - * ``` - * @since v0.1.8 - */ - cwd(): string; - /** - * The port used by the Node.js debugger when enabled. - * - * ```js - * import process from 'process'; - * - * process.debugPort = 5858; - * ``` - * @since v0.7.2 - */ - debugPort: number; - /** - * The `process.emitWarning()` method can be used to emit custom or application - * specific process warnings. These can be listened for by adding a handler to the `'warning'` event. - * - * ```js - * import { emitWarning } from 'process'; - * - * // Emit a warning with a code and additional detail. - * emitWarning('Something happened!', { - * code: 'MY_WARNING', - * detail: 'This is some additional information' - * }); - * // Emits: - * // (node:56338) [MY_WARNING] Warning: Something happened! - * // This is some additional information - * ``` - * - * In this example, an `Error` object is generated internally by`process.emitWarning()` and passed through to the `'warning'` handler. - * - * ```js - * import process from 'process'; - * - * process.on('warning', (warning) => { - * console.warn(warning.name); // 'Warning' - * console.warn(warning.message); // 'Something happened!' - * console.warn(warning.code); // 'MY_WARNING' - * console.warn(warning.stack); // Stack trace - * console.warn(warning.detail); // 'This is some additional information' - * }); - * ``` - * - * If `warning` is passed as an `Error` object, the `options` argument is ignored. - * @since v8.0.0 - * @param warning The warning to emit. - */ - emitWarning(warning: string | Error, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, ctor?: Function): void; - emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void; - emitWarning(warning: string | Error, options?: EmitWarningOptions): void; - /** - * The `process.env` property returns an object containing the user environment. - * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html). - * - * An example of this object looks like: - * - * ```js - * { - * TERM: 'xterm-256color', - * SHELL: '/usr/local/bin/bash', - * USER: 'maciej', - * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', - * PWD: '/Users/maciej', - * EDITOR: 'vim', - * SHLVL: '1', - * HOME: '/Users/maciej', - * LOGNAME: 'maciej', - * _: '/usr/local/bin/node' - * } - * ``` - * - * It is possible to modify this object, but such modifications will not be - * reflected outside the Node.js process, or (unless explicitly requested) - * to other `Worker` threads. - * In other words, the following example would not work: - * - * ```console - * $ node -e 'process.env.foo = "bar"' && echo $foo - * ``` - * - * While the following will: - * - * ```js - * import { env } from 'process'; - * - * env.foo = 'bar'; - * console.log(env.foo); - * ``` - * - * Assigning a property on `process.env` will implicitly convert the value - * to a string. **This behavior is deprecated.** Future versions of Node.js may - * throw an error when the value is not a string, number, or boolean. - * - * ```js - * import { env } from 'process'; - * - * env.test = null; - * console.log(env.test); - * // => 'null' - * env.test = undefined; - * console.log(env.test); - * // => 'undefined' - * ``` - * - * Use `delete` to delete a property from `process.env`. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * delete env.TEST; - * console.log(env.TEST); - * // => undefined - * ``` - * - * On Windows operating systems, environment variables are case-insensitive. - * - * ```js - * import { env } from 'process'; - * - * env.TEST = 1; - * console.log(env.test); - * // => 1 - * ``` - * - * Unless explicitly specified when creating a `Worker` instance, - * each `Worker` thread has its own copy of `process.env`, based on its - * parent thread’s `process.env`, or whatever was specified as the `env` option - * to the `Worker` constructor. Changes to `process.env` will not be visible - * across `Worker` threads, and only the main thread can make changes that - * are visible to the operating system or to native add-ons. - * @since v0.1.27 - */ - env: ProcessEnv; - /** - * The `process.exit()` method instructs Node.js to terminate the process - * synchronously with an exit status of `code`. If `code` is omitted, exit uses - * either the 'success' code `0` or the value of `process.exitCode` if it has been - * set. Node.js will not terminate until all the `'exit'` event listeners are - * called. - * - * To exit with a 'failure' code: - * - * ```js - * import { exit } from 'process'; - * - * exit(1); - * ``` - * - * The shell that executed Node.js should see the exit code as `1`. - * - * Calling `process.exit()` will force the process to exit as quickly as possible - * even if there are still asynchronous operations pending that have not yet - * completed fully, including I/O operations to `process.stdout` and`process.stderr`. - * - * In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_ - * _work pending_ in the event loop. The `process.exitCode` property can be set to - * tell the process which exit code to use when the process exits gracefully. - * - * For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being - * truncated and lost: - * - * ```js - * import { exit } from 'process'; - * - * // This is an example of what *not* to do: - * if (someConditionNotMet()) { - * printUsageToStdout(); - * exit(1); - * } - * ``` - * - * The reason this is problematic is because writes to `process.stdout` in Node.js - * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js - * event loop. Calling `process.exit()`, however, forces the process to exit_before_ those additional writes to `stdout` can be performed. - * - * Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding - * scheduling any additional work for the event loop: - * - * ```js - * import process from 'process'; - * - * // How to properly set the exit code while letting - * // the process exit gracefully. - * if (someConditionNotMet()) { - * printUsageToStdout(); - * process.exitCode = 1; - * } - * ``` - * - * If it is necessary to terminate the Node.js process due to an error condition, - * throwing an _uncaught_ error and allowing the process to terminate accordingly - * is safer than calling `process.exit()`. - * - * In `Worker` threads, this function stops the current thread rather - * than the current process. - * @since v0.1.13 - * @param [code=0] The exit code. - */ - exit(code?: number): never; - /** - * A number which will be the process exit code, when the process either - * exits gracefully, or is exited via {@link exit} without specifying - * a code. - * - * Specifying a code to {@link exit} will override any - * previous setting of `process.exitCode`. - * @since v0.11.8 - */ - exitCode?: number | undefined; - /** - * The `process.getgid()` method returns the numerical group identity of the - * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getgid) { - * console.log(`Current gid: ${process.getgid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.31 - */ - getgid(): number; - /** - * The `process.setgid()` method sets the group identity of the process. (See[`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a - * numeric ID or a group name - * string. If a group name is specified, this method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getgid && process.setgid) { - * console.log(`Current gid: ${process.getgid()}`); - * try { - * process.setgid(501); - * console.log(`New gid: ${process.getgid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.31 - * @param id The group name or ID - */ - setgid(id: number | string): void; - /** - * The `process.getuid()` method returns the numeric user identity of the process. - * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getuid) { - * console.log(`Current uid: ${process.getuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.1.28 - */ - getuid(): number; - /** - * The `process.setuid(id)` method sets the user identity of the process. (See[`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a - * numeric ID or a username string. - * If a username is specified, the method blocks while resolving the associated - * numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getuid && process.setuid) { - * console.log(`Current uid: ${process.getuid()}`); - * try { - * process.setuid(501); - * console.log(`New uid: ${process.getuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.1.28 - */ - setuid(id: number | string): void; - /** - * The `process.geteuid()` method returns the numerical effective user identity of - * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.geteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - geteuid(): number; - /** - * The `process.seteuid()` method sets the effective user identity of the process. - * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username - * string. If a username is specified, the method blocks while resolving the - * associated numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.geteuid && process.seteuid) { - * console.log(`Current uid: ${process.geteuid()}`); - * try { - * process.seteuid(501); - * console.log(`New uid: ${process.geteuid()}`); - * } catch (err) { - * console.log(`Failed to set uid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A user name or ID - */ - seteuid(id: number | string): void; - /** - * The `process.getegid()` method returns the numerical effective group identity - * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).) - * - * ```js - * import process from 'process'; - * - * if (process.getegid) { - * console.log(`Current gid: ${process.getegid()}`); - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v2.0.0 - */ - getegid(): number; - /** - * The `process.setegid()` method sets the effective group identity of the process. - * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group - * name string. If a group name is specified, this method blocks while resolving - * the associated a numeric ID. - * - * ```js - * import process from 'process'; - * - * if (process.getegid && process.setegid) { - * console.log(`Current gid: ${process.getegid()}`); - * try { - * process.setegid(501); - * console.log(`New gid: ${process.getegid()}`); - * } catch (err) { - * console.log(`Failed to set gid: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v2.0.0 - * @param id A group name or ID - */ - setegid(id: number | string): void; - /** - * The `process.getgroups()` method returns an array with the supplementary group - * IDs. POSIX leaves it unspecified if the effective group ID is included but - * Node.js ensures it always is. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups) { - * console.log(process.getgroups()); // [ 16, 21, 297 ] - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * @since v0.9.4 - */ - getgroups(): number[]; - /** - * The `process.setgroups()` method sets the supplementary group IDs for the - * Node.js process. This is a privileged operation that requires the Node.js - * process to have `root` or the `CAP_SETGID` capability. - * - * The `groups` array can contain numeric group IDs, group names, or both. - * - * ```js - * import process from 'process'; - * - * if (process.getgroups && process.setgroups) { - * try { - * process.setgroups([501]); - * console.log(process.getgroups()); // new groups - * } catch (err) { - * console.log(`Failed to set groups: ${err}`); - * } - * } - * ``` - * - * This function is only available on POSIX platforms (i.e. not Windows or - * Android). - * This feature is not available in `Worker` threads. - * @since v0.9.4 - */ - setgroups(groups: ReadonlyArray): void; - /** - * The `process.setUncaughtExceptionCaptureCallback()` function sets a function - * that will be invoked when an uncaught exception occurs, which will receive the - * exception value itself as its first argument. - * - * If such a function is set, the `'uncaughtException'` event will - * not be emitted. If `--abort-on-uncaught-exception` was passed from the - * command line or set through `v8.setFlagsFromString()`, the process will - * not abort. Actions configured to take place on exceptions such as report - * generations will be affected too - * - * To unset the capture function,`process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this - * method with a non-`null` argument while another capture function is set will - * throw an error. - * - * Using this function is mutually exclusive with using the deprecated `domain` built-in module. - * @since v9.3.0 - */ - setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; - /** - * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}. - * @since v9.3.0 - */ - hasUncaughtExceptionCaptureCallback(): boolean; - /** - * The `process.version` property contains the Node.js version string. - * - * ```js - * import { version } from 'process'; - * - * console.log(`Version: ${version}`); - * // Version: v14.8.0 - * ``` - * - * To get the version string without the prepended _v_, use`process.versions.node`. - * @since v0.1.3 - */ - readonly version: string; - /** - * The `process.versions` property returns an object listing the version strings of - * Node.js and its dependencies. `process.versions.modules` indicates the current - * ABI version, which is increased whenever a C++ API changes. Node.js will refuse - * to load modules that were compiled against a different module ABI version. - * - * ```js - * import { versions } from 'process'; - * - * console.log(versions); - * ``` - * - * Will generate an object similar to: - * - * ```console - * { node: '11.13.0', - * v8: '7.0.276.38-node.18', - * uv: '1.27.0', - * zlib: '1.2.11', - * brotli: '1.0.7', - * ares: '1.15.0', - * modules: '67', - * nghttp2: '1.34.0', - * napi: '4', - * llhttp: '1.1.1', - * openssl: '1.1.1b', - * cldr: '34.0', - * icu: '63.1', - * tz: '2018e', - * unicode: '11.0' } - * ``` - * @since v0.2.0 - */ - readonly versions: ProcessVersions; - /** - * The `process.config` property returns an `Object` containing the JavaScript - * representation of the configure options used to compile the current Node.js - * executable. This is the same as the `config.gypi` file that was produced when - * running the `./configure` script. - * - * An example of the possible output looks like: - * - * ```js - * { - * target_defaults: - * { cflags: [], - * default_configuration: 'Release', - * defines: [], - * include_dirs: [], - * libraries: [] }, - * variables: - * { - * host_arch: 'x64', - * napi_build_version: 5, - * node_install_npm: 'true', - * node_prefix: '', - * node_shared_cares: 'false', - * node_shared_http_parser: 'false', - * node_shared_libuv: 'false', - * node_shared_zlib: 'false', - * node_use_dtrace: 'false', - * node_use_openssl: 'true', - * node_shared_openssl: 'false', - * strict_aliasing: 'true', - * target_arch: 'x64', - * v8_use_snapshot: 1 - * } - * } - * ``` - * - * The `process.config` property is **not** read-only and there are existing - * modules in the ecosystem that are known to extend, modify, or entirely replace - * the value of `process.config`. - * - * Modifying the `process.config` property, or any child-property of the`process.config` object has been deprecated. The `process.config` will be made - * read-only in a future release. - * @since v0.7.7 - */ - readonly config: ProcessConfig; - /** - * The `process.kill()` method sends the `signal` to the process identified by`pid`. - * - * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information. - * - * This method will throw an error if the target `pid` does not exist. As a special - * case, a signal of `0` can be used to test for the existence of a process. - * Windows platforms will throw an error if the `pid` is used to kill a process - * group. - * - * Even though the name of this function is `process.kill()`, it is really just a - * signal sender, like the `kill` system call. The signal sent may do something - * other than kill the target process. - * - * ```js - * import process, { kill } from 'process'; - * - * process.on('SIGHUP', () => { - * console.log('Got SIGHUP signal.'); - * }); - * - * setTimeout(() => { - * console.log('Exiting.'); - * process.exit(0); - * }, 100); - * - * kill(process.pid, 'SIGHUP'); - * ``` - * - * When `SIGUSR1` is received by a Node.js process, Node.js will start the - * debugger. See `Signal Events`. - * @since v0.0.6 - * @param pid A process ID - * @param [signal='SIGTERM'] The signal to send, either as a string or number. - */ - kill(pid: number, signal?: string | number): true; - /** - * The `process.pid` property returns the PID of the process. - * - * ```js - * import { pid } from 'process'; - * - * console.log(`This process is pid ${pid}`); - * ``` - * @since v0.1.15 - */ - readonly pid: number; - /** - * The `process.ppid` property returns the PID of the parent of the - * current process. - * - * ```js - * import { ppid } from 'process'; - * - * console.log(`The parent process is pid ${ppid}`); - * ``` - * @since v9.2.0, v8.10.0, v6.13.0 - */ - readonly ppid: number; - /** - * The `process.title` property returns the current process title (i.e. returns - * the current value of `ps`). Assigning a new value to `process.title` modifies - * the current value of `ps`. - * - * When a new value is assigned, different platforms will impose different maximum - * length restrictions on the title. Usually such restrictions are quite limited. - * For instance, on Linux and macOS, `process.title` is limited to the size of the - * binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8 - * allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure) - * cases. - * - * Assigning a value to `process.title` might not result in an accurate label - * within process manager applications such as macOS Activity Monitor or Windows - * Services Manager. - * @since v0.1.104 - */ - title: string; - /** - * The operating system CPU architecture for which the Node.js binary was compiled. - * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`. - * - * ```js - * import { arch } from 'process'; - * - * console.log(`This processor architecture is ${arch}`); - * ``` - * @since v0.5.0 - */ - readonly arch: string; - /** - * The `process.platform` property returns a string identifying the operating - * system platform on which the Node.js process is running. - * - * Currently possible values are: - * - * * `'aix'` - * * `'darwin'` - * * `'freebsd'` - * * `'linux'` - * * `'openbsd'` - * * `'sunos'` - * * `'win32'` - * - * ```js - * import { platform } from 'process'; - * - * console.log(`This platform is ${platform}`); - * ``` - * - * The value `'android'` may also be returned if the Node.js is built on the - * Android operating system. However, Android support in Node.js[is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os). - * @since v0.1.16 - */ - readonly platform: Platform; - /** - * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at - * runtime, `require.main` may still refer to the original main module in - * modules that were required before the change occurred. Generally, it's - * safe to assume that the two refer to the same module. - * - * As with `require.main`, `process.mainModule` will be `undefined` if there - * is no entry script. - * @since v0.1.17 - * @deprecated Since v14.0.0 - Use `main` instead. - */ - mainModule?: Module | undefined; - memoryUsage: MemoryUsageFn; - /** - * The `process.cpuUsage()` method returns the user and system CPU time usage of - * the current process, in an object with properties `user` and `system`, whose - * values are microsecond values (millionth of a second). These values measure time - * spent in user and system code respectively, and may end up being greater than - * actual elapsed time if multiple CPU cores are performing work for this process. - * - * The result of a previous call to `process.cpuUsage()` can be passed as the - * argument to the function, to get a diff reading. - * - * ```js - * import { cpuUsage } from 'process'; - * - * const startUsage = cpuUsage(); - * // { user: 38579, system: 6986 } - * - * // spin the CPU for 500 milliseconds - * const now = Date.now(); - * while (Date.now() - now < 500); - * - * console.log(cpuUsage(startUsage)); - * // { user: 514883, system: 11226 } - * ``` - * @since v6.1.0 - * @param previousValue A previous return value from calling `process.cpuUsage()` - */ - cpuUsage(previousValue?: CpuUsage): CpuUsage; - /** - * `process.nextTick()` adds `callback` to the "next tick queue". This queue is - * fully drained after the current operation on the JavaScript stack runs to - * completion and before the event loop is allowed to continue. It's possible to - * create an infinite loop if one were to recursively call `process.nextTick()`. - * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background. - * - * ```js - * import { nextTick } from 'process'; - * - * console.log('start'); - * nextTick(() => { - * console.log('nextTick callback'); - * }); - * console.log('scheduled'); - * // Output: - * // start - * // scheduled - * // nextTick callback - * ``` - * - * This is important when developing APIs in order to give users the opportunity - * to assign event handlers _after_ an object has been constructed but before any - * I/O has occurred: - * - * ```js - * import { nextTick } from 'process'; - * - * function MyThing(options) { - * this.setupOptions(options); - * - * nextTick(() => { - * this.startDoingStuff(); - * }); - * } - * - * const thing = new MyThing(); - * thing.getReadyForStuff(); - * - * // thing.startDoingStuff() gets called now, not before. - * ``` - * - * It is very important for APIs to be either 100% synchronous or 100% - * asynchronous. Consider this example: - * - * ```js - * // WARNING! DO NOT USE! BAD UNSAFE HAZARD! - * function maybeSync(arg, cb) { - * if (arg) { - * cb(); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * - * This API is hazardous because in the following case: - * - * ```js - * const maybeTrue = Math.random() > 0.5; - * - * maybeSync(maybeTrue, () => { - * foo(); - * }); - * - * bar(); - * ``` - * - * It is not clear whether `foo()` or `bar()` will be called first. - * - * The following approach is much better: - * - * ```js - * import { nextTick } from 'process'; - * - * function definitelyAsync(arg, cb) { - * if (arg) { - * nextTick(cb); - * return; - * } - * - * fs.stat('file', cb); - * } - * ``` - * @since v0.1.26 - * @param args Additional arguments to pass when invoking the `callback` - */ - nextTick(callback: Function, ...args: any[]): void; - /** - * The `process.release` property returns an `Object` containing metadata related - * to the current release, including URLs for the source tarball and headers-only - * tarball. - * - * `process.release` contains the following properties: - * - * ```js - * { - * name: 'node', - * lts: 'Erbium', - * sourceUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1.tar.gz', - * headersUrl: 'https://nodejs.org/download/release/v12.18.1/node-v12.18.1-headers.tar.gz', - * libUrl: 'https://nodejs.org/download/release/v12.18.1/win-x64/node.lib' - * } - * ``` - * - * In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be - * relied upon to exist. - * @since v3.0.0 - */ - readonly release: ProcessRelease; - features: { - inspector: boolean; - debug: boolean; - uv: boolean; - ipv6: boolean; - tls_alpn: boolean; - tls_sni: boolean; - tls_ocsp: boolean; - tls: boolean; - }; - /** - * `process.umask()` returns the Node.js process's file mode creation mask. Child - * processes inherit the mask from the parent process. - * @since v0.1.19 - * @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential * - * security vulnerability. There is no safe, cross-platform alternative API. - */ - umask(): number; - /** - * Can only be set if not in worker thread. - */ - umask(mask: string | number): number; - /** - * The `process.uptime()` method returns the number of seconds the current Node.js - * process has been running. - * - * The return value includes fractions of a second. Use `Math.floor()` to get whole - * seconds. - * @since v0.5.0 - */ - uptime(): number; - hrtime: HRTime; - /** - * If Node.js is spawned with an IPC channel, the `process.send()` method can be - * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object. - * - * If Node.js was not spawned with an IPC channel, `process.send` will be`undefined`. - * - * The message goes through serialization and parsing. The resulting message might - * not be the same as what is originally sent. - * @since v0.5.9 - * @param options used to parameterize the sending of certain types of handles.`options` supports the following properties: - */ - send?( - message: any, - sendHandle?: any, - options?: { - swallowErrors?: boolean | undefined; - }, - callback?: (error: Error | null) => void - ): boolean; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the - * IPC channel to the parent process, allowing the child process to exit gracefully - * once there are no other connections keeping it alive. - * - * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process. - * - * If the Node.js process was not spawned with an IPC channel,`process.disconnect()` will be `undefined`. - * @since v0.7.2 - */ - disconnect(): void; - /** - * If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC - * channel is connected and will return `false` after`process.disconnect()` is called. - * - * Once `process.connected` is `false`, it is no longer possible to send messages - * over the IPC channel using `process.send()`. - * @since v0.7.2 - */ - connected: boolean; - /** - * The `process.allowedNodeEnvironmentFlags` property is a special, - * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable. - * - * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag - * representations. `process.allowedNodeEnvironmentFlags.has()` will - * return `true` in the following cases: - * - * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g.,`inspect-brk` for `--inspect-brk`, or `r` for `-r`. - * * Flags passed through to V8 (as listed in `--v8-options`) may replace - * one or more _non-leading_ dashes for an underscore, or vice-versa; - * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`, - * etc. - * * Flags may contain one or more equals (`=`) characters; all - * characters after and including the first equals will be ignored; - * e.g., `--stack-trace-limit=100`. - * * Flags _must_ be allowable within `NODE_OPTIONS`. - * - * When iterating over `process.allowedNodeEnvironmentFlags`, flags will - * appear only _once_; each will begin with one or more dashes. Flags - * passed through to V8 will contain underscores instead of non-leading - * dashes: - * - * ```js - * import { allowedNodeEnvironmentFlags } from 'process'; - * - * allowedNodeEnvironmentFlags.forEach((flag) => { - * // -r - * // --inspect-brk - * // --abort_on_uncaught_exception - * // ... - * }); - * ``` - * - * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail - * silently. - * - * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will - * contain what _would have_ been allowable. - * @since v10.10.0 - */ - allowedNodeEnvironmentFlags: ReadonlySet; - /** - * `process.report` is an object whose methods are used to generate diagnostic - * reports for the current process. Additional documentation is available in the `report documentation`. - * @since v11.8.0 - */ - report?: ProcessReport | undefined; - /** - * ```js - * import { resourceUsage } from 'process'; - * - * console.log(resourceUsage()); - * /* - * Will output: - * { - * userCPUTime: 82872, - * systemCPUTime: 4143, - * maxRSS: 33164, - * sharedMemorySize: 0, - * unsharedDataSize: 0, - * unsharedStackSize: 0, - * minorPageFault: 2469, - * majorPageFault: 0, - * swappedOut: 0, - * fsRead: 0, - * fsWrite: 8, - * ipcSent: 0, - * ipcReceived: 0, - * signalsCount: 0, - * voluntaryContextSwitches: 79, - * involuntaryContextSwitches: 1 - * } - * - * ``` - * @since v12.6.0 - * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t]. - */ - resourceUsage(): ResourceUsage; - /** - * The `process.traceDeprecation` property indicates whether the`--trace-deprecation` flag is set on the current Node.js process. See the - * documentation for the `'warning' event` and the `emitWarning() method` for more information about this - * flag's behavior. - * @since v0.8.0 - */ - traceDeprecation: boolean; - /* 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: 'uncaughtExceptionMonitor', 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: 'multipleResolves', listener: MultipleResolveListener): this; - addListener(event: 'worker', listener: WorkerListener): 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: 'uncaughtExceptionMonitor', error: Error): boolean; - emit(event: 'unhandledRejection', reason: unknown, promise: Promise): boolean; - emit(event: 'warning', warning: Error): boolean; - emit(event: 'message', message: unknown, sendHandle: unknown): this; - emit(event: Signals, signal: Signals): boolean; - emit(event: 'multipleResolves', type: MultipleResolveType, promise: Promise, value: unknown): this; - emit(event: 'worker', listener: WorkerListener): 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: 'uncaughtExceptionMonitor', 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: 'multipleResolves', listener: MultipleResolveListener): this; - on(event: 'worker', listener: WorkerListener): this; - on(event: string | symbol, listener: (...args: any[]) => void): 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: 'uncaughtExceptionMonitor', 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: 'multipleResolves', listener: MultipleResolveListener): this; - once(event: 'worker', listener: WorkerListener): this; - once(event: string | symbol, listener: (...args: any[]) => void): 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: 'uncaughtExceptionMonitor', 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: 'multipleResolves', listener: MultipleResolveListener): this; - prependListener(event: 'worker', listener: WorkerListener): 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: 'uncaughtExceptionMonitor', 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: 'multipleResolves', listener: MultipleResolveListener): this; - prependOnceListener(event: 'worker', listener: WorkerListener): this; - listeners(event: 'beforeExit'): BeforeExitListener[]; - listeners(event: 'disconnect'): DisconnectListener[]; - listeners(event: 'exit'): ExitListener[]; - listeners(event: 'rejectionHandled'): RejectionHandledListener[]; - listeners(event: 'uncaughtException'): UncaughtExceptionListener[]; - listeners(event: 'uncaughtExceptionMonitor'): UncaughtExceptionListener[]; - listeners(event: 'unhandledRejection'): UnhandledRejectionListener[]; - listeners(event: 'warning'): WarningListener[]; - listeners(event: 'message'): MessageListener[]; - listeners(event: Signals): SignalsListener[]; - listeners(event: 'multipleResolves'): MultipleResolveListener[]; - listeners(event: 'worker'): WorkerListener[]; - } - } - } - export = process; -} -declare module 'node:process' { - import process = require('process'); - export = process; -} diff --git a/JS/node_modules/@types/node/punycode.d.ts b/JS/node_modules/@types/node/punycode.d.ts deleted file mode 100755 index 5854d67..0000000 --- a/JS/node_modules/@types/node/punycode.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/** - * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users - * currently depending on the `punycode` module should switch to using the - * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL - * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`. - * - * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It - * can be accessed using: - * - * ```js - * const punycode = require('punycode'); - * ``` - * - * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is - * primarily intended for use in Internationalized Domain Names. Because host - * names in URLs are limited to ASCII characters only, Domain Names that contain - * non-ASCII characters must be converted into ASCII using the Punycode scheme. - * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent - * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`. - * - * The `punycode` module provides a simple implementation of the Punycode standard. - * - * The `punycode` module is a third-party dependency used by Node.js and - * made available to developers as a convenience. Fixes or other modifications to - * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project. - * @deprecated Since v7.0.0 - Deprecated - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/punycode.js) - */ -declare module 'punycode' { - /** - * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only - * characters to the equivalent string of Unicode codepoints. - * - * ```js - * punycode.decode('maana-pta'); // 'mañana' - * punycode.decode('--dqo34k'); // '☃-⌘' - * ``` - * @since v0.5.1 - */ - function decode(string: string): string; - /** - * The `punycode.encode()` method converts a string of Unicode codepoints to a[Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. - * - * ```js - * punycode.encode('mañana'); // 'maana-pta' - * punycode.encode('☃-⌘'); // '--dqo34k' - * ``` - * @since v0.5.1 - */ - function encode(string: string): string; - /** - * The `punycode.toUnicode()` method converts a string representing a domain name - * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492)encoded parts of the domain name are be - * converted. - * - * ```js - * // decode domain names - * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' - * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' - * punycode.toUnicode('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toUnicode(domain: string): string; - /** - * The `punycode.toASCII()` method converts a Unicode string representing an - * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the - * domain name will be converted. Calling `punycode.toASCII()` on a string that - * already only contains ASCII characters will have no effect. - * - * ```js - * // encode domain names - * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' - * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' - * punycode.toASCII('example.com'); // 'example.com' - * ``` - * @since v0.6.1 - */ - function toASCII(domain: string): string; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const ucs2: ucs2; - interface ucs2 { - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - decode(string: string): number[]; - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - encode(codePoints: ReadonlyArray): string; - } - /** - * @deprecated since v7.0.0 - * The version of the punycode module bundled in Node.js is being deprecated. - * In a future major version of Node.js this module will be removed. - * Users currently depending on the punycode module should switch to using - * the userland-provided Punycode.js module instead. - */ - const version: string; -} -declare module 'node:punycode' { - export * from 'punycode'; -} diff --git a/JS/node_modules/@types/node/querystring.d.ts b/JS/node_modules/@types/node/querystring.d.ts deleted file mode 100755 index ce6e60c..0000000 --- a/JS/node_modules/@types/node/querystring.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * The `querystring` module provides utilities for parsing and formatting URL - * query strings. It can be accessed using: - * - * ```js - * const querystring = require('querystring'); - * ``` - * - * The `querystring` API is considered Legacy. While it is still maintained, - * new code should use the `URLSearchParams` API instead. - * @deprecated Legacy - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/querystring.js) - */ -declare module 'querystring' { - interface StringifyOptions { - encodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParseOptions { - maxKeys?: number | undefined; - decodeURIComponent?: ((str: string) => string) | undefined; - } - interface ParsedUrlQuery extends NodeJS.Dict {} - interface ParsedUrlQueryInput extends NodeJS.Dict | ReadonlyArray | ReadonlyArray | null> {} - /** - * The `querystring.stringify()` method produces a URL query string from a - * given `obj` by iterating through the object's "own properties". - * - * It serializes the following types of values passed in `obj`:[<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [<number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [<bigint>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) | - * [<string\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) | - * [<number\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) | - * [<bigint\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) | - * [<boolean\[\]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type)The numeric values must be finite. Any other input values will be coerced to - * empty strings. - * - * ```js - * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' }); - * // Returns 'foo=bar&baz=qux&baz=quux&corge=' - * - * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':'); - * // Returns 'foo:bar;baz:qux' - * ``` - * - * By default, characters requiring percent-encoding within the query string will - * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkEncodeURIComponent function already exists, - * - * querystring.stringify({ w: '中文', foo: 'bar' }, null, null, - * { encodeURIComponent: gbkEncodeURIComponent }); - * ``` - * @since v0.1.25 - * @param obj The object to serialize into a URL query string - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query string. - */ - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string; - /** - * The `querystring.parse()` method parses a URL query string (`str`) into a - * collection of key and value pairs. - * - * For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - * - * ```js - * { - * foo: 'bar', - * abc: ['xyz', '123'] - * } - * ``` - * - * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`, - * `obj.hasOwnProperty()`, and others - * are not defined and _will not work_. - * - * By default, percent-encoded characters within the query string will be assumed - * to use UTF-8 encoding. If an alternative character encoding is used, then an - * alternative `decodeURIComponent` option will need to be specified: - * - * ```js - * // Assuming gbkDecodeURIComponent function already exists... - * - * querystring.parse('w=%D6%D0%CE%C4&foo=bar', null, null, - * { decodeURIComponent: gbkDecodeURIComponent }); - * ``` - * @since v0.1.25 - * @param str The URL query string to parse - * @param [sep='&'] The substring used to delimit key and value pairs in the query string. - * @param [eq='='] . The substring used to delimit keys and values in the query 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; - /** - * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL - * query strings. - * - * The `querystring.escape()` method is used by `querystring.stringify()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement percent-encoding implementation if - * necessary by assigning `querystring.escape` to an alternative function. - * @since v0.1.25 - */ - function escape(str: string): string; - /** - * The `querystring.unescape()` method performs decoding of URL percent-encoded - * characters on the given `str`. - * - * The `querystring.unescape()` method is used by `querystring.parse()` and is - * generally not expected to be used directly. It is exported primarily to allow - * application code to provide a replacement decoding implementation if - * necessary by assigning `querystring.unescape` to an alternative function. - * - * By default, the `querystring.unescape()` method will attempt to use the - * JavaScript built-in `decodeURIComponent()` method to decode. If that fails, - * a safer equivalent that does not throw on malformed URLs will be used. - * @since v0.1.25 - */ - function unescape(str: string): string; -} -declare module 'node:querystring' { - export * from 'querystring'; -} diff --git a/JS/node_modules/@types/node/readline.d.ts b/JS/node_modules/@types/node/readline.d.ts deleted file mode 100755 index 0f0706a..0000000 --- a/JS/node_modules/@types/node/readline.d.ts +++ /dev/null @@ -1,542 +0,0 @@ -/** - * The `readline` module provides an interface for reading data from a `Readable` stream (such as `process.stdin`) one line at a time. It can be accessed - * using: - * - * ```js - * const readline = require('readline'); - * ``` - * - * The following simple example illustrates the basic use of the `readline` module. - * - * ```js - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * - * rl.question('What do you think of Node.js? ', (answer) => { - * // TODO: Log the answer in a database - * console.log(`Thank you for your valuable feedback: ${answer}`); - * - * rl.close(); - * }); - * ``` - * - * Once this code is invoked, the Node.js application will not terminate until the`readline.Interface` is closed because the interface waits for data to be - * received on the `input` stream. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/readline.js) - */ -declare module 'readline' { - import { Abortable, EventEmitter } from 'node:events'; - interface Key { - sequence?: string | undefined; - name?: string | undefined; - ctrl?: boolean | undefined; - meta?: boolean | undefined; - shift?: boolean | undefined; - } - /** - * Instances of the `readline.Interface` class are constructed using the`readline.createInterface()` method. Every instance is associated with a - * single `input` `Readable` stream and a single `output` `Writable` stream. - * The `output` stream is used to print prompts for user input that arrives on, - * and is read from, the `input` stream. - * @since v0.1.104 - */ - class Interface extends EventEmitter { - readonly terminal: boolean; - /** - * The current input data being processed by node. - * - * This can be used when collecting input from a TTY stream to retrieve the - * current value that has been processed thus far, prior to the `line` event - * being emitted. Once the `line` event has been emitted, this property will - * be an empty string. - * - * Be aware that modifying the value during the instance runtime may have - * unintended consequences if `rl.cursor` is not also controlled. - * - * **If not using a TTY stream for input, use the `'line'` event.** - * - * One possible use case would be as follows: - * - * ```js - * const values = ['lorem ipsum', 'dolor sit amet']; - * const rl = readline.createInterface(process.stdin); - * const showResults = debounce(() => { - * console.log( - * '\n', - * values.filter((val) => val.startsWith(rl.line)).join(' ') - * ); - * }, 300); - * process.stdin.on('keypress', (c, k) => { - * showResults(); - * }); - * ``` - * @since v0.1.98 - */ - readonly line: string; - /** - * The cursor position relative to `rl.line`. - * - * This will track where the current cursor lands in the input string, when - * reading input from a TTY stream. The position of cursor determines the - * portion of the input string that will be modified as input is processed, - * as well as the column where the terminal caret will be rendered. - * @since v0.1.98 - */ - readonly cursor: number; - /** - * 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); - /** - * The `rl.getPrompt()` method returns the current prompt used by `rl.prompt()`. - * @since v15.3.0 - * @return the current prompt string - */ - getPrompt(): string; - /** - * The `rl.setPrompt()` method sets the prompt that will be written to `output`whenever `rl.prompt()` is called. - * @since v0.1.98 - */ - setPrompt(prompt: string): void; - /** - * The `rl.prompt()` method writes the `readline.Interface` instances configured`prompt` to a new line in `output` in order to provide a user with a new - * location at which to provide input. - * - * When called, `rl.prompt()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the prompt is not written. - * @since v0.1.98 - * @param preserveCursor If `true`, prevents the cursor placement from being reset to `0`. - */ - prompt(preserveCursor?: boolean): void; - /** - * The `rl.question()` method displays the `query` by writing it to the `output`, - * waits for user input to be provided on `input`, then invokes the `callback`function passing the provided input as the first argument. - * - * When called, `rl.question()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `query` is not written. - * - * The `callback` function passed to `rl.question()` does not follow the typical - * pattern of accepting an `Error` object or `null` as the first argument. - * The `callback` is called with the provided answer as the only argument. - * - * Example usage: - * - * ```js - * rl.question('What is your favorite food? ', (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * ``` - * - * Using an `AbortController` to cancel a question. - * - * ```js - * const ac = new AbortController(); - * const signal = ac.signal; - * - * rl.question('What is your favorite food? ', { signal }, (answer) => { - * console.log(`Oh, so your favorite food is ${answer}`); - * }); - * - * signal.addEventListener('abort', () => { - * console.log('The food question timed out'); - * }, { once: true }); - * - * setTimeout(() => ac.abort(), 10000); - * ``` - * - * If this method is invoked as it's util.promisify()ed version, it returns a - * Promise that fulfills with the answer. If the question is canceled using - * an `AbortController` it will reject with an `AbortError`. - * - * ```js - * const util = require('util'); - * const question = util.promisify(rl.question).bind(rl); - * - * async function questionExample() { - * try { - * const answer = await question('What is you favorite food? '); - * console.log(`Oh, so your favorite food is ${answer}`); - * } catch (err) { - * console.error('Question rejected', err); - * } - * } - * questionExample(); - * ``` - * @since v0.3.3 - * @param query A statement or query to write to `output`, prepended to the prompt. - * @param callback A callback function that is invoked with the user's input in response to the `query`. - */ - question(query: string, callback: (answer: string) => void): void; - question(query: string, options: Abortable, callback: (answer: string) => void): void; - /** - * The `rl.pause()` method pauses the `input` stream, allowing it to be resumed - * later if necessary. - * - * Calling `rl.pause()` does not immediately pause other events (including`'line'`) from being emitted by the `readline.Interface` instance. - * @since v0.3.4 - */ - pause(): this; - /** - * The `rl.resume()` method resumes the `input` stream if it has been paused. - * @since v0.3.4 - */ - resume(): this; - /** - * The `rl.close()` method closes the `readline.Interface` instance and - * relinquishes control over the `input` and `output` streams. When called, - * the `'close'` event will be emitted. - * - * Calling `rl.close()` does not immediately stop other events (including `'line'`) - * from being emitted by the `readline.Interface` instance. - * @since v0.1.98 - */ - close(): void; - /** - * The `rl.write()` method will write either `data` or a key sequence identified - * by `key` to the `output`. The `key` argument is supported only if `output` is - * a `TTY` text terminal. See `TTY keybindings` for a list of key - * combinations. - * - * If `key` is specified, `data` is ignored. - * - * When called, `rl.write()` will resume the `input` stream if it has been - * paused. - * - * If the `readline.Interface` was created with `output` set to `null` or`undefined` the `data` and `key` are not written. - * - * ```js - * rl.write('Delete this!'); - * // Simulate Ctrl+U to delete the line written previously - * rl.write(null, { ctrl: true, name: 'u' }); - * ``` - * - * The `rl.write()` method will write the data to the `readline` `Interface`'s`input`_as if it were provided by the user_. - * @since v0.1.98 - */ - write(data: string | Buffer, key?: Key): void; - /** - * Returns the real position of the cursor in relation to the input - * prompt + string. Long input (wrapping) strings, as well as multiple - * line prompts are included in the calculations. - * @since v13.5.0, v12.16.0 - */ - getCursorPos(): CursorPos; - /** - * events.EventEmitter - * 1. close - * 2. line - * 3. pause - * 4. resume - * 5. SIGCONT - * 6. SIGINT - * 7. SIGTSTP - * 8. history - */ - 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: 'history', listener: (history: string[]) => 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: 'history', history: string[]): 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: 'history', listener: (history: string[]) => 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: 'history', listener: (history: string[]) => 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: 'history', listener: (history: string[]) => 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: 'history', listener: (history: string[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - type ReadLine = Interface; // type forwarded for backwards compatibility - type Completer = (line: string) => CompleterResult; - type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => void; - type CompleterResult = [string[], string]; - interface ReadLineOptions { - input: NodeJS.ReadableStream; - output?: NodeJS.WritableStream | undefined; - completer?: Completer | AsyncCompleter | undefined; - terminal?: boolean | undefined; - /** - * Initial list of history lines. This option makes sense - * only if `terminal` is set to `true` by the user or by an internal `output` - * check, otherwise the history caching mechanism is not initialized at all. - * @default [] - */ - history?: string[] | undefined; - historySize?: number | undefined; - prompt?: string | undefined; - crlfDelay?: number | undefined; - /** - * If `true`, when a new input line added - * to the history list duplicates an older one, this removes the older line - * from the list. - * @default false - */ - removeHistoryDuplicates?: boolean | undefined; - escapeCodeTimeout?: number | undefined; - tabSize?: number | undefined; - } - /** - * The `readline.createInterface()` method creates a new `readline.Interface`instance. - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout - * }); - * ``` - * - * Once the `readline.Interface` instance is created, the most common case is to - * listen for the `'line'` event: - * - * ```js - * rl.on('line', (line) => { - * console.log(`Received: ${line}`); - * }); - * ``` - * - * If `terminal` is `true` for this instance then the `output` stream will get - * the best compatibility if it defines an `output.columns` property and emits - * a `'resize'` event on the `output` if or when the columns ever change - * (`process.stdout` does this automatically when it is a TTY). - * - * When creating a `readline.Interface` using `stdin` as input, the program - * will not terminate until it receives `EOF` (Ctrl+D on - * Linux/macOS, Ctrl+Z followed by Return on - * Windows). - * If you want your application to exit without waiting for user input, you can `unref()` the standard input stream: - * - * ```js - * process.stdin.unref(); - * ``` - * @since v0.1.98 - */ - function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface; - function createInterface(options: ReadLineOptions): Interface; - /** - * The `readline.emitKeypressEvents()` method causes the given `Readable` stream to begin emitting `'keypress'` events corresponding to received input. - * - * Optionally, `interface` specifies a `readline.Interface` instance for which - * autocompletion is disabled when copy-pasted input is detected. - * - * If the `stream` is a `TTY`, then it must be in raw mode. - * - * This is automatically called by any readline instance on its `input` if the`input` is a terminal. Closing the `readline` instance does not stop - * the `input` from emitting `'keypress'` events. - * - * ```js - * readline.emitKeypressEvents(process.stdin); - * if (process.stdin.isTTY) - * process.stdin.setRawMode(true); - * ``` - * @since v0.7.7 - */ - function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void; - type Direction = -1 | 0 | 1; - interface CursorPos { - rows: number; - cols: number; - } - /** - * The `readline.clearLine()` method clears current line of given `TTY` stream - * in a specified direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean; - /** - * The `readline.clearScreenDown()` method clears the given `TTY` stream from - * the current position of the cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean; - /** - * The `readline.cursorTo()` method moves cursor to the specified position in a - * given `TTY` `stream`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean; - /** - * The `readline.moveCursor()` method moves the cursor _relative_ to its current - * position in a given `TTY` `stream`. - * - * ## Example: Tiny CLI - * - * The following example illustrates the use of `readline.Interface` class to - * implement a small command-line interface: - * - * ```js - * const readline = require('readline'); - * const rl = readline.createInterface({ - * input: process.stdin, - * output: process.stdout, - * prompt: 'OHAI> ' - * }); - * - * rl.prompt(); - * - * rl.on('line', (line) => { - * switch (line.trim()) { - * case 'hello': - * console.log('world!'); - * break; - * default: - * console.log(`Say what? I might have heard '${line.trim()}'`); - * break; - * } - * rl.prompt(); - * }).on('close', () => { - * console.log('Have a great day!'); - * process.exit(0); - * }); - * ``` - * - * ## Example: Read file stream line-by-Line - * - * A common use case for `readline` is to consume an input file one line at a - * time. The easiest way to do so is leveraging the `fs.ReadStream` API as - * well as a `for await...of` loop: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * async function processLineByLine() { - * const fileStream = fs.createReadStream('input.txt'); - * - * const rl = readline.createInterface({ - * input: fileStream, - * crlfDelay: Infinity - * }); - * // Note: we use the crlfDelay option to recognize all instances of CR LF - * // ('\r\n') in input.txt as a single line break. - * - * for await (const line of rl) { - * // Each line in input.txt will be successively available here as `line`. - * console.log(`Line from file: ${line}`); - * } - * } - * - * processLineByLine(); - * ``` - * - * Alternatively, one could use the `'line'` event: - * - * ```js - * const fs = require('fs'); - * const readline = require('readline'); - * - * const rl = readline.createInterface({ - * input: fs.createReadStream('sample.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * console.log(`Line from file: ${line}`); - * }); - * ``` - * - * Currently, `for await...of` loop can be a bit slower. If `async` / `await`flow and speed are both essential, a mixed approach can be applied: - * - * ```js - * const { once } = require('events'); - * const { createReadStream } = require('fs'); - * const { createInterface } = require('readline'); - * - * (async function processLineByLine() { - * try { - * const rl = createInterface({ - * input: createReadStream('big-file.txt'), - * crlfDelay: Infinity - * }); - * - * rl.on('line', (line) => { - * // Process the line. - * }); - * - * await once(rl, 'close'); - * - * console.log('File processed.'); - * } catch (err) { - * console.error(err); - * } - * })(); - * ``` - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean; -} -declare module 'node:readline' { - export * from 'readline'; -} diff --git a/JS/node_modules/@types/node/repl.d.ts b/JS/node_modules/@types/node/repl.d.ts deleted file mode 100755 index 053d977..0000000 --- a/JS/node_modules/@types/node/repl.d.ts +++ /dev/null @@ -1,424 +0,0 @@ -/** - * The `repl` module provides a Read-Eval-Print-Loop (REPL) implementation that - * is available both as a standalone program or includible in other applications. - * It can be accessed using: - * - * ```js - * const repl = require('repl'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/repl.js) - */ -declare module 'repl' { - import { Interface, Completer, AsyncCompleter } from 'node:readline'; - import { Context } from 'node:vm'; - import { InspectOptions } from 'node:util'; - interface ReplOptions { - /** - * The input prompt to display. - * @default "> " - */ - prompt?: string | undefined; - /** - * The `Readable` stream from which REPL input will be read. - * @default process.stdin - */ - input?: NodeJS.ReadableStream | undefined; - /** - * The `Writable` stream to which REPL output will be written. - * @default process.stdout - */ - output?: NodeJS.WritableStream | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - /** - * Defines if the repl prints output previews or not. - * @default `true` Always `false` in case `terminal` is falsy. - */ - preview?: boolean | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - } - 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 | undefined; - /** - * The function to execute, optionally accepting a single string argument. - */ - action: REPLCommandAction; - } - /** - * Instances of `repl.REPLServer` are created using the {@link start} method - * or directly using the JavaScript `new` keyword. - * - * ```js - * const repl = require('repl'); - * - * const options = { useColors: true }; - * - * const firstInstance = repl.start(options); - * const secondInstance = new repl.REPLServer(options); - * ``` - * @since v0.1.91 - */ - class REPLServer extends Interface { - /** - * The `vm.Context` provided to the `eval` function to be used for JavaScript - * evaluation. - */ - readonly context: Context; - /** - * @deprecated since v14.3.0 - Use `input` instead. - */ - readonly inputStream: NodeJS.ReadableStream; - /** - * @deprecated since v14.3.0 - Use `output` instead. - */ - readonly outputStream: NodeJS.WritableStream; - /** - * The `Readable` stream from which REPL input will be read. - */ - readonly input: NodeJS.ReadableStream; - /** - * The `Writable` stream to which REPL output will be written. - */ - readonly output: NodeJS.WritableStream; - /** - * The commands registered via `replServer.defineCommand()`. - */ - readonly commands: NodeJS.ReadOnlyDict; - /** - * 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(); - /** - * The `replServer.defineCommand()` method is used to add new `.`\-prefixed commands - * to the REPL instance. Such commands are invoked by typing a `.` followed by the`keyword`. The `cmd` is either a `Function` or an `Object` with the following - * properties: - * - * The following example shows two new commands added to the REPL instance: - * - * ```js - * const repl = require('repl'); - * - * const replServer = repl.start({ prompt: '> ' }); - * replServer.defineCommand('sayhello', { - * help: 'Say hello', - * action(name) { - * this.clearBufferedCommand(); - * console.log(`Hello, ${name}!`); - * this.displayPrompt(); - * } - * }); - * replServer.defineCommand('saybye', function saybye() { - * console.log('Goodbye!'); - * this.close(); - * }); - * ``` - * - * The new commands can then be used from within the REPL instance: - * - * ```console - * > .sayhello Node.js User - * Hello, Node.js User! - * > .saybye - * Goodbye! - * ``` - * @since v0.3.0 - * @param keyword The command keyword (*without* a leading `.` character). - * @param cmd The function to invoke when the command is processed. - */ - defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void; - /** - * The `replServer.displayPrompt()` method 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'. - * - * When `preserveCursor` is `true`, the cursor placement will not be reset to `0`. - * - * The `replServer.displayPrompt` method is primarily intended to be called from - * within the action function for commands registered using the`replServer.defineCommand()` method. - * @since v0.1.91 - */ - displayPrompt(preserveCursor?: boolean): void; - /** - * The `replServer.clearBufferedCommand()` method 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. - * @since v11.10.0 - * @param historyPath the path to the history file - * @param callback called when history writes are ready or upon error - */ - setupHistory(path: string, callback: (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. - */ - const REPL_MODE_SLOPPY: 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'`. - */ - const REPL_MODE_STRICT: unique symbol; - /** - * The `repl.start()` method creates and starts a {@link REPLServer} instance. - * - * If `options` is a string, then it specifies the input prompt: - * - * ```js - * const repl = require('repl'); - * - * // a Unix style prompt - * repl.start('$ '); - * ``` - * @since v0.1.91 - */ - 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); - } -} -declare module 'node:repl' { - export * from 'repl'; -} diff --git a/JS/node_modules/@types/node/stream.d.ts b/JS/node_modules/@types/node/stream.d.ts deleted file mode 100755 index 9fdf3bd..0000000 --- a/JS/node_modules/@types/node/stream.d.ts +++ /dev/null @@ -1,1218 +0,0 @@ -/** - * A stream is an abstract interface for working with streaming data in Node.js. - * The `stream` module provides an API for implementing the stream interface. - * - * There are many stream objects provided by Node.js. For instance, a `request to an HTTP server` and `process.stdout` are both stream instances. - * - * Streams can be readable, writable, or both. All streams are instances of `EventEmitter`. - * - * To access the `stream` module: - * - * ```js - * const stream = require('stream'); - * ``` - * - * The `stream` module is useful for creating new types of stream instances. It is - * usually not necessary to use the `stream` module to consume streams. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/stream.js) - */ -declare module 'stream' { - import { EventEmitter, Abortable } from 'node:events'; - import * as streamPromises from 'node:stream/promises'; - import * as streamConsumers from 'node:stream/consumers'; - class internal extends EventEmitter { - pipe( - destination: T, - options?: { - end?: boolean | undefined; - } - ): T; - } - namespace internal { - class Stream extends internal { - constructor(opts?: ReadableOptions); - } - interface StreamOptions extends Abortable { - emitClose?: boolean | undefined; - highWaterMark?: number | undefined; - objectMode?: boolean | undefined; - construct?(this: T, callback: (error?: Error | null) => void): void; - destroy?(this: T, error: Error | null, callback: (error: Error | null) => void): void; - autoDestroy?: boolean | undefined; - } - interface ReadableOptions extends StreamOptions { - encoding?: BufferEncoding | undefined; - read?(this: Readable, size: number): void; - } - /** - * @since v0.9.4 - */ - 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; - /** - * Returns whether the stream has been read from or cancelled. - * @since v16.8.0 - */ - static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; - /** - * Returns whether the stream was destroyed or errored before emitting `'end'`. - * @since v16.8.0 - */ - readonly readableAborted: boolean; - /** - * Is `true` if it is safe to call `readable.read()`, which means - * the stream has not been destroyed or emitted `'error'` or `'end'`. - * @since v11.4.0 - */ - readable: boolean; - /** - * Returns whether `'data'` has been emitted. - * @since v16.7.0 - */ - readonly readableDidRead: boolean; - /** - * Getter for the property `encoding` of a given `Readable` stream. The `encoding`property can be set using the `readable.setEncoding()` method. - * @since v12.7.0 - */ - readonly readableEncoding: BufferEncoding | null; - /** - * Becomes `true` when `'end'` event is emitted. - * @since v12.9.0 - */ - readonly readableEnded: boolean; - /** - * This property reflects the current state of a `Readable` stream as described - * in the `Three states` section. - * @since v9.4.0 - */ - readonly readableFlowing: boolean | null; - /** - * Returns the value of `highWaterMark` passed when creating this `Readable`. - * @since v9.3.0 - */ - readonly readableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be read. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly readableLength: number; - /** - * Getter for the property `objectMode` of a given `Readable` stream. - * @since v12.3.0 - */ - readonly readableObjectMode: boolean; - /** - * Is `true` after `readable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - constructor(opts?: ReadableOptions); - _construct?(callback: (error?: Error | null) => void): void; - _read(size: number): void; - /** - * The `readable.read()` method pulls some data out of the internal buffer and - * returns it. If no data available to be read, `null` is returned. By default, - * the data will be returned as a `Buffer` object unless an encoding has been - * specified using the `readable.setEncoding()` method or the stream is operating - * in object mode. - * - * The optional `size` argument specifies a specific number of bytes to read. If`size` bytes are not available to be read, `null` will be returned _unless_the stream has ended, in which - * case all of the data remaining in the internal - * buffer will be returned. - * - * If the `size` argument is not specified, all of the data contained in the - * internal buffer will be returned. - * - * The `size` argument must be less than or equal to 1 GiB. - * - * The `readable.read()` method should only be called on `Readable` streams - * operating in paused mode. In flowing mode, `readable.read()` is called - * automatically until the internal buffer is fully drained. - * - * ```js - * const readable = getReadableStreamSomehow(); - * - * // 'readable' may be triggered multiple times as data is buffered in - * readable.on('readable', () => { - * let chunk; - * console.log('Stream is readable (new data received in buffer)'); - * // Use a loop to make sure we read all currently available data - * while (null !== (chunk = readable.read())) { - * console.log(`Read ${chunk.length} bytes of data...`); - * } - * }); - * - * // 'end' will be triggered once when there is no more data available - * readable.on('end', () => { - * console.log('Reached end of stream.'); - * }); - * ``` - * - * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks - * are not concatenated. A `while` loop is necessary to consume all data - * currently in the buffer. When reading a large file `.read()` may return `null`, - * having consumed all buffered content so far, but there is still more data to - * come not yet buffered. In this case a new `'readable'` event will be emitted - * when there is more data in the buffer. Finally the `'end'` event will be - * emitted when there is no more data to come. - * - * Therefore to read a file's whole contents from a `readable`, it is necessary - * to collect chunks across multiple `'readable'` events: - * - * ```js - * const chunks = []; - * - * readable.on('readable', () => { - * let chunk; - * while (null !== (chunk = readable.read())) { - * chunks.push(chunk); - * } - * }); - * - * readable.on('end', () => { - * const content = chunks.join(''); - * }); - * ``` - * - * A `Readable` stream in object mode will always return a single item from - * a call to `readable.read(size)`, regardless of the value of the`size` argument. - * - * If the `readable.read()` method returns a chunk of data, a `'data'` event will - * also be emitted. - * - * Calling {@link read} after the `'end'` event has - * been emitted will return `null`. No runtime error will be raised. - * @since v0.9.4 - * @param size Optional argument to specify how much data to read. - */ - read(size?: number): any; - /** - * The `readable.setEncoding()` method sets the character encoding for - * data read from the `Readable` stream. - * - * By default, no encoding is assigned and stream data will be returned as`Buffer` objects. Setting an encoding causes the stream data - * to be returned as strings of the specified encoding rather than as `Buffer`objects. For instance, calling `readable.setEncoding('utf8')` will cause the - * output data to be interpreted as UTF-8 data, and passed as strings. Calling`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal - * string format. - * - * The `Readable` stream will properly handle multi-byte characters delivered - * through the stream that would otherwise become improperly decoded if simply - * pulled from the stream as `Buffer` objects. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.setEncoding('utf8'); - * readable.on('data', (chunk) => { - * assert.equal(typeof chunk, 'string'); - * console.log('Got %d characters of string data:', chunk.length); - * }); - * ``` - * @since v0.9.4 - * @param encoding The encoding to use. - */ - setEncoding(encoding: BufferEncoding): this; - /** - * The `readable.pause()` method will cause a stream in flowing mode to stop - * emitting `'data'` events, switching out of flowing mode. Any data that - * becomes available will remain in the internal buffer. - * - * ```js - * const readable = getReadableStreamSomehow(); - * readable.on('data', (chunk) => { - * console.log(`Received ${chunk.length} bytes of data.`); - * readable.pause(); - * console.log('There will be no additional data for 1 second.'); - * setTimeout(() => { - * console.log('Now data will start flowing again.'); - * readable.resume(); - * }, 1000); - * }); - * ``` - * - * The `readable.pause()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - pause(): this; - /** - * The `readable.resume()` method causes an explicitly paused `Readable` stream to - * resume emitting `'data'` events, switching the stream into flowing mode. - * - * The `readable.resume()` method can be used to fully consume the data from a - * stream without actually processing any of that data: - * - * ```js - * getReadableStreamSomehow() - * .resume() - * .on('end', () => { - * console.log('Reached the end, but did not read anything.'); - * }); - * ``` - * - * The `readable.resume()` method has no effect if there is a `'readable'`event listener. - * @since v0.9.4 - */ - resume(): this; - /** - * The `readable.isPaused()` method returns the current operating state of the`Readable`. This is used primarily by the mechanism that underlies the`readable.pipe()` method. In most - * typical cases, there will be no reason to - * use this method directly. - * - * ```js - * const readable = new stream.Readable(); - * - * readable.isPaused(); // === false - * readable.pause(); - * readable.isPaused(); // === true - * readable.resume(); - * readable.isPaused(); // === false - * ``` - * @since v0.11.14 - */ - isPaused(): boolean; - /** - * The `readable.unpipe()` method detaches a `Writable` stream previously attached - * using the {@link pipe} method. - * - * If the `destination` is not specified, then _all_ pipes are detached. - * - * If the `destination` is specified, but no pipe is set up for it, then - * the method does nothing. - * - * ```js - * const fs = require('fs'); - * const readable = getReadableStreamSomehow(); - * const writable = fs.createWriteStream('file.txt'); - * // All the data from readable goes into 'file.txt', - * // but only for the first second. - * readable.pipe(writable); - * setTimeout(() => { - * console.log('Stop writing to file.txt.'); - * readable.unpipe(writable); - * console.log('Manually close the file stream.'); - * writable.end(); - * }, 1000); - * ``` - * @since v0.9.4 - * @param destination Optional specific stream to unpipe - */ - unpipe(destination?: NodeJS.WritableStream): this; - /** - * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the - * same as `readable.push(null)`, after which no more data can be written. The EOF - * signal is put at the end of the buffer and any buffered data will still be - * flushed. - * - * The `readable.unshift()` method pushes a chunk of data back into the internal - * buffer. This is useful in certain situations where a stream is being consumed by - * code that needs to "un-consume" some amount of data that it has optimistically - * pulled out of the source, so that the data can be passed on to some other party. - * - * The `stream.unshift(chunk)` method cannot be called after the `'end'` event - * has been emitted or a runtime error will be thrown. - * - * Developers using `stream.unshift()` often should consider switching to - * use of a `Transform` stream instead. See the `API for stream implementers` section for more information. - * - * ```js - * // Pull off a header delimited by \n\n. - * // Use unshift() if we get too much. - * // Call the callback with (error, header, stream). - * const { StringDecoder } = require('string_decoder'); - * function parseHeader(stream, callback) { - * stream.on('error', callback); - * stream.on('readable', onReadable); - * const decoder = new StringDecoder('utf8'); - * let header = ''; - * function onReadable() { - * let chunk; - * while (null !== (chunk = stream.read())) { - * const str = decoder.write(chunk); - * if (str.match(/\n\n/)) { - * // Found the header boundary. - * const split = str.split(/\n\n/); - * header += split.shift(); - * const remaining = split.join('\n\n'); - * const buf = Buffer.from(remaining, 'utf8'); - * stream.removeListener('error', callback); - * // Remove the 'readable' listener before unshifting. - * stream.removeListener('readable', onReadable); - * if (buf.length) - * stream.unshift(buf); - * // Now the body of the message can be read from the stream. - * callback(null, header, stream); - * } else { - * // Still reading the header. - * header += str; - * } - * } - * } - * } - * ``` - * - * Unlike {@link push}, `stream.unshift(chunk)` will not - * end the reading process by resetting the internal reading state of the stream. - * This can cause unexpected results if `readable.unshift()` is called during a - * read (i.e. from within a {@link _read} implementation on a - * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately, - * however it is best to simply avoid calling `readable.unshift()` while in the - * process of performing a read. - * @since v0.9.11 - * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a string, `Buffer`, `Uint8Array` or `null`. For object mode - * streams, `chunk` may be any JavaScript value. - * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`. - */ - unshift(chunk: any, encoding?: BufferEncoding): void; - /** - * Prior to Node.js 0.10, streams did not implement the entire `stream` module API - * as it is currently defined. (See `Compatibility` for more information.) - * - * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the`readable.wrap()` method can be used to create a `Readable` - * stream that uses - * the old stream as its data source. - * - * It will rarely be necessary to use `readable.wrap()` but the method has been - * provided as a convenience for interacting with older Node.js applications and - * libraries. - * - * ```js - * const { OldReader } = require('./old-api-module.js'); - * const { Readable } = require('stream'); - * const oreader = new OldReader(); - * const myReader = new Readable().wrap(oreader); - * - * myReader.on('readable', () => { - * myReader.read(); // etc. - * }); - * ``` - * @since v0.9.4 - * @param stream An "old style" readable stream - */ - wrap(stream: NodeJS.ReadableStream): this; - push(chunk: any, encoding?: BufferEncoding): boolean; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the readable - * stream will release any internal resources and subsequent calls to `push()`will be ignored. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, but instead implement `readable._destroy()`. - * @since v8.0.0 - * @param error Error which will be passed as payload in `'error'` event - */ - destroy(error?: Error): void; - /** - * Event emitter - * The defined events on documents including: - * 1. close - * 2. data - * 3. end - * 4. error - * 5. pause - * 6. readable - * 7. resume - */ - addListener(event: 'close', listener: () => void): this; - addListener(event: 'data', listener: (chunk: any) => void): this; - addListener(event: 'end', listener: () => void): this; - addListener(event: 'error', listener: (err: Error) => void): this; - addListener(event: 'pause', listener: () => void): this; - addListener(event: 'readable', listener: () => void): this; - addListener(event: 'resume', listener: () => 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: 'error', err: Error): boolean; - emit(event: 'pause'): boolean; - emit(event: 'readable'): boolean; - emit(event: 'resume'): 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: 'error', listener: (err: Error) => void): this; - on(event: 'pause', listener: () => void): this; - on(event: 'readable', listener: () => void): this; - on(event: 'resume', listener: () => 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: 'error', listener: (err: Error) => void): this; - once(event: 'pause', listener: () => void): this; - once(event: 'readable', listener: () => void): this; - once(event: 'resume', listener: () => 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: 'error', listener: (err: Error) => void): this; - prependListener(event: 'pause', listener: () => void): this; - prependListener(event: 'readable', listener: () => void): this; - prependListener(event: 'resume', listener: () => 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: 'error', listener: (err: Error) => void): this; - prependOnceListener(event: 'pause', listener: () => void): this; - prependOnceListener(event: 'readable', listener: () => void): this; - prependOnceListener(event: 'resume', listener: () => 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: 'error', listener: (err: Error) => void): this; - removeListener(event: 'pause', listener: () => void): this; - removeListener(event: 'readable', listener: () => void): this; - removeListener(event: 'resume', listener: () => void): this; - removeListener(event: string | symbol, listener: (...args: any[]) => void): this; - [Symbol.asyncIterator](): AsyncIterableIterator; - } - interface WritableOptions extends StreamOptions { - decodeStrings?: boolean | undefined; - defaultEncoding?: BufferEncoding | undefined; - write?(this: Writable, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Writable, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - final?(this: Writable, callback: (error?: Error | null) => void): void; - } - /** - * @since v0.9.4 - */ - class Writable extends Stream implements NodeJS.WritableStream { - /** - * Is `true` if it is safe to call `writable.write()`, which means - * the stream has not been destroyed, errored or ended. - * @since v11.4.0 - */ - readonly writable: boolean; - /** - * Is `true` after `writable.end()` has been called. This property - * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead. - * @since v12.9.0 - */ - readonly writableEnded: boolean; - /** - * Is set to `true` immediately before the `'finish'` event is emitted. - * @since v12.6.0 - */ - readonly writableFinished: boolean; - /** - * Return the value of `highWaterMark` passed when creating this `Writable`. - * @since v9.3.0 - */ - readonly writableHighWaterMark: number; - /** - * This property contains the number of bytes (or objects) in the queue - * ready to be written. The value provides introspection data regarding - * the status of the `highWaterMark`. - * @since v9.4.0 - */ - readonly writableLength: number; - /** - * Getter for the property `objectMode` of a given `Writable` stream. - * @since v12.3.0 - */ - readonly writableObjectMode: boolean; - /** - * Number of times `writable.uncork()` needs to be - * called in order to fully uncork the stream. - * @since v13.2.0, v12.16.0 - */ - readonly writableCorked: number; - /** - * Is `true` after `writable.destroy()` has been called. - * @since v8.0.0 - */ - destroyed: boolean; - constructor(opts?: WritableOptions); - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - callback: (error?: Error | null) => void - ): void; - _construct?(callback: (error?: Error | null) => void): void; - _destroy(error: Error | null, callback: (error?: Error | null) => void): void; - _final(callback: (error?: Error | null) => void): void; - /** - * The `writable.write()` method writes some data to the stream, and calls the - * supplied `callback` once the data has been fully handled. If an error - * occurs, the `callback` will be called with the error as its - * first argument. The `callback` is called asynchronously and before `'error'` is - * emitted. - * - * The return value is `true` if the internal buffer is less than the`highWaterMark` configured when the stream was created after admitting `chunk`. - * If `false` is returned, further attempts to write data to the stream should - * stop until the `'drain'` event is emitted. - * - * While a stream is not draining, calls to `write()` will buffer `chunk`, and - * return false. Once all currently buffered chunks are drained (accepted for - * delivery by the operating system), the `'drain'` event will be emitted. - * It is recommended that once `write()` returns false, no more chunks be written - * until the `'drain'` event is emitted. While calling `write()` on a stream that - * is not draining is allowed, Node.js will buffer all written chunks until - * maximum memory usage occurs, at which point it will abort unconditionally. - * Even before it aborts, high memory usage will cause poor garbage collector - * performance and high RSS (which is not typically released back to the system, - * even after the memory is no longer required). Since TCP sockets may never - * drain if the remote peer does not read the data, writing a socket that is - * not draining may lead to a remotely exploitable vulnerability. - * - * Writing data while the stream is not draining is particularly - * problematic for a `Transform`, because the `Transform` streams are paused - * by default until they are piped or a `'data'` or `'readable'` event handler - * is added. - * - * If the data to be written can be generated or fetched on demand, it is - * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is - * possible to respect backpressure and avoid memory issues using the `'drain'` event: - * - * ```js - * function write(data, cb) { - * if (!stream.write(data)) { - * stream.once('drain', cb); - * } else { - * process.nextTick(cb); - * } - * } - * - * // Wait for cb to be called before doing any other write. - * write('hello', () => { - * console.log('Write completed, do more writes now.'); - * }); - * ``` - * - * A `Writable` stream in object mode will always ignore the `encoding` argument. - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param [encoding='utf8'] The encoding, if `chunk` is a string. - * @param callback Callback for when this chunk of data is flushed. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean; - /** - * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream. - * @since v0.11.15 - * @param encoding The new default encoding - */ - setDefaultEncoding(encoding: BufferEncoding): this; - /** - * Calling the `writable.end()` method signals that no more data will be written - * to the `Writable`. The optional `chunk` and `encoding` arguments allow one - * final additional chunk of data to be written immediately before closing the - * stream. - * - * Calling the {@link write} method after calling {@link end} will raise an error. - * - * ```js - * // Write 'hello, ' and then end with 'world!'. - * const fs = require('fs'); - * const file = fs.createWriteStream('example.txt'); - * file.write('hello, '); - * file.end('world!'); - * // Writing more now is not allowed! - * ``` - * @since v0.9.4 - * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string, `Buffer` or `Uint8Array`. For object mode streams, `chunk` may be any - * JavaScript value other than `null`. - * @param encoding The encoding if `chunk` is a string - * @param callback Callback for when the stream is finished. - */ - end(cb?: () => void): void; - end(chunk: any, cb?: () => void): void; - end(chunk: any, encoding: BufferEncoding, cb?: () => void): void; - /** - * The `writable.cork()` method forces all written data to be buffered in memory. - * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called. - * - * The primary intent of `writable.cork()` is to accommodate a situation in which - * several small chunks are written to the stream in rapid succession. Instead of - * immediately forwarding them to the underlying destination, `writable.cork()`buffers all the chunks until `writable.uncork()` is called, which will pass them - * all to `writable._writev()`, if present. This prevents a head-of-line blocking - * situation where data is being buffered while waiting for the first small chunk - * to be processed. However, use of `writable.cork()` without implementing`writable._writev()` may have an adverse effect on throughput. - * - * See also: `writable.uncork()`, `writable._writev()`. - * @since v0.11.2 - */ - cork(): void; - /** - * The `writable.uncork()` method flushes all data buffered since {@link cork} was called. - * - * When using `writable.cork()` and `writable.uncork()` to manage the buffering - * of writes to a stream, it is recommended that calls to `writable.uncork()` be - * deferred using `process.nextTick()`. Doing so allows batching of all`writable.write()` calls that occur within a given Node.js event loop phase. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.write('data '); - * process.nextTick(() => stream.uncork()); - * ``` - * - * If the `writable.cork()` method is called multiple times on a stream, the - * same number of calls to `writable.uncork()` must be called to flush the buffered - * data. - * - * ```js - * stream.cork(); - * stream.write('some '); - * stream.cork(); - * stream.write('data '); - * process.nextTick(() => { - * stream.uncork(); - * // The data will not be flushed until uncork() is called a second time. - * stream.uncork(); - * }); - * ``` - * - * See also: `writable.cork()`. - * @since v0.11.2 - */ - uncork(): void; - /** - * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'`event (unless `emitClose` is set to `false`). After this call, the writable - * stream has ended and subsequent calls to `write()` or `end()` will result in - * an `ERR_STREAM_DESTROYED` error. - * This is a destructive and immediate way to destroy a stream. Previous calls to`write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error. - * Use `end()` instead of destroy if data should flush before close, or wait for - * the `'drain'` event before destroying the stream. - * - * Once `destroy()` has been called any further calls will be a no-op and no - * further errors except from `_destroy()` may be emitted as `'error'`. - * - * Implementors should not override this method, - * but instead implement `writable._destroy()`. - * @since v8.0.0 - * @param error Optional, an error to emit with `'error'` event. - */ - 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 | undefined; - readableObjectMode?: boolean | undefined; - writableObjectMode?: boolean | undefined; - readableHighWaterMark?: number | undefined; - writableHighWaterMark?: number | undefined; - writableCorked?: number | undefined; - construct?(this: Duplex, callback: (error?: Error | null) => void): void; - read?(this: Duplex, size: number): void; - write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Duplex, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - 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; - } - /** - * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Duplex` streams include: - * - * * `TCP sockets` - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Duplex extends Readable implements Writable { - readonly writable: boolean; - readonly writableEnded: boolean; - readonly writableFinished: boolean; - readonly writableHighWaterMark: number; - readonly writableLength: number; - readonly writableObjectMode: boolean; - readonly writableCorked: number; - allowHalfOpen: boolean; - constructor(opts?: DuplexOptions); - /** - * A utility method for creating duplex streams. - * - * - `Stream` converts writable stream into writable `Duplex` and readable stream - * to `Duplex`. - * - `Blob` converts into readable `Duplex`. - * - `string` converts into readable `Duplex`. - * - `ArrayBuffer` converts into readable `Duplex`. - * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`. - * - `AsyncGeneratorFunction` converts into a readable/writable transform - * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield - * `null`. - * - `AsyncFunction` converts into a writable `Duplex`. Must return - * either `null` or `undefined` - * - `Object ({ writable, readable })` converts `readable` and - * `writable` into `Stream` and then combines them into `Duplex` where the - * `Duplex` will write to the `writable` and read from the `readable`. - * - `Promise` converts into readable `Duplex`. Value `null` is ignored. - * - * @since v16.8.0 - */ - static from(src: Stream | Blob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; - _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - _writev?( - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - 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?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean; - write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean; - setDefaultEncoding(encoding: BufferEncoding): this; - end(cb?: () => void): void; - end(chunk: any, cb?: () => void): void; - end(chunk: any, encoding?: BufferEncoding, cb?: () => void): void; - cork(): void; - uncork(): void; - } - type TransformCallback = (error?: Error | null, data?: any) => void; - interface TransformOptions extends DuplexOptions { - construct?(this: Transform, callback: (error?: Error | null) => void): void; - read?(this: Transform, size: number): void; - write?(this: Transform, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; - writev?( - this: Transform, - chunks: Array<{ - chunk: any; - encoding: BufferEncoding; - }>, - 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: BufferEncoding, callback: TransformCallback): void; - flush?(this: Transform, callback: TransformCallback): void; - } - /** - * Transform streams are `Duplex` streams where the output is in some way - * related to the input. Like all `Duplex` streams, `Transform` streams - * implement both the `Readable` and `Writable` interfaces. - * - * Examples of `Transform` streams include: - * - * * `zlib streams` - * * `crypto streams` - * @since v0.9.4 - */ - class Transform extends Duplex { - constructor(opts?: TransformOptions); - _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void; - _flush(callback: TransformCallback): void; - } - /** - * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is - * primarily for examples and testing, but there are some use cases where`stream.PassThrough` is useful as a building block for novel sorts of streams. - */ - class PassThrough extends Transform {} - /** - * Attaches an AbortSignal to a readable or writeable stream. This lets code - * control stream destruction using an `AbortController`. - * - * Calling `abort` on the `AbortController` corresponding to the passed`AbortSignal` will behave the same way as calling `.destroy(new AbortError())`on the stream. - * - * ```js - * const fs = require('fs'); - * - * const controller = new AbortController(); - * const read = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * // Later, abort the operation closing the stream - * controller.abort(); - * ``` - * - * Or using an `AbortSignal` with a readable stream as an async iterable: - * - * ```js - * const controller = new AbortController(); - * setTimeout(() => controller.abort(), 10_000); // set a timeout - * const stream = addAbortSignal( - * controller.signal, - * fs.createReadStream(('object.json')) - * ); - * (async () => { - * try { - * for await (const chunk of stream) { - * await process(chunk); - * } - * } catch (e) { - * if (e.name === 'AbortError') { - * // The operation was cancelled - * } else { - * throw e; - * } - * } - * })(); - * ``` - * @since v15.4.0 - * @param signal A signal representing possible cancellation - * @param stream a stream to attach a signal to - */ - function addAbortSignal(signal: AbortSignal, stream: T): T; - interface FinishedOptions extends Abortable { - error?: boolean | undefined; - readable?: boolean | undefined; - writable?: boolean | undefined; - } - /** - * A function to get notified when a stream is no longer readable, writable - * or has experienced an error or a premature close event. - * - * ```js - * const { finished } = require('stream'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * finished(rs, (err) => { - * if (err) { - * console.error('Stream failed.', err); - * } else { - * console.log('Stream is done reading.'); - * } - * }); - * - * rs.resume(); // Drain the stream. - * ``` - * - * Especially useful in error handling scenarios where a stream is destroyed - * prematurely (like an aborted HTTP request), and will not emit `'end'`or `'finish'`. - * - * The `finished` API provides promise version: - * - * ```js - * const { finished } = require('stream/promises'); - * - * const rs = fs.createReadStream('archive.tar'); - * - * async function run() { - * await finished(rs); - * console.log('Stream is done reading.'); - * } - * - * run().catch(console.error); - * rs.resume(); // Drain the stream. - * ``` - * - * `stream.finished()` leaves dangling event listeners (in particular`'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been - * invoked. The reason for this is so that unexpected `'error'` events (due to - * incorrect stream implementations) do not cause unexpected crashes. - * If this is unwanted behavior then the returned cleanup function needs to be - * invoked in the callback: - * - * ```js - * const cleanup = finished(rs, (err) => { - * cleanup(); - * // ... - * }); - * ``` - * @since v10.0.0 - * @param stream A readable and/or writable stream. - * @param callback A callback function that takes an optional error argument. - * @return A cleanup function which removes all registered listeners. - */ - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void; - 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, options?: FinishedOptions): Promise; - } - type PipelineSourceFunction = () => Iterable | AsyncIterable; - type PipelineSource = Iterable | AsyncIterable | NodeJS.ReadableStream | PipelineSourceFunction; - type PipelineTransform, U> = - | NodeJS.ReadWriteStream - | ((source: S extends (...args: any[]) => Iterable | AsyncIterable ? AsyncIterable : S) => AsyncIterable); - type PipelineTransformSource = PipelineSource | PipelineTransform; - type PipelineDestinationIterableFunction = (source: AsyncIterable) => AsyncIterable; - type PipelineDestinationPromiseFunction = (source: AsyncIterable) => Promise

; - type PipelineDestination, P> = S extends PipelineTransformSource - ? NodeJS.WritableStream | PipelineDestinationIterableFunction | PipelineDestinationPromiseFunction - : never; - type PipelineCallback> = S extends PipelineDestinationPromiseFunction - ? (err: NodeJS.ErrnoException | null, value: P) => void - : (err: NodeJS.ErrnoException | null) => void; - type PipelinePromise> = S extends PipelineDestinationPromiseFunction ? Promise

: Promise; - interface PipelineOptions { - signal: AbortSignal; - } - /** - * A module method to pipe between streams and generators forwarding errors and - * properly cleaning up and provide a callback when the pipeline is complete. - * - * ```js - * const { pipeline } = require('stream'); - * const fs = require('fs'); - * const zlib = require('zlib'); - * - * // Use the pipeline API to easily pipe a series of streams - * // together and get notified when the pipeline is fully done. - * - * // A pipeline to gzip a potentially huge tar file efficiently: - * - * pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * (err) => { - * if (err) { - * console.error('Pipeline failed.', err); - * } else { - * console.log('Pipeline succeeded.'); - * } - * } - * ); - * ``` - * - * The `pipeline` API provides a promise version, which can also - * receive an options argument as the last parameter with a`signal` `AbortSignal` property. When the signal is aborted,`destroy` will be called on the underlying pipeline, with - * an`AbortError`. - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * To use an `AbortSignal`, pass it inside an options object, - * as the last argument: - * - * ```js - * const { pipeline } = require('stream/promises'); - * - * async function run() { - * const ac = new AbortController(); - * const options = { - * signal: ac.signal, - * }; - * - * setTimeout(() => ac.abort(), 1); - * await pipeline( - * fs.createReadStream('archive.tar'), - * zlib.createGzip(), - * fs.createWriteStream('archive.tar.gz'), - * options, - * ); - * } - * - * run().catch(console.error); // AbortError - * ``` - * - * The `pipeline` API also supports async generators: - * - * ```js - * const { pipeline } = require('stream/promises'); - * const fs = require('fs'); - * - * async function run() { - * await pipeline( - * fs.createReadStream('lowercase.txt'), - * async function* (source) { - * source.setEncoding('utf8'); // Work with strings rather than `Buffer`s. - * for await (const chunk of source) { - * yield chunk.toUpperCase(); - * } - * }, - * fs.createWriteStream('uppercase.txt') - * ); - * console.log('Pipeline succeeded.'); - * } - * - * run().catch(console.error); - * ``` - * - * `stream.pipeline()` will call `stream.destroy(err)` on all streams except: - * - * * `Readable` streams which have emitted `'end'` or `'close'`. - * * `Writable` streams which have emitted `'finish'` or `'close'`. - * - * `stream.pipeline()` leaves dangling event listeners on the streams - * after the `callback` has been invoked. In the case of reuse of streams after - * failure, this can cause event listener leaks and swallowed errors. - * @since v10.0.0 - * @param callback Called when the pipeline is fully done. - */ - function pipeline, B extends PipelineDestination>( - source: A, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - callback?: PipelineCallback - ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, callback?: PipelineCallback): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream; - function pipeline( - streams: ReadonlyArray, - 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__, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function __promisify__(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function __promisify__( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; - } - interface Pipe { - close(): void; - hasRef(): boolean; - ref(): void; - unref(): void; - } - const promises: typeof streamPromises; - const consumers: typeof streamConsumers; - } - export = internal; -} -declare module 'node:stream' { - import stream = require('stream'); - export = stream; -} diff --git a/JS/node_modules/@types/node/stream/consumers.d.ts b/JS/node_modules/@types/node/stream/consumers.d.ts deleted file mode 100755 index ce6c9bb..0000000 --- a/JS/node_modules/@types/node/stream/consumers.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Duplicates of interface in lib.dom.ts. -// Duplicated here rather than referencing lib.dom.ts because doing so causes lib.dom.ts to be loaded for "test-all" -// Which in turn causes tests to pass that shouldn't pass. -// -// This interface is not, and should not be, exported. -interface Blob { - readonly size: number; - readonly type: string; - arrayBuffer(): Promise; - slice(start?: number, end?: number, contentType?: string): Blob; - stream(): NodeJS.ReadableStream; - text(): Promise; -} -declare module 'stream/consumers' { - import { Readable } from 'node:stream'; - function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function text(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function arrayBuffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function blob(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; - function json(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; -} -declare module 'node:stream/consumers' { - export * from 'stream/consumers'; -} diff --git a/JS/node_modules/@types/node/stream/promises.d.ts b/JS/node_modules/@types/node/stream/promises.d.ts deleted file mode 100755 index b427073..0000000 --- a/JS/node_modules/@types/node/stream/promises.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -declare module 'stream/promises' { - import { FinishedOptions, PipelineSource, PipelineTransform, PipelineDestination, PipelinePromise, PipelineOptions } from 'node:stream'; - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise; - function pipeline, B extends PipelineDestination>(source: A, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline, T1 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline, T1 extends PipelineTransform, T2 extends PipelineTransform, B extends PipelineDestination>( - source: A, - transform1: T1, - transform2: T2, - destination: B, - options?: PipelineOptions - ): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline< - A extends PipelineSource, - T1 extends PipelineTransform, - T2 extends PipelineTransform, - T3 extends PipelineTransform, - T4 extends PipelineTransform, - B extends PipelineDestination - >(source: A, transform1: T1, transform2: T2, transform3: T3, transform4: T4, destination: B, options?: PipelineOptions): PipelinePromise; - function pipeline(streams: ReadonlyArray, options?: PipelineOptions): Promise; - function pipeline( - stream1: NodeJS.ReadableStream, - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, - ...streams: Array - ): Promise; -} -declare module 'node:stream/promises' { - export * from 'stream/promises'; -} diff --git a/JS/node_modules/@types/node/stream/web.d.ts b/JS/node_modules/@types/node/stream/web.d.ts deleted file mode 100755 index a9d75c1..0000000 --- a/JS/node_modules/@types/node/stream/web.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -declare module 'stream/web' { - // stub module, pending copy&paste from .d.ts or manual impl -} -declare module 'node:stream/web' { - export * from 'stream/web'; -} diff --git a/JS/node_modules/@types/node/string_decoder.d.ts b/JS/node_modules/@types/node/string_decoder.d.ts deleted file mode 100755 index f12aa98..0000000 --- a/JS/node_modules/@types/node/string_decoder.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * The `string_decoder` module provides an API for decoding `Buffer` objects into - * strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 - * characters. It can be accessed using: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * ``` - * - * The following example shows the basic use of the `StringDecoder` class. - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * const cent = Buffer.from([0xC2, 0xA2]); - * console.log(decoder.write(cent)); - * - * const euro = Buffer.from([0xE2, 0x82, 0xAC]); - * console.log(decoder.write(euro)); - * ``` - * - * When a `Buffer` instance is written to the `StringDecoder` instance, an - * internal buffer is used to ensure that the decoded string does not contain - * any incomplete multibyte characters. These are held in the buffer until the - * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called. - * - * In the following example, the three UTF-8 encoded bytes of the European Euro - * symbol (`€`) are written over three separate operations: - * - * ```js - * const { StringDecoder } = require('string_decoder'); - * const decoder = new StringDecoder('utf8'); - * - * decoder.write(Buffer.from([0xE2])); - * decoder.write(Buffer.from([0x82])); - * console.log(decoder.end(Buffer.from([0xAC]))); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/string_decoder.js) - */ -declare module 'string_decoder' { - class StringDecoder { - constructor(encoding?: BufferEncoding); - /** - * Returns a decoded string, ensuring that any incomplete multibyte characters at - * the end of the `Buffer`, or `TypedArray`, or `DataView` are omitted from the - * returned string and stored in an internal buffer for the next call to`stringDecoder.write()` or `stringDecoder.end()`. - * @since v0.1.99 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - write(buffer: Buffer): string; - /** - * Returns any remaining input stored in the internal buffer as a string. Bytes - * representing incomplete UTF-8 and UTF-16 characters will be replaced with - * substitution characters appropriate for the character encoding. - * - * If the `buffer` argument is provided, one final call to `stringDecoder.write()`is performed before returning the remaining input. - * After `end()` is called, the `stringDecoder` object can be reused for new input. - * @since v0.9.3 - * @param buffer A `Buffer`, or `TypedArray`, or `DataView` containing the bytes to decode. - */ - end(buffer?: Buffer): string; - } -} -declare module 'node:string_decoder' { - export * from 'string_decoder'; -} diff --git a/JS/node_modules/@types/node/timers.d.ts b/JS/node_modules/@types/node/timers.d.ts deleted file mode 100755 index 3f3bace..0000000 --- a/JS/node_modules/@types/node/timers.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * The `timer` module exposes a global API for scheduling functions to - * be called at some future period of time. Because the timer functions are - * globals, there is no need to call `require('timers')` to use the API. - * - * The timer functions within Node.js implement a similar API as the timers API - * provided by Web Browsers but use a different internal implementation that is - * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout). - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/timers.js) - */ -declare module 'timers' { - import { Abortable } from 'node:events'; - import { setTimeout as setTimeoutPromise, setImmediate as setImmediatePromise, setInterval as setIntervalPromise } from 'node:timers/promises'; - interface TimerOptions extends Abortable { - /** - * Set to `false` to indicate that the scheduled `Timeout` - * should not require the Node.js event loop to remain active. - * @default true - */ - ref?: boolean | undefined; - } - let setTimeout: typeof global.setTimeout; - let clearTimeout: typeof global.clearTimeout; - let setInterval: typeof global.setInterval; - let clearInterval: typeof global.clearInterval; - let setImmediate: typeof global.setImmediate; - let clearImmediate: typeof global.clearImmediate; - global { - namespace NodeJS { - // compatibility with older typings - interface Timer extends RefCounted { - hasRef(): boolean; - refresh(): this; - [Symbol.toPrimitive](): number; - } - interface Immediate extends RefCounted { - /** - * If true, the `Immediate` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - _onImmediate: Function; // to distinguish it from the Timeout class - } - interface Timeout extends Timer { - /** - * If true, the `Timeout` object will keep the Node.js event loop active. - * @since v11.0.0 - */ - hasRef(): boolean; - /** - * Sets the timer's start time to the current time, and reschedules the timer to - * call its callback at the previously specified duration adjusted to the current - * time. This is useful for refreshing a timer without allocating a new - * JavaScript object. - * - * Using this on a timer that has already called its callback will reactivate the - * timer. - * @since v10.2.0 - * @return a reference to `timeout` - */ - refresh(): this; - [Symbol.toPrimitive](): number; - } - } - function setTimeout(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timeout; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setTimeout(callback: (args: void) => void, ms?: number): NodeJS.Timeout; - namespace setTimeout { - const __promisify__: typeof setTimeoutPromise; - } - function clearTimeout(timeoutId: NodeJS.Timeout): void; - function setInterval(callback: (...args: TArgs) => void, ms?: number, ...args: TArgs): NodeJS.Timer; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setInterval(callback: (args: void) => void, ms?: number): NodeJS.Timer; - namespace setInterval { - const __promisify__: typeof setIntervalPromise; - } - function clearInterval(intervalId: NodeJS.Timeout): void; - function setImmediate(callback: (...args: TArgs) => void, ...args: TArgs): NodeJS.Immediate; - // util.promisify no rest args compability - // tslint:disable-next-line void-return - function setImmediate(callback: (args: void) => void): NodeJS.Immediate; - namespace setImmediate { - const __promisify__: typeof setImmediatePromise; - } - function clearImmediate(immediateId: NodeJS.Immediate): void; - function queueMicrotask(callback: () => void): void; - } -} -declare module 'node:timers' { - export * from 'timers'; -} diff --git a/JS/node_modules/@types/node/timers/promises.d.ts b/JS/node_modules/@types/node/timers/promises.d.ts deleted file mode 100755 index fd77888..0000000 --- a/JS/node_modules/@types/node/timers/promises.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * The `timers/promises` API provides an alternative set of timer functions - * that return `Promise` objects. The API is accessible via`require('timers/promises')`. - * - * ```js - * import { - * setTimeout, - * setImmediate, - * setInterval, - * } from 'timers/promises'; - * ``` - * @since v15.0.0 - */ -declare module 'timers/promises' { - import { TimerOptions } from 'node:timers'; - /** - * ```js - * import { - * setTimeout, - * } from 'timers/promises'; - * - * const res = await setTimeout(100, 'result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param [delay=1] The number of milliseconds to wait before fulfilling the promise. - * @param value A value with which the promise is fulfilled. - */ - function setTimeout(delay?: number, value?: T, options?: TimerOptions): Promise; - /** - * ```js - * import { - * setImmediate, - * } from 'timers/promises'; - * - * const res = await setImmediate('result'); - * - * console.log(res); // Prints 'result' - * ``` - * @since v15.0.0 - * @param value A value with which the promise is fulfilled. - */ - function setImmediate(value?: T, options?: TimerOptions): Promise; - /** - * Returns an async iterator that generates values in an interval of `delay` ms. - * - * ```js - * import { - * setInterval, - * } from 'timers/promises'; - * - * const interval = 100; - * for await (const startTime of setInterval(interval, Date.now())) { - * const now = Date.now(); - * console.log(now); - * if ((now - startTime) > 1000) - * break; - * } - * console.log(Date.now()); - * ``` - * @since v15.9.0 - */ - function setInterval(delay?: number, value?: T, options?: TimerOptions): AsyncIterable; -} -declare module 'node:timers/promises' { - export * from 'timers/promises'; -} diff --git a/JS/node_modules/@types/node/tls.d.ts b/JS/node_modules/@types/node/tls.d.ts deleted file mode 100755 index 8d523b4..0000000 --- a/JS/node_modules/@types/node/tls.d.ts +++ /dev/null @@ -1,1019 +0,0 @@ -/** - * The `tls` module provides an implementation of the Transport Layer Security - * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL. - * The module can be accessed using: - * - * ```js - * const tls = require('tls'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/tls.js) - */ -declare module 'tls' { - import { X509Certificate } from 'node:crypto'; - import * as net from 'node:net'; - 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: NodeJS.Dict; - modulus: string; - exponent: string; - valid_from: string; - valid_to: string; - fingerprint: string; - fingerprint256: 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; - /** - * IETF name for the cipher suite. - */ - standardName: string; - } - interface EphemeralKeyInfo { - /** - * The supported types are 'DH' and 'ECDH'. - */ - type: string; - /** - * The name property is available only when type is 'ECDH'. - */ - name?: string | undefined; - /** - * The size of parameter of an ephemeral key exchange. - */ - size: number; - } - interface KeyObject { - /** - * Private keys in PEM format. - */ - pem: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface PxfObject { - /** - * PFX or PKCS12 encoded private key and certificate chain. - */ - buf: string | Buffer; - /** - * Optional passphrase. - */ - passphrase?: string | undefined; - } - interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions { - /** - * If true the TLS socket will be instantiated in server-mode. - * Defaults to false. - */ - isServer?: boolean | undefined; - /** - * An optional net.Server instance. - */ - server?: net.Server | undefined; - /** - * An optional Buffer instance containing a TLS session. - */ - session?: Buffer | undefined; - /** - * 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 | undefined; - } - /** - * Performs transparent encryption of written data and all required TLS - * negotiation. - * - * Instances of `tls.TLSSocket` implement the duplex `Stream` interface. - * - * Methods that return TLS connection metadata (e.g.{@link TLSSocket.getPeerCertificate} will only return data while the - * connection is open. - * @since v0.11.4 - */ - class TLSSocket extends net.Socket { - /** - * Construct a new tls.TLSSocket object from an existing TCP socket. - */ - constructor(socket: net.Socket, options?: TLSSocketOptions); - /** - * Returns `true` if the peer certificate was signed by one of the CAs specified - * when creating the `tls.TLSSocket` instance, otherwise `false`. - * @since v0.11.4 - */ - authorized: boolean; - /** - * Returns the reason why the peer's certificate was not been verified. This - * property is set only when `tlsSocket.authorized === false`. - * @since v0.11.4 - */ - authorizationError: Error; - /** - * Always returns `true`. This may be used to distinguish TLS sockets from regular`net.Socket` instances. - * @since v0.11.4 - */ - encrypted: boolean; - /** - * String containing the selected ALPN protocol. - * Before a handshake has completed, this value is always null. - * When a handshake is completed but not ALPN protocol was selected, tlsSocket.alpnProtocol equals false. - */ - alpnProtocol: string | false | null; - /** - * Returns an object representing the local certificate. The returned object has - * some properties corresponding to the fields of the certificate. - * - * See {@link TLSSocket.getPeerCertificate} for an example of the certificate - * structure. - * - * If there is no local certificate, an empty object will be returned. If the - * socket has been destroyed, `null` will be returned. - * @since v11.2.0 - */ - getCertificate(): PeerCertificate | object | null; - /** - * Returns an object containing information on the negotiated cipher suite. - * - * For example: - * - * ```json - * { - * "name": "AES128-SHA256", - * "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", - * "version": "TLSv1.2" - * } - * ``` - * - * See[SSL\_CIPHER\_get\_name](https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html)for more information. - * @since v0.11.4 - */ - getCipher(): CipherNameAndProtocol; - /** - * Returns an object representing the type, name, and size of parameter of - * an ephemeral key exchange in `perfect forward secrecy` on a client - * connection. It returns an empty object when the key exchange is not - * ephemeral. As this is only supported on a client socket; `null` is returned - * if called on a server socket. The supported types are `'DH'` and `'ECDH'`. The`name` property is available only when type is `'ECDH'`. - * - * For example: `{ type: 'ECDH', name: 'prime256v1', size: 256 }`. - * @since v5.0.0 - */ - getEphemeralKeyInfo(): EphemeralKeyInfo | object | null; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that has been sent to the socket as part of a SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet. - */ - getFinished(): Buffer | undefined; - /** - * Returns an object representing the peer's certificate. If the peer does not - * provide a certificate, an empty object will be returned. If the socket has been - * destroyed, `null` will be returned. - * - * If the full certificate chain was requested, each certificate will include an`issuerCertificate` property containing an object representing its issuer's - * certificate. - * @since v0.11.4 - * @param detailed Include the full certificate chain if `true`, otherwise include just the peer's certificate. - * @return A certificate object. - */ - getPeerCertificate(detailed: true): DetailedPeerCertificate; - getPeerCertificate(detailed?: false): PeerCertificate; - getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; - /** - * As the `Finished` messages are message digests of the complete handshake - * (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can - * be used for external authentication procedures when the authentication - * provided by SSL/TLS is not desired or is not enough. - * - * Corresponds to the `SSL_get_peer_finished` routine in OpenSSL and may be used - * to implement the `tls-unique` channel binding from [RFC 5929](https://tools.ietf.org/html/rfc5929). - * @since v9.9.0 - * @return The latest `Finished` message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or `undefined` if there is no `Finished` message so - * far. - */ - getPeerFinished(): Buffer | undefined; - /** - * 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. - * - * Protocol versions are: - * - * * `'SSLv3'` - * * `'TLSv1'` - * * `'TLSv1.1'` - * * `'TLSv1.2'` - * * `'TLSv1.3'` - * - * See the OpenSSL [`SSL_get_version`](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html) documentation for more information. - * @since v5.7.0 - */ - getProtocol(): string | null; - /** - * Returns the TLS session data or `undefined` if no session was - * negotiated. On the client, the data can be provided to the `session` option of {@link connect} to resume the connection. On the server, it may be useful - * for debugging. - * - * See `Session Resumption` for more information. - * - * Note: `getSession()` works only for TLSv1.2 and below. For TLSv1.3, applications - * must use the `'session'` event (it also works for TLSv1.2 and below). - * @since v0.11.4 - */ - getSession(): Buffer | undefined; - /** - * See[SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html)for more information. - * @since v12.11.0 - * @return List of signature algorithms shared between the server and the client in the order of decreasing preference. - */ - getSharedSigalgs(): string[]; - /** - * For a client, returns the TLS session ticket if one is available, or`undefined`. For a server, always returns `undefined`. - * - * It may be useful for debugging. - * - * See `Session Resumption` for more information. - * @since v0.11.4 - */ - getTLSTicket(): Buffer | undefined; - /** - * See `Session Resumption` for more information. - * @since v0.5.6 - * @return `true` if the session was reused, `false` otherwise. - */ - isSessionReused(): boolean; - /** - * The `tlsSocket.renegotiate()` method initiates a TLS renegotiation process. - * Upon completion, the `callback` function will be passed a single argument - * that is either an `Error` (if the request failed) or `null`. - * - * This method can be used to request a peer's certificate after the secure - * connection has been established. - * - * When running as the server, the socket will be destroyed with an error after`handshakeTimeout` timeout. - * - * For TLSv1.3, renegotiation cannot be initiated, it is not supported by the - * protocol. - * @since v0.11.8 - * @param callback If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with - * an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all. - * @return `true` if renegotiation was initiated, `false` otherwise. - */ - renegotiate( - options: { - rejectUnauthorized?: boolean | undefined; - requestCert?: boolean | undefined; - }, - callback: (err: Error | null) => void - ): undefined | boolean; - /** - * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. - * Returns `true` if setting the limit succeeded; `false` otherwise. - * - * Smaller fragment sizes decrease the buffering latency on the client: larger - * 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. - * @since v0.11.11 - * @param [size=16384] The maximum TLS fragment size. The maximum value is `16384`. - */ - setMaxSendFragment(size: number): boolean; - /** - * Disables TLS renegotiation for this `TLSSocket` instance. Once called, attempts - * to renegotiate will trigger an `'error'` event on the `TLSSocket`. - * @since v8.4.0 - */ - disableRenegotiation(): void; - /** - * 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. - * @since v12.2.0 - */ - enableTrace(): void; - /** - * Returns the peer certificate as an `X509Certificate` object. - * - * If there is no peer certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getPeerX509Certificate(): X509Certificate | undefined; - /** - * Returns the local certificate as an `X509Certificate` object. - * - * If there is no local certificate, or the socket has been destroyed,`undefined` will be returned. - * @since v15.9.0 - */ - getX509Certificate(): X509Certificate | undefined; - /** - * Keying material is used for validations to prevent different kind of attacks in - * network protocols, for example in the specifications of IEEE 802.1X. - * - * Example - * - * ```js - * const keyingMaterial = tlsSocket.exportKeyingMaterial( - * 128, - * 'client finished'); - * - * - * Example return value of keyingMaterial: - * - * - * ``` - * - * See the OpenSSL [`SSL_export_keying_material`](https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html) documentation for more - * information. - * @since v13.10.0, v12.17.0 - * @param length number of bytes to retrieve from keying material - * @param label an application specific label, typically this will be a value from the [IANA Exporter Label - * Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels). - * @param context Optionally provide a context. - * @return requested bytes of the keying material - */ - exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer; - 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 | undefined; - /** - * When enabled, TLS packet trace information is written to `stderr`. This can be - * used to debug TLS connection problems. - * @default false - */ - enableTrace?: boolean | undefined; - /** - * If true the server will request a certificate from clients that - * connect and attempt to verify that certificate. Defaults to - * false. - */ - requestCert?: boolean | undefined; - /** - * An array of strings or a Buffer naming possible ALPN protocols. - * (Protocols should be ordered by their priority.) - */ - ALPNProtocols?: string[] | Uint8Array[] | Uint8Array | undefined; - /** - * 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) | undefined; - /** - * 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 | undefined; - } - interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts { - /** - * Abort the connection if the SSL/TLS handshake does not finish in the - * specified number of milliseconds. A 'tlsClientError' is emitted on - * the tls.Server object whenever a handshake times out. Default: - * 120000 (120 seconds). - */ - handshakeTimeout?: number | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - */ - ticketKeys?: Buffer | undefined; - /** - * - * @param socket - * @param identity identity parameter sent from the client. - * @return pre-shared key that must either be - * a buffer or `null` to stop the negotiation process. Returned PSK must be - * compatible with the selected cipher's digest. - * - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with the identity provided by the client. - * If the return value is `null` the negotiation process will stop and an - * "unknown_psk_identity" alert message will be sent to the other party. - * If the server wishes to hide the fact that the PSK identity was not known, - * the callback must provide some random data as `psk` to make the connection - * fail with "decrypt_error" before negotiation is finished. - * PSK ciphers are disabled by default, and using TLS-PSK thus - * requires explicitly specifying a cipher suite with the `ciphers` option. - * More information can be found in the RFC 4279. - */ - pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null; - /** - * hint to send to a client to help - * with selecting the identity during TLS-PSK negotiation. Will be ignored - * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be - * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code. - */ - pskIdentityHint?: string | undefined; - } - interface PSKCallbackNegotation { - psk: DataView | NodeJS.TypedArray; - identity: string; - } - interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions { - host?: string | undefined; - port?: number | undefined; - path?: string | undefined; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. - socket?: net.Socket | undefined; // Establish secure connection on a given socket rather than creating a new socket - checkServerIdentity?: typeof checkServerIdentity | undefined; - servername?: string | undefined; // SNI TLS Extension - session?: Buffer | undefined; - minDHSize?: number | undefined; - lookup?: net.LookupFunction | undefined; - timeout?: number | undefined; - /** - * When negotiating TLS-PSK (pre-shared keys), this function is called - * with optional identity `hint` provided by the server or `null` - * in case of TLS 1.3 where `hint` was removed. - * It will be necessary to provide a custom `tls.checkServerIdentity()` - * for the connection as the default one will try to check hostname/IP - * of the server against the certificate but that's not applicable for PSK - * because there won't be a certificate present. - * More information can be found in the RFC 4279. - * - * @param hint message sent from the server to help client - * decide which identity to use during negotiation. - * Always `null` if TLS 1.3 is used. - * @returns Return `null` to stop the negotiation process. `psk` must be - * compatible with the selected cipher's digest. - * `identity` must use UTF-8 encoding. - */ - pskCallback?(hint: string | null): PSKCallbackNegotation | null; - } - /** - * Accepts encrypted connections using TLS or SSL. - * @since v0.3.2 - */ - class Server extends net.Server { - constructor(secureConnectionListener?: (socket: TLSSocket) => void); - constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void); - /** - * The `server.addContext()` method adds a secure context that will be used if - * the client request's SNI name matches the supplied `hostname` (or wildcard). - * - * When there are multiple matching contexts, the most recently added one is - * used. - * @since v0.5.3 - * @param hostname A SNI host name or wildcard (e.g. `'*'`) - * @param context An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - addContext(hostname: string, context: SecureContextOptions): void; - /** - * Returns the session ticket keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @return A 48-byte buffer containing the session ticket keys. - */ - getTicketKeys(): Buffer; - /** - * The `server.setSecureContext()` method replaces the secure context of an - * existing server. Existing connections to the server are not interrupted. - * @since v11.0.0 - * @param options An object containing any of the possible properties from the {@link createSecureContext} `options` arguments (e.g. `key`, `cert`, `ca`, etc). - */ - setSecureContext(options: SecureContextOptions): void; - /** - * Sets the session ticket keys. - * - * Changes to the ticket keys are effective only for future server connections. - * Existing or currently pending server connections will use the previous keys. - * - * See `Session Resumption` for more information. - * @since v3.0.0 - * @param keys A 48-byte buffer containing the session ticket keys. - */ - setTicketKeys(keys: Buffer): void; - /** - * events.EventEmitter - * 1. tlsClientError - * 2. newSession - * 3. OCSPRequest - * 4. resumeSession - * 5. secureConnection - * 6. keylog - */ - 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; - } - /** - * @deprecated since v0.11.3 Use `tls.TLSSocket` instead. - */ - interface SecurePair { - encrypted: TLSSocket; - cleartext: TLSSocket; - } - type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1'; - interface SecureContextOptions { - /** - * Optionally override the trusted CA certificates. Default is to trust - * the well-known CAs curated by Mozilla. Mozilla's CAs are completely - * replaced when CAs are explicitly specified using this option. - */ - ca?: string | Buffer | Array | undefined; - /** - * Cert chains in PEM format. One cert chain should be provided per - * private key. Each cert chain should consist of the PEM formatted - * certificate for a provided private key, followed by the PEM - * formatted intermediate certificates (if any), in order, and not - * including the root CA (the root CA must be pre-known to the peer, - * see ca). When providing multiple cert chains, they do not have to - * be in the same order as their private keys in key. If the - * intermediate certificates are not provided, the peer will not be - * able to validate the certificate, and the handshake will fail. - */ - cert?: string | Buffer | Array | undefined; - /** - * Colon-separated list of supported signature algorithms. The list - * can contain digest algorithms (SHA256, MD5 etc.), public key - * algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g - * 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512). - */ - sigalgs?: string | undefined; - /** - * Cipher suite specification, replacing the default. For more - * information, see modifying the default cipher suite. Permitted - * ciphers can be obtained via tls.getCiphers(). Cipher names must be - * uppercased in order for OpenSSL to accept them. - */ - ciphers?: string | undefined; - /** - * Name of an OpenSSL engine which can provide the client certificate. - */ - clientCertEngine?: string | undefined; - /** - * PEM formatted CRLs (Certificate Revocation Lists). - */ - crl?: string | Buffer | Array | undefined; - /** - * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use - * openssl dhparam to create the parameters. The key length must be - * greater than or equal to 1024 bits or else an error will be thrown. - * Although 1024 bits is permissible, use 2048 bits or larger for - * stronger security. If omitted or invalid, the parameters are - * silently discarded and DHE ciphers will not be available. - */ - dhparam?: string | Buffer | undefined; - /** - * A string describing a named curve or a colon separated list of curve - * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key - * agreement. Set to auto to select the curve automatically. Use - * crypto.getCurves() to obtain a list of available curve names. On - * recent releases, openssl ecparam -list_curves will also display the - * name and description of each available elliptic curve. Default: - * tls.DEFAULT_ECDH_CURVE. - */ - ecdhCurve?: string | undefined; - /** - * Attempt to use the server's cipher suite preferences instead of the - * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be - * set in secureOptions - */ - honorCipherOrder?: boolean | undefined; - /** - * Private keys in PEM format. PEM allows the option of private keys - * being encrypted. Encrypted keys will be decrypted with - * options.passphrase. Multiple keys using different algorithms can be - * provided either as an array of unencrypted key strings or buffers, - * or an array of objects in the form {pem: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted keys will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - key?: string | Buffer | Array | undefined; - /** - * Name of an OpenSSL engine to get private key from. Should be used - * together with privateKeyIdentifier. - */ - privateKeyEngine?: string | undefined; - /** - * Identifier of a private key managed by an OpenSSL engine. Should be - * used together with privateKeyEngine. Should not be set together with - * key, because both options define a private key in different ways. - */ - privateKeyIdentifier?: string | undefined; - /** - * 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 | undefined; - /** - * 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 | undefined; - /** - * Shared passphrase used for a single private key and/or a PFX. - */ - passphrase?: string | undefined; - /** - * PFX or PKCS12 encoded private key and certificate chain. pfx is an - * alternative to providing key and cert individually. PFX is usually - * encrypted, if it is, passphrase will be used to decrypt it. Multiple - * PFX can be provided either as an array of unencrypted PFX buffers, - * or an array of objects in the form {buf: [, - * passphrase: ]}. The object form can only occur in an array. - * object.passphrase is optional. Encrypted PFX will be decrypted with - * object.passphrase if provided, or options.passphrase if it is not. - */ - pfx?: string | Buffer | Array | undefined; - /** - * Optionally affect the OpenSSL protocol behavior, which is not - * usually necessary. This should be used carefully if at all! Value is - * a numeric bitmask of the SSL_OP_* options from OpenSSL Options - */ - secureOptions?: number | undefined; // Value is a numeric bitmask of the `SSL_OP_*` options - /** - * Legacy mechanism to select the TLS protocol version to use, it does - * not support independent control of the minimum and maximum version, - * and does not support limiting the protocol to TLSv1.3. Use - * minVersion and maxVersion instead. The possible values are listed as - * SSL_METHODS, use the function names as strings. For example, use - * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow - * any TLS protocol version up to TLSv1.3. It is not recommended to use - * TLS versions less than 1.2, but it may be required for - * interoperability. Default: none, see minVersion. - */ - secureProtocol?: string | undefined; - /** - * Opaque identifier used by servers to ensure session state is not - * shared between applications. Unused by clients. - */ - sessionIdContext?: string | undefined; - /** - * 48-bytes of cryptographically strong pseudo-random data. - * See Session Resumption for more information. - */ - ticketKeys?: Buffer | undefined; - /** - * The number of seconds after which a TLS session created by the - * server will no longer be resumable. See Session Resumption for more - * information. Default: 300. - */ - sessionTimeout?: number | undefined; - } - interface SecureContext { - context: any; - } - /** - * Verifies the certificate `cert` is issued to `hostname`. - * - * Returns [<Error>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object, populating it with `reason`, `host`, and `cert` on - * failure. On success, returns [<undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Undefined_type). - * - * This function can be overwritten by providing alternative function as part of - * the `options.checkServerIdentity` option passed to `tls.connect()`. The - * overwriting function can call `tls.checkServerIdentity()` of course, to augment - * the checks done with additional verification. - * - * This function is only called if the certificate passed all other checks, such as - * being issued by trusted CA (`options.ca`). - * @since v0.8.4 - * @param hostname The host name or IP address to verify the certificate against. - * @param cert A `certificate object` representing the peer's certificate. - */ - function checkServerIdentity(hostname: string, cert: PeerCertificate): Error | undefined; - /** - * Creates a new {@link Server}. The `secureConnectionListener`, if provided, is - * automatically set as a listener for the `'secureConnection'` event. - * - * The `ticketKeys` options is automatically shared between `cluster` module - * workers. - * - * The following illustrates a simple echo server: - * - * ```js - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * key: fs.readFileSync('server-key.pem'), - * cert: fs.readFileSync('server-cert.pem'), - * - * // This is necessary only if using client certificate authentication. - * requestCert: true, - * - * // This is necessary only if the client uses a self-signed certificate. - * ca: [ fs.readFileSync('client-cert.pem') ] - * }; - * - * const server = tls.createServer(options, (socket) => { - * console.log('server connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * socket.write('welcome!\n'); - * socket.setEncoding('utf8'); - * socket.pipe(socket); - * }); - * server.listen(8000, () => { - * console.log('server bound'); - * }); - * ``` - * - * The server can be tested by connecting to it using the example client from {@link connect}. - * @since v0.3.2 - */ - function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server; - function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; - /** - * The `callback` function, if specified, will be added as a listener for the `'secureConnect'` event. - * - * `tls.connect()` returns a {@link TLSSocket} object. - * - * Unlike the `https` API, `tls.connect()` does not enable the - * SNI (Server Name Indication) extension by default, which may cause some - * servers to return an incorrect certificate or reject the connection - * altogether. To enable SNI, set the `servername` option in addition - * to `host`. - * - * The following illustrates a client for the echo server example from {@link createServer}: - * - * ```js - * // Assumes an echo server that is listening on port 8000. - * const tls = require('tls'); - * const fs = require('fs'); - * - * const options = { - * // Necessary only if the server requires client certificate authentication. - * key: fs.readFileSync('client-key.pem'), - * cert: fs.readFileSync('client-cert.pem'), - * - * // Necessary only if the server uses a self-signed certificate. - * ca: [ fs.readFileSync('server-cert.pem') ], - * - * // Necessary only if the server's cert isn't for "localhost". - * checkServerIdentity: () => { return null; }, - * }; - * - * const socket = tls.connect(8000, options, () => { - * console.log('client connected', - * socket.authorized ? 'authorized' : 'unauthorized'); - * process.stdin.pipe(socket); - * process.stdin.resume(); - * }); - * socket.setEncoding('utf8'); - * socket.on('data', (data) => { - * console.log(data); - * }); - * socket.on('end', () => { - * console.log('server ends connection'); - * }); - * ``` - * @since v0.11.3 - */ - 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; - /** - * Creates a new secure pair object with two streams, one of which reads and writes - * the encrypted data and the other of which reads and writes the cleartext data. - * Generally, the encrypted stream is piped to/from an incoming encrypted data - * stream and the cleartext one is used as a replacement for the initial encrypted - * stream. - * - * `tls.createSecurePair()` returns a `tls.SecurePair` object with `cleartext` and`encrypted` stream properties. - * - * Using `cleartext` has the same API as {@link TLSSocket}. - * - * The `tls.createSecurePair()` method is now deprecated in favor of`tls.TLSSocket()`. For example, the code: - * - * ```js - * pair = tls.createSecurePair(// ... ); - * pair.encrypted.pipe(socket); - * socket.pipe(pair.encrypted); - * ``` - * - * can be replaced by: - * - * ```js - * secureSocket = tls.TLSSocket(socket, options); - * ``` - * - * where `secureSocket` has the same API as `pair.cleartext`. - * @since v0.3.2 - * @deprecated Since v0.11.3 - Use {@link TLSSocket} instead. - * @param context A secure context object as returned by `tls.createSecureContext()` - * @param isServer `true` to specify that this TLS connection should be opened as a server. - * @param requestCert `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. - * @param rejectUnauthorized If not `false` a server automatically reject clients with invalid certificates. Only applies when `isServer` is `true`. - */ - function createSecurePair(context?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; - /** - * {@link createServer} sets the default value of the `honorCipherOrder` option - * to `true`, other APIs that create secure contexts leave it unset. - * - * {@link createServer} uses a 128 bit truncated SHA1 hash value generated - * from `process.argv` as the default value of the `sessionIdContext` option, other - * APIs that create secure contexts have no default value. - * - * The `tls.createSecureContext()` method creates a `SecureContext` object. It is - * usable as an argument to several `tls` APIs, such as {@link createServer} and `server.addContext()`, but has no public methods. - * - * A key is _required_ for ciphers that use certificates. Either `key` or`pfx` can be used to provide it. - * - * If the `ca` option is not given, then Node.js will default to using[Mozilla's publicly trusted list of - * CAs](https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt). - * @since v0.11.13 - */ - function createSecureContext(options?: SecureContextOptions): SecureContext; - /** - * Returns an array with the names of the supported TLS ciphers. The names are - * lower-case for historical reasons, but must be uppercased to be used in - * the `ciphers` option of {@link createSecureContext}. - * - * Cipher names that start with `'tls_'` are for TLSv1.3, all the others are for - * TLSv1.2 and below. - * - * ```js - * console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...] - * ``` - * @since v0.10.2 - */ - function getCiphers(): string[]; - /** - * The default curve name to use for ECDH key agreement in a tls server. - * The default value is 'auto'. See tls.createSecureContext() for further - * information. - */ - let DEFAULT_ECDH_CURVE: string; - /** - * The default value of the maxVersion option of - * tls.createSecureContext(). It can be assigned any of the supported TLS - * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. 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. - */ - let DEFAULT_MAX_VERSION: SecureVersion; - /** - * The default value of the minVersion option of tls.createSecureContext(). - * It can be assigned any of the supported TLS protocol versions, - * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless - * changed using CLI options. Using --tls-min-v1.0 sets the default to - * 'TLSv1'. Using --tls-min-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. - */ - let DEFAULT_MIN_VERSION: SecureVersion; - /** - * An immutable array of strings representing the root certificates (in PEM - * format) used for verifying peer certificates. This is the default value - * of the ca option to tls.createSecureContext(). - */ - const rootCertificates: ReadonlyArray; -} -declare module 'node:tls' { - export * from 'tls'; -} diff --git a/JS/node_modules/@types/node/trace_events.d.ts b/JS/node_modules/@types/node/trace_events.d.ts deleted file mode 100755 index 67f3298..0000000 --- a/JS/node_modules/@types/node/trace_events.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -/** - * The `trace_events` module provides a mechanism to centralize tracing information - * generated by V8, Node.js core, and userspace code. - * - * Tracing can be enabled with the `--trace-event-categories` command-line flag - * or by using the `trace_events` module. The `--trace-event-categories` flag - * accepts a list of comma-separated category names. - * - * The available categories are: - * - * * `node`: An empty placeholder. - * * `node.async_hooks`: Enables capture of detailed `async_hooks` trace data. - * The `async_hooks` events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property. - * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones. - * * `node.console`: Enables capture of `console.time()` and `console.count()`output. - * * `node.dns.native`: Enables capture of trace data for DNS queries. - * * `node.environment`: Enables capture of Node.js Environment milestones. - * * `node.fs.sync`: Enables capture of trace data for file system sync methods. - * * `node.perf`: Enables capture of `Performance API` measurements. - * * `node.perf.usertiming`: Enables capture of only Performance API User Timing - * measures and marks. - * * `node.perf.timerify`: Enables capture of only Performance API timerify - * measurements. - * * `node.promises.rejections`: Enables capture of trace data tracking the number - * of unhandled Promise rejections and handled-after-rejections. - * * `node.vm.script`: Enables capture of trace data for the `vm` module's`runInNewContext()`, `runInContext()`, and `runInThisContext()` methods. - * * `v8`: The `V8` events are GC, compiling, and execution related. - * - * By default the `node`, `node.async_hooks`, and `v8` categories are enabled. - * - * ```bash - * node --trace-event-categories v8,node,node.async_hooks server.js - * ``` - * - * Prior versions of Node.js required the use of the `--trace-events-enabled`flag to enable trace events. This requirement has been removed. However, the`--trace-events-enabled` flag _may_ still be - * used and will enable the`node`, `node.async_hooks`, and `v8` trace event categories by default. - * - * ```bash - * node --trace-events-enabled - * - * # is equivalent to - * - * node --trace-event-categories v8,node,node.async_hooks - * ``` - * - * Alternatively, trace events may be enabled using the `trace_events` module: - * - * ```js - * const trace_events = require('trace_events'); - * const tracing = trace_events.createTracing({ categories: ['node.perf'] }); - * tracing.enable(); // Enable trace event capture for the 'node.perf' category - * - * // do work - * - * tracing.disable(); // Disable trace event capture for the 'node.perf' category - * ``` - * - * Running Node.js with tracing enabled will produce log files that can be opened - * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)tab of Chrome. - * - * The logging file is by default called `node_trace.${rotation}.log`, where`${rotation}` is an incrementing log-rotation id. The filepath pattern can - * be specified with `--trace-event-file-pattern` that accepts a template - * string that supports `${rotation}` and `${pid}`: - * - * ```bash - * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js - * ``` - * - * The tracing system uses the same time source - * as the one used by `process.hrtime()`. - * However the trace-event timestamps are expressed in microseconds, - * unlike `process.hrtime()` which returns nanoseconds. - * - * The features from this module are not available in `Worker` threads. - * @experimental - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/trace_events.js) - */ -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. - */ - 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`. - * - * ```js - * const trace_events = require('trace_events'); - * const categories = ['node.perf', 'node.async_hooks']; - * const tracing = trace_events.createTracing({ categories }); - * tracing.enable(); - * // do stuff - * tracing.disable(); - * ``` - * @since v10.0.0 - * @return . - */ - 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. - * - * Given the file `test.js` below, the command`node --trace-event-categories node.perf test.js` will print`'node.async_hooks,node.perf'` to the console. - * - * ```js - * const trace_events = require('trace_events'); - * const t1 = trace_events.createTracing({ categories: ['node.async_hooks'] }); - * const t2 = trace_events.createTracing({ categories: ['node.perf'] }); - * const t3 = trace_events.createTracing({ categories: ['v8'] }); - * - * t1.enable(); - * t2.enable(); - * - * console.log(trace_events.getEnabledCategories()); - * ``` - * @since v10.0.0 - */ - function getEnabledCategories(): string | undefined; -} -declare module 'node:trace_events' { - export * from 'trace_events'; -} diff --git a/JS/node_modules/@types/node/tty.d.ts b/JS/node_modules/@types/node/tty.d.ts deleted file mode 100755 index e8cb236..0000000 --- a/JS/node_modules/@types/node/tty.d.ts +++ /dev/null @@ -1,206 +0,0 @@ -/** - * The `tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. - * In most cases, it will not be necessary or possible to use this module directly. - * However, it can be accessed using: - * - * ```js - * const tty = require('tty'); - * ``` - * - * When Node.js detects that it is being run with a text terminal ("TTY") - * attached, `process.stdin` will, by default, be initialized as an instance of`tty.ReadStream` and both `process.stdout` and `process.stderr` will, by - * default, be instances of `tty.WriteStream`. The preferred method of determining - * whether Node.js is being run within a TTY context is to check that the value of - * the `process.stdout.isTTY` property is `true`: - * - * ```console - * $ node -p -e "Boolean(process.stdout.isTTY)" - * true - * $ node -p -e "Boolean(process.stdout.isTTY)" | cat - * false - * ``` - * - * In most cases, there should be little to no reason for an application to - * manually create instances of the `tty.ReadStream` and `tty.WriteStream`classes. - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/tty.js) - */ -declare module 'tty' { - import * as net from 'node:net'; - /** - * The `tty.isatty()` method returns `true` if the given `fd` is associated with - * a TTY and `false` if it is not, including whenever `fd` is not a non-negative - * integer. - * @since v0.5.8 - * @param fd A numeric file descriptor - */ - function isatty(fd: number): boolean; - /** - * Represents the readable side of a TTY. In normal circumstances `process.stdin` will be the only `tty.ReadStream` instance in a Node.js - * process and there should be no reason to create additional instances. - * @since v0.5.8 - */ - class ReadStream extends net.Socket { - constructor(fd: number, options?: net.SocketConstructorOpts); - /** - * A `boolean` that is `true` if the TTY is currently configured to operate as a - * raw device. Defaults to `false`. - * @since v0.7.7 - */ - isRaw: boolean; - /** - * Allows configuration of `tty.ReadStream` so that it operates as a raw device. - * - * When in raw mode, input is always available character-by-character, not - * including modifiers. Additionally, all special processing of characters by the - * terminal is disabled, including echoing input characters.Ctrl+C will no longer cause a `SIGINT` when in this mode. - * @since v0.7.7 - * @param mode If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` - * property will be set to the resulting mode. - * @return The read stream instance. - */ - setRawMode(mode: boolean): this; - /** - * A `boolean` that is always `true` for `tty.ReadStream` instances. - * @since v0.5.8 - */ - isTTY: boolean; - } - /** - * -1 - to the left from cursor - * 0 - the entire line - * 1 - to the right from cursor - */ - type Direction = -1 | 0 | 1; - /** - * Represents the writable side of a TTY. In normal circumstances,`process.stdout` and `process.stderr` will be the only`tty.WriteStream` instances created for a Node.js process and there - * should be no reason to create additional instances. - * @since v0.5.8 - */ - class WriteStream extends net.Socket { - constructor(fd: number); - 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; - /** - * `writeStream.clearLine()` clears the current line of this `WriteStream` in a - * direction identified by `dir`. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearLine(dir: Direction, callback?: () => void): boolean; - /** - * `writeStream.clearScreenDown()` clears this `WriteStream` from the current - * cursor down. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - clearScreenDown(callback?: () => void): boolean; - /** - * `writeStream.cursorTo()` moves this `WriteStream`'s cursor to the specified - * position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - cursorTo(x: number, y?: number, callback?: () => void): boolean; - cursorTo(x: number, callback: () => void): boolean; - /** - * `writeStream.moveCursor()` moves this `WriteStream`'s cursor _relative_ to its - * current position. - * @since v0.7.7 - * @param callback Invoked once the operation completes. - * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`. - */ - moveCursor(dx: number, dy: number, callback?: () => void): boolean; - /** - * Returns: - * - * * `1` for 2, - * * `4` for 16, - * * `8` for 256, - * * `24` for 16,777,216 - * - * colors supported. - * - * Use this to determine what colors the terminal supports. Due to the nature of - * colors in terminals it is possible to either have false positives or false - * negatives. It depends on process information and the environment variables that - * may lie about what terminal is used. - * It is possible to pass in an `env` object to simulate the usage of a specific - * terminal. This can be useful to check how specific environment settings behave. - * - * To enforce a specific color support, use one of the below environment settings. - * - * * 2 colors: `FORCE_COLOR = 0` (Disables colors) - * * 16 colors: `FORCE_COLOR = 1` - * * 256 colors: `FORCE_COLOR = 2` - * * 16,777,216 colors: `FORCE_COLOR = 3` - * - * Disabling color support is also possible by using the `NO_COLOR` and`NODE_DISABLE_COLORS` environment variables. - * @since v9.9.0 - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - getColorDepth(env?: object): number; - /** - * Returns `true` if the `writeStream` supports at least as many colors as provided - * in `count`. Minimum support is 2 (black and white). - * - * This has the same false positives and negatives as described in `writeStream.getColorDepth()`. - * - * ```js - * process.stdout.hasColors(); - * // Returns true or false depending on if `stdout` supports at least 16 colors. - * process.stdout.hasColors(256); - * // Returns true or false depending on if `stdout` supports at least 256 colors. - * process.stdout.hasColors({ TMUX: '1' }); - * // Returns true. - * process.stdout.hasColors(2 ** 24, { TMUX: '1' }); - * // Returns false (the environment setting pretends to support 2 ** 8 colors). - * ``` - * @since v11.13.0, v10.16.0 - * @param [count=16] The number of colors that are requested (minimum 2). - * @param [env=process.env] An object containing the environment variables to check. This enables simulating the usage of a specific terminal. - */ - hasColors(count?: number): boolean; - hasColors(env?: object): boolean; - hasColors(count: number, env?: object): boolean; - /** - * `writeStream.getWindowSize()` returns the size of the TTY - * corresponding to this `WriteStream`. The array is of the type`[numColumns, numRows]` where `numColumns` and `numRows` represent the number - * of columns and rows in the corresponding TTY. - * @since v0.7.7 - */ - getWindowSize(): [number, number]; - /** - * A `number` specifying the number of columns the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - columns: number; - /** - * A `number` specifying the number of rows the TTY currently has. This property - * is updated whenever the `'resize'` event is emitted. - * @since v0.7.7 - */ - rows: number; - /** - * A `boolean` that is always `true`. - * @since v0.5.8 - */ - isTTY: boolean; - } -} -declare module 'node:tty' { - export * from 'tty'; -} diff --git a/JS/node_modules/@types/node/url.d.ts b/JS/node_modules/@types/node/url.d.ts deleted file mode 100755 index fe07ea4..0000000 --- a/JS/node_modules/@types/node/url.d.ts +++ /dev/null @@ -1,798 +0,0 @@ -/** - * The `url` module provides utilities for URL resolution and parsing. It can be - * accessed using: - * - * ```js - * import url from 'url'; - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/url.js) - */ -declare module 'url' { - import { Blob } from 'node:buffer'; - import { ClientRequestArgs } from 'node:http'; - import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring'; - // Input to `url.format` - interface UrlObject { - auth?: string | null | undefined; - hash?: string | null | undefined; - host?: string | null | undefined; - hostname?: string | null | undefined; - href?: string | null | undefined; - pathname?: string | null | undefined; - protocol?: string | null | undefined; - search?: string | null | undefined; - slashes?: boolean | null | undefined; - port?: string | number | null | undefined; - query?: string | null | ParsedUrlQueryInput | undefined; - } - // Output of `url.parse` - interface Url { - auth: string | null; - hash: string | null; - host: string | null; - hostname: string | null; - href: string; - path: string | null; - pathname: string | null; - protocol: string | null; - search: string | null; - slashes: boolean | null; - port: string | null; - query: string | null | ParsedUrlQuery; - } - interface UrlWithParsedQuery extends Url { - query: ParsedUrlQuery; - } - interface UrlWithStringQuery extends Url { - query: string | null; - } - /** - * The `url.parse()` method takes a URL string, parses it, and returns a URL - * object. - * - * A `TypeError` is thrown if `urlString` is not a string. - * - * A `URIError` is thrown if the `auth` property is present but cannot be decoded. - * - * Use of the legacy `url.parse()` method is discouraged. Users should - * use the WHATWG `URL` API. Because the `url.parse()` method uses a - * lenient, non-standard algorithm for parsing URL strings, security - * issues can be introduced. Specifically, issues with [host name spoofing](https://hackerone.com/reports/678487) and - * incorrect handling of usernames and passwords have been identified. - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param urlString The URL string to parse. - * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property - * on the returned URL object will be an unparsed, undecoded string. - * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the - * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. - */ - function parse(urlString: string): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; - function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; - function parse(urlString: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; - /** - * The `url.format()` method returns a formatted URL string derived from`urlObject`. - * - * ```js - * const url = require('url'); - * url.format({ - * protocol: 'https', - * hostname: 'example.com', - * pathname: '/some/path', - * query: { - * page: 1, - * format: 'json' - * } - * }); - * - * // => 'https://example.com/some/path?page=1&format=json' - * ``` - * - * If `urlObject` is not an object or a string, `url.format()` will throw a `TypeError`. - * - * The formatting process operates as follows: - * - * * A new empty string `result` is created. - * * If `urlObject.protocol` is a string, it is appended as-is to `result`. - * * Otherwise, if `urlObject.protocol` is not `undefined` and is not a string, an `Error` is thrown. - * * For all string values of `urlObject.protocol` that _do not end_ with an ASCII - * colon (`:`) character, the literal string `:` will be appended to `result`. - * * If either of the following conditions is true, then the literal string `//`will be appended to `result`: - * * `urlObject.slashes` property is true; - * * `urlObject.protocol` begins with `http`, `https`, `ftp`, `gopher`, or`file`; - * * If the value of the `urlObject.auth` property is truthy, and either`urlObject.host` or `urlObject.hostname` are not `undefined`, the value of`urlObject.auth` will be coerced into a string - * and appended to `result`followed by the literal string `@`. - * * If the `urlObject.host` property is `undefined` then: - * * If the `urlObject.hostname` is a string, it is appended to `result`. - * * Otherwise, if `urlObject.hostname` is not `undefined` and is not a string, - * an `Error` is thrown. - * * If the `urlObject.port` property value is truthy, and `urlObject.hostname`is not `undefined`: - * * The literal string `:` is appended to `result`, and - * * The value of `urlObject.port` is coerced to a string and appended to`result`. - * * Otherwise, if the `urlObject.host` property value is truthy, the value of`urlObject.host` is coerced to a string and appended to `result`. - * * If the `urlObject.pathname` property is a string that is not an empty string: - * * If the `urlObject.pathname`_does not start_ with an ASCII forward slash - * (`/`), then the literal string `'/'` is appended to `result`. - * * The value of `urlObject.pathname` is appended to `result`. - * * Otherwise, if `urlObject.pathname` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.search` property is `undefined` and if the `urlObject.query`property is an `Object`, the literal string `?` is appended to `result`followed by the output of calling the - * `querystring` module's `stringify()`method passing the value of `urlObject.query`. - * * Otherwise, if `urlObject.search` is a string: - * * If the value of `urlObject.search`_does not start_ with the ASCII question - * mark (`?`) character, the literal string `?` is appended to `result`. - * * The value of `urlObject.search` is appended to `result`. - * * Otherwise, if `urlObject.search` is not `undefined` and is not a string, an `Error` is thrown. - * * If the `urlObject.hash` property is a string: - * * If the value of `urlObject.hash`_does not start_ with the ASCII hash (`#`) - * character, the literal string `#` is appended to `result`. - * * The value of `urlObject.hash` is appended to `result`. - * * Otherwise, if the `urlObject.hash` property is not `undefined` and is not a - * string, an `Error` is thrown. - * * `result` is returned. - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param urlObject A URL object (as returned by `url.parse()` or constructed otherwise). If a string, it is converted to an object by passing it to `url.parse()`. - */ - function format(urlObject: URL, options?: URLFormatOptions): string; - function format(urlObject: UrlObject | string): string; - /** - * The `url.resolve()` method resolves a target URL relative to a base URL in a - * manner similar to that of a Web browser resolving an anchor tag HREF. - * - * ```js - * const url = require('url'); - * url.resolve('/one/two/three', 'four'); // '/one/two/four' - * url.resolve('http://example.com/', '/one'); // 'http://example.com/one' - * url.resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * - * You can achieve the same result using the WHATWG URL API: - * - * ```js - * function resolve(from, to) { - * const resolvedUrl = new URL(to, new URL(from, 'resolve://')); - * if (resolvedUrl.protocol === 'resolve:') { - * // `from` is a relative URL. - * const { pathname, search, hash } = resolvedUrl; - * return pathname + search + hash; - * } - * return resolvedUrl.toString(); - * } - * - * resolve('/one/two/three', 'four'); // '/one/two/four' - * resolve('http://example.com/', '/one'); // 'http://example.com/one' - * resolve('http://example.com/one', '/two'); // 'http://example.com/two' - * ``` - * @since v0.1.25 - * @deprecated Legacy: Use the WHATWG URL API instead. - * @param from The Base URL being resolved against. - * @param to The HREF URL being resolved. - */ - function resolve(from: string, to: string): string; - /** - * Returns the [Punycode](https://tools.ietf.org/html/rfc5891#section-4.4) ASCII serialization of the `domain`. If `domain` is an - * invalid domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToUnicode}. - * - * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. - * - * ```js - * import url from 'url'; - * - * console.log(url.domainToASCII('español.com')); - * // Prints xn--espaol-zwa.com - * console.log(url.domainToASCII('中文.com')); - * // Prints xn--fiq228c.com - * console.log(url.domainToASCII('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - function domainToASCII(domain: string): string; - /** - * Returns the Unicode serialization of the `domain`. If `domain` is an invalid - * domain, the empty string is returned. - * - * It performs the inverse operation to {@link domainToASCII}. - * - * This feature is only available if the `node` executable was compiled with `ICU` enabled. If not, the domain names are passed through unchanged. - * - * ```js - * import url from 'url'; - * - * console.log(url.domainToUnicode('xn--espaol-zwa.com')); - * // Prints español.com - * console.log(url.domainToUnicode('xn--fiq228c.com')); - * // Prints 中文.com - * console.log(url.domainToUnicode('xn--iñvalid.com')); - * // Prints an empty string - * ``` - * @since v7.4.0, v6.13.0 - */ - 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. - * - * ```js - * import { fileURLToPath } from 'url'; - * - * const __filename = fileURLToPath(import.meta.url); - * - * new URL('file:///C:/path/').pathname; // Incorrect: /C:/path/ - * fileURLToPath('file:///C:/path/'); // Correct: C:\path\ (Windows) - * - * new URL('file://nas/foo.txt').pathname; // Incorrect: /foo.txt - * fileURLToPath('file://nas/foo.txt'); // Correct: \\nas\foo.txt (Windows) - * - * new URL('file:///你好.txt').pathname; // Incorrect: /%E4%BD%A0%E5%A5%BD.txt - * fileURLToPath('file:///你好.txt'); // Correct: /你好.txt (POSIX) - * - * new URL('file:///hello world').pathname; // Incorrect: /hello%20world - * fileURLToPath('file:///hello world'); // Correct: /hello world (POSIX) - * ``` - * @since v10.12.0 - * @param url The file URL string or URL object to convert to a path. - * @return The fully-resolved platform-specific Node.js file 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. - * - * ```js - * import { pathToFileURL } from 'url'; - * - * new URL('/foo#1', 'file:'); // Incorrect: file:///foo#1 - * pathToFileURL('/foo#1'); // Correct: file:///foo%231 (POSIX) - * - * new URL('/some/path%.c', 'file:'); // Incorrect: file:///some/path%.c - * pathToFileURL('/some/path%.c'); // Correct: file:///some/path%25.c (POSIX) - * ``` - * @since v10.12.0 - * @param path The path to convert to a File URL. - * @return The file URL object. - */ - function pathToFileURL(path: string): URL; - /** - * This utility function converts a URL object into an ordinary options object as - * expected by the `http.request()` and `https.request()` APIs. - * - * ```js - * import { urlToHttpOptions } from 'url'; - * const myURL = new URL('https://a:b@測試?abc#foo'); - * - * console.log(urlToHttpOptions(myURL)); - * - * { - * protocol: 'https:', - * hostname: 'xn--g6w251d', - * hash: '#foo', - * search: '?abc', - * pathname: '/', - * path: '/?abc', - * href: 'https://a:b@xn--g6w251d/?abc#foo', - * auth: 'a:b' - * } - * - * ``` - * @since v15.7.0 - * @param url The `WHATWG URL` object to convert to an options object. - * @return Options object - */ - function urlToHttpOptions(url: URL): ClientRequestArgs; - interface URLFormatOptions { - auth?: boolean | undefined; - fragment?: boolean | undefined; - search?: boolean | undefined; - unicode?: boolean | undefined; - } - /** - * Browser-compatible `URL` class, implemented by following the WHATWG URL - * Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. - * The `URL` class is also available on the global object. - * - * In accordance with browser conventions, all properties of `URL` objects - * are implemented as getters and setters on the class prototype, rather than as - * data properties on the object itself. Thus, unlike `legacy urlObject` s, - * using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still - * return `true`. - * @since v7.0.0, v6.13.0 - */ - class URL { - /** - * Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. - * - * ```js - * const { - * Blob, - * resolveObjectURL, - * } = require('buffer'); - * - * const blob = new Blob(['hello']); - * const id = URL.createObjectURL(blob); - * - * // later... - * - * const otherBlob = resolveObjectURL(id); - * console.log(otherBlob.size); - * ``` - * - * The data stored by the registered `Blob` will be retained in memory until`URL.revokeObjectURL()` is called to remove it. - * - * `Blob` objects are registered within the current thread. If using Worker - * Threads, `Blob` objects registered within one Worker will not be available - * to other workers or the main thread. - * @since v16.7.0 - * @experimental - */ - static createObjectURL(blob: Blob): string; - /** - * Removes the stored `Blob` identified by the given ID. - * @since v16.7.0 - * @experimental - * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`. - */ - static revokeObjectURL(objectUrl: string): void; - constructor(input: string, base?: string | URL); - /** - * Gets and sets the fragment portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/foo#bar'); - * console.log(myURL.hash); - * // Prints #bar - * - * myURL.hash = 'baz'; - * console.log(myURL.href); - * // Prints https://example.org/foo#baz - * ``` - * - * Invalid URL characters included in the value assigned to the `hash` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - hash: string; - /** - * Gets and sets the host portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.host); - * // Prints example.org:81 - * - * myURL.host = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:82/foo - * ``` - * - * Invalid host values assigned to the `host` property are ignored. - */ - host: string; - /** - * Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the - * port. - * - * ```js - * const myURL = new URL('https://example.org:81/foo'); - * console.log(myURL.hostname); - * // Prints example.org - * - * // Setting the hostname does not change the port - * myURL.hostname = 'example.com:82'; - * console.log(myURL.href); - * // Prints https://example.com:81/foo - * - * // Use myURL.host to change the hostname and port - * myURL.host = 'example.org:82'; - * console.log(myURL.href); - * // Prints https://example.org:82/foo - * ``` - * - * Invalid host name values assigned to the `hostname` property are ignored. - */ - hostname: string; - /** - * Gets and sets the serialized URL. - * - * ```js - * const myURL = new URL('https://example.org/foo'); - * console.log(myURL.href); - * // Prints https://example.org/foo - * - * myURL.href = 'https://example.com/bar'; - * console.log(myURL.href); - * // Prints https://example.com/bar - * ``` - * - * Getting the value of the `href` property is equivalent to calling {@link toString}. - * - * Setting the value of this property to a new value is equivalent to creating a - * new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified. - * - * If the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown. - */ - href: string; - /** - * Gets the read-only serialization of the URL's origin. - * - * ```js - * const myURL = new URL('https://example.org/foo/bar?baz'); - * console.log(myURL.origin); - * // Prints https://example.org - * ``` - * - * ```js - * const idnURL = new URL('https://測試'); - * console.log(idnURL.origin); - * // Prints https://xn--g6w251d - * - * console.log(idnURL.hostname); - * // Prints xn--g6w251d - * ``` - */ - readonly origin: string; - /** - * Gets and sets the password portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.password); - * // Prints xyz - * - * myURL.password = '123'; - * console.log(myURL.href); - * // Prints https://abc:123@example.com - * ``` - * - * Invalid URL characters included in the value assigned to the `password` property - * are `percent-encoded`. The selection of which characters to - * percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - password: string; - /** - * Gets and sets the path portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc/xyz?123'); - * console.log(myURL.pathname); - * // Prints /abc/xyz - * - * myURL.pathname = '/abcdef'; - * console.log(myURL.href); - * // Prints https://example.org/abcdef?123 - * ``` - * - * Invalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters - * to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - pathname: string; - /** - * Gets and sets the port portion of the URL. - * - * The port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will - * result in the `port` value becoming - * the empty string (`''`). - * - * The port value can be an empty string in which case the port depends on - * the protocol/scheme: - * - * - * - * Upon assigning a value to the port, the value will first be converted to a - * string using `.toString()`. - * - * If that string is invalid but it begins with a number, the leading number is - * assigned to `port`. - * If the number lies outside the range denoted above, it is ignored. - * - * ```js - * const myURL = new URL('https://example.org:8888'); - * console.log(myURL.port); - * // Prints 8888 - * - * // Default ports are automatically transformed to the empty string - * // (HTTPS protocol's default port is 443) - * myURL.port = '443'; - * console.log(myURL.port); - * // Prints the empty string - * console.log(myURL.href); - * // Prints https://example.org/ - * - * myURL.port = 1234; - * console.log(myURL.port); - * // Prints 1234 - * console.log(myURL.href); - * // Prints https://example.org:1234/ - * - * // Completely invalid port strings are ignored - * myURL.port = 'abcd'; - * console.log(myURL.port); - * // Prints 1234 - * - * // Leading numbers are treated as a port number - * myURL.port = '5678abcd'; - * console.log(myURL.port); - * // Prints 5678 - * - * // Non-integers are truncated - * myURL.port = 1234.5678; - * console.log(myURL.port); - * // Prints 1234 - * - * // Out-of-range numbers which are not represented in scientific notation - * // will be ignored. - * myURL.port = 1e10; // 10000000000, will be range-checked as described below - * console.log(myURL.port); - * // Prints 1234 - * ``` - * - * Numbers which contain a decimal point, - * such as floating-point numbers or numbers in scientific notation, - * are not an exception to this rule. - * Leading numbers up to the decimal point will be set as the URL's port, - * assuming they are valid: - * - * ```js - * myURL.port = 4.567e21; - * console.log(myURL.port); - * // Prints 4 (because it is the leading number in the string '4.567e21') - * ``` - */ - port: string; - /** - * Gets and sets the protocol portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org'); - * console.log(myURL.protocol); - * // Prints https: - * - * myURL.protocol = 'ftp'; - * console.log(myURL.href); - * // Prints ftp://example.org/ - * ``` - * - * Invalid URL protocol values assigned to the `protocol` property are ignored. - */ - protocol: string; - /** - * Gets and sets the serialized query portion of the URL. - * - * ```js - * const myURL = new URL('https://example.org/abc?123'); - * console.log(myURL.search); - * // Prints ?123 - * - * myURL.search = 'abc=xyz'; - * console.log(myURL.href); - * // Prints https://example.org/abc?abc=xyz - * ``` - * - * Any invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - search: string; - /** - * Gets the `URLSearchParams` object representing the query parameters of the - * URL. This property is read-only but the `URLSearchParams` object it provides - * can be used to mutate the URL instance; to replace the entirety of query - * parameters of the URL, use the {@link search} setter. See `URLSearchParams` documentation for details. - * - * Use care when using `.searchParams` to modify the `URL` because, - * per the WHATWG specification, the `URLSearchParams` object uses - * different rules to determine which characters to percent-encode. For - * instance, the `URL` object will not percent encode the ASCII tilde (`~`) - * character, while `URLSearchParams` will always encode it: - * - * ```js - * const myUrl = new URL('https://example.org/abc?foo=~bar'); - * - * console.log(myUrl.search); // prints ?foo=~bar - * - * // Modify the URL via searchParams... - * myUrl.searchParams.sort(); - * - * console.log(myUrl.search); // prints ?foo=%7Ebar - * ``` - */ - readonly searchParams: URLSearchParams; - /** - * Gets and sets the username portion of the URL. - * - * ```js - * const myURL = new URL('https://abc:xyz@example.com'); - * console.log(myURL.username); - * // Prints abc - * - * myURL.username = '123'; - * console.log(myURL.href); - * // Prints https://123:xyz@example.com/ - * ``` - * - * Any invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which - * characters to percent-encode may vary somewhat from what the {@link parse} and {@link format} methods would produce. - */ - username: string; - /** - * The `toString()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toJSON}. - */ - toString(): string; - /** - * The `toJSON()` method on the `URL` object returns the serialized URL. The - * value returned is equivalent to that of {@link href} and {@link toString}. - * - * This method is automatically called when an `URL` object is serialized - * with [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). - * - * ```js - * const myURLs = [ - * new URL('https://www.example.com'), - * new URL('https://test.example.org'), - * ]; - * console.log(JSON.stringify(myURLs)); - * // Prints ["https://www.example.com/","https://test.example.org/"] - * ``` - */ - toJSON(): string; - } - /** - * The `URLSearchParams` API provides read and write access to the query of a`URL`. The `URLSearchParams` class can also be used standalone with one of the - * four following constructors. - * The `URLSearchParams` class is also available on the global object. - * - * The WHATWG `URLSearchParams` interface and the `querystring` module have - * similar purpose, but the purpose of the `querystring` module is more - * general, as it allows the customization of delimiter characters (`&` and `=`). - * On the other hand, this API is designed purely for URL query strings. - * - * ```js - * const myURL = new URL('https://example.org/?abc=123'); - * console.log(myURL.searchParams.get('abc')); - * // Prints 123 - * - * myURL.searchParams.append('abc', 'xyz'); - * console.log(myURL.href); - * // Prints https://example.org/?abc=123&abc=xyz - * - * myURL.searchParams.delete('abc'); - * myURL.searchParams.set('a', 'b'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * - * const newSearchParams = new URLSearchParams(myURL.searchParams); - * // The above is equivalent to - * // const newSearchParams = new URLSearchParams(myURL.search); - * - * newSearchParams.append('a', 'c'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b - * console.log(newSearchParams.toString()); - * // Prints a=b&a=c - * - * // newSearchParams.toString() is implicitly called - * myURL.search = newSearchParams; - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * newSearchParams.delete('a'); - * console.log(myURL.href); - * // Prints https://example.org/?a=b&a=c - * ``` - * @since v7.5.0, v6.13.0 - */ - class URLSearchParams implements Iterable<[string, string]> { - constructor(init?: URLSearchParams | string | NodeJS.Dict> | Iterable<[string, string]> | ReadonlyArray<[string, string]>); - /** - * Append a new name-value pair to the query string. - */ - append(name: string, value: string): void; - /** - * Remove all name-value pairs whose name is `name`. - */ - delete(name: string): void; - /** - * Returns an ES6 `Iterator` over each of the name-value pairs in the query. - * Each item of the iterator is a JavaScript `Array`. The first item of the `Array`is the `name`, the second item of the `Array` is the `value`. - * - * Alias for `urlSearchParams[@@iterator]()`. - */ - entries(): IterableIterator<[string, string]>; - /** - * Iterates over each name-value pair in the query and invokes the given function. - * - * ```js - * const myURL = new URL('https://example.org/?a=b&c=d'); - * myURL.searchParams.forEach((value, name, searchParams) => { - * console.log(name, value, myURL.searchParams === searchParams); - * }); - * // Prints: - * // a b true - * // c d true - * ``` - * @param fn Invoked for each name-value pair in the query - * @param thisArg To be used as `this` value for when `fn` is called - */ - forEach(callback: (this: TThis, value: string, name: string, searchParams: this) => void, thisArg?: TThis): void; - /** - * Returns the value of the first name-value pair whose name is `name`. If there - * are no such pairs, `null` is returned. - * @return or `null` if there is no name-value pair with the given `name`. - */ - get(name: string): string | null; - /** - * Returns the values of all name-value pairs whose name is `name`. If there are - * no such pairs, an empty array is returned. - */ - getAll(name: string): string[]; - /** - * Returns `true` if there is at least one name-value pair whose name is `name`. - */ - has(name: string): boolean; - /** - * Returns an ES6 `Iterator` over the names of each name-value pair. - * - * ```js - * const params = new URLSearchParams('foo=bar&foo=baz'); - * for (const name of params.keys()) { - * console.log(name); - * } - * // Prints: - * // foo - * // foo - * ``` - */ - keys(): IterableIterator; - /** - * Sets the value in the `URLSearchParams` object associated with `name` to`value`. If there are any pre-existing name-value pairs whose names are `name`, - * set the first such pair's value to `value` and remove all others. If not, - * append the name-value pair to the query string. - * - * ```js - * const params = new URLSearchParams(); - * params.append('foo', 'bar'); - * params.append('foo', 'baz'); - * params.append('abc', 'def'); - * console.log(params.toString()); - * // Prints foo=bar&foo=baz&abc=def - * - * params.set('foo', 'def'); - * params.set('xyz', 'opq'); - * console.log(params.toString()); - * // Prints foo=def&abc=def&xyz=opq - * ``` - */ - set(name: string, value: string): void; - /** - * Sort all existing name-value pairs in-place by their names. Sorting is done - * with a [stable sorting algorithm](https://en.wikipedia.org/wiki/Sorting_algorithm#Stability), so relative order between name-value pairs - * with the same name is preserved. - * - * This method can be used, in particular, to increase cache hits. - * - * ```js - * const params = new URLSearchParams('query[]=abc&type=search&query[]=123'); - * params.sort(); - * console.log(params.toString()); - * // Prints query%5B%5D=abc&query%5B%5D=123&type=search - * ``` - * @since v7.7.0, v6.13.0 - */ - sort(): void; - /** - * Returns the search parameters serialized as a string, with characters - * percent-encoded where necessary. - */ - toString(): string; - /** - * Returns an ES6 `Iterator` over the values of each name-value pair. - */ - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; - } -} -declare module 'node:url' { - export * from 'url'; -} diff --git a/JS/node_modules/@types/node/util.d.ts b/JS/node_modules/@types/node/util.d.ts deleted file mode 100755 index b8cb07e..0000000 --- a/JS/node_modules/@types/node/util.d.ts +++ /dev/null @@ -1,1564 +0,0 @@ -/** - * The `util` module supports the needs of Node.js internal APIs. Many of the - * utilities are useful for application and module developers as well. To access - * it: - * - * ```js - * const util = require('util'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/util.js) - */ -declare module 'util' { - import * as types from 'node:util/types'; - export 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 | undefined; - showHidden?: boolean | undefined; - /** - * @default 2 - */ - depth?: number | null | undefined; - colors?: boolean | undefined; - customInspect?: boolean | undefined; - showProxy?: boolean | undefined; - maxArrayLength?: number | null | undefined; - /** - * Specifies the maximum number of characters to - * include when formatting. Set to `null` or `Infinity` to show all elements. - * Set to `0` or negative to show no characters. - * @default 10000 - */ - maxStringLength?: number | null | undefined; - breakLength?: number | undefined; - /** - * 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 | undefined; - sorted?: boolean | ((a: string, b: string) => number) | undefined; - } - export type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module'; - export type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string; - export interface InspectOptionsStylized extends InspectOptions { - stylize(text: string, styleType: Style): string; - } - /** - * The `util.format()` method returns a formatted string using the first argument - * as a `printf`\-like format string which can contain zero or more format - * specifiers. Each specifier is replaced with the converted value from the - * corresponding argument. Supported specifiers are: - * - * If a specifier does not have a corresponding argument, it is not replaced: - * - * ```js - * util.format('%s:%s', 'foo'); - * // Returns: 'foo:%s' - * ``` - * - * Values that are not part of the format string are formatted using`util.inspect()` if their type is not `string`. - * - * If there are more arguments passed to the `util.format()` method than the - * number of specifiers, the extra arguments are concatenated to the returned - * string, separated by spaces: - * - * ```js - * util.format('%s:%s', 'foo', 'bar', 'baz'); - * // Returns: 'foo:bar baz' - * ``` - * - * If the first argument does not contain a valid format specifier, `util.format()`returns a string that is the concatenation of all arguments separated by spaces: - * - * ```js - * util.format(1, 2, 3); - * // Returns: '1 2 3' - * ``` - * - * If only one argument is passed to `util.format()`, it is returned as it is - * without any formatting: - * - * ```js - * util.format('%% %s'); - * // Returns: '%% %s' - * ``` - * - * `util.format()` is a synchronous method that is intended as a debugging tool. - * Some input values can have a significant performance overhead that can block the - * event loop. Use this function with care and never in a hot code path. - * @since v0.5.3 - * @param format A `printf`-like format string. - */ - export function format(format?: any, ...param: any[]): string; - /** - * This function is identical to {@link format}, except in that it takes - * an `inspectOptions` argument which specifies options that are passed along to {@link inspect}. - * - * ```js - * util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 }); - * // Returns 'See object { foo: 42 }', where `42` is colored as a number - * // when printed to a terminal. - * ``` - * @since v10.0.0 - */ - export function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string; - /** - * Returns a Map of all system error codes available from the Node.js API. - * The mapping between error codes and error names is platform-dependent. - * See `Common System Errors` for the names of common errors. - * - * ```js - * fs.access('file/that/does/not/exist', (err) => { - * const errorMap = util.getSystemErrorMap(); - * const name = errorMap.get(err.errno); - * console.error(name); // ENOENT - * }); - * ``` - * @since v16.0.0 - */ - export function getSystemErrorMap(): Map; - /** - * The `util.log()` method prints the given `string` to `stdout` with an included - * timestamp. - * - * ```js - * const util = require('util'); - * - * util.log('Timestamped message.'); - * ``` - * @since v0.3.0 - * @deprecated Since v6.0.0 - Use a third party module instead. - */ - export function log(string: string): void; - /** - * Returns the `string` after replacing any surrogate code points - * (or equivalently, any unpaired surrogate code units) with the - * Unicode "replacement character" U+FFFD. - * - * @since v16.8.0 - */ - export function toUSVString(string: string): string; - /** - * The `util.inspect()` method returns a string representation of `object` that is - * intended for debugging. The output of `util.inspect` may change at any time - * and should not be depended upon programmatically. Additional `options` may be - * passed that alter the result.`util.inspect()` will use the constructor's name and/or `@@toStringTag` to make - * an identifiable tag for an inspected value. - * - * ```js - * class Foo { - * get [Symbol.toStringTag]() { - * return 'bar'; - * } - * } - * - * class Bar {} - * - * const baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } }); - * - * util.inspect(new Foo()); // 'Foo [bar] {}' - * util.inspect(new Bar()); // 'Bar {}' - * util.inspect(baz); // '[foo] {}' - * ``` - * - * Circular references point to their anchor by using a reference index: - * - * ```js - * const { inspect } = require('util'); - * - * const obj = {}; - * obj.a = [obj]; - * obj.b = {}; - * obj.b.inner = obj.b; - * obj.b.obj = obj; - * - * console.log(inspect(obj)); - * // { - * // a: [ [Circular *1] ], - * // b: { inner: [Circular *2], obj: [Circular *1] } - * // } - * ``` - * - * The following example inspects all properties of the `util` object: - * - * ```js - * const util = require('util'); - * - * console.log(util.inspect(util, { showHidden: true, depth: null })); - * ``` - * - * The following example highlights the effect of the `compact` option: - * - * ```js - * const util = require('util'); - * - * const o = { - * a: [1, 2, [[ - * 'Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit, sed do ' + - * 'eiusmod \ntempor incididunt ut labore et dolore magna aliqua.', - * 'test', - * 'foo']], 4], - * b: new Map([['za', 1], ['zb', 'test']]) - * }; - * console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); - * - * // { a: - * // [ 1, - * // 2, - * // [ [ 'Lorem ipsum dolor sit amet,\nconsectetur [...]', // A long line - * // 'test', - * // 'foo' ] ], - * // 4 ], - * // b: Map(2) { 'za' => 1, 'zb' => 'test' } } - * - * // Setting `compact` to false or an integer creates more reader friendly output. - * console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); - * - * // { - * // a: [ - * // 1, - * // 2, - * // [ - * // [ - * // 'Lorem ipsum dolor sit amet,\n' + - * // 'consectetur adipiscing elit, sed do eiusmod \n' + - * // 'tempor incididunt ut labore et dolore magna aliqua.', - * // 'test', - * // 'foo' - * // ] - * // ], - * // 4 - * // ], - * // b: Map(2) { - * // 'za' => 1, - * // 'zb' => 'test' - * // } - * // } - * - * // Setting `breakLength` to e.g. 150 will print the "Lorem ipsum" text in a - * // single line. - * ``` - * - * The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and - * [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be - * inspected. If there are more entries than `maxArrayLength`, there is no - * guarantee which entries are displayed. That means retrieving the same[`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may - * result in different output. Furthermore, entries - * with no remaining strong references may be garbage collected at any time. - * - * ```js - * const { inspect } = require('util'); - * - * const obj = { a: 1 }; - * const obj2 = { b: 2 }; - * const weakSet = new WeakSet([obj, obj2]); - * - * console.log(inspect(weakSet, { showHidden: true })); - * // WeakSet { { a: 1 }, { b: 2 } } - * ``` - * - * The `sorted` option ensures that an object's property insertion order does not - * impact the result of `util.inspect()`. - * - * ```js - * const { inspect } = require('util'); - * const assert = require('assert'); - * - * const o1 = { - * b: [2, 3, 1], - * a: '`a` comes before `b`', - * c: new Set([2, 3, 1]) - * }; - * console.log(inspect(o1, { sorted: true })); - * // { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } } - * console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) })); - * // { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' } - * - * const o2 = { - * c: new Set([2, 1, 3]), - * a: '`a` comes before `b`', - * b: [2, 3, 1] - * }; - * assert.strict.equal( - * inspect(o1, { sorted: true }), - * inspect(o2, { sorted: true }) - * ); - * ``` - * - * `util.inspect()` is a synchronous method intended for debugging. Its maximum - * output length is approximately 128 MB. Inputs that result in longer output will - * be truncated. - * @since v0.3.0 - * @param object Any JavaScript primitive or `Object`. - * @return The representation of `object`. - */ - export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; - export function inspect(object: any, options: InspectOptions): string; - export namespace inspect { - let colors: NodeJS.Dict<[number, number]>; - let styles: { - [K in Style]: string; - }; - let defaultOptions: InspectOptions; - /** - * Allows changing inspect settings from the repl. - */ - let replDefaults: InspectOptions; - const custom: unique symbol; - } - /** - * Alias for [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray). - * - * Returns `true` if the given `object` is an `Array`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isArray([]); - * // Returns: true - * util.isArray(new Array()); - * // Returns: true - * util.isArray({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use `isArray` instead. - */ - export function isArray(object: unknown): object is unknown[]; - /** - * Returns `true` if the given `object` is a `RegExp`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isRegExp(/some regexp/); - * // Returns: true - * util.isRegExp(new RegExp('another regexp')); - * // Returns: true - * util.isRegExp({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Deprecated - */ - export function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the given `object` is a `Date`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isDate(new Date()); - * // Returns: true - * util.isDate(Date()); - * // false (without 'new' returns a String) - * util.isDate({}); - * // Returns: false - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isDate} instead. - */ - export function isDate(object: unknown): object is Date; - /** - * Returns `true` if the given `object` is an `Error`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isError(new Error()); - * // Returns: true - * util.isError(new TypeError()); - * // Returns: true - * util.isError({ name: 'Error', message: 'an error occurred' }); - * // Returns: false - * ``` - * - * This method relies on `Object.prototype.toString()` behavior. It is - * possible to obtain an incorrect result when the `object` argument manipulates`@@toStringTag`. - * - * ```js - * const util = require('util'); - * const obj = { name: 'Error', message: 'an error occurred' }; - * - * util.isError(obj); - * // Returns: false - * obj[Symbol.toStringTag] = 'Error'; - * util.isError(obj); - * // Returns: true - * ``` - * @since v0.6.0 - * @deprecated Since v4.0.0 - Use {@link types.isNativeError} instead. - */ - export function isError(object: unknown): object is Error; - /** - * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and`extends` keywords to get language level inheritance support. Also note - * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). - * - * Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The - * prototype of `constructor` will be set to a new object created from`superConstructor`. - * - * This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. - * As an additional convenience, `superConstructor` will be accessible - * through the `constructor.super_` property. - * - * ```js - * const util = require('util'); - * const EventEmitter = require('events'); - * - * function MyStream() { - * EventEmitter.call(this); - * } - * - * util.inherits(MyStream, EventEmitter); - * - * MyStream.prototype.write = function(data) { - * this.emit('data', data); - * }; - * - * const stream = new MyStream(); - * - * console.log(stream instanceof EventEmitter); // true - * console.log(MyStream.super_ === EventEmitter); // true - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('It works!'); // Received data: "It works!" - * ``` - * - * ES6 example using `class` and `extends`: - * - * ```js - * const EventEmitter = require('events'); - * - * class MyStream extends EventEmitter { - * write(data) { - * this.emit('data', data); - * } - * } - * - * const stream = new MyStream(); - * - * stream.on('data', (data) => { - * console.log(`Received data: "${data}"`); - * }); - * stream.write('With ES6'); - * ``` - * @since v0.3.0 - * @deprecated Legacy: Use ES2015 class syntax and `extends` keyword instead. - */ - export function inherits(constructor: unknown, superConstructor: unknown): void; - export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; - export interface DebugLogger extends DebugLoggerFunction { - enabled: boolean; - } - /** - * The `util.debuglog()` method is used to create a function that conditionally - * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that - * environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. - * - * ```js - * const util = require('util'); - * const debuglog = util.debuglog('foo'); - * - * debuglog('hello from foo [%d]', 123); - * ``` - * - * If this program is run with `NODE_DEBUG=foo` in the environment, then - * it will output something like: - * - * ```console - * FOO 3245: hello from foo [123] - * ``` - * - * where `3245` is the process id. If it is not run with that - * environment variable set, then it will not print anything. - * - * The `section` supports wildcard also: - * - * ```js - * const util = require('util'); - * const debuglog = util.debuglog('foo-bar'); - * - * debuglog('hi there, it\'s foo-bar [%d]', 2333); - * ``` - * - * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output - * something like: - * - * ```console - * FOO-BAR 3257: hi there, it's foo-bar [2333] - * ``` - * - * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. - * - * The optional `callback` argument can be used to replace the logging function - * with a different function that doesn't have any initialization or - * unnecessary wrapping. - * - * ```js - * const util = require('util'); - * let debuglog = util.debuglog('internals', (debug) => { - * // Replace with a logging function that optimizes out - * // testing if the section is enabled - * debuglog = debug; - * }); - * ``` - * @since v0.11.3 - * @param section A string identifying the portion of the application for which the `debuglog` function is being created. - * @param callback A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function. - * @return The logging function - */ - export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; - /** - * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isBoolean(1); - * // Returns: false - * util.isBoolean(0); - * // Returns: false - * util.isBoolean(false); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'boolean'` instead. - */ - export function isBoolean(object: unknown): object is boolean; - /** - * Returns `true` if the given `object` is a `Buffer`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isBuffer({ length: 0 }); - * // Returns: false - * util.isBuffer([]); - * // Returns: false - * util.isBuffer(Buffer.from('hello world')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `isBuffer` instead. - */ - export function isBuffer(object: unknown): object is Buffer; - /** - * Returns `true` if the given `object` is a `Function`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * function Foo() {} - * const Bar = () => {}; - * - * util.isFunction({}); - * // Returns: false - * util.isFunction(Foo); - * // Returns: true - * util.isFunction(Bar); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'function'` instead. - */ - export function isFunction(object: unknown): boolean; - /** - * Returns `true` if the given `object` is strictly `null`. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isNull(0); - * // Returns: false - * util.isNull(undefined); - * // Returns: false - * util.isNull(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === null` instead. - */ - export function isNull(object: unknown): object is null; - /** - * Returns `true` if the given `object` is `null` or `undefined`. Otherwise, - * returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isNullOrUndefined(0); - * // Returns: false - * util.isNullOrUndefined(undefined); - * // Returns: true - * util.isNullOrUndefined(null); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined || value === null` instead. - */ - export function isNullOrUndefined(object: unknown): object is null | undefined; - /** - * Returns `true` if the given `object` is a `Number`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isNumber(false); - * // Returns: false - * util.isNumber(Infinity); - * // Returns: true - * util.isNumber(0); - * // Returns: true - * util.isNumber(NaN); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'number'` instead. - */ - export function isNumber(object: unknown): object is number; - /** - * Returns `true` if the given `object` is strictly an `Object`**and** not a`Function` (even though functions are objects in JavaScript). - * Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isObject(5); - * // Returns: false - * util.isObject(null); - * // Returns: false - * util.isObject({}); - * // Returns: true - * util.isObject(() => {}); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Deprecated: Use `value !== null && typeof value === 'object'` instead. - */ - export function isObject(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a primitive type. Otherwise, returns`false`. - * - * ```js - * const util = require('util'); - * - * util.isPrimitive(5); - * // Returns: true - * util.isPrimitive('foo'); - * // Returns: true - * util.isPrimitive(false); - * // Returns: true - * util.isPrimitive(null); - * // Returns: true - * util.isPrimitive(undefined); - * // Returns: true - * util.isPrimitive({}); - * // Returns: false - * util.isPrimitive(() => {}); - * // Returns: false - * util.isPrimitive(/^$/); - * // Returns: false - * util.isPrimitive(new Date()); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. - */ - export function isPrimitive(object: unknown): boolean; - /** - * Returns `true` if the given `object` is a `string`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isString(''); - * // Returns: true - * util.isString('foo'); - * // Returns: true - * util.isString(String('foo')); - * // Returns: true - * util.isString(5); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'string'` instead. - */ - export function isString(object: unknown): object is string; - /** - * Returns `true` if the given `object` is a `Symbol`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * util.isSymbol(5); - * // Returns: false - * util.isSymbol('foo'); - * // Returns: false - * util.isSymbol(Symbol('foo')); - * // Returns: true - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `typeof value === 'symbol'` instead. - */ - export function isSymbol(object: unknown): object is symbol; - /** - * Returns `true` if the given `object` is `undefined`. Otherwise, returns `false`. - * - * ```js - * const util = require('util'); - * - * const foo = undefined; - * util.isUndefined(5); - * // Returns: false - * util.isUndefined(foo); - * // Returns: true - * util.isUndefined(null); - * // Returns: false - * ``` - * @since v0.11.5 - * @deprecated Since v4.0.0 - Use `value === undefined` instead. - */ - export function isUndefined(object: unknown): object is undefined; - /** - * The `util.deprecate()` method wraps `fn` (which may be a function or class) in - * such a way that it is marked as deprecated. - * - * ```js - * const util = require('util'); - * - * exports.obsoleteFunction = util.deprecate(() => { - * // Do something here. - * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); - * ``` - * - * When called, `util.deprecate()` will return a function that will emit a`DeprecationWarning` using the `'warning'` event. The warning will - * be emitted and printed to `stderr` the first time the returned function is - * called. After the warning is emitted, the wrapped function is called without - * emitting a warning. - * - * If the same optional `code` is supplied in multiple calls to `util.deprecate()`, - * the warning will be emitted only once for that `code`. - * - * ```js - * const util = require('util'); - * - * const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); - * const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); - * fn1(); // Emits a deprecation warning with code DEP0001 - * fn2(); // Does not emit a deprecation warning because it has the same code - * ``` - * - * If either the `--no-deprecation` or `--no-warnings` command-line flags are - * used, or if the `process.noDeprecation` property is set to `true`_prior_ to - * the first deprecation warning, the `util.deprecate()` method does nothing. - * - * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, - * or the `process.traceDeprecation` property is set to `true`, a warning and a - * stack trace are printed to `stderr` the first time the deprecated function is - * called. - * - * If the `--throw-deprecation` command-line flag is set, or the`process.throwDeprecation` property is set to `true`, then an exception will be - * thrown when the deprecated function is called. - * - * The `--throw-deprecation` command-line flag and `process.throwDeprecation`property take precedence over `--trace-deprecation` and`process.traceDeprecation`. - * @since v0.8.0 - * @param fn The function that is being deprecated. - * @param msg A warning message to display when the deprecated function is invoked. - * @param code A deprecation code. See the `list of deprecated APIs` for a list of codes. - * @return The deprecated function wrapped to emit a warning. - */ - export function deprecate(fn: T, msg: string, code?: string): T; - /** - * Returns `true` if there is deep strict equality between `val1` and `val2`. - * Otherwise, returns `false`. - * - * See `assert.deepStrictEqual()` for more information about deep strict - * equality. - * @since v9.0.0 - */ - export function isDeepStrictEqual(val1: unknown, val2: unknown): boolean; - /** - * Takes an `async` function (or a function that returns a `Promise`) and returns a - * function following the error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument. In the callback, the - * first argument will be the rejection reason (or `null` if the `Promise`resolved), and the second argument will be the resolved value. - * - * ```js - * const util = require('util'); - * - * async function fn() { - * return 'hello world'; - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * if (err) throw err; - * console.log(ret); - * }); - * ``` - * - * Will print: - * - * ```text - * hello world - * ``` - * - * The callback is executed asynchronously, and will have a limited stack trace. - * If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. - * - * Since `null` has a special meaning as the first argument to a callback, if a - * wrapped function rejects a `Promise` with a falsy value as a reason, the value - * is wrapped in an `Error` with the original value stored in a field named`reason`. - * - * ```js - * function fn() { - * return Promise.reject(null); - * } - * const callbackFunction = util.callbackify(fn); - * - * callbackFunction((err, ret) => { - * // When the Promise was rejected with `null` it is wrapped with an Error and - * // the original value is stored in `reason`. - * err && err.hasOwnProperty('reason') && err.reason === null; // true - * }); - * ``` - * @since v8.2.0 - * @param original An `async` function - * @return a callback style function - */ - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void; - export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; - export 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; - export 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; - export 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; - export 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; - export 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; - export 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; - export 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; - export interface CustomPromisifyLegacy extends Function { - __promisify__: TCustom; - } - export interface CustomPromisifySymbol extends Function { - [promisify.custom]: TCustom; - } - export type CustomPromisify = CustomPromisifySymbol | CustomPromisifyLegacy; - /** - * Takes a function following the common error-first callback style, i.e. taking - * an `(err, value) => ...` callback as the last argument, and returns a version - * that returns promises. - * - * ```js - * const util = require('util'); - * const fs = require('fs'); - * - * const stat = util.promisify(fs.stat); - * stat('.').then((stats) => { - * // Do something with `stats` - * }).catch((error) => { - * // Handle the error. - * }); - * ``` - * - * Or, equivalently using `async function`s: - * - * ```js - * const util = require('util'); - * const fs = require('fs'); - * - * const stat = util.promisify(fs.stat); - * - * async function callStat() { - * const stats = await stat('.'); - * console.log(`This directory is owned by ${stats.uid}`); - * } - * ``` - * - * If there is an `original[util.promisify.custom]` property present, `promisify`will return its value, see `Custom promisified functions`. - * - * `promisify()` assumes that `original` is a function taking a callback as its - * final argument in all cases. If `original` is not a function, `promisify()`will throw an error. If `original` is a function but its last argument is not - * an error-first callback, it will still be passed an error-first - * callback as its last argument. - * - * Using `promisify()` on class methods or other methods that use `this` may not - * work as expected unless handled specially: - * - * ```js - * const util = require('util'); - * - * class Foo { - * constructor() { - * this.a = 42; - * } - * - * bar(callback) { - * callback(null, this.a); - * } - * } - * - * const foo = new Foo(); - * - * const naiveBar = util.promisify(foo.bar); - * // TypeError: Cannot read property 'a' of undefined - * // naiveBar().then(a => console.log(a)); - * - * naiveBar.call(foo).then((a) => console.log(a)); // '42' - * - * const bindBar = naiveBar.bind(foo); - * bindBar().then((a) => console.log(a)); // '42' - * ``` - * @since v8.0.0 - */ - export function promisify(fn: CustomPromisify): TCustom; - export function promisify(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise; - export function promisify(fn: (callback: (err?: any) => void) => void): () => Promise; - export function promisify(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify( - fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void - ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; - export function promisify(fn: Function): Function; - export namespace promisify { - const custom: unique symbol; - } - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextDecoder` API. - * - * ```js - * const decoder = new TextDecoder('shift_jis'); - * let string = ''; - * let buffer; - * while (buffer = getNextChunkSomehow()) { - * string += decoder.decode(buffer, { stream: true }); - * } - * string += decoder.decode(); // end-of-stream - * ``` - * @since v8.3.0 - */ - export class TextDecoder { - /** - * The encoding supported by the `TextDecoder` instance. - */ - readonly encoding: string; - /** - * The value will be `true` if decoding errors result in a `TypeError` being - * thrown. - */ - readonly fatal: boolean; - /** - * The value will be `true` if the decoding result will include the byte order - * mark. - */ - readonly ignoreBOM: boolean; - constructor( - encoding?: string, - options?: { - fatal?: boolean | undefined; - ignoreBOM?: boolean | undefined; - } - ); - /** - * Decodes the `input` and returns a string. If `options.stream` is `true`, any - * incomplete byte sequences occurring at the end of the `input` are buffered - * internally and emitted after the next call to `textDecoder.decode()`. - * - * If `textDecoder.fatal` is `true`, decoding errors that occur will result in a`TypeError` being thrown. - * @param input An `ArrayBuffer`, `DataView` or `TypedArray` instance containing the encoded data. - */ - decode( - input?: NodeJS.ArrayBufferView | ArrayBuffer | null, - options?: { - stream?: boolean | undefined; - } - ): string; - } - export interface EncodeIntoResult { - /** - * The read Unicode code units of input. - */ - read: number; - /** - * The written UTF-8 bytes of output. - */ - written: number; - } - export { types }; - /** - * An implementation of the [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/)`TextEncoder` API. All - * instances of `TextEncoder` only support UTF-8 encoding. - * - * ```js - * const encoder = new TextEncoder(); - * const uint8array = encoder.encode('this is some data'); - * ``` - * - * The `TextEncoder` class is also available on the global object. - * @since v8.3.0 - */ - export class TextEncoder { - /** - * The encoding supported by the `TextEncoder` instance. Always set to `'utf-8'`. - */ - readonly encoding: string; - /** - * UTF-8 encodes the `input` string and returns a `Uint8Array` containing the - * encoded bytes. - * @param [input='an empty string'] The text to encode. - */ - encode(input?: string): Uint8Array; - /** - * UTF-8 encodes the `src` string to the `dest` Uint8Array and returns an object - * containing the read Unicode code units and written UTF-8 bytes. - * - * ```js - * const encoder = new TextEncoder(); - * const src = 'this is some data'; - * const dest = new Uint8Array(10); - * const { read, written } = encoder.encodeInto(src, dest); - * ``` - * @param src The text to encode. - * @param dest The array to hold the encode result. - */ - encodeInto(src: string, dest: Uint8Array): EncodeIntoResult; - } -} -declare module 'util/types' { - export * from 'util/types'; -} -declare module 'util/types' { - import { KeyObject, webcrypto } from 'node:crypto'; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) - * or[`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * - * See also `util.types.isArrayBuffer()` and `util.types.isSharedArrayBuffer()`. - * - * ```js - * util.types.isAnyArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isAnyArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isAnyArrayBuffer(object: unknown): object is ArrayBufferLike; - /** - * Returns `true` if the value is an `arguments` object. - * - * ```js - * function foo() { - * util.types.isArgumentsObject(arguments); // Returns true - * } - * ``` - * @since v10.0.0 - */ - function isArgumentsObject(object: unknown): object is IArguments; - /** - * Returns `true` if the value is a built-in [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instance. - * This does _not_ include [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isArrayBuffer(new ArrayBuffer()); // Returns true - * util.types.isArrayBuffer(new SharedArrayBuffer()); // Returns false - * ``` - * @since v10.0.0 - */ - function isArrayBuffer(object: unknown): object is ArrayBuffer; - /** - * Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)views, such as typed array - * objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent - * to[`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * - * ```js - * util.types.isArrayBufferView(new Int8Array()); // true - * util.types.isArrayBufferView(Buffer.from('hello world')); // true - * util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true - * util.types.isArrayBufferView(new ArrayBuffer()); // false - * ``` - * @since v10.0.0 - */ - function isArrayBufferView(object: unknown): object is NodeJS.ArrayBufferView; - /** - * Returns `true` if the value is an [async function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isAsyncFunction(function foo() {}); // Returns false - * util.types.isAsyncFunction(async function foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isAsyncFunction(object: unknown): boolean; - /** - * Returns `true` if the value is a `BigInt64Array` instance. - * - * ```js - * util.types.isBigInt64Array(new BigInt64Array()); // Returns true - * util.types.isBigInt64Array(new BigUint64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isBigInt64Array(value: unknown): value is BigInt64Array; - /** - * Returns `true` if the value is a `BigUint64Array` instance. - * - * ```js - * util.types.isBigUint64Array(new BigInt64Array()); // Returns false - * util.types.isBigUint64Array(new BigUint64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isBigUint64Array(value: unknown): value is BigUint64Array; - /** - * Returns `true` if the value is a boolean object, e.g. created - * by `new Boolean()`. - * - * ```js - * util.types.isBooleanObject(false); // Returns false - * util.types.isBooleanObject(true); // Returns false - * util.types.isBooleanObject(new Boolean(false)); // Returns true - * util.types.isBooleanObject(new Boolean(true)); // Returns true - * util.types.isBooleanObject(Boolean(false)); // Returns false - * util.types.isBooleanObject(Boolean(true)); // Returns false - * ``` - * @since v10.0.0 - */ - function isBooleanObject(object: unknown): object is Boolean; - /** - * Returns `true` if the value is any boxed primitive object, e.g. created - * by `new Boolean()`, `new String()` or `Object(Symbol())`. - * - * For example: - * - * ```js - * util.types.isBoxedPrimitive(false); // Returns false - * util.types.isBoxedPrimitive(new Boolean(false)); // Returns true - * util.types.isBoxedPrimitive(Symbol('foo')); // Returns false - * util.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true - * util.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true - * ``` - * @since v10.11.0 - */ - function isBoxedPrimitive(object: unknown): object is String | Number | BigInt | Boolean | Symbol; - /** - * Returns `true` if the value is a built-in [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) instance. - * - * ```js - * const ab = new ArrayBuffer(20); - * util.types.isDataView(new DataView(ab)); // Returns true - * util.types.isDataView(new Float64Array()); // Returns false - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isDataView(object: unknown): object is DataView; - /** - * Returns `true` if the value is a built-in [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instance. - * - * ```js - * util.types.isDate(new Date()); // Returns true - * ``` - * @since v10.0.0 - */ - function isDate(object: unknown): object is Date; - /** - * Returns `true` if the value is a native `External` value. - * - * A native `External` value is a special type of object that contains a - * raw C++ pointer (`void*`) for access from native code, and has no other - * properties. Such objects are created either by Node.js internals or native - * addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. - * - * ```c - * #include - * #include - * napi_value result; - * static napi_value MyNapi(napi_env env, napi_callback_info info) { - * int* raw = (int*) malloc(1024); - * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result); - * if (status != napi_ok) { - * napi_throw_error(env, NULL, "napi_create_external failed"); - * return NULL; - * } - * return result; - * } - * ... - * DECLARE_NAPI_PROPERTY("myNapi", MyNapi) - * ... - * ``` - * - * ```js - * const native = require('napi_addon.node'); - * const data = native.myNapi(); - * util.types.isExternal(data); // returns true - * util.types.isExternal(0); // returns false - * util.types.isExternal(new String('foo')); // returns false - * ``` - * - * For further information on `napi_create_external`, refer to `napi_create_external()`. - * @since v10.0.0 - */ - function isExternal(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`Float32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array) instance. - * - * ```js - * util.types.isFloat32Array(new ArrayBuffer()); // Returns false - * util.types.isFloat32Array(new Float32Array()); // Returns true - * util.types.isFloat32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isFloat32Array(object: unknown): object is Float32Array; - /** - * Returns `true` if the value is a built-in [`Float64Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array) instance. - * - * ```js - * util.types.isFloat64Array(new ArrayBuffer()); // Returns false - * util.types.isFloat64Array(new Uint8Array()); // Returns false - * util.types.isFloat64Array(new Float64Array()); // Returns true - * ``` - * @since v10.0.0 - */ - function isFloat64Array(object: unknown): object is Float64Array; - /** - * Returns `true` if the value is a generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * util.types.isGeneratorFunction(function foo() {}); // Returns false - * util.types.isGeneratorFunction(function* foo() {}); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorFunction(object: unknown): object is GeneratorFunction; - /** - * Returns `true` if the value is a generator object as returned from a - * built-in generator function. - * This only reports back what the JavaScript engine is seeing; - * in particular, the return value may not match the original source code if - * a transpilation tool was used. - * - * ```js - * function* foo() {} - * const generator = foo(); - * util.types.isGeneratorObject(generator); // Returns true - * ``` - * @since v10.0.0 - */ - function isGeneratorObject(object: unknown): object is Generator; - /** - * Returns `true` if the value is a built-in [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) instance. - * - * ```js - * util.types.isInt8Array(new ArrayBuffer()); // Returns false - * util.types.isInt8Array(new Int8Array()); // Returns true - * util.types.isInt8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt8Array(object: unknown): object is Int8Array; - /** - * Returns `true` if the value is a built-in [`Int16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array) instance. - * - * ```js - * util.types.isInt16Array(new ArrayBuffer()); // Returns false - * util.types.isInt16Array(new Int16Array()); // Returns true - * util.types.isInt16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt16Array(object: unknown): object is Int16Array; - /** - * Returns `true` if the value is a built-in [`Int32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array) instance. - * - * ```js - * util.types.isInt32Array(new ArrayBuffer()); // Returns false - * util.types.isInt32Array(new Int32Array()); // Returns true - * util.types.isInt32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isInt32Array(object: unknown): object is Int32Array; - /** - * Returns `true` if the value is a built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * util.types.isMap(new Map()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMap(object: T | {}): object is T extends ReadonlyMap ? (unknown extends T ? never : ReadonlyMap) : Map; - /** - * Returns `true` if the value is an iterator returned for a built-in[`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) instance. - * - * ```js - * const map = new Map(); - * util.types.isMapIterator(map.keys()); // Returns true - * util.types.isMapIterator(map.values()); // Returns true - * util.types.isMapIterator(map.entries()); // Returns true - * util.types.isMapIterator(map[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isMapIterator(object: unknown): boolean; - /** - * Returns `true` if the value is an instance of a [Module Namespace Object](https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects). - * - * ```js - * import * as ns from './a.js'; - * - * util.types.isModuleNamespaceObject(ns); // Returns true - * ``` - * @since v10.0.0 - */ - function isModuleNamespaceObject(value: unknown): boolean; - /** - * Returns `true` if the value is an instance of a built-in `Error` type. - * - * ```js - * util.types.isNativeError(new Error()); // Returns true - * util.types.isNativeError(new TypeError()); // Returns true - * util.types.isNativeError(new RangeError()); // Returns true - * ``` - * @since v10.0.0 - */ - function isNativeError(object: unknown): object is Error; - /** - * Returns `true` if the value is a number object, e.g. created - * by `new Number()`. - * - * ```js - * util.types.isNumberObject(0); // Returns false - * util.types.isNumberObject(new Number(0)); // Returns true - * ``` - * @since v10.0.0 - */ - function isNumberObject(object: unknown): object is Number; - /** - * Returns `true` if the value is a built-in [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - * - * ```js - * util.types.isPromise(Promise.resolve(42)); // Returns true - * ``` - * @since v10.0.0 - */ - function isPromise(object: unknown): object is Promise; - /** - * Returns `true` if the value is a [`Proxy`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) instance. - * - * ```js - * const target = {}; - * const proxy = new Proxy(target, {}); - * util.types.isProxy(target); // Returns false - * util.types.isProxy(proxy); // Returns true - * ``` - * @since v10.0.0 - */ - function isProxy(object: unknown): boolean; - /** - * Returns `true` if the value is a regular expression object. - * - * ```js - * util.types.isRegExp(/abc/); // Returns true - * util.types.isRegExp(new RegExp('abc')); // Returns true - * ``` - * @since v10.0.0 - */ - function isRegExp(object: unknown): object is RegExp; - /** - * Returns `true` if the value is a built-in [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * util.types.isSet(new Set()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSet(object: T | {}): object is T extends ReadonlySet ? (unknown extends T ? never : ReadonlySet) : Set; - /** - * Returns `true` if the value is an iterator returned for a built-in[`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) instance. - * - * ```js - * const set = new Set(); - * util.types.isSetIterator(set.keys()); // Returns true - * util.types.isSetIterator(set.values()); // Returns true - * util.types.isSetIterator(set.entries()); // Returns true - * util.types.isSetIterator(set[Symbol.iterator]()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSetIterator(object: unknown): boolean; - /** - * Returns `true` if the value is a built-in [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) instance. - * This does _not_ include [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) instances. Usually, it is - * desirable to test for both; See `util.types.isAnyArrayBuffer()` for that. - * - * ```js - * util.types.isSharedArrayBuffer(new ArrayBuffer()); // Returns false - * util.types.isSharedArrayBuffer(new SharedArrayBuffer()); // Returns true - * ``` - * @since v10.0.0 - */ - function isSharedArrayBuffer(object: unknown): object is SharedArrayBuffer; - /** - * Returns `true` if the value is a string object, e.g. created - * by `new String()`. - * - * ```js - * util.types.isStringObject('foo'); // Returns false - * util.types.isStringObject(new String('foo')); // Returns true - * ``` - * @since v10.0.0 - */ - function isStringObject(object: unknown): object is String; - /** - * Returns `true` if the value is a symbol object, created - * by calling `Object()` on a `Symbol` primitive. - * - * ```js - * const symbol = Symbol('foo'); - * util.types.isSymbolObject(symbol); // Returns false - * util.types.isSymbolObject(Object(symbol)); // Returns true - * ``` - * @since v10.0.0 - */ - function isSymbolObject(object: unknown): object is Symbol; - /** - * Returns `true` if the value is a built-in [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) instance. - * - * ```js - * util.types.isTypedArray(new ArrayBuffer()); // Returns false - * util.types.isTypedArray(new Uint8Array()); // Returns true - * util.types.isTypedArray(new Float64Array()); // Returns true - * ``` - * - * See also [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). - * @since v10.0.0 - */ - function isTypedArray(object: unknown): object is NodeJS.TypedArray; - /** - * Returns `true` if the value is a built-in [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instance. - * - * ```js - * util.types.isUint8Array(new ArrayBuffer()); // Returns false - * util.types.isUint8Array(new Uint8Array()); // Returns true - * util.types.isUint8Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8Array(object: unknown): object is Uint8Array; - /** - * Returns `true` if the value is a built-in [`Uint8ClampedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray) instance. - * - * ```js - * util.types.isUint8ClampedArray(new ArrayBuffer()); // Returns false - * util.types.isUint8ClampedArray(new Uint8ClampedArray()); // Returns true - * util.types.isUint8ClampedArray(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint8ClampedArray(object: unknown): object is Uint8ClampedArray; - /** - * Returns `true` if the value is a built-in [`Uint16Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array) instance. - * - * ```js - * util.types.isUint16Array(new ArrayBuffer()); // Returns false - * util.types.isUint16Array(new Uint16Array()); // Returns true - * util.types.isUint16Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint16Array(object: unknown): object is Uint16Array; - /** - * Returns `true` if the value is a built-in [`Uint32Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array) instance. - * - * ```js - * util.types.isUint32Array(new ArrayBuffer()); // Returns false - * util.types.isUint32Array(new Uint32Array()); // Returns true - * util.types.isUint32Array(new Float64Array()); // Returns false - * ``` - * @since v10.0.0 - */ - function isUint32Array(object: unknown): object is Uint32Array; - /** - * Returns `true` if the value is a built-in [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) instance. - * - * ```js - * util.types.isWeakMap(new WeakMap()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakMap(object: unknown): object is WeakMap; - /** - * Returns `true` if the value is a built-in [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) instance. - * - * ```js - * util.types.isWeakSet(new WeakSet()); // Returns true - * ``` - * @since v10.0.0 - */ - function isWeakSet(object: unknown): object is WeakSet; - /** - * Returns `true` if `value` is a `KeyObject`, `false` otherwise. - * @since v16.2.0 - */ - function isKeyObject(object: unknown): object is KeyObject; - /** - * Returns `true` if `value` is a `CryptoKey`, `false` otherwise. - * @since v16.2.0 - */ - function isCryptoKey(object: unknown): object is webcrypto.CryptoKey; -} -declare module 'node:util' { - export * from 'util'; -} -declare module 'node:util/types' { - export * from 'util/types'; -} diff --git a/JS/node_modules/@types/node/v8.d.ts b/JS/node_modules/@types/node/v8.d.ts deleted file mode 100755 index 35e233d..0000000 --- a/JS/node_modules/@types/node/v8.d.ts +++ /dev/null @@ -1,378 +0,0 @@ -/** - * The `v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/)built into the Node.js binary. It can be accessed using: - * - * ```js - * const v8 = require('v8'); - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/v8.js) - */ -declare module 'v8' { - import { Readable } from 'node: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; - } - interface HeapCodeStatistics { - code_and_metadata_size: number; - bytecode_and_metadata_size: number; - external_script_source_size: number; - } - /** - * Returns an integer representing a version tag derived from the V8 version, - * command-line flags, and detected CPU features. This is useful for determining - * whether a `vm.Script` `cachedData` buffer is compatible with this instance - * of V8. - * - * ```js - * console.log(v8.cachedDataVersionTag()); // 3947234607 - * // The value returned by v8.cachedDataVersionTag() is derived from the V8 - * // version, command-line flags, and detected CPU features. Test that the value - * // does indeed update when flags are toggled. - * v8.setFlagsFromString('--allow_natives_syntax'); - * console.log(v8.cachedDataVersionTag()); // 183726201 - * ``` - * @since v8.0.0 - */ - function cachedDataVersionTag(): number; - /** - * Returns an object with the following properties: - * - * `does_zap_garbage` is a 0/1 boolean, which signifies whether the`--zap_code_space` option is enabled or not. This makes V8 overwrite heap - * garbage with a bit pattern. The RSS footprint (resident set size) gets bigger - * because it continuously touches all heap pages and that makes them less likely - * to get swapped out by the operating system. - * - * `number_of_native_contexts` The value of native\_context is the number of the - * top-level contexts currently active. Increase of this number over time indicates - * a memory leak. - * - * `number_of_detached_contexts` The value of detached\_context is the number - * of contexts that were detached and not yet garbage collected. This number - * being non-zero indicates a potential memory leak. - * - * ```js - * { - * total_heap_size: 7326976, - * total_heap_size_executable: 4194304, - * total_physical_size: 7326976, - * total_available_size: 1152656, - * used_heap_size: 3476208, - * heap_size_limit: 1535115264, - * malloced_memory: 16384, - * peak_malloced_memory: 1127496, - * does_zap_garbage: 0, - * number_of_native_contexts: 1, - * number_of_detached_contexts: 0 - * } - * ``` - * @since v1.0.0 - */ - function getHeapStatistics(): HeapInfo; - /** - * Returns statistics about the V8 heap spaces, i.e. the segments which make up - * the V8 heap. Neither the ordering of heap spaces, nor the availability of a - * heap space can be guaranteed as the statistics are provided via the - * V8[`GetHeapSpaceStatistics`](https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4) function and may change from one V8 version to the - * next. - * - * The value returned is an array of objects containing the following properties: - * - * ```json - * [ - * { - * "space_name": "new_space", - * "space_size": 2063872, - * "space_used_size": 951112, - * "space_available_size": 80824, - * "physical_space_size": 2063872 - * }, - * { - * "space_name": "old_space", - * "space_size": 3090560, - * "space_used_size": 2493792, - * "space_available_size": 0, - * "physical_space_size": 3090560 - * }, - * { - * "space_name": "code_space", - * "space_size": 1260160, - * "space_used_size": 644256, - * "space_available_size": 960, - * "physical_space_size": 1260160 - * }, - * { - * "space_name": "map_space", - * "space_size": 1094160, - * "space_used_size": 201608, - * "space_available_size": 0, - * "physical_space_size": 1094160 - * }, - * { - * "space_name": "large_object_space", - * "space_size": 0, - * "space_used_size": 0, - * "space_available_size": 1490980608, - * "physical_space_size": 0 - * } - * ] - * ``` - * @since v6.0.0 - */ - function getHeapSpaceStatistics(): HeapSpaceInfo[]; - /** - * The `v8.setFlagsFromString()` method can be used to programmatically set - * V8 command-line flags. This method should be used with care. Changing settings - * after the VM has started may result in unpredictable behavior, including - * crashes and data loss; or it may simply do nothing. - * - * The V8 options available for a version of Node.js may be determined by running`node --v8-options`. - * - * Usage: - * - * ```js - * // Print GC events to stdout for one minute. - * const v8 = require('v8'); - * v8.setFlagsFromString('--trace_gc'); - * setTimeout(() => { v8.setFlagsFromString('--notrace_gc'); }, 60e3); - * ``` - * @since v1.0.0 - */ - 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 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. Therefore, the schema may change from one version of V8 to the next. - * - * ```js - * // Print heap snapshot to the console - * const v8 = require('v8'); - * const stream = v8.getHeapSnapshot(); - * stream.pipe(process.stdout); - * ``` - * @since v11.13.0 - * @return A Readable Stream containing the V8 heap snapshot - */ - function getHeapSnapshot(): Readable; - /** - * Generates a snapshot of the current V8 heap and writes it to a JSON - * file. This file 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. - * - * A heap snapshot is specific to a single V8 isolate. When using `worker threads`, a heap snapshot generated from the main thread will - * not contain any information about the workers, and vice versa. - * - * ```js - * const { writeHeapSnapshot } = require('v8'); - * const { - * Worker, - * isMainThread, - * parentPort - * } = require('worker_threads'); - * - * if (isMainThread) { - * const worker = new Worker(__filename); - * - * worker.once('message', (filename) => { - * console.log(`worker heapdump: ${filename}`); - * // Now get a heapdump for the main thread. - * console.log(`main thread heapdump: ${writeHeapSnapshot()}`); - * }); - * - * // Tell the worker to create a heapdump. - * worker.postMessage('heapdump'); - * } else { - * parentPort.once('message', (message) => { - * if (message === 'heapdump') { - * // Generate a heapdump for the worker - * // and return the filename to the parent. - * parentPort.postMessage(writeHeapSnapshot()); - * } - * }); - * } - * ``` - * @since v11.13.0 - * @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. - * @return The filename where the snapshot was saved. - */ - function writeHeapSnapshot(filename?: string): string; - /** - * Returns an object with the following properties: - * - * ```js - * { - * code_and_metadata_size: 212208, - * bytecode_and_metadata_size: 161368, - * external_script_source_size: 1410794 - * } - * ``` - * @since v12.8.0 - */ - function getHeapCodeStatistics(): HeapCodeStatistics; - /** - * @since v8.0.0 - */ - class Serializer { - /** - * Writes out a header, which includes the serialization format version. - */ - writeHeader(): void; - /** - * Serializes a JavaScript value and adds the serialized representation to the - * internal buffer. - * - * This throws an error if `value` cannot be serialized. - */ - writeValue(val: any): boolean; - /** - * Returns the stored internal buffer. This serializer should not be used once - * the buffer is released. Calling this method results in undefined behavior - * if a previous write has failed. - */ - releaseBuffer(): Buffer; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the deserializing context to `deserializer.transferArrayBuffer()`. - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Write a raw 32-bit unsigned integer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint32(value: number): void; - /** - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeUint64(hi: number, lo: number): void; - /** - * Write a JS `number` value. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeDouble(value: number): void; - /** - * Write raw bytes into the serializer’s internal buffer. The deserializer - * will require a way to compute the length of the buffer. - * For use inside of a custom `serializer._writeHostObject()`. - */ - writeRawBytes(buffer: NodeJS.TypedArray): void; - } - /** - * A subclass of `Serializer` that serializes `TypedArray`(in particular `Buffer`) and `DataView` objects as host objects, and only - * stores the part of their underlying `ArrayBuffer`s that they are referring to. - * @since v8.0.0 - */ - class DefaultSerializer extends Serializer {} - /** - * @since v8.0.0 - */ - class Deserializer { - constructor(data: NodeJS.TypedArray); - /** - * Reads and validates a header (including the format version). - * May, for example, reject an invalid or unsupported wire format. In that case, - * an `Error` is thrown. - */ - readHeader(): boolean; - /** - * Deserializes a JavaScript value from the buffer and returns it. - */ - readValue(): any; - /** - * Marks an `ArrayBuffer` as having its contents transferred out of band. - * Pass the corresponding `ArrayBuffer` in the serializing context to `serializer.transferArrayBuffer()` (or return the `id` from `serializer._getSharedArrayBufferId()` in the case of - * `SharedArrayBuffer`s). - * @param id A 32-bit unsigned integer. - * @param arrayBuffer An `ArrayBuffer` instance. - */ - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void; - /** - * Reads the underlying wire format version. Likely mostly to be useful to - * legacy code reading old wire format versions. May not be called before`.readHeader()`. - */ - getWireFormatVersion(): number; - /** - * Read a raw 32-bit unsigned integer and return it. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint32(): number; - /** - * Read a raw 64-bit unsigned integer and return it as an array `[hi, lo]`with two 32-bit unsigned integer entries. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readUint64(): [number, number]; - /** - * Read a JS `number` value. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readDouble(): number; - /** - * Read raw bytes from the deserializer’s internal buffer. The `length` parameter - * must correspond to the length of the buffer that was passed to `serializer.writeRawBytes()`. - * For use inside of a custom `deserializer._readHostObject()`. - */ - readRawBytes(length: number): Buffer; - } - /** - * A subclass of `Deserializer` corresponding to the format written by `DefaultSerializer`. - * @since v8.0.0 - */ - class DefaultDeserializer extends Deserializer {} - /** - * Uses a `DefaultSerializer` to serialize `value` into a buffer. - * @since v8.0.0 - */ - function serialize(value: any): Buffer; - /** - * Uses a `DefaultDeserializer` with default options to read a JS value - * from a buffer. - * @since v8.0.0 - * @param buffer A buffer returned by {@link serialize}. - */ - function deserialize(buffer: NodeJS.TypedArray): any; - /** - * The `v8.takeCoverage()` method allows the user to write the coverage started by `NODE_V8_COVERAGE` to disk on demand. This method can be invoked multiple - * times during the lifetime of the process. Each time the execution counter will - * be reset and a new coverage report will be written to the directory specified - * by `NODE_V8_COVERAGE`. - * - * When the process is about to exit, one last coverage will still be written to - * disk unless {@link stopCoverage} is invoked before the process exits. - * @since v15.1.0, v12.22.0 - */ - function takeCoverage(): void; - /** - * The `v8.stopCoverage()` method allows the user to stop the coverage collection - * started by `NODE_V8_COVERAGE`, so that V8 can release the execution count - * records and optimize code. This can be used in conjunction with {@link takeCoverage} if the user wants to collect the coverage on demand. - * @since v15.1.0, v12.22.0 - */ - function stopCoverage(): void; -} -declare module 'node:v8' { - export * from 'v8'; -} diff --git a/JS/node_modules/@types/node/vm.d.ts b/JS/node_modules/@types/node/vm.d.ts deleted file mode 100755 index 48d1fc8..0000000 --- a/JS/node_modules/@types/node/vm.d.ts +++ /dev/null @@ -1,508 +0,0 @@ -/** - * The `vm` module enables compiling and running code within V8 Virtual - * Machine contexts. **The `vm` module is not a security mechanism. Do** - * **not use it to run untrusted code.** - * - * JavaScript code can be compiled and run immediately or - * compiled, saved, and run later. - * - * A common use case is to run the code in a different V8 Context. This means - * invoked code has a different global object than the invoking code. - * - * One can provide the context by `contextifying` an - * object. The invoked code treats any property in the context like a - * global variable. Any changes to global variables caused by the invoked - * code are reflected in the context object. - * - * ```js - * const vm = require('vm'); - * - * const x = 1; - * - * const context = { x: 2 }; - * vm.createContext(context); // Contextify the object. - * - * const code = 'x += 40; var y = 17;'; - * // `x` and `y` are global variables in the context. - * // Initially, x has the value 2 because that is the value of context.x. - * vm.runInContext(code, context); - * - * console.log(context.x); // 42 - * console.log(context.y); // 17 - * - * console.log(x); // 1; y is not defined. - * ``` - * @see [source](https://github.com/nodejs/node/blob/v16.7.0/lib/vm.js) - */ -declare module 'vm' { - interface Context extends NodeJS.Dict {} - interface BaseOptions { - /** - * Specifies the filename used in stack traces produced by this script. - * Default: `''`. - */ - filename?: string | undefined; - /** - * Specifies the line number offset that is displayed in stack traces produced by this script. - * Default: `0`. - */ - lineOffset?: number | undefined; - /** - * Specifies the column number offset that is displayed in stack traces produced by this script. - * @default 0 - */ - columnOffset?: number | undefined; - } - interface ScriptOptions extends BaseOptions { - displayErrors?: boolean | undefined; - timeout?: number | undefined; - cachedData?: Buffer | undefined; - /** @deprecated in favor of `script.createCachedData()` */ - produceCachedData?: boolean | undefined; - } - interface RunningScriptOptions extends BaseOptions { - /** - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. - * Default: `true`. - */ - displayErrors?: boolean | undefined; - /** - * Specifies the number of milliseconds to execute code before terminating execution. - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer. - */ - timeout?: number | undefined; - /** - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received. - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that. - * If execution is terminated, an `Error` will be thrown. - * Default: `false`. - */ - breakOnSigint?: boolean | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: 'afterEvaluate' | undefined; - } - interface CompileFunctionOptions extends BaseOptions { - /** - * Provides an optional data with V8's code cache data for the supplied source. - */ - cachedData?: Buffer | undefined; - /** - * Specifies whether to produce new cache data. - * Default: `false`, - */ - produceCachedData?: boolean | undefined; - /** - * The sandbox/context in which the said function should be compiled in. - */ - parsingContext?: Context | undefined; - /** - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling - */ - contextExtensions?: Object[] | undefined; - } - 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 | undefined; - /** - * 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 | undefined; - codeGeneration?: - | { - /** - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc) - * will throw an EvalError. - * @default true - */ - strings?: boolean | undefined; - /** - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError. - * @default true - */ - wasm?: boolean | undefined; - } - | undefined; - /** - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run. - */ - microtaskMode?: 'afterEvaluate' | undefined; - } - type MeasureMemoryMode = 'summary' | 'detailed'; - interface MeasureMemoryOptions { - /** - * @default 'summary' - */ - mode?: MeasureMemoryMode | undefined; - context?: Context | undefined; - } - interface MemoryMeasurement { - total: { - jsMemoryEstimate: number; - jsMemoryRange: [number, number]; - }; - } - /** - * Instances of the `vm.Script` class contain precompiled scripts that can be - * executed in specific contexts. - * @since v0.3.1 - */ - class Script { - constructor(code: string, options?: ScriptOptions); - /** - * Runs the compiled code contained by the `vm.Script` object within the given`contextifiedObject` and returns the result. Running code does not have access - * to local scope. - * - * The following example compiles code that increments a global variable, sets - * the value of another global variable, then execute the code multiple times. - * The globals are contained in the `context` object. - * - * ```js - * const vm = require('vm'); - * - * const context = { - * animal: 'cat', - * count: 2 - * }; - * - * const script = new vm.Script('count += 1; name = "kitty";'); - * - * vm.createContext(context); - * for (let i = 0; i < 10; ++i) { - * script.runInContext(context); - * } - * - * console.log(context); - * // Prints: { animal: 'cat', count: 12, name: 'kitty' } - * ``` - * - * Using the `timeout` or `breakOnSigint` options will result in new event loops - * and corresponding threads being started, which have a non-zero performance - * overhead. - * @since v0.3.1 - * @param contextifiedObject A `contextified` object as returned by the `vm.createContext()` method. - * @return the result of the very last statement executed in the script. - */ - runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any; - /** - * First contextifies the given `contextObject`, runs the compiled code contained - * by the `vm.Script` object within the created context, and returns the result. - * Running code does not have access to local scope. - * - * The following example compiles code that sets a global variable, then executes - * the code multiple times in different contexts. The globals are set on and - * contained within each individual `context`. - * - * ```js - * const vm = require('vm'); - * - * const script = new vm.Script('globalVar = "set"'); - * - * const contexts = [{}, {}, {}]; - * contexts.forEach((context) => { - * script.runInNewContext(context); - * }); - * - * console.log(contexts); - * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }] - * ``` - * @since v0.3.1 - * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created. - * @return the result of the very last statement executed in the script. - */ - runInNewContext(contextObject?: Context, options?: RunningScriptOptions): any; - /** - * Runs the compiled code contained by the `vm.Script` within the context of the - * current `global` object. Running code does not have access to local scope, but_does_ have access to the current `global` object. - * - * The following example compiles code that increments a `global` variable then - * executes that code multiple times: - * - * ```js - * const vm = require('vm'); - * - * global.globalVar = 0; - * - * const script = new vm.Script('globalVar += 1', { filename: 'myfile.vm' }); - * - * for (let i = 0; i < 1000; ++i) { - * script.runInThisContext(); - * } - * - * console.log(globalVar); - * - * // 1000 - * ``` - * @since v0.3.1 - * @return the result of the very last statement executed in the script. - */ - runInThisContext(options?: RunningScriptOptions): any; - /** - * Creates a code cache that can be used with the `Script` constructor's`cachedData` option. Returns a `Buffer`. This method may be called at any - * time and any number of times. - * - * ```js - * const script = new vm.Script(` - * function add(a, b) { - * return a + b; - * } - * - * const x = add(1, 2); - * `); - * - * const cacheWithoutX = script.createCachedData(); - * - * script.runInThisContext(); - * - * const cacheWithX = script.createCachedData(); - * ``` - * @since v10.6.0 - */ - createCachedData(): Buffer; - - /** @deprecated in favor of `script.createCachedData()` */ - cachedDataProduced?: boolean | undefined; - cachedDataRejected?: boolean | undefined; - cachedData?: Buffer | undefined; - } - /** - * If given a `contextObject`, the `vm.createContext()` method will `prepare - * that object` so that it can be used in calls to {@link runInContext} or `script.runInContext()`. Inside such scripts, - * the `contextObject` will be the global object, retaining all of its existing - * properties but also having the built-in objects and functions any standard[global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global variables - * will remain unchanged. - * - * ```js - * const vm = require('vm'); - * - * global.globalVar = 3; - * - * const context = { globalVar: 1 }; - * vm.createContext(context); - * - * vm.runInContext('globalVar *= 2;', context); - * - * console.log(context); - * // Prints: { globalVar: 2 } - * - * console.log(global.globalVar); - * // Prints: 3 - * ``` - * - * If `contextObject` is omitted (or passed explicitly as `undefined`), a new, - * empty `contextified` object will be returned. - * - * The `vm.createContext()` method is primarily useful for creating a single - * context that can be used to run multiple scripts. For instance, if emulating a - * web browser, the method can be used to create a single context representing a - * window's global object, then run all `` -``` - -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/JS/node_modules/apollo-cache-inmemory/jest.config.js b/JS/node_modules/apollo-cache-inmemory/jest.config.js deleted file mode 100644 index 48f0a89..0000000 --- a/JS/node_modules/apollo-cache-inmemory/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../config/jest.config.settings'), -}; diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts deleted file mode 100644 index a914d2b..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map deleted file mode 100644 index 5e7ef9a..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/__tests__/cache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js deleted file mode 100644 index fa91d39..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js +++ /dev/null @@ -1,627 +0,0 @@ -"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(tslib_1.__assign({ addTypename: false }, config), { resultCaching: true })), - new __1.InMemoryCache(tslib_1.__assign(tslib_1.__assign({ addTypename: false }, config), { resultCaching: false })), - new __1.InMemoryCache(tslib_1.__assign(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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map deleted file mode 100644 index 47c72f3..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/cache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"c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C,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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts deleted file mode 100644 index f81c72a..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function withError(func: Function, regex: RegExp): any; -//# sourceMappingURL=diffAgainstStore.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map deleted file mode 100644 index bf5c66b..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js deleted file mode 100644 index 9db2e35..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js +++ /dev/null @@ -1,678 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map deleted file mode 100644 index d9c1724..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/diffAgainstStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAAC,CAAC;QAC/B,OAAO,MAAM,C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ache-inmemory/lib/__tests__/fragmentMatcher.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts deleted file mode 100644 index c07b9b3..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=fragmentMatcher.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map deleted file mode 100644 index 23193f3..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragmentMatcher.d.ts","sourceRoot":"","sources":["../src/__tests__/fragmentMatcher.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js deleted file mode 100644 index cba24f2..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js +++ /dev/null @@ -1,79 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map deleted file mode 100644 index 68d2035..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/fragmentMatcher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAC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,CAAC,CAAC;QAEH,IAAM,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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts deleted file mode 100644 index 7a55a8b..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts +++ /dev/null @@ -1 +0,0 @@ -//# sourceMappingURL=mapCache.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map deleted file mode 100644 index c5374f3..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mapCache.d.ts","sourceRoot":"","sources":["../src/__tests__/mapCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js deleted file mode 100644 index e6fcb73..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js +++ /dev/null @@ -1,18 +0,0 @@ -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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map deleted file mode 100644 index e343f39..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/mapCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts deleted file mode 100644 index edef318..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=objectCache.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map deleted file mode 100644 index a2b4f7e..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"objectCache.d.ts","sourceRoot":"","sources":["../src/__tests__/objectCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js deleted file mode 100644 index 714519d..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js +++ /dev/null @@ -1,33 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map deleted file mode 100644 index 9d00c38..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/objectCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts deleted file mode 100644 index 637affa..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=readFromStore.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map deleted file mode 100644 index 9a5c0b1..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readFromStore.d.ts","sourceRoot":"","sources":["../src/__tests__/readFromStore.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js deleted file mode 100644 index 49fbc3c..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js +++ /dev/null @@ -1,555 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map deleted file mode 100644 index 93ec353..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/readFromStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,C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YAAY,CAAC,CAAC,CAAC,OAAO,CAAC;YACzC,WAAW,EAAE,uBAAuB;YACpC,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts deleted file mode 100644 index 290798f..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=recordingCache.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map deleted file mode 100644 index 0029a6c..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"recordingCache.d.ts","sourceRoot":"","sources":["../src/__tests__/recordingCache.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js deleted file mode 100644 index 29ad65f..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js +++ /dev/null @@ -1,70 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map deleted file mode 100644 index 4c2dd1c..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/recordingCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,G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o-cache-inmemory/lib/__tests__/roundtrip.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts deleted file mode 100644 index 2b083ec..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=roundtrip.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map deleted file mode 100644 index 148afc1..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"roundtrip.d.ts","sourceRoot":"","sources":["../src/__tests__/roundtrip.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js deleted file mode 100644 index bc932c5..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js +++ /dev/null @@ -1,275 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map deleted file mode 100644 index 1b36787..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/roundtrip.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,KAA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I,EAAE,gBAAgB;oBACtB,IAAI,EAAE,QAAQ;iBACf;aACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE;YAC/D,cAAc,CACZ,qBAAG,ycAAA,4XAiBF,MACD;gBACE,MAAM,EAAE;oBACN,UAAU,EAAE,MAAM;oBAClB,IAAI,EAAE,gBAAgB;oBACtB,IAAI,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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts deleted file mode 100644 index f110982..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function withWarning(func: Function, regex: RegExp): Promise; -//# sourceMappingURL=writeToStore.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map deleted file mode 100644 index b0a79c2..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js deleted file mode 100644 index 2c40feb..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js +++ /dev/null @@ -1,1523 +0,0 @@ -"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(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/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map b/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map deleted file mode 100644 index ceefa3d..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/__tests__/writeToStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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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;yBACZ;qBACF;iBACF;aACF;YACD,gBAAgB,kBAAA;YAChB,KAAK,OAAA;SACN,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC;YAC/B,+BAA+B,EAAE,SAAS;YAC1C,kBAAkB,EAAE;gBAClB,EAAE,EAAE,aAAa;gBACjB,IAAI,EAAE,KAAK;aACZ;YACD,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP;wBACE,SAAS,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/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js b/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js deleted file mode 100644 index 425a221..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js +++ /dev/null @@ -1,1280 +0,0 @@ -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 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, 1) : (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, 2) : (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 (__typename && 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) { - return this.diffQueryAgainstStore((0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - returnPartialData: false - })).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, - 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(8) : 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(9) : new _tsInvariant.InvariantError("No fragment named " + selection.name.value); - } - } - - var typeCondition = fragment.typeCondition && fragment.typeCondition.name.value; - var match = !typeCondition || 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)((0, _tslib.__assign)({}, fragmentExecResult), { - missing: fragmentExecResult.missing.map(function (info) { - return (0, _tslib.__assign)((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; - 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; - - 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(10) : 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), 11) : (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) { - var id = context.dataIdFromObject(storeObj); - return id && (0, _apolloUtilities.toIdValue)({ - id: id, - 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, 3) : (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), 4) : (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, 5) : (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, 6) : (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)((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)((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)((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)((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; - } - - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config - }) || null; - }; - - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction - }); - this.broadcastWatches(); - }; - - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction, - 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(7) : 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/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map b/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map deleted file mode 100644 index 9cd94a3..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"names":["defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,IAAI,UAAU,GAAG,KAAjB;;AAEA,SAAS,UAAT,GAAmB;AACjB,MAAM,MAAM,GAAG,CAAC,UAAhB;;AAEA,MAAI,CAAC,8BAAL,EAAe;AACb,IAAA,UAAU,GAAG,IAAb;AACD;;AACD,SAAO,MAAP;AACD;;AAKD,IAAA,wBAAA,GAAA,YAAA;AACE,WAAA,wBAAA,GAAA,CAEC;;AAEM,EAAA,wBAAA,CAAA,SAAA,CAAA,WAAA,GAAP,YAAA;AACE,WAAO,OAAO,CAAC,OAAR,EAAP;AACD,GAFM;;AAIA,EAAA,wBAAA,CAAA,SAAA,CAAA,aAAA,GAAP,YAAA;AACE,WAAO,IAAP;AACD,GAFM;;AAIA,EAAA,wBAAA,CAAA,SAAA,CAAA,KAAA,GAAP,UACE,OADF,EAEE,aAFF,EAGE,OAHF,EAG2B;AAEzB,QAAM,GAAG,GAAG,OAAO,CAAC,KAAR,CAAc,GAAd,CAAkB,OAAO,CAAC,EAA1B,CAAZ;AACA,QAAM,WAAW,GAAG,OAAO,CAAC,EAAR,KAAe,YAAnC;;AAEA,QAAI,CAAC,GAAL,EAAU;AAER,aAAO,WAAP;AACD;;AAEO,QAAA,EAAA,GAAA,GAAA,CAAA,UAAA;AAAA,QAAA,UAAA,GAAA,EAAA,KAAA,KAAA,CAAA,GAA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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;AAjRA,C,CAAmC,wB","sourcesContent":["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 // At this point we don't know if this fragment should match or not. It's\n // either:\n //\n // 1. (GOOD) A fragment on a matching interface or union.\n // 2. (BAD) A fragment on a non-matching concrete type or interface or union.\n //\n // If it's 2, we don't want it to match. If it's 1, we want it to match. We\n // can't tell the difference, so we warn the user, but still try to match\n // it (for backwards compatibility reasons). This unfortunately means that\n // using the `HeuristicFragmentMatcher` with unions and interfaces is\n // very unreliable. This will be addressed in a future major version of\n // Apollo Client, but for now the recommendation is to use the\n // `IntrospectionFragmentMatcher` when working with unions/interfaces.\n\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 (\n __typename &&\n implementingTypes &&\n implementingTypes.indexOf(__typename) > -1\n ) {\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 | undefined>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((dataId: string) => 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 | null): 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 | undefined {\n return this.diffQueryAgainstStore({\n ...options,\n returnPartialData: false,\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,\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 =\n fragment.typeCondition && fragment.typeCondition.name.value;\n\n const match =\n !typeCondition ||\n execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n\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[] | undefined;\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[] | undefined;\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 const id = context.dataIdFromObject!(storeObj);\n return id && toIdValue({\n id,\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\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 const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\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,\n previousResult: options.previousResult,\n config: this.config,\n }) || null;\n }\n\n public write(write: Cache.WriteOptions): void {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\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,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\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,\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/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js b/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js deleted file mode 100644 index cd4f04f..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -exports.__esModule=!0,exports.assertIdValue=function(e){(0,a.invariant)((0,r.isIdValue)(e),11)},exports.defaultDataIdFromObject=R,exports.defaultNormalizedCacheFactory=function(e){return new m(e)},exports.enhanceErrorWithDocument=v,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"),i=require("optimism"),a=require("ts-invariant"),n=!1;function o(){var e=!n;return(0,r.isTest)()||(n=!0),e}var s=function(){function e(){}return e.prototype.ensureReady=function(){return Promise.resolve()},e.prototype.canBypassInit=function(){return!0},e.prototype.match=function(e,t,r){var i=r.store.get(e.id),a="ROOT_QUERY"===e.id;if(!i)return a;var n=i.__typename,s=void 0===n?a&&"Query":n;return s&&s===t||(o(),"heuristic")},e}();exports.HeuristicFragmentMatcher=s;var c=function(){function e(e){e&&e.introspectionQueryResultData?(this.possibleTypesMap=this.parseIntrospectionResult(e.introspectionQueryResultData),this.isReady=!0):this.isReady=!1,this.match=this.match.bind(this)}return e.prototype.match=function(e,t,r){(0,a.invariant)(this.isReady,1);var i=r.store.get(e.id),n="ROOT_QUERY"===e.id;if(!i)return n;var o=i.__typename,s=void 0===o?n&&"Query":o;if((0,a.invariant)(s,2),s===t)return!0;var c=this.possibleTypesMap[t];return!!(s&&c&&c.indexOf(s)>-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=c;var u=Object.prototype.hasOwnProperty,l=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=(0,i.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){u.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){u.call(e,r)||t.delete(r)})):Object.keys(this.data).forEach(function(e){t.delete(e)})},e}();function d(e){return new l(e)}var p=function(){function t(e){var t=this,a=void 0===e?{}:e,n=a.cacheKeyRoot,o=void 0===n?new i.KeyTrie(r.canUseWeakMap):n,s=a.freezeResults,c=void 0!==s&&s,u=this.executeStoreQuery,d=this.executeSelectionSet,p=this.executeSubSelectedArray;this.freezeResults=c,this.executeStoreQuery=(0,i.wrap)(function(e){return u.call(t,e)},{makeCacheKey:function(e){var t=e.query,r=e.rootValue,i=e.contextValue,a=e.variableValues,n=e.fragmentMatcher;if(i.store instanceof l)return o.lookup(i.store,t,n,JSON.stringify(a),r.id)}}),this.executeSelectionSet=(0,i.wrap)(function(e){return d.call(t,e)},{makeCacheKey:function(e){var t=e.selectionSet,r=e.rootValue,i=e.execContext;if(i.contextValue.store instanceof l)return o.lookup(i.contextValue.store,t,i.fragmentMatcher,JSON.stringify(i.variableValues),r.id)}}),this.executeSubSelectedArray=(0,i.wrap)(function(e){return p.call(t,e)},{makeCacheKey:function(e){var t=e.field,r=e.array,i=e.execContext;if(i.contextValue.store instanceof l)return o.lookup(i.contextValue.store,t,r,JSON.stringify(i.variableValues))}})}return t.prototype.readQueryFromStore=function(t){return this.diffQueryAgainstStore((0,e.__assign)((0,e.__assign)({},t),{returnPartialData:!1})).result},t.prototype.diffQueryAgainstStore=function(e){var t=e.store,i=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)(i);n=(0,r.assign)({},(0,r.getDefaultValues)(f),n);var h={store:t,dataIdFromObject:p&&p.dataIdFromObject,cacheRedirects:p&&p.cacheRedirects||{}},m=this.executeStoreQuery({query:i,rootValue:{type:"id",id:l,generated:!0,typename:"Query"},contextValue:h,variableValues:n,fragmentMatcher:d}),y=m.missing&&m.missing.length>0;return y&&!c&&m.missing.forEach(function(e){if(!e.tolerable)throw new a.InvariantError(8)}),o&&(0,r.isEqual)(o,m.result)&&(m.result=o),{result:m.result,complete:!y}},t.prototype.executeStoreQuery=function(e){var t=e.query,i=e.rootValue,a=e.contextValue,n=e.variableValues,o=e.fragmentMatcher,s=void 0===o?h:o,c=(0,r.getMainDefinition)(t),u=(0,r.getFragmentDefinitions)(t),l={query:t,fragmentMap:(0,r.createFragmentMap)(u),contextValue:a,variableValues:n,fragmentMatcher:s};return this.executeSelectionSet({selectionSet:c.selectionSet,rootValue:i,execContext:l})},t.prototype.executeSelectionSet=function(t){var i=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 m(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=m(i.executeField(f,h,t,s));void 0!==d&&p.push(((n={})[(0,r.resultKeyNameFromField)(t)]=d,n))}else{var y=void 0;if((0,r.isInlineFragment)(t))y=t;else if(!(y=c[t.name.value]))throw new a.InvariantError(9);var v=y.typeCondition&&y.typeCondition.name.value,g=!v||s.fragmentMatcher(o,v,u);if(g){var S=i.executeSelectionSet({selectionSet:y.selectionSet,rootValue:o,execContext:s});"heuristic"===g&&S.missing&&(S=(0,e.__assign)((0,e.__assign)({},S),{missing:S.missing.map(function(t){return(0,e.__assign)((0,e.__assign)({},t),{tolerable:!0})})})),p.push(m(S))}}}),d.result=(0,r.mergeDeepArray)(p),this.freezeResults,d},t.prototype.executeField=function(e,t,i,a){var n=a.variableValues,o=a.contextValue,s=function(e,t,i,a,n,o){o.resultKey;var s=o.directives,c=i;(a||s)&&(c=(0,r.getStoreKeyName)(c,a,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[i];d&&(u=d(e,a,{getCacheKey:function(e){var t=n.dataIdFromObject(e);return t&&(0,r.toIdValue)({id:t,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,i.name.value,(0,r.argumentsObjectFromField)(i,n),o,{resultKey:(0,r.resultKeyNameFromField)(i),directives:(0,r.getDirectiveInfoFromField)(i,n)});return Array.isArray(s.result)?this.combineExecResults(s,this.executeSubSelectedArray({field:i,array:s.result,execContext:a})):i.selectionSet?null==s.result?s:this.combineExecResults(s,this.executeSelectionSet({selectionSet:i.selectionSet,rootValue:s.result,execContext:a})):(f(i,s.result),this.freezeResults,s)},t.prototype.combineExecResults=function(){for(var e,t=[],r=0;r=0)return!0;r[e].push(t)}else r[e]=[t];return!1}exports.StoreWriter=g;var x={fragmentMatcher:new s,dataIdFromObject:R,addTypename:!0,resultCaching:!0,freezeResults:!1};function R(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 _=Object.prototype.hasOwnProperty,I=function(t){function r(e,r,i){var a=t.call(this,Object.create(null))||this;return a.optimisticId=e,a.parent=r,a.transaction=i,a}return(0,e.__extends)(r,t),r.prototype.toObject=function(){return(0,e.__assign)((0,e.__assign)({},this.parent.toObject()),this.data)},r.prototype.get=function(e){return _.call(this.data,e)?this.data[e]:this.parent.get(e)},r}(m),F=function(t){function n(a){void 0===a&&(a={});var n=t.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new i.KeyTrie(r.canUseWeakMap),n.silenceBroadcast=!1,n.config=(0,e.__assign)((0,e.__assign)({},x),a),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 l:new m,n.optimisticData=n.data,n.storeWriter=new g,n.storeReader=new p({cacheKeyRoot:n.cacheKeyRoot,freezeResults:a.freezeResults});var o=n,s=o.maybeBroadcastWatch;return n.maybeBroadcastWatch=(0,i.wrap)(function(e){return s.call(n,e)},{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return o.data instanceof l?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){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,r=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:r,previousResult:e.previousResult,config:this.config})||null},n.prototype.write=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;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:r}),this.broadcastWatches()},n.prototype.diff=function(e){var t=this.config.fragmentMatcher,r=t&&t.match;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:r,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 a.InvariantError(7)},n.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},n.prototype.removeOptimistic=function(e){for(var t=[],r=0,i=this.optimisticData;i instanceof I;)i.optimisticId===e?++r:t.push(i),i=i.parent;if(r>0){for(this.optimisticData=i;t.length>0;){var a=t.pop();this.performTransaction(a.transaction,a.optimisticId)}this.broadcastWatches()}},n.prototype.performTransaction=function(e,t){var r=this.data,i=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new I(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=i,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=F; diff --git a/JS/node_modules/apollo-cache-inmemory/lib/bundle.esm.js b/JS/node_modules/apollo-cache-inmemory/lib/bundle.esm.js deleted file mode 100644 index 44ee01e..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/bundle.esm.js +++ /dev/null @@ -1,984 +0,0 @@ -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, KeyTrie } from 'optimism'; -import { invariant, InvariantError } from 'ts-invariant'; - -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, 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; - process.env.NODE_ENV === "production" ? invariant(__typename, 2) : invariant(__typename, "Cannot match fragment because __typename property is missing: " + JSON.stringify(obj)); - if (__typename === typeCondition) { - return true; - } - var implementingTypes = this.possibleTypesMap[typeCondition]; - if (__typename && - 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(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(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(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(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) { - return this.diffQueryAgainstStore(__assign(__assign({}, options), { returnPartialData: false })).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, - 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(8) : 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(9) : new InvariantError("No fragment named " + selection.name.value); - } - } - var typeCondition = fragment.typeCondition && fragment.typeCondition.name.value; - var match = !typeCondition || - 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(__assign({}, fragmentExecResult), { missing: fragmentExecResult.missing.map(function (info) { - return __assign(__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; - 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; - 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(10) : 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), 11) : 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) { - var id = context.dataIdFromObject(storeObj); - return id && toIdValue({ - id: id, - 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, 3) : 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), 4) : 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, 5) : 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, 6) : 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(__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(__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(__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(__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(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; - } - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config, - }) || null; - }; - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction, - }); - this.broadcastWatches(); - }; - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction, - 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(7) : 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/JS/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map b/JS/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map deleted file mode 100644 index 98ebab5..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.esm.js","sources":["../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"sourcesContent":["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 // At this point we don't know if this fragment should match or not. It's\n // either:\n //\n // 1. (GOOD) A fragment on a matching interface or union.\n // 2. (BAD) A fragment on a non-matching concrete type or interface or union.\n //\n // If it's 2, we don't want it to match. If it's 1, we want it to match. We\n // can't tell the difference, so we warn the user, but still try to match\n // it (for backwards compatibility reasons). This unfortunately means that\n // using the `HeuristicFragmentMatcher` with unions and interfaces is\n // very unreliable. This will be addressed in a future major version of\n // Apollo Client, but for now the recommendation is to use the\n // `IntrospectionFragmentMatcher` when working with unions/interfaces.\n\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 (\n __typename &&\n implementingTypes &&\n implementingTypes.indexOf(__typename) > -1\n ) {\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 | undefined>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((dataId: string) => 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 | null): 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 | undefined {\n return this.diffQueryAgainstStore({\n ...options,\n returnPartialData: false,\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,\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 =\n fragment.typeCondition && fragment.typeCondition.name.value;\n\n const match =\n !typeCondition ||\n execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n\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[] | undefined;\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[] | undefined;\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 const id = context.dataIdFromObject!(storeObj);\n return id && toIdValue({\n id,\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\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 const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\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,\n previousResult: options.previousResult,\n config: this.config,\n }) || null;\n }\n\n public write(write: Cache.WriteOptions): void {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\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,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\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,\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":["defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;AAUA,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,SAAS,UAAU;IACjB,IAAM,MAAM,GAAG,CAAC,UAAU,CAAC;IAE3B,IAAI,CAAC,MAAM,EAAE,EAAE;QACb,UAAU,GAAG,IAAI,CAAC;KACnB;IACD,OAAO,MAAM,CAAC;CACf;AAKD;IACE;KAEC;IAEM,8CAAW,GAAlB;QACE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;KAC1B;IAEM,gDAAa,GAApB;QACE,OAAO,IAAI,CAAC;KACb;IAEM,wCAAK,GAAZ,UACE,OAAgB,EAChB,aAAqB,EACrB,OAAyB;QAEzB,IAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1C,IAAM,WAAW,GAAG,OAAO,CAAC,EAAE,KAAK,YAAY,CAAC;QAEhD,IAAI,CAAC,GAAG,EAAE;YAER,OAAO,WAAW,CAAC;SACpB;QAEO,IAAA,mBAAmC,EAAnC,wDAAmC,CAAS;QAEpD,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,UAAU,EAAE,EAAE;gBAChB;gBAIA,uDAC0C;gBAI1C;oBAEI,+GAA+G,CAClH,CAAC;aACH;YAED,OAAO,WAAW,CAAC;SACpB;QAED,IAAI,UAAU,KAAK,aAAa,EAAE;YAChC,OAAO,IAAI,CAAC;SACb;QAgBD,IAAI,UAAU,EAAE,EAAE;YAChB;gBAEI,sEAAsE;gBACtE,oEAAoE;gBACpE,+DAA+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AE;gBACX,MAAM,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;gBACzC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;gBAIjD,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;aAChD;YACD,OAAO,MAAM,CAAC;SACf;QACD,OAAO,QAAQ,CAAC;KACjB;IAES,wCAAgB,GAA1B;QAAA,iBAIC;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;CAjRD,CAAmC,WAAW;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/bundle.umd.js b/JS/node_modules/apollo-cache-inmemory/lib/bundle.umd.js deleted file mode 100644 index a25e9e0..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/bundle.umd.js +++ /dev/null @@ -1,1284 +0,0 @@ -(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; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : 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 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, 1) : (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, 2) : (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 (__typename && 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) { - return this.diffQueryAgainstStore((0, _tslib.__assign)((0, _tslib.__assign)({}, options), { - returnPartialData: false - })).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, - 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(8) : 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(9) : new _tsInvariant.InvariantError("No fragment named " + selection.name.value); - } - } - - var typeCondition = fragment.typeCondition && fragment.typeCondition.name.value; - var match = !typeCondition || 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)((0, _tslib.__assign)({}, fragmentExecResult), { - missing: fragmentExecResult.missing.map(function (info) { - return (0, _tslib.__assign)((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; - 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; - - 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(10) : 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), 11) : (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) { - var id = context.dataIdFromObject(storeObj); - return id && (0, _apolloUtilities.toIdValue)({ - id: id, - 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, 3) : (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), 4) : (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, 5) : (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, 6) : (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)((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)((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)((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)((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; - } - - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config - }) || null; - }; - - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction - }); - this.broadcastWatches(); - }; - - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction, - 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(7) : 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/JS/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map b/JS/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map deleted file mode 100644 index 867e016..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/fragmentMatcher.ts","../src/depTrackingCache.ts","../src/readFromStore.ts","../src/objectCache.ts","../src/writeToStore.ts","../src/inMemoryCache.ts"],"names":["defaultNormalizedCacheFactory","hasOwn"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,MAAI,UAAU,GAAG,KAAjB;;AAEA,WAAS,UAAT,GAAmB;AACjB,QAAM,MAAM,GAAG,CAAC,UAAhB;;AAEA,QAAI,CAAC,8BAAL,EAAe;AACb,MAAA,UAAU,GAAG,IAAb;AACD;;AACD,WAAO,MAAP;AACD;;AAKD,MAAA,wBAAA,GAAA,YAAA;AACE,aAAA,wBAAA,GAAA,CAEC;;AAEM,IAAA,wBAAA,CAAA,SAAA,CAAA,WAAA,GAAP,YAAA;AACE,aAAO,OAAO,CAAC,OAAR,EAAP;AACD,KAFM;;AAI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AAM,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;AAjRA,G,CAAmC,wB","sourcesContent":["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 // At this point we don't know if this fragment should match or not. It's\n // either:\n //\n // 1. (GOOD) A fragment on a matching interface or union.\n // 2. (BAD) A fragment on a non-matching concrete type or interface or union.\n //\n // If it's 2, we don't want it to match. If it's 1, we want it to match. We\n // can't tell the difference, so we warn the user, but still try to match\n // it (for backwards compatibility reasons). This unfortunately means that\n // using the `HeuristicFragmentMatcher` with unions and interfaces is\n // very unreliable. This will be addressed in a future major version of\n // Apollo Client, but for now the recommendation is to use the\n // `IntrospectionFragmentMatcher` when working with unions/interfaces.\n\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 (\n __typename &&\n implementingTypes &&\n implementingTypes.indexOf(__typename) > -1\n ) {\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 | undefined>;\n\n constructor(private data: NormalizedCacheObject = Object.create(null)) {\n this.depend = wrap((dataId: string) => 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 | null): 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 | undefined {\n return this.diffQueryAgainstStore({\n ...options,\n returnPartialData: false,\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,\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 =\n fragment.typeCondition && fragment.typeCondition.name.value;\n\n const match =\n !typeCondition ||\n execContext.fragmentMatcher(rootValue, typeCondition, contextValue);\n\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[] | undefined;\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[] | undefined;\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 const id = context.dataIdFromObject!(storeObj);\n return id && toIdValue({\n id,\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\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 const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\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,\n previousResult: options.previousResult,\n config: this.config,\n }) || null;\n }\n\n public write(write: Cache.WriteOptions): void {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\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,\n });\n\n this.broadcastWatches();\n }\n\n public diff(query: Cache.DiffOptions): Cache.DiffResult {\n const { fragmentMatcher } = this.config;\n const fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match;\n\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,\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/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts deleted file mode 100644 index a4e74af..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -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 | null): void; -} -export declare function defaultNormalizedCacheFactory(seed?: NormalizedCacheObject): NormalizedCache; -//# sourceMappingURL=depTrackingCache.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map deleted file mode 100644 index 0a63627..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAA+D;gBAEzD,IAAI,GAAE,qBAA2C;IAS9D,QAAQ,IAAI,qBAAqB;IAIjC,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAKhC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW;IAQvC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO5B,KAAK,IAAI,IAAI;IAIb,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI;CAgB5D;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,CAAC,EAAE,qBAAqB,GAC3B,eAAe,CAEjB"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js b/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js deleted file mode 100644 index c4441aa..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js +++ /dev/null @@ -1,65 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map deleted file mode 100644 index 032dd21..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/depTrackingCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,iBAOC;QAPmB,qBAAA,EAAA,OAA8B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAAjD,SAAI,GAAJ,IAAI,CAA6C;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AG,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAA,MAAM;gBACnC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;oBACjC,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;iBACrB;YACH,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAA,MAAM;gBACnC,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AA1DD,IA0DC;AA1DY,4CAAgB;AA4D7B,SAAgB,6BAA6B,CAC3C,IAA4B;IAE5B,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAJD,sEAIC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts deleted file mode 100644 index ae059bd..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=fixPolyfills.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map deleted file mode 100644 index 3a65eb4..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js b/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js deleted file mode 100644 index 4a686ea..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js +++ /dev/null @@ -1,49 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map b/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map deleted file mode 100644 index b5c3035..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fixPolyfills.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,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AAI,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/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts deleted file mode 100644 index acf3558..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -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/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map deleted file mode 100644 index 40a4f02..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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;CA6DzB;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;IAwC3B,OAAO,CAAC,wBAAwB;CAajC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js deleted file mode 100644 index e3152ca..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js +++ /dev/null @@ -1,96 +0,0 @@ -"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 (__typename && - 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/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map deleted file mode 100644 index f6e4c0b..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcher.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAAC;IAEM,wCAAK,GAAZ,UACE,OAAgB,EAChB,aAAqB,EACrB,OAAyB;QAEzB,IAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1C,IAAM,WAAW,GAAG,OAAO,CAAC,EAAE,KAAK,YAAY,CAAC;QAEhD,IAAI,CAAC,GAAG,EAAE;YAER,OAAO,WAAW,CAAC;SACpB;QAEO,IAAA,mBAAmC,EAAnC,wDAAmC,CAAS;QAEpD,IAAI,CAAC,UAAU,EAAE;YACf,IAAI,UAAU,EAAE,EAAE;gBAChB,wBAAS,CAAC,IAAI,CAAC,kVAGY,CAAC,CAAC;gBAC7B,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UAAU,EACV,mEAAiE,IAAI,CAAC,SAAS,CAC7E,GAAG,CACF,CACJ,CAAC;QAEF,IAAI,UAAU,KAAK,aAAa,EAAE;YAChC,OAAO,IAAI,CAAC;SACb;QAED,IAAM,iBAAiB,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC/D,IACE,UAAU;YACV,iBAAiB;YACjB,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAC1C;YACA,OAAO,IAAI,CAAC;SACb;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,+DAAwB,GAAhC,UACE,uBAAgD;QAEhD,IAAM,OAAO,GAAqB,EAAE,CAAC;QACrC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,UAAA,IAAI;YACjD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE;gBACtD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CACzC,UAAA,gBAAgB,IAAI,OAAA,gBAAgB,CAAC,IAAI,EAArB,CAAqB,CAC1C,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,mCAAC;AAAD,CAAC,AA3ED,IA2EC;AA3EY,oEAA4B"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts deleted file mode 100644 index 08f2dbd..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const query: any; -export default query; -//# sourceMappingURL=fragmentMatcherIntrospectionQuery.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map deleted file mode 100644 index 58ba5cd..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js deleted file mode 100644 index c591b41..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js +++ /dev/null @@ -1,99 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map b/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map deleted file mode 100644 index d64dd3a..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/fragmentMatcherIntrospectionQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;wBACD,SAAS,EAAE,EAAE;wBACb,UAAU,EAAE,EAAE;wBACd,YAAY,EAAE;4BACZ,IAAI,EAAE,cAAc;4BACpB,UAAU,EAAE;gCACV;oCACE,IAAI,EAAE,OAAO;oCACb,KAAK,EAAE,IAAI;oCACX,IAAI,EAAE;wCACJ,IAAI,EAAE,MAAM;wCACZ,KAAK,EAAE,OAAO;qCACf;oCACD,SAAS,EAAE,EAAE;oCACb,UAAU,EAAE,EAAE;oCACd,YAAY,EAAE;wCACZ,IAAI,EAAE,cAAc;wCACpB,UAAU,EAAE;4CACV;gDACE,IAAI,EAAE,OAAO;gDACb,KAAK,EAAE,IAAI;gDACX,IAAI,EAAE;oDACJ,IAAI,EAAE,MAAM;oDACZ,KAAK,EAAE,MAAM;iDACd;gDACD,SAAS,EAAE,EAAE;gDACb,UAAU,EAAE,EAAE;gDACd,YAAY,EAAE,IAAI;6CACnB;4CACD;gDACE,IAAI,EAAE,OAAO;gDACb,KAAK,EAAE,IAAI;gDACX,IAAI,EAAE;oDACJ,IAAI,EAAE,MAAM;oDACZ,KAAK,EAAE,MAAM;iDACd;gDACD,SAAS,EAAE,EAAE;gDACb,UAAU,EAAE,EAAE;gDACd,YAAY,EAAE,IAAI;6CACnB;4CACD;gDACE,IAAI,EAAE,OAAO;gDACb,KAAK,EAAE,IAAI;gDACX,IAAI,EAAE;oDACJ,IAAI,EAAE,MAAM;oDACZ,KAAK,EAAE,eAAe;iDACvB;gDACD,SAAS,EAAE,EAAE;gDACb,UAAU,EAAE,EAAE;gDACd,YAAY,EAAE;oDACZ,IAAI,EAAE,cAAc;oDACpB,UAAU,EAAE;wDACV;4DACE,IAAI,EAAE,OAAO;4DACb,KAAK,EAAE,IAAI;4DACX,IAAI,EAAE;gEACJ,IAAI,EAAE,MAAM;gEACZ,KAAK,EAAE,MAAM;6DACd;4DACD,SAAS,EAAE,EAAE;4DACb,UAAU,EAAE,EAAE;4DACd,YAAY,EAAE,IAAI;yDACnB;qDACF;iDACF;6CACF;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/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts deleted file mode 100644 index 9702c1d..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -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/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map deleted file mode 100644 index 13bbabe..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"inMemoryCache.d.ts","sourceRoot":"","sources":["src/inMemoryCache.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAA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AC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,IAAI;IAoB7C,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,IAAI;IAiBtC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAetD,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/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js b/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js deleted file mode 100644 index 06bf62d..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js +++ /dev/null @@ -1,239 +0,0 @@ -"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(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(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; - } - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - return this.storeReader.readQueryFromStore({ - store: options.optimistic ? this.optimisticData : this.data, - query: this.transformDocument(options.query), - variables: options.variables, - rootId: options.rootId, - fragmentMatcherFunction: fragmentMatcherFunction, - previousResult: options.previousResult, - config: this.config, - }) || null; - }; - InMemoryCache.prototype.write = function (write) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction, - }); - this.broadcastWatches(); - }; - InMemoryCache.prototype.diff = function (query) { - var fragmentMatcher = this.config.fragmentMatcher; - var fragmentMatcherFunction = fragmentMatcher && fragmentMatcher.match; - 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: fragmentMatcherFunction, - 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/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map deleted file mode 100644 index 5463f8a..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/inMemoryCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QACD,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE;YAC5B,OAAU,MAAM,CAAC,UAAU,SAAI,MAAM,CAAC,G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,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;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAjRD,CAAmC,0BAAW,GAiR7C;AAjRY,sCAAa"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/index.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/index.d.ts deleted file mode 100644 index eb6e7fa..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -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/JS/node_modules/apollo-cache-inmemory/lib/index.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/index.d.ts.map deleted file mode 100644 index 111c29e..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/index.js b/JS/node_modules/apollo-cache-inmemory/lib/index.js deleted file mode 100644 index a434394..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/index.js +++ /dev/null @@ -1,11 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/index.js.map b/JS/node_modules/apollo-cache-inmemory/lib/index.js.map deleted file mode 100644 index 96285b2..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts deleted file mode 100644 index 24fe078..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -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/JS/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map deleted file mode 100644 index 26b6170..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/mapCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAAuC;gBAExC,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/JS/node_modules/apollo-cache-inmemory/lib/mapCache.js b/JS/node_modules/apollo-cache-inmemory/lib/mapCache.js deleted file mode 100644 index f3f870e..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/mapCache.js +++ /dev/null @@ -1,42 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/mapCache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/mapCache.js.map deleted file mode 100644 index 7bc739f..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/mapCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAAE,CAAC;IACtC,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/JS/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts deleted file mode 100644 index 2d5e611..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -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/JS/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map deleted file mode 100644 index 5219ce7..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/objectCache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAIR,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/JS/node_modules/apollo-cache-inmemory/lib/objectCache.js b/JS/node_modules/apollo-cache-inmemory/lib/objectCache.js deleted file mode 100644 index f55bac8..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/objectCache.js +++ /dev/null @@ -1,33 +0,0 @@ -"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/JS/node_modules/apollo-cache-inmemory/lib/objectCache.js.map b/JS/node_modules/apollo-cache-inmemory/lib/objectCache.js.map deleted file mode 100644 index a42e368..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/objectCache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;IAEM,yBAAG,GAAV,UAAW,MAAc;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAE,CAAC;IAC5B,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,AA1BD,IA0BC;AA1BY,kCAAW;AA4BxB,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/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts deleted file mode 100644 index 896e962..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -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 | undefined; - 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/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map deleted file mode 100644 index d5e7003..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readFromStore.d.ts","sourceRoot":"","sources":["src/readFromStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,OAAO,EAYR,MAAM,kBAAkB,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AmB;IA+F3B,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/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.js b/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.js deleted file mode 100644 index da669e8..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.js +++ /dev/null @@ -1,318 +0,0 @@ -"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) { - return this.diffQueryAgainstStore(tslib_1.__assign(tslib_1.__assign({}, options), { returnPartialData: false })).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, - 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 && fragment.typeCondition.name.value; - var match = !typeCondition || - 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(tslib_1.__assign({}, fragmentExecResult), { missing: fragmentExecResult.missing.map(function (info) { - return tslib_1.__assign(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; - 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; - 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) { - var id = context.dataIdFromObject(storeObj); - return id && apollo_utilities_1.toIdValue({ - id: id, - 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/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map b/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map deleted file mode 100644 index 6910ead..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/readFromStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readFromStore.js","sourceRoot":"","sources":["../src/readFromStore.ts"],"names":[],"mappings":";;;AAAA,qDAyB0B;AAmB1B,qCAAyC;AACzC,uDAAsD;AACtD,6CAAyD;AA6DzD;IAGE,qBAAY,EAGa;QAHzB,iBAuEC;YAvEW,4BAGa,EAFvB,oBAAiD,EAAjD,4FAAiD,EACjD,qBAAqB,EAArB,0CAAqB;QAEf,IAAA,SAIE,EAHN,wCAAiB,EACjB,4CAAmB,EACnB,oDACM,CAAC;QAET,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,IAAI,CAAC,iBAAiB,GAAG,eAAI,CAAC,UAAC,OAA8B;YAC3D,OAAO,iBAAiB,CAAC,IAAI,CAAC,KAAI,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC,EAAE;YACD,YAAY,EAAZ,UAAa,EAMW;oBALtB,gBAAK,EACL,wBAAS,EACT,8BAAY,EACZ,kCAAc,EACd,oCAAe;gBAKf,IAAI,YAAY,CAAC,KAAK,YAAY,mCAAgB,EAAE;oBAClD,OAAO,YAAY,CAAC,MAAM,CACxB,YAAY,CAAC,KAAK,EAClB,KAAK,EACL,eAAe,EACf,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAC9B,SAAS,CAAC,EAAE,CACb,CAAC;iBACH;YACH,CAAC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,mBAAmB,GAAG,eAAI,CAAC,UAAC,OAAgC;YAC/D,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAI,EAAE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AAA;gCACF,QAAQ,EAAE,QAAQ,CAAC,UAAU;6BAC9B,CAAC,CAAC;wBACL,CAAC;qBACF,CAAC,CAAC;iBACJ;aACF;SACF;KACF;IAED,IAAI,OAAO,UAAU,KAAK,WAAW,EAAE;QACrC,OAAO;YACL,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,CAAC;oBACR,MAAM,QAAA;oBACN,SAAS,EAAE,YAAY;oBACvB,SAAS,EAAE,KAAK;iBACjB,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/JS/node_modules/apollo-cache-inmemory/lib/types.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/types.d.ts deleted file mode 100644 index dbef3cc..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/types.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -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 | undefined; -} -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/JS/node_modules/apollo-cache-inmemory/lib/types.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/types.d.ts.map deleted file mode 100644 index 8846892..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,G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types.js deleted file mode 100644 index 11e638d..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/types.js.map b/JS/node_modules/apollo-cache-inmemory/lib/types.js.map deleted file mode 100644 index c768b79..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts b/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts deleted file mode 100644 index a67c325..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -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/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map b/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map deleted file mode 100644 index 6a82131..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"writeToStore.d.ts","sourceRoot":"","sources":["src/writeToStore.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,YAAY,EAGb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAGL,WAAW,EAeZ,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EACL,QAAQ,EACR,eAAe,EAGhB,MAAM,SAAS,CAAC;AAEjB,qBAAa,UAAW,SAAQ,KAAK;IAC5B,IAAI,SAAgB;CAC5B;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,cAQ5E;AAED,oBAAY,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAAA;KAAE,CAAC;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,CAAC;IACzB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,eAAe,CAAC;CACpD,CAAC;AAEF,qBAAa,WAAW;IAkBf,iBAAiB,CAAC,EACvB,KAAK,EACL,MAAM,EACN,KAAuC,EACvC,SAAS,EACT,gBAAgB,EAChB,uBAAuB,GACxB,EAAE;QACD,KAAK,EAAE,YAAY,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,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;IAYZ,kBAAkB,CAAC,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/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.js b/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.js deleted file mode 100644 index 5ec2a42..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.js +++ /dev/null @@ -1,276 +0,0 @@ -"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(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(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/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map b/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map deleted file mode 100644 index b592a9c..0000000 --- a/JS/node_modules/apollo-cache-inmemory/lib/writeToStore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"writeToStore.js","sourceRoot":"","sources":["../src/writeToStore.ts"],"names":[],"mappings":";;;AASA,qDAkB0B;AAE1B,6CAAyC;AAEzC,6CAA4C;AAC5C,uDAAmE;AASnE;IAAgC,sCAAK;IAArC;QAAA,qEAEC;QADQ,UAAI,GAAG,YAAY,CAAC;;IAC7B,CAAC;IAAD,iBAAC;AAAD,CAAC,AAFD,CAAgC,KAAK,GAEpC;AAFY,gCAAU;AAIvB,SAAgB,wBAAwB,CAAC,KAAY,EAAE,QAAsB;IAE3E,IAAM,aAAa,GAAG,IAAI,UAAU,CAClC,gDAA8C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAG,CACzE,CAAC;IACF,aAAa,CAAC,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC;IAC9C,aAAa,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAClC,OAAO,aAAa,CAAC;AACvB,CAAC;AARD,4DAQC;AAWD;IAAA;IAoYA,CAAC;IAlXQ,uCAAiB,GAAxB,UAAyB,EAcxB;YAbC,gBAAK,EACL,kBAAM,EACN,aAAuC,EAAvC,+EAAuC,EACvC,wBAAS,EACT,sCAAgB,EAChB,oDAAuB;QASvB,OAAO,IAAI,CAAC,kBAAkB,CAAC;YAC7B,MAAM,EAAE,YAAY;YACpB,MAAM,QAAA;YACN,QAAQ,EAAE,KAAK;YACf,KAAK,OAAA;YACL,SAAS,WAAA;YACT,gBAAgB,kBAAA;YAChB,uBAAuB,yBAAA;SACxB,CAAC,CAAC;IACL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,CAAC,aAAa,EAAE;QAClB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;QACzB,IAAI,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAC7C,OAAO,IAAI,CAAC;SACb;aAAM;YACL,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnC;KACF;SAAM;QACL,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACjC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache-inmemory/package.json b/JS/node_modules/apollo-cache-inmemory/package.json deleted file mode 100644 index 82cf0c2..0000000 --- a/JS/node_modules/apollo-cache-inmemory/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "apollo-cache-inmemory", - "version": "1.6.6", - "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": "npx 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.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "gitHead": "d22394c419ff7d678afb5e7d4cd1df16ed803ead" -} diff --git a/JS/node_modules/apollo-cache/CHANGELOG.md b/JS/node_modules/apollo-cache/CHANGELOG.md deleted file mode 100644 index c9adb0e..0000000 --- a/JS/node_modules/apollo-cache/CHANGELOG.md +++ /dev/null @@ -1,72 +0,0 @@ -# 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/JS/node_modules/apollo-cache/LICENSE b/JS/node_modules/apollo-cache/LICENSE deleted file mode 100644 index 278ee9d..0000000 --- a/JS/node_modules/apollo-cache/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -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/JS/node_modules/apollo-cache/jest.config.js b/JS/node_modules/apollo-cache/jest.config.js deleted file mode 100644 index 48f0a89..0000000 --- a/JS/node_modules/apollo-cache/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../config/jest.config.settings'), -}; diff --git a/JS/node_modules/apollo-cache/lib/bundle.cjs.js b/JS/node_modules/apollo-cache/lib/bundle.cjs.js deleted file mode 100644 index 25b0a4e..0000000 --- a/JS/node_modules/apollo-cache/lib/bundle.cjs.js +++ /dev/null @@ -1,194 +0,0 @@ -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/JS/node_modules/apollo-cache/lib/bundle.cjs.js.map b/JS/node_modules/apollo-cache/lib/bundle.cjs.js.map deleted file mode 100644 index dee6b94..0000000 --- a/JS/node_modules/apollo-cache/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;A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Ae;AAC9B,UAAA,MAAM,EAAE,EADsB;AAE9B,UAAA,UAAU,EAAE,KAFkB;AAG9B,UAAA,KAAK,EAAE;AAHuB,SAAf,CAAjB;AAKD,OAND,CAME,OAAO,CAAP,EAAU,CAEX;;AAGD,UAAM,UAAU,GACb,cAAc,IAAI,cAAc,CAAC,UAAlC,IAAiD,cADnD;;AAIA,UAAM,WAAW,GAAG,MAAM,CAAC,MAAP,CAAc;AAAE,QAAA,UAAU,EAAA;AAAZ,OAAd,EAA8B,IAA9B,CAApB;AAEA,WAAK,aAAL,CAAmB;AACjB,QAAA,EAAE,EAAA,EADe;AAEjB,QAAA,QAAQ,EAAE,gBAAgB,CAAC,WAAD,EAAc,UAAd,CAFT;AAGjB,QAAA,IAAI,EAAE;AAHW,OAAnB;AAKD,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/JS/node_modules/apollo-cache/lib/bundle.cjs.min.js b/JS/node_modules/apollo-cache/lib/bundle.cjs.min.js deleted file mode 100644 index 5b9e384..0000000 --- a/JS/node_modules/apollo-cache/lib/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -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/JS/node_modules/apollo-cache/lib/bundle.esm.js b/JS/node_modules/apollo-cache/lib/bundle.esm.js deleted file mode 100644 index 7f3e30e..0000000 --- a/JS/node_modules/apollo-cache/lib/bundle.esm.js +++ /dev/null @@ -1,175 +0,0 @@ -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/JS/node_modules/apollo-cache/lib/bundle.esm.js.map b/JS/node_modules/apollo-cache/lib/bundle.esm.js.map deleted file mode 100644 index 04ac58c..0000000 --- a/JS/node_modules/apollo-cache/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;Q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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/JS/node_modules/apollo-cache/lib/bundle.umd.js b/JS/node_modules/apollo-cache/lib/bundle.umd.js deleted file mode 100644 index 0edf921..0000000 --- a/JS/node_modules/apollo-cache/lib/bundle.umd.js +++ /dev/null @@ -1,208 +0,0 @@ -(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; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : 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/JS/node_modules/apollo-cache/lib/bundle.umd.js.map b/JS/node_modules/apollo-cache/lib/bundle.umd.js.map deleted file mode 100644 index ce6fdb0..0000000 --- a/JS/node_modules/apollo-cache/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;AAElC,MAAA,SAAS,EAAE,OAFuB;AAGlC,MAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,MADF;AAEJ,QAAA,KAAK,EAAE;AAFH,OAH4B;AAOlC,MAAA,YAAY,EAAE,mBAAmB,CAAC,GAAD;AAPC,KAApC;AAUA,QAAM,GAAG,GAAiB;AACxB,MAAA,IAAI,EAAE,UADkB;AAExB,MAAA,WAAW,EAAE,CAAC,EAAD;AAFW,KAA1B;AAKA,WAAO,GAAP;AACD;;AAED,WAAgB,gBAAhB,CAAiC,GAAjC,EAA2C,QAA3C,EAA4D;AAC1D,QAAM,IAAI,GAA2B;AACnC,MAAA,IAAI,EAAE,oBAD6B;AAEnC,MAAA,aAAa,EAAE;AACb,QAAA,IAAI,EAAE,WADO;AAEb,QAAA,IAAI,EAAE;AACJ,UAAA,IAAI,EAAE,MADF;AAEJ,UAAA,KAAK,EAAE,QAAQ,IAAI;AAFf;AAFO,OAFoB;AASnC,MAAA,IAAI,EAAE;AACJ,QAAA,IAAI,EAAE,MADF;A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M,UAAU,GACb,cAAc,IAAI,cAAc,CAAC,UAAlC,IAAiD,cADnD;;AAIA,YAAM,WAAW,GAAG,MAAM,CAAC,MAAP,CAAc;AAAE,UAAA,UAAU,EAAA;AAAZ,SAAd,EAA8B,IAA9B,CAApB;AAEA,aAAK,aAAL,CAAmB;AACjB,UAAA,EAAE,EAAA,EADe;AAEjB,UAAA,QAAQ,EAAE,gBAAgB,CAAC,WAAD,EAAc,UAAd,CAFT;AAGjB,UAAA,IAAI,EAAE;AAHW,SAAnB;AAKD,OA5BD,MA4BO;AACL,aAAK,UAAL,CAAgB;AAAE,UAAA,KAAK,EAAE,aAAa,CAAC,IAAD,CAAtB;AAA8B,UAAA,IAAI,EAAA;AAAlC,SAAhB;AACD;AACF,KAnCM;;AAoCT,WAAA,WAAA;AAAC,G;;;MCnJgB,K;;;AAAjB,GAAA,UAAiB,KAAjB,EAAsB,CAqCrB,CArCD,EAAiB,KAAK,sBAAL,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/JS/node_modules/apollo-cache/lib/cache.d.ts b/JS/node_modules/apollo-cache/lib/cache.d.ts deleted file mode 100644 index 7d2c3c3..0000000 --- a/JS/node_modules/apollo-cache/lib/cache.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -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/JS/node_modules/apollo-cache/lib/cache.d.ts.map b/JS/node_modules/apollo-cache/lib/cache.d.ts.map deleted file mode 100644 index 45ce125..0000000 --- a/JS/node_modules/apollo-cache/lib/cache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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;AAG3C,oBAAY,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAEzD,8BAAsB,WAAW,CAAC,WAAW,CAAE,YAAW,SAAS;aAGjD,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,GAAG,EACtC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,UAAU,CAAC,GACnC,CAAC,GAAG,IAAI;aACK,KAAK,CAAC,OAAO,GAAG,GAAG,EAAE,UAAU,GAAG,GAAG,EACnD,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,GAC7C,IAAI;aACS,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;aACtD,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,IAAI;aAC5C,KAAK,CAAC,UAAU,GAAG,G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,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,IAAI;CAiCxC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache/lib/cache.js b/JS/node_modules/apollo-cache/lib/cache.js deleted file mode 100644 index aec0779..0000000 --- a/JS/node_modules/apollo-cache/lib/cache.js +++ /dev/null @@ -1,75 +0,0 @@ -"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/JS/node_modules/apollo-cache/lib/cache.js.map b/JS/node_modules/apollo-cache/lib/cache.js.map deleted file mode 100644 index 348c78f..0000000 --- a/JS/node_modules/apollo-cache/lib/cache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,OAAO,CAAC,SAAS;YAC5B,UAAU,YAAA;SACX,CAAC,CAAC;IACL,CAAC;IAEM,kCAAY,GAAnB,UACE,OAAuC,EACvC,UAA2B;QAA3B,2BAAA,EAAA,kBAA2B;QAE3B,OAAO,IAAI,CAAC,IAAI,CAAC;YACf,KAAK,EAAE,2CAAwB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC;YACvE,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,MAAM,EAAE,OAAO,CAAC,EAAE;YAClB,UAAU,YAAA;SACX,CAAC,CAAC;IACL,CAAC;IAEM,gCAAU,GAAjB,UACE,OAAmD;QAEnD,IAAI,CAAC,KAAK,CAAC;YACT,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE,OAAO,CAAC,IAAI;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAC,CAAC;IACL,CAAC;IAEM,mCAAa,GAApB,UACE,OAAsD;QAEtD,IAAI,CAAC,KAAK,CAAC;YACT,MAAM,EAAE,OAAO,CAAC,EAAE;YAClB,MAAM,EAAE,OAAO,CAAC,IAAI;YACpB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,KAAK,EAAE,2CAAwB,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC;SACxE,CAAC,CAAC;IACL,CAAC;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,yBAAiB;iBACzB,CAAC,CAAC;aACJ;YAAC,OAAO,CAAC,EAAE;aAEX;YAGD,IAAM,UAAU,GACd,CAAC,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/JS/node_modules/apollo-cache/lib/index.d.ts b/JS/node_modules/apollo-cache/lib/index.d.ts deleted file mode 100644 index 492af37..0000000 --- a/JS/node_modules/apollo-cache/lib/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './cache'; -export * from './types'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache/lib/index.d.ts.map b/JS/node_modules/apollo-cache/lib/index.d.ts.map deleted file mode 100644 index bc24545..0000000 --- a/JS/node_modules/apollo-cache/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache/lib/index.js b/JS/node_modules/apollo-cache/lib/index.js deleted file mode 100644 index decd22a..0000000 --- a/JS/node_modules/apollo-cache/lib/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"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/JS/node_modules/apollo-cache/lib/index.js.map b/JS/node_modules/apollo-cache/lib/index.js.map deleted file mode 100644 index a385466..0000000 --- a/JS/node_modules/apollo-cache/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache/lib/types/Cache.d.ts b/JS/node_modules/apollo-cache/lib/types/Cache.d.ts deleted file mode 100644 index f73aeb1..0000000 --- a/JS/node_modules/apollo-cache/lib/types/Cache.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -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/JS/node_modules/apollo-cache/lib/types/Cache.d.ts.map b/JS/node_modules/apollo-cache/lib/types/Cache.d.ts.map deleted file mode 100644 index aa4f617..0000000 --- a/JS/node_modules/apollo-cache/lib/types/Cache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache/lib/types/Cache.js b/JS/node_modules/apollo-cache/lib/types/Cache.js deleted file mode 100644 index a2cebe5..0000000 --- a/JS/node_modules/apollo-cache/lib/types/Cache.js +++ /dev/null @@ -1,6 +0,0 @@ -"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/JS/node_modules/apollo-cache/lib/types/Cache.js.map b/JS/node_modules/apollo-cache/lib/types/Cache.js.map deleted file mode 100644 index f92c62a..0000000 --- a/JS/node_modules/apollo-cache/lib/types/Cache.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache/lib/types/DataProxy.d.ts b/JS/node_modules/apollo-cache/lib/types/DataProxy.d.ts deleted file mode 100644 index 992df92..0000000 --- a/JS/node_modules/apollo-cache/lib/types/DataProxy.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -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/JS/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map b/JS/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map deleted file mode 100644 index 81d0ffc..0000000 --- a/JS/node_modules/apollo-cache/lib/types/DataProxy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataProxy.d.ts","sourceRoot":"","sources":["../src/types/DataProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,yBAAiB,SAAS,CAAC;IACzB,UAAiB,KAAK,CAAC,UAAU;QAM/B,KAAK,EAAE,YAAY,CAAC;QAKpB,SAAS,CAAC,EAAE,UAAU,CAAC;KACxB;IAED,UAAiB,QAAQ,CAAC,UAAU;QAMlC,EAAE,EAAE,MAAM,CAAC;QAQX,QAAQ,EAAE,YAAY,CAAC;QAOvB,YAAY,CAAC,EAAE,MAAM,CAAC;QAKtB,SAAS,CAAC,EAAE,UAAU,CAAC;KAC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1E"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache/lib/types/DataProxy.js b/JS/node_modules/apollo-cache/lib/types/DataProxy.js deleted file mode 100644 index e64cb3d..0000000 --- a/JS/node_modules/apollo-cache/lib/types/DataProxy.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=DataProxy.js.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache/lib/types/DataProxy.js.map b/JS/node_modules/apollo-cache/lib/types/DataProxy.js.map deleted file mode 100644 index 6975675..0000000 --- a/JS/node_modules/apollo-cache/lib/types/DataProxy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataProxy.js","sourceRoot":"","sources":["../../src/types/DataProxy.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache/lib/types/index.d.ts b/JS/node_modules/apollo-cache/lib/types/index.d.ts deleted file mode 100644 index ed0f027..0000000 --- a/JS/node_modules/apollo-cache/lib/types/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './DataProxy'; -export * from './Cache'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-cache/lib/types/index.d.ts.map b/JS/node_modules/apollo-cache/lib/types/index.d.ts.map deleted file mode 100644 index 856e64b..0000000 --- a/JS/node_modules/apollo-cache/lib/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache/lib/types/index.js b/JS/node_modules/apollo-cache/lib/types/index.js deleted file mode 100644 index 83309fe..0000000 --- a/JS/node_modules/apollo-cache/lib/types/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"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/JS/node_modules/apollo-cache/lib/types/index.js.map b/JS/node_modules/apollo-cache/lib/types/index.js.map deleted file mode 100644 index 3b77f7b..0000000 --- a/JS/node_modules/apollo-cache/lib/types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AACA,kDAAwB"} \ No newline at end of file diff --git a/JS/node_modules/apollo-cache/lib/utils.d.ts b/JS/node_modules/apollo-cache/lib/utils.d.ts deleted file mode 100644 index f107b48..0000000 --- a/JS/node_modules/apollo-cache/lib/utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -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/JS/node_modules/apollo-cache/lib/utils.d.ts.map b/JS/node_modules/apollo-cache/lib/utils.d.ts.map deleted file mode 100644 index f673d7a..0000000 --- a/JS/node_modules/apollo-cache/lib/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-cache/lib/utils.js b/JS/node_modules/apollo-cache/lib/utils.js deleted file mode 100644 index 289e518..0000000 --- a/JS/node_modules/apollo-cache/lib/utils.js +++ /dev/null @@ -1,101 +0,0 @@ -"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/JS/node_modules/apollo-cache/lib/utils.js.map b/JS/node_modules/apollo-cache/lib/utils.js.map deleted file mode 100644 index 465f502..0000000 --- a/JS/node_modules/apollo-cache/lib/utils.js.map +++ /dev/null @@ -1 +0,0 @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EAAE;QAEtB,OAAO,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;KACpC;IAGD,IAAM,UAAU,GAAgB,EAAE,CAAC;IAEnC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;QAC1B,IAAM,YAAY,GAAqB,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAErE,IAAM,KAAK,GAAc;YACvB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,GAAG;aACX;YACD,YAAY,EAAE,YAAY,IAAI,SAAS;SACxC,CAAC;QAEF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,IAAM,YAAY,GAAqB;QACrC,IAAI,EAAE,cAAc;QACpB,UAAU,YAAA;KACX,CAAC;IAEF,OAAO,YAAY,CAAC;AACtB,CAAC;AAEY,QAAA,iBAAiB,GAAiB;IAC7C,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,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/JS/node_modules/apollo-cache/package.json b/JS/node_modules/apollo-cache/package.json deleted file mode 100644 index 9518a0f..0000000 --- a/JS/node_modules/apollo-cache/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "apollo-cache", - "version": "1.3.5", - "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": "npx 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.4", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "gitHead": "d22394c419ff7d678afb5e7d4cd1df16ed803ead" -} diff --git a/JS/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap b/JS/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap deleted file mode 100644 index 2a167ec..0000000 --- a/JS/node_modules/apollo-cache/src/__tests__/__snapshots__/utils.ts.snap +++ /dev/null @@ -1,63 +0,0 @@ -// 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/JS/node_modules/apollo-cache/src/__tests__/cache.ts b/JS/node_modules/apollo-cache/src/__tests__/cache.ts deleted file mode 100644 index 6f10d7c..0000000 --- a/JS/node_modules/apollo-cache/src/__tests__/cache.ts +++ /dev/null @@ -1,149 +0,0 @@ -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/JS/node_modules/apollo-cache/src/__tests__/utils.ts b/JS/node_modules/apollo-cache/src/__tests__/utils.ts deleted file mode 100644 index 953e0e1..0000000 --- a/JS/node_modules/apollo-cache/src/__tests__/utils.ts +++ /dev/null @@ -1,76 +0,0 @@ -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/JS/node_modules/apollo-cache/src/cache.ts b/JS/node_modules/apollo-cache/src/cache.ts deleted file mode 100644 index ab45b1a..0000000 --- a/JS/node_modules/apollo-cache/src/cache.ts +++ /dev/null @@ -1,150 +0,0 @@ -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/JS/node_modules/apollo-cache/src/index.ts b/JS/node_modules/apollo-cache/src/index.ts deleted file mode 100644 index 18273b7..0000000 --- a/JS/node_modules/apollo-cache/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './cache'; -export * from './types'; diff --git a/JS/node_modules/apollo-cache/src/types/Cache.ts b/JS/node_modules/apollo-cache/src/types/Cache.ts deleted file mode 100644 index da6ef0b..0000000 --- a/JS/node_modules/apollo-cache/src/types/Cache.ts +++ /dev/null @@ -1,40 +0,0 @@ -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/JS/node_modules/apollo-cache/src/types/DataProxy.ts b/JS/node_modules/apollo-cache/src/types/DataProxy.ts deleted file mode 100644 index 8b85709..0000000 --- a/JS/node_modules/apollo-cache/src/types/DataProxy.ts +++ /dev/null @@ -1,127 +0,0 @@ -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/JS/node_modules/apollo-cache/src/types/index.ts b/JS/node_modules/apollo-cache/src/types/index.ts deleted file mode 100644 index c44054d..0000000 --- a/JS/node_modules/apollo-cache/src/types/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './DataProxy'; -export * from './Cache'; diff --git a/JS/node_modules/apollo-cache/src/utils.ts b/JS/node_modules/apollo-cache/src/utils.ts deleted file mode 100644 index 7d88d0b..0000000 --- a/JS/node_modules/apollo-cache/src/utils.ts +++ /dev/null @@ -1,123 +0,0 @@ -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/JS/node_modules/apollo-client/ApolloClient.d.ts b/JS/node_modules/apollo-client/ApolloClient.d.ts deleted file mode 100644 index 33fc2ee..0000000 --- a/JS/node_modules/apollo-client/ApolloClient.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -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/JS/node_modules/apollo-client/ApolloClient.d.ts.map b/JS/node_modules/apollo-client/ApolloClient.d.ts.map deleted file mode 100644 index 37f5b9e..0000000 --- a/JS/node_modules/apollo-client/ApolloClient.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,O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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/JS/node_modules/apollo-client/ApolloClient.js b/JS/node_modules/apollo-client/ApolloClient.js deleted file mode 100644 index eb86d49..0000000 --- a/JS/node_modules/apollo-client/ApolloClient.js +++ /dev/null @@ -1,219 +0,0 @@ -"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(tslib_1.__assign({}, this.defaultOptions.watchQuery), options); - } - if (this.disableNetworkFetches && - (options.fetchPolicy === 'network-only' || - options.fetchPolicy === 'cache-and-network')) { - options = tslib_1.__assign(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(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(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(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/JS/node_modules/apollo-client/ApolloClient.js.map b/JS/node_modules/apollo-client/ApolloClient.js.map deleted file mode 100644 index 1963b99..0000000 --- a/JS/node_modules/apollo-client/ApolloClient.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,IAAI,iBAAS,CAAC,KAAK,CAAC,CAAC;QAClC,I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/JS/node_modules/apollo-client/LICENSE b/JS/node_modules/apollo-client/LICENSE deleted file mode 100644 index 278ee9d..0000000 --- a/JS/node_modules/apollo-client/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -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/JS/node_modules/apollo-client/README.md b/JS/node_modules/apollo-client/README.md deleted file mode 100644 index e41dca6..0000000 --- a/JS/node_modules/apollo-client/README.md +++ /dev/null @@ -1,127 +0,0 @@ -# [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) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/apollo) - -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/JS/node_modules/apollo-client/bundle.cjs.js b/JS/node_modules/apollo-client/bundle.cjs.js deleted file mode 100644 index b96ca46..0000000 --- a/JS/node_modules/apollo-client/bundle.cjs.js +++ /dev/null @@ -1,2729 +0,0 @@ -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)((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)((0, _tslib.__assign)({}, result), { - stale: false - })); - } - - return (0, _tslib.__assign)((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(1) : 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)((0, _tslib.__assign)({}, this.variables), variables); - } - - if (!(0, _apolloUtilities.isEqual)(this.options.variables, this.variables)) { - this.options.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options.variables), this.variables); - } - - return this.queryManager.fetchQuery(this.queryId, (0, _tslib.__assign)((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, 2) : (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)((0, _tslib.__assign)({}, fetchMoreOptions.query ? fetchMoreOptions : (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), fetchMoreOptions), { - variables: (0, _tslib.__assign)((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)((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) { - _this.updateLastResult((0, _tslib.__assign)((0, _tslib.__assign)({}, _this.lastResult), { - errors: error.graphQLErrors, - networkStatus: NetworkStatus.error, - loading: false - })); - - 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', 3) : (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)((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)((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, 6) : (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)((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)((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, 7) : (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, - fragmentMap: execContext.fragmentMap - })); - } - } - } - - 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(8) : 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, 9) : (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', 10) : (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - 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)((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)((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)((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', 11) : (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, 12) : (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', 13) : (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, 14) : (0, _tsInvariant.invariant)(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.pollInterval, 15) : (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(16) : 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, 17) : (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)((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)((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)((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, 18) : (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)((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.10"; -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(4) : 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)((0, _tslib.__assign)({}, this.defaultOptions.watchQuery), options); - } - - if (this.disableNetworkFetches && (options.fetchPolicy === 'network-only' || options.fetchPolicy === 'cache-and-network')) { - options = (0, _tslib.__assign)((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)((0, _tslib.__assign)({}, this.defaultOptions.query), options); - } - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 5) : (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)((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)((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/JS/node_modules/apollo-client/bundle.cjs.js.map b/JS/node_modules/apollo-client/bundle.cjs.js.map deleted file mode 100644 index bc74e9e..0000000 --- a/JS/node_modules/apollo-client/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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"],"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,cAAA;AAMA,EAAA,aAAA,CAAA,aAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAA;AAMA,EAAA,aAAA,CAAA,aAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AAOA,EAAA,aAAA,CAAA,aAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAA;AAKA,EAAA,aAAA,CAAA,aAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AAKA,EAAA,aAAA,CAAA,aAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAA;AACD,CA1CD,EAAY,aAAa,6BAAb,aAAa,GAAA,EAAA,CAAzB;;AAgDA,SAAgB,wBAAhB,CACE,aADF,EAC8B;AAE5B,SAAO,aAAa,GAAG,CAAvB;AACD;;AC7CD,IAAA,UAAA,GAAA,UAAA,MAAA,EAAA;AAAmCA,wBAAAA,UAAAA,EAAAA,MAAAA;;AAAnC,WAAA,UAAA,GAAA;;AAQC;;AAPQ,EAAA,U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AA,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';\nimport { Resolver } from './LocalState';\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 ]: Resolver;\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 // Since we don't get the current result on errors, only the error, we\n // must mirror the updates that occur in QueryStore.markQueryError here\n this.updateLastResult({\n ...this.lastResult,\n errors: error.graphQLErrors,\n networkStatus: NetworkStatus.error,\n loading: false,\n });\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 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';\nimport { FetchResult } from 'apollo-link';\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 rootValue?: any,\n args?: any,\n context?: any,\n info?: {\n field: FieldNode;\n fragmentMap: FragmentMap;\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: FetchResult;\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, fragmentMap: execContext.fragmentMap },\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 { 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 \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\"\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: FetchResult) {\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;\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!);\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: FetchResult,\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: FetchResult) => {\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.10\"","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/JS/node_modules/apollo-client/bundle.cjs.min.js b/JS/node_modules/apollo-client/bundle.cjs.min.js deleted file mode 100644 index 0448cd8..0000000 --- a/JS/node_modules/apollo-client/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -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"),s=(e=require("symbol-observable"))&&e.__esModule?e:{default:e},i=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[s.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,s=r.errorMessage,i=r.extraInfo,a=e.call(this,s)||this;return a.graphQLErrors=o||[],a.networkError=n||null,a.message=s||y(a),a.extraInfo=i,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,s=t.shouldSubscribe,i=void 0===s||s,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=i;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,s,i=this.queryManager.getCurrentQueryResult(this),a=i.data,c=i.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===(s=this.options.errorPolicy)&&(s="none"),n&&(n.networkError||"none"===s&&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)((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)((0,r.__assign)({},o),{stale:!1})),(0,r.__assign)((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 i.InvariantError(1)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),(0,o.isEqual)(this.variables,e)||(this.variables=(0,r.__assign)((0,r.__assign)({},this.variables),e)),(0,o.isEqual)(this.options.variables,this.variables)||(this.options.variables=(0,r.__assign)((0,r.__assign)({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,(0,r.__assign)((0,r.__assign)({},this.options),{fetchPolicy:t}),p.refetch))},n.prototype.fetchMore=function(e){var t=this;(0,i.invariant)(e.updateQuery,2);var o=(0,r.__assign)((0,r.__assign)({},e.query?e:(0,r.__assign)((0,r.__assign)((0,r.__assign)({},this.options),e),{variables:(0,r.__assign)((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)((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,s=r.variables,i=r.document,a=(0,o.tryFunctionOrLogError)(function(){return e(n,{variables:s})});a&&(t.dataStore.markUpdateQueryResult(i,s,a),t.broadcastQueries())},n.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},n.prototype.startPolling=function(e){g(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,n=this.queryManager,s=this.queryId;this.shouldSubscribe&&n.addObservableQuery(s,this),this.options.pollInterval&&(g(this),n.startPollingQuery(this.options,s));var i=function(o){e.updateLastResult((0,r.__assign)((0,r.__assign)({},e.lastResult),{errors:o.graphQLErrors,networkStatus:t.error,loading:!1})),b(e.observers,"error",e.lastError=o)};n.observeQuery(s,this.options,{next:function(t){if(e.lastError||e.isDifferentFromLastResult(t)){var r=e.updateLastResult(t),s=e.options,i=s.query,a=s.variables,u=s.fetchPolicy;n.transform(i).hasClientExports?n.getLocalState().addExportedVariables(i,a).then(function(s){var a=e.variables;e.variables=e.options.variables=s,!t.loading&&r&&"cache-only"!==u&&n.transform(i).serverQuery&&!(0,o.isEqual)(a,s)?e.refetch():b(e.observers,"next",t)}):b(e.observers,"next",t)}},error:i}).catch(i)},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 g(e){var t=e.options.fetchPolicy;(0,i.invariant)("cache-first"!==t&&"cache-only"!==t,3)}exports.ObservableQuery=v;var m=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,i.invariant)(!r||r.document===e.document||(0,o.isEqual)(r.document,e.document),19);var n,s=!1,a=null;e.storePreviousVariables&&r&&r.networkStatus!==t.loading&&((0,o.isEqual)(r.variables,e.variables)||(s=!0,a=r.variables)),n=s?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 _=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,s=e.variables,i=e.onlyRunForcedResolvers,a=void 0!==i&&i;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,s,this.fragmentMatcher,a).then(function(e){return(0,r.__assign)((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)((0,r.__assign)({},e),{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);(0,i.invariant)(!1,6)}})},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)((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,s,i,a){return void 0===n&&(n={}),void 0===s&&(s={}),void 0===i&&(i=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 g;return u=(0,o.getMainDefinition)(e),c=(0,o.getFragmentDefinitions)(e),l=(0,o.createFragmentMap)(c),h=u.operation,p=h?(g=h).charAt(0).toUpperCase()+g.slice(1):"Query",f=(y=this).cache,v=y.client,d={fragmentMap:l,context:(0,r.__assign)((0,r.__assign)({},n),{cache:f,client:v}),variables:s,fragmentMatcher:i,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 s,a,u,c,l,h=this;return(0,r.__generator)(this,function(p){return s=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=s[e.name.value],(0,i.invariant)(l,7)),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 s,i,a,u,c,l,h,p,y,f=this;return(0,r.__generator)(this,function(r){return s=n.variables,i=e.name.value,a=(0,o.resultKeyNameFromField)(e),u=i!==a,c=t[a]||t[i],l=Promise.resolve(c),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(h=t.__typename||n.defaultOperationType,(p=this.resolvers&&this.resolvers[h])&&(y=p[u?i:a])&&(l=Promise.resolve(y(t,(0,o.argumentsObjectFromField)(e,s),n.context,{field:e,fragmentMap:n.fragmentMap})))),[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 w(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 S=Object.prototype.hasOwnProperty,q=function(){function e(e){var t=e.link,r=e.queryDeduplication,n=void 0!==r&&r,s=e.store,i=e.onBroadcast,a=void 0===i?function(){}:i,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 m,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=s,this.onBroadcast=a,this.clientAwareness=h,this.localState=p||new _({cache:s.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 i.InvariantError(8))})},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,s=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,g=e.context,m=void 0===g?{}:g;return(0,r.__awaiter)(this,void 0,void 0,function(){var e,u,h,v=this;return(0,r.__generator)(this,function(g){switch(g.label){case 0:return(0,i.invariant)(t,9),(0,i.invariant)(!b||"no-cache"===b,10),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,m)]:[3,2];case 1:n=g.sent(),g.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&&S.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:s}),this.broadcastQueries(),h=this,[2,new Promise(function(i,a){var v,g;h.getObservableFromLink(t,(0,r.__assign)((0,r.__assign)({},m),{optimisticResponse:s}),n,!1).subscribe({next:function(r){(0,o.graphQLResultHasError)(r)&&"none"===d?g=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:s}),h.broadcastQueries(),h.setQuery(e,function(){return{document:null}}),a(new f({networkError:t}))},complete:function(){if(g&&h.mutationStore.markMutationError(e,g),h.dataStore.markMutationComplete({mutationId:e,optimisticResponse:s}),h.broadcastQueries(),g)a(g);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,i(v)})}}})})]}})})},e.prototype.fetchQuery=function(e,t,n,s){return(0,r.__awaiter)(this,void 0,void 0,function(){var i,a,u,c,l,y,v,d,b,g,m,Q,_,w,S,q,R,k,E=this;return(0,r.__generator)(this,function(M){switch(M.label){case 0:return i=t.metadata,a=void 0===i?null:i,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=M.sent(),M.label=2;case 2:if(t=(0,r.__assign)((0,r.__assign)({},t),{variables:d}),m=g="network-only"===c||"no-cache"===c,g||(Q=this.dataStore.getCache().diff({query:v,variables:d,returnPartialData:!0,optimistic:!1}),_=Q.complete,w=Q.result,m=!_||"cache-and-network"===c,b=w),S=m&&"cache-only"!==c&&"standby"!==c,(0,o.hasDirectives)(["live"],v)&&(S=!0),q=this.idCounter++,R="no-cache"!==c?this.updateQueryWatch(e,v,t):void 0,this.setQuery(e,function(){return{document:v,lastRequestId:q,invalidated:!0,cancel:R}}),this.invalidate(s),this.queryStore.initQuery({queryId:e,document:v,storePreviousVariables:S,variables:d,isPoll:n===p.poll,isRefetch:n===p.refetch,metadata:a,fetchMoreForQueryId:s}),this.broadcastQueries(),S){if(k=this.fetchRequest({requestId:q,queryId:e,document:v,options:t,fetchMoreForQueryId:s}).catch(function(t){throw h(t)?t:(q>=E.getQuery(e).lastRequestId&&(E.queryStore.markQueryError(e,t,s),E.invalidate(e),E.invalidate(s),E.broadcastQueries()),new f({networkError:t}))}),"cache-and-network"!==c)return[2,k];k.catch(function(){})}return this.queryStore.markQueryResultClient(e,!S),this.invalidate(e),this.invalidate(s),this.transform(v).hasForcedResolvers?[2,this.localState.runResolvers({document:v,remoteResult:{data:b},context:y,variables:d,onlyRunForcedResolvers:!0}).then(function(r){return E.markQueryResult(e,r,t,s),E.broadcastQueries(),r})]:(this.broadcastQueries(),[2,{data:b}])}})})},e.prototype.markQueryResult=function(e,t,r,o){var n=r.fetchPolicy,s=r.variables,i=r.errorPolicy;"no-cache"===n?this.setQuery(e,function(){return{newData:{result:t.data,complete:!0}}}):this.dataStore.markQueryResult(t,this.getQuery(e).document,s,o,"ignore"===i||"all"===i)},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,s){if(o.invalidate(e,!1),r){var i=o.getQuery(e),a=i.observableQuery,c=i.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||!s&&r.previousVariables||v&&t.notifyOnNetworkStatusChange||"cache-only"===h||"cache-and-network"===h;if(!p||d){var b=l(r.graphQLErrors),g=a&&a.options.errorPolicy||t.errorPolicy||"none";if("none"===g&&b||r.networkError)return n("error",new f({graphQLErrors:r.graphQLErrors,networkError:r.networkError}));try{var m=void 0,Q=void 0;if(s)"no-cache"!==h&&"network-only"!==h&&o.setQuery(e,function(){return{newData:null}}),m=s.result,Q=!s.complete;else{var _=a&&a.getLastError(),w="none"!==g&&(_&&_.graphQLErrors)!==r.graphQLErrors;if(y&&y.data&&!w)m=y.data,Q=!1;else{var S=o.dataStore.getCache().diff({query:c,variables:r.previousVariables||r.variables,returnPartialData:!0,optimistic:!0});m=S.result,Q=!S.complete}}var q=Q&&!(t.returnPartialData||"cache-only"===h),R={data:q?y&&y.data:m,loading:p,networkStatus:r.networkStatus,stale:q};"all"===g&&b&&(R.errors=r.graphQLErrors),n("next",R)}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),s=(0,o.removeConnectionDirectiveFromDocument)(r.transformForLink(n)),i=this.localState.clientQuery(n),a=this.localState.serverQuery(s),u={document:n,hasClientExports:(0,o.hasClientExports)(n),hasForcedResolvers:this.localState.shouldForceResolvers(n),clientQuery:i,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(i),c(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,r.__assign)((0,r.__assign)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),(0,i.invariant)("standby"!==e.fetchPolicy,11),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,i.invariant)(e.query,12),(0,i.invariant)("Document"===e.query.kind,13),(0,i.invariant)(!e.returnPartialData,14),(0,i.invariant)(!e.pollInterval,15),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 i.InvariantError(16))});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 s=o.observableQuery;if(s){var i=s.options.fetchPolicy;s.resetLastResults(),"cache-only"===i||!e&&"standby"===i||r.push(s.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,s=e.variables;r=this.transform(r).document,s=this.getVariables(r,s);var i=function(e){return t.getObservableFromLink(r,{},e,!1).map(function(s){if(n&&"no-cache"===n||(t.dataStore.markSubscriptionResult(s,r,e),t.broadcastQueries()),(0,o.graphQLResultHasError)(s))throw new f({graphQLErrors:s.errors});return s})};if(this.transform(r).hasClientExports){var a=this.localState.addExportedVariables(r,s).then(i);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 i(s)},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,s=r.fetchPolicy,i=r.returnPartialData,a=e.getLastResult(),u=this.getQuery(e.queryId).newData;if(u&&u.complete)return{data:u.result,partial:!1};if("no-cache"===s||"network-only"===s)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||i?l:void 0,partial:!h}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var r=this.getQuery(e).observableQuery;(0,i.invariant)(r,17),t=r}else t=e;var o=t.options,n=o.variables,s=o.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:n,document:s}},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,s,i){var a,u=this;void 0===i&&(i=this.queryDeduplication);var l=this.transform(e).serverQuery;if(l){var h=this.inFlightLinkObservables,p=this.link,y={query:l,variables:s,operationName:(0,o.getOperationName)(l)||void 0,context:this.prepareContext((0,r.__assign)((0,r.__assign)({},t),{forceFetch:!i}))};if(t=y.context,i){var f=h.get(l)||new Map;h.set(l,f);var v=JSON.stringify(s);if(!(a=f.get(v))){f.set(v,a=w((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=w((0,n.execute)(p,y))}else a=c.of({data:{}}),t=this.prepareContext(t);var g=this.transform(e).clientQuery;return g&&(a=function(e,t){return new c(function(r){var o=r.next,n=r.error,s=r.complete,i=0,a=!1,u={next:function(e){++i,new Promise(function(r){r(t(e))}).then(function(e){--i,o&&o.call(r,e),a&&u.complete()},function(e){--i,n&&n.call(r,e)})},error:function(e){n&&n.call(r,e)},complete:function(){a=!0,i||s&&s.call(r)}},c=e.subscribe(u);return function(){return c.unsubscribe()}})}(a,function(e){return u.localState.runResolvers({document:g,remoteResult:e,context:t,variables:s})})),a},e.prototype.fetchRequest=function(e){var r,o,n=this,s=e.requestId,i=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:"+i;n.fetchQueryRejectFns.set(b,p);var g=function(){n.fetchQueryRejectFns.delete(b),n.setQuery(i,function(e){e.subscriptions.delete(m)})},m=d.map(function(e){if(s>=n.getQuery(i).lastRequestId&&(n.markQueryResult(i,e,u,c),n.queryStore.markQueryResult(i,e,c),n.invalidate(i),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){g(),p(e)},complete:function(){g(),e({data:r,errors:o,loading:!1,networkStatus:t.ready,stale:!1})}});n.setQuery(i,function(e){e.subscriptions.add(m)})})},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)((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)((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,s=e.pollInterval;if((0,i.invariant)(s,18),!this.ssrMode){var a=this.pollingInfoByQueryId.get(t);a||this.pollingInfoByQueryId.set(t,a={}),a.interval=s,a.options=(0,r.__assign)((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}(),R=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,r,n,s){void 0===s&&(s=!1);var i=!(0,o.graphQLResultHasError)(e);s&&(0,o.graphQLResultHasError)(e)&&e.data&&(i=!0),!n&&i&&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(s){var i=n[s],a=i.query,u=i.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}(),k="2.6.10",E=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.cache,o=e.ssrMode,s=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,g=e.name,m=e.version,Q=e.link;if(!Q&&v&&(Q=n.ApolloLink.empty()),!Q||!r)throw new i.InvariantError(4);this.link=Q,this.cache=r,this.store=new R(r),this.disableNetworkFetches=s||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=k,this.localState=new _({cache:r,client:this,resolvers:v,fragmentMatcher:b}),this.queryManager=new q({link:this.link,store:this.store,queryDeduplication:h,ssrMode:s,clientAwareness:{name:g,version:m},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)((0,r.__assign)({},this.defaultOptions.watchQuery),e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,r.__assign)((0,r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=(0,r.__assign)((0,r.__assign)({},this.defaultOptions.query),e)),(0,i.invariant)("cache-and-network"!==e.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,r.__assign)((0,r.__assign)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=(0,r.__assign)((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=E;var M=E;exports.default=M; diff --git a/JS/node_modules/apollo-client/bundle.esm.js b/JS/node_modules/apollo-client/bundle.esm.js deleted file mode 100644 index 450ae21..0000000 --- a/JS/node_modules/apollo-client/bundle.esm.js +++ /dev/null @@ -1,2108 +0,0 @@ -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(__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(__assign({}, result), { stale: false })); - } - return __assign(__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(1) : 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(__assign({}, this.variables), variables); - } - if (!isEqual(this.options.variables, this.variables)) { - this.options.variables = __assign(__assign({}, this.options.variables), this.variables); - } - return this.queryManager.fetchQuery(this.queryId, __assign(__assign({}, this.options), { fetchPolicy: fetchPolicy }), FetchType.refetch); - }; - ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) { - var _this = this; - process.env.NODE_ENV === "production" ? invariant(fetchMoreOptions.updateQuery, 2) : invariant(fetchMoreOptions.updateQuery, 'updateQuery option is required. This function defines how to update the query data with the new results.'); - var combinedOptions = __assign(__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : __assign(__assign(__assign({}, this.options), fetchMoreOptions), { variables: __assign(__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(__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) { - _this.updateLastResult(__assign(__assign({}, _this.lastResult), { errors: error.graphQLErrors, networkStatus: NetworkStatus.error, loading: false })); - 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', 3) : 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(__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(__assign({}, context), { cache: cache, getCacheKey: function (obj) { - if (cache.config) { - return cache.config.dataIdFromObject(obj); - } - else { - process.env.NODE_ENV === "production" ? invariant(false, 6) : 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(__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(__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, 7) : 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, fragmentMap: execContext.fragmentMap })); - } - } - } - 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(8) : 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, 9) : 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', 10) : invariant(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - 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(__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(__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(__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', 11) : 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, 12) : 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', 13) : invariant(options.query.kind === 'Document', 'You must wrap the query string in a "gql" tag.'); - process.env.NODE_ENV === "production" ? invariant(!options.returnPartialData, 14) : invariant(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); - process.env.NODE_ENV === "production" ? invariant(!options.pollInterval, 15) : 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(16) : 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, 17) : 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(__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(__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(__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, 18) : 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(__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.10"; - -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(4) : 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(__assign({}, this.defaultOptions.watchQuery), options); - } - if (this.disableNetworkFetches && - (options.fetchPolicy === 'network-only' || - options.fetchPolicy === 'cache-and-network')) { - options = __assign(__assign({}, options), { fetchPolicy: 'cache-first' }); - } - return this.queryManager.watchQuery(options); - }; - ApolloClient.prototype.query = function (options) { - if (this.defaultOptions.query) { - options = __assign(__assign({}, this.defaultOptions.query), options); - } - process.env.NODE_ENV === "production" ? invariant(options.fetchPolicy !== 'cache-and-network', 5) : 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(__assign({}, options), { fetchPolicy: 'cache-first' }); - } - return this.queryManager.query(options); - }; - ApolloClient.prototype.mutate = function (options) { - if (this.defaultOptions.mutate) { - options = __assign(__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/JS/node_modules/apollo-client/bundle.esm.js.map b/JS/node_modules/apollo-client/bundle.esm.js.map deleted file mode 100644 index e1b9a1f..0000000 --- a/JS/node_modules/apollo-client/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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';\nimport { Resolver } from './LocalState';\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 ]: Resolver;\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 // Since we don't get the current result on errors, only the error, we\n // must mirror the updates that occur in QueryStore.markQueryError here\n this.updateLastResult({\n ...this.lastResult,\n errors: error.graphQLErrors,\n networkStatus: NetworkStatus.error,\n loading: false,\n });\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 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';\nimport { FetchResult } from 'apollo-link';\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 rootValue?: any,\n args?: any,\n context?: any,\n info?: {\n field: FieldNode;\n fragmentMap: FragmentMap;\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: FetchResult;\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, fragmentMap: execContext.fragmentMap },\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 { 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 \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\"\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: FetchResult) {\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;\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!);\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: FetchResult,\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: FetchResult) => {\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.10\"","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":["LinkObservable"],"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;IAAmC,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,CAAmCA,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,IAAM,oBAAoB,GAAG,UAAC,GAAgB;IAC5C,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE;QACtC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,UAAC,YAA0B;YACnD,IAAM,YAAY,GAAG,YAAY;kBAC7B,YAAY,CAAC,OAAO;kBACpB,0BAA0B,CAAC;YAC/B,OAAO,IAAI,oBAAkB,YAAY,OAAI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AC,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/JS/node_modules/apollo-client/bundle.umd.js b/JS/node_modules/apollo-client/bundle.umd.js deleted file mode 100644 index f3c5420..0000000 --- a/JS/node_modules/apollo-client/bundle.umd.js +++ /dev/null @@ -1,2733 +0,0 @@ -(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; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : 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)((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)((0, _tslib.__assign)({}, result), { - stale: false - })); - } - - return (0, _tslib.__assign)((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(1) : 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)((0, _tslib.__assign)({}, this.variables), variables); - } - - if (!(0, _apolloUtilities.isEqual)(this.options.variables, this.variables)) { - this.options.variables = (0, _tslib.__assign)((0, _tslib.__assign)({}, this.options.variables), this.variables); - } - - return this.queryManager.fetchQuery(this.queryId, (0, _tslib.__assign)((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, 2) : (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)((0, _tslib.__assign)({}, fetchMoreOptions.query ? fetchMoreOptions : (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, this.options), fetchMoreOptions), { - variables: (0, _tslib.__assign)((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)((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) { - _this.updateLastResult((0, _tslib.__assign)((0, _tslib.__assign)({}, _this.lastResult), { - errors: error.graphQLErrors, - networkStatus: NetworkStatus.error, - loading: false - })); - - 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', 3) : (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)((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)((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, 6) : (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)((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)((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, 7) : (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, - fragmentMap: execContext.fragmentMap - })); - } - } - } - - 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(8) : 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, 9) : (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', 10) : (0, _tsInvariant.invariant)(!fetchPolicy || fetchPolicy === 'no-cache', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - 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)((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)((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)((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', 11) : (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, 12) : (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', 13) : (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, 14) : (0, _tsInvariant.invariant)(!options.returnPartialData, 'returnPartialData option only supported on watchQuery.'); - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(!options.pollInterval, 15) : (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(16) : 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, 17) : (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)((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)((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)((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, 18) : (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)((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.10"; - 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(4) : 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)((0, _tslib.__assign)({}, this.defaultOptions.watchQuery), options); - } - - if (this.disableNetworkFetches && (options.fetchPolicy === 'network-only' || options.fetchPolicy === 'cache-and-network')) { - options = (0, _tslib.__assign)((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)((0, _tslib.__assign)({}, this.defaultOptions.query), options); - } - - process.env.NODE_ENV === "production" ? (0, _tsInvariant.invariant)(options.fetchPolicy !== 'cache-and-network', 5) : (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)((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)((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/JS/node_modules/apollo-client/bundle.umd.js.map b/JS/node_modules/apollo-client/bundle.umd.js.map deleted file mode 100644 index f4c2971..0000000 --- a/JS/node_modules/apollo-client/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAGY,a;;;AAAZ,GAAA,UAA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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';\nimport { Resolver } from './LocalState';\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 ]: Resolver;\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 // Since we don't get the current result on errors, only the error, we\n // must mirror the updates that occur in QueryStore.markQueryError here\n this.updateLastResult({\n ...this.lastResult,\n errors: error.graphQLErrors,\n networkStatus: NetworkStatus.error,\n loading: false,\n });\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 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';\nimport { FetchResult } from 'apollo-link';\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 rootValue?: any,\n args?: any,\n context?: any,\n info?: {\n field: FieldNode;\n fragmentMap: FragmentMap;\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: FetchResult;\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, fragmentMap: execContext.fragmentMap },\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 { 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 \"Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior.\"\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: FetchResult) {\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;\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!);\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: FetchResult,\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: FetchResult) => {\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.10\"","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/JS/node_modules/apollo-client/config/jest/setup.d.ts b/JS/node_modules/apollo-client/config/jest/setup.d.ts deleted file mode 100644 index 1cbe8c4..0000000 --- a/JS/node_modules/apollo-client/config/jest/setup.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=setup.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-client/config/jest/setup.d.ts.map b/JS/node_modules/apollo-client/config/jest/setup.d.ts.map deleted file mode 100644 index 62b670a..0000000 --- a/JS/node_modules/apollo-client/config/jest/setup.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/config/jest/setup.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/config/jest/setup.js b/JS/node_modules/apollo-client/config/jest/setup.js deleted file mode 100644 index e45f1b0..0000000 --- a/JS/node_modules/apollo-client/config/jest/setup.js +++ /dev/null @@ -1,6 +0,0 @@ -"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/JS/node_modules/apollo-client/config/jest/setup.js.map b/JS/node_modules/apollo-client/config/jest/setup.js.map deleted file mode 100644 index 56b7a5d..0000000 --- a/JS/node_modules/apollo-client/config/jest/setup.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/core/LocalState.d.ts b/JS/node_modules/apollo-client/core/LocalState.d.ts deleted file mode 100644 index 040127f..0000000 --- a/JS/node_modules/apollo-client/core/LocalState.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { DocumentNode, FieldNode, ASTNode } from 'graphql'; -import { ApolloCache } from 'apollo-cache'; -import { FragmentMap } from 'apollo-utilities'; -import { FetchResult } from 'apollo-link'; -import ApolloClient from '../ApolloClient'; -import { Resolvers, OperationVariables } from './types'; -export declare type Resolver = (rootValue?: any, args?: any, context?: any, info?: { - field: FieldNode; - fragmentMap: FragmentMap; -}) => 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: FetchResult; - 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/JS/node_modules/apollo-client/core/LocalState.d.ts.map b/JS/node_modules/apollo-client/core/LocalState.d.ts.map deleted file mode 100644 index 30d146f..0000000 --- a/JS/node_modules/apollo-client/core/LocalState.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LocalState.d.ts","sourceRoot":"","sources":["../src/core/LocalState.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,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;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGxD,oBAAY,QAAQ,GAAG,CACrB,SAAS,CAAC,EAAE,GAAG,EACf,IAAI,CAAC,EAAE,GAAG,EACV,OAAO,CAAC,EAAE,GAAG,EACb,IAAI,CAAC,EAAE;IACL,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;CAC1B,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,G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,CAAC,KAAK,CAAC,CAAC;IAkBxB,kBAAkB,CAAC,eAAe,EAAE,eAAe;IAInD,kBAAkB,IAAI,eAAe;IAMrC,WAAW,CAAC,QAAQ,EAAE,YAAY;IAgBlC,WAAW,CAAC,QAAQ,EAAE,YAAY;IAIlC,cAAc,CAAC,OAAO,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/JS/node_modules/apollo-client/core/LocalState.js b/JS/node_modules/apollo-client/core/LocalState.js deleted file mode 100644 index 934f3e2..0000000 --- a/JS/node_modules/apollo-client/core/LocalState.js +++ /dev/null @@ -1,276 +0,0 @@ -"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(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(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(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(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, fragmentMap: execContext.fragmentMap })); - } - } - } - 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/JS/node_modules/apollo-client/core/LocalState.js.map b/JS/node_modules/apollo-client/core/LocalState.js.map deleted file mode 100644 index c2282fe..0000000 --- a/JS/node_modules/apollo-client/core/LocalState.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"LocalState.js","sourceRoot":"","sources":["../../src/core/LocalState.ts"],"names":[],"mappings":";;;AAUA,oDAAwD;AAGxD,qDAe0B;AAG1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B;QAH1B,iBAsBC;QAjBC,OAAO,OAAO,CAAC,GAAG,CAChB,MAAM,CAAC,GAAG,CAAC,UAAA,IAAI;YACb,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjB,OAAO,IAAI,CAAC;aACb;YAGD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACvB,OAAO,KAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;aAC/D;YAGD,IAAI,KAAK,CAAC,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/JS/node_modules/apollo-client/core/ObservableQuery.d.ts b/JS/node_modules/apollo-client/core/ObservableQuery.d.ts deleted file mode 100644 index c2e01f4..0000000 --- a/JS/node_modules/apollo-client/core/ObservableQuery.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -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/JS/node_modules/apollo-client/core/ObservableQuery.d.ts.map b/JS/node_modules/apollo-client/core/ObservableQuery.d.ts.map deleted file mode 100644 index 88e8458..0000000 --- a/JS/node_modules/apollo-client/core/ObservableQuery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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;AAC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B,CAAC,KAAK,CAAC,CAAC;IAwClE,SAAS,CAAC,CAAC,SAAS,MAAM,UAAU,EACzC,gBAAgB,EAAE,qBAAqB,CAAC,UAAU,EAAE,CAAC,CAAC,GACpD,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,GACpC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAiD7B,eAAe,CACpB,iBAAiB,GAAG,KAAK,EACzB,sBAAsB,GAAG,UAAU,EAEnC,OAAO,EAAE,sBAAsB,CAC7B,KAAK,EACL,sBAAsB,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;IAgElB,OAAO,CAAC,aAAa;CAetB"} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/core/ObservableQuery.js b/JS/node_modules/apollo-client/core/ObservableQuery.js deleted file mode 100644 index cf6160a..0000000 --- a/JS/node_modules/apollo-client/core/ObservableQuery.js +++ /dev/null @@ -1,367 +0,0 @@ -"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(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(tslib_1.__assign({}, result), { stale: false })); - } - return tslib_1.__assign(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(tslib_1.__assign({}, this.variables), variables); - } - if (!apollo_utilities_1.isEqual(this.options.variables, this.variables)) { - this.options.variables = tslib_1.__assign(tslib_1.__assign({}, this.options.variables), this.variables); - } - return this.queryManager.fetchQuery(this.queryId, tslib_1.__assign(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(tslib_1.__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, this.options), fetchMoreOptions), { variables: tslib_1.__assign(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(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) { - _this.updateLastResult(tslib_1.__assign(tslib_1.__assign({}, _this.lastResult), { errors: error.graphQLErrors, networkStatus: networkStatus_1.NetworkStatus.error, loading: false })); - 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/JS/node_modules/apollo-client/core/ObservableQuery.js.map b/JS/node_modules/apollo-client/core/ObservableQuery.js.map deleted file mode 100644 index 2983a91..0000000 --- a/JS/node_modules/apollo-client/core/ObservableQuery.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,2CA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of file diff --git a/JS/node_modules/apollo-client/core/QueryManager.d.ts b/JS/node_modules/apollo-client/core/QueryManager.d.ts deleted file mode 100644 index ca23f6a..0000000 --- a/JS/node_modules/apollo-client/core/QueryManager.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -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/JS/node_modules/apollo-client/core/QueryManager.d.ts.map b/JS/node_modules/apollo-client/core/QueryManager.d.ts.map deleted file mode 100644 index c31bab2..0000000 --- a/JS/node_modules/apollo-client/core/QueryManager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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C1B,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/JS/node_modules/apollo-client/core/QueryManager.js b/JS/node_modules/apollo-client/core/QueryManager.js deleted file mode 100644 index ad59088..0000000 --- a/JS/node_modules/apollo-client/core/QueryManager.js +++ /dev/null @@ -1,867 +0,0 @@ -"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', "Mutations only support a 'no-cache' fetchPolicy. If you don't want to disable the cache, remove your fetchPolicy setting to proceed with the default mutation behavior."); - 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(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(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(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(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(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(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(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/JS/node_modules/apollo-client/core/QueryManager.js.map b/JS/node_modules/apollo-client/core/QueryManager.js.map deleted file mode 100644 index c85ceb3..0000000 --- a/JS/node_modules/apollo-client/core/QueryManager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;QAQ7C,cAAS,GAAG,CAAC,CAAC;QAId,YAAO,GAA2B,IAAI,GAAG,EAAE,CAAC;QAO5C,wBAAmB,GAAG,IAAI,GAAG,EAAoB,CAAC;QAujBlD,mBAAc,GAAG,IAAI,CAAC,gCAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAUzD,CAAC;QAwbI,4BAAuB,GAAG,IAAI,GAAG,EAGtC,CAAC;QA6OI,yBAAoB,GAAG,IAAI,G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AI,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/JS/node_modules/apollo-client/core/networkStatus.d.ts b/JS/node_modules/apollo-client/core/networkStatus.d.ts deleted file mode 100644 index 4112caf..0000000 --- a/JS/node_modules/apollo-client/core/networkStatus.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -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/JS/node_modules/apollo-client/core/networkStatus.d.ts.map b/JS/node_modules/apollo-client/core/networkStatus.d.ts.map deleted file mode 100644 index 9623964..0000000 --- a/JS/node_modules/apollo-client/core/networkStatus.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/core/networkStatus.js b/JS/node_modules/apollo-client/core/networkStatus.js deleted file mode 100644 index 262f964..0000000 --- a/JS/node_modules/apollo-client/core/networkStatus.js +++ /dev/null @@ -1,17 +0,0 @@ -"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/JS/node_modules/apollo-client/core/networkStatus.js.map b/JS/node_modules/apollo-client/core/networkStatus.js.map deleted file mode 100644 index ebe2eff..0000000 --- a/JS/node_modules/apollo-client/core/networkStatus.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/core/types.d.ts b/JS/node_modules/apollo-client/core/types.d.ts deleted file mode 100644 index 2816c32..0000000 --- a/JS/node_modules/apollo-client/core/types.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { FetchResult } from 'apollo-link'; -import { DocumentNode, GraphQLError } from 'graphql'; -import { QueryStoreValue } from '../data/queries'; -import { NetworkStatus } from './networkStatus'; -import { Resolver } from './LocalState'; -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]: Resolver; - }; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-client/core/types.d.ts.map b/JS/node_modules/apollo-client/core/types.d.ts.map deleted file mode 100644 index 04c69fb..0000000 --- a/JS/node_modules/apollo-client/core/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,oBAAY,aAAa,GAAG,CAC1B,eAAe,EAAE,eAAe,EAChC,OAAO,CAAC,EAAE,GAAG,EACb,cAAc,CAAC,EAAE,OAAO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at end of file diff --git a/JS/node_modules/apollo-client/core/types.js b/JS/node_modules/apollo-client/core/types.js deleted file mode 100644 index a0437d7..0000000 --- a/JS/node_modules/apollo-client/core/types.js +++ /dev/null @@ -1,9 +0,0 @@ -"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/JS/node_modules/apollo-client/core/types.js.map b/JS/node_modules/apollo-client/core/types.js.map deleted file mode 100644 index 1877806..0000000 --- a/JS/node_modules/apollo-client/core/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":";;AA6BA,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/JS/node_modules/apollo-client/core/watchQueryOptions.d.ts b/JS/node_modules/apollo-client/core/watchQueryOptions.d.ts deleted file mode 100644 index 2e702c6..0000000 --- a/JS/node_modules/apollo-client/core/watchQueryOptions.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { DocumentNode } 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; - context?: any; -} -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: FetchResult) => 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/JS/node_modules/apollo-client/core/watchQueryOptions.d.ts.map b/JS/node_modules/apollo-client/core/watchQueryOptions.d.ts.map deleted file mode 100644 index afbd092..0000000 --- a/JS/node_modules/apollo-client/core/watchQueryOptions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"watchQueryOptions.d.ts","sourceRoot":"","sources":["../src/core/watchQueryOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MA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AC,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,WAAW,CAAC,CAAC,CAAC,KAAK,uBAAuB,CAAC,GACrD,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/JS/node_modules/apollo-client/core/watchQueryOptions.js b/JS/node_modules/apollo-client/core/watchQueryOptions.js deleted file mode 100644 index 7a61e2e..0000000 --- a/JS/node_modules/apollo-client/core/watchQueryOptions.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=watchQueryOptions.js.map \ No newline at end of file diff --git a/JS/node_modules/apollo-client/core/watchQueryOptions.js.map b/JS/node_modules/apollo-client/core/watchQueryOptions.js.map deleted file mode 100644 index 9ad66e3..0000000 --- a/JS/node_modules/apollo-client/core/watchQueryOptions.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"watchQueryOptions.js","sourceRoot":"","sources":["../../src/core/watchQueryOptions.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/data/mutations.d.ts b/JS/node_modules/apollo-client/data/mutations.d.ts deleted file mode 100644 index c7cbafa..0000000 --- a/JS/node_modules/apollo-client/data/mutations.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -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/JS/node_modules/apollo-client/data/mutations.d.ts.map b/JS/node_modules/apollo-client/data/mutations.d.ts.map deleted file mode 100644 index cd6b572..0000000 --- a/JS/node_modules/apollo-client/data/mutations.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/data/mutations.js b/JS/node_modules/apollo-client/data/mutations.js deleted file mode 100644 index 8779300..0000000 --- a/JS/node_modules/apollo-client/data/mutations.js +++ /dev/null @@ -1,41 +0,0 @@ -"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/JS/node_modules/apollo-client/data/mutations.js.map b/JS/node_modules/apollo-client/data/mutations.js.map deleted file mode 100644 index 1f5364f..0000000 --- a/JS/node_modules/apollo-client/data/mutations.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/data/queries.d.ts b/JS/node_modules/apollo-client/data/queries.d.ts deleted file mode 100644 index 685ea34..0000000 --- a/JS/node_modules/apollo-client/data/queries.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -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/JS/node_modules/apollo-client/data/queries.d.ts.map b/JS/node_modules/apollo-client/data/queries.d.ts.map deleted file mode 100644 index 70c3b71..0000000 --- a/JS/node_modules/apollo-client/data/queries.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/data/queries.js b/JS/node_modules/apollo-client/data/queries.js deleted file mode 100644 index 22eadff..0000000 --- a/JS/node_modules/apollo-client/data/queries.js +++ /dev/null @@ -1,112 +0,0 @@ -"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/JS/node_modules/apollo-client/data/queries.js.map b/JS/node_modules/apollo-client/data/queries.js.map deleted file mode 100644 index 8e0c751..0000000 --- a/JS/node_modules/apollo-client/data/queries.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,KAAK,KAAK,CAAC,QAAQ;YACzC,0BAAO,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,EAC/C,+DAA+D,CAChE,CAAC;QAEF,IAA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AI,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/JS/node_modules/apollo-client/data/store.d.ts b/JS/node_modules/apollo-client/data/store.d.ts deleted file mode 100644 index 3363df4..0000000 --- a/JS/node_modules/apollo-client/data/store.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -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/JS/node_modules/apollo-client/data/store.d.ts.map b/JS/node_modules/apollo-client/data/store.d.ts.map deleted file mode 100644 index 7f0e559..0000000 --- a/JS/node_modules/apollo-client/data/store.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,EAAE,MAAM,eAAe,CAAC;AAErD,oBAAY,gBAAgB,GAAG;IAC7B,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACtC,KA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vD,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/JS/node_modules/apollo-client/data/store.js b/JS/node_modules/apollo-client/data/store.js deleted file mode 100644 index aecfa79..0000000 --- a/JS/node_modules/apollo-client/data/store.js +++ /dev/null @@ -1,132 +0,0 @@ -"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/JS/node_modules/apollo-client/data/store.js.map b/JS/node_modules/apollo-client/data/store.js.map deleted file mode 100644 index 66905e9..0000000 --- a/JS/node_modules/apollo-client/data/store.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,mBAAmB;gBAC3B,KAAK,EAAE,QAAQ;gBACf,SAAS,EAAE,SAAS;aACrB,CAAC,CAAC;SACJ;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AAkB;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/JS/node_modules/apollo-client/errors/ApolloError.d.ts b/JS/node_modules/apollo-client/errors/ApolloError.d.ts deleted file mode 100644 index 4cf37ab..0000000 --- a/JS/node_modules/apollo-client/errors/ApolloError.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -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/JS/node_modules/apollo-client/errors/ApolloError.d.ts.map b/JS/node_modules/apollo-client/errors/ApolloError.d.ts.map deleted file mode 100644 index 7881e67..0000000 --- a/JS/node_modules/apollo-client/errors/ApolloError.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/errors/ApolloError.js b/JS/node_modules/apollo-client/errors/ApolloError.js deleted file mode 100644 index e0eda4a..0000000 --- a/JS/node_modules/apollo-client/errors/ApolloError.js +++ /dev/null @@ -1,45 +0,0 @@ -"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/JS/node_modules/apollo-client/errors/ApolloError.js.map b/JS/node_modules/apollo-client/errors/ApolloError.js.map deleted file mode 100644 index e10bf82..0000000 --- a/JS/node_modules/apollo-client/errors/ApolloError.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/index.d.ts b/JS/node_modules/apollo-client/index.d.ts deleted file mode 100644 index 7c26dd5..0000000 --- a/JS/node_modules/apollo-client/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -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/JS/node_modules/apollo-client/index.d.ts.map b/JS/node_modules/apollo-client/index.d.ts.map deleted file mode 100644 index 6ca55e7..0000000 --- a/JS/node_modules/apollo-client/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/index.js b/JS/node_modules/apollo-client/index.js deleted file mode 100644 index a259ed1..0000000 --- a/JS/node_modules/apollo-client/index.js +++ /dev/null @@ -1,15 +0,0 @@ -"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/JS/node_modules/apollo-client/index.js.map b/JS/node_modules/apollo-client/index.js.map deleted file mode 100644 index 68b6728..0000000 --- a/JS/node_modules/apollo-client/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/package.json b/JS/node_modules/apollo-client/package.json deleted file mode 100644 index c0e6661..0000000 --- a/JS/node_modules/apollo-client/package.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "apollo-client", - "version": "2.6.10", - "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.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } -} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/util/Observable.d.ts b/JS/node_modules/apollo-client/util/Observable.d.ts deleted file mode 100644 index b4cc631..0000000 --- a/JS/node_modules/apollo-client/util/Observable.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -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/JS/node_modules/apollo-client/util/Observable.d.ts.map b/JS/node_modules/apollo-client/util/Observable.d.ts.map deleted file mode 100644 index 2f8454b..0000000 --- a/JS/node_modules/apollo-client/util/Observable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/Observable.js b/JS/node_modules/apollo-client/util/Observable.js deleted file mode 100644 index 59ead53..0000000 --- a/JS/node_modules/apollo-client/util/Observable.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/JS/node_modules/apollo-client/util/Observable.js.map b/JS/node_modules/apollo-client/util/Observable.js.map deleted file mode 100644 index 1222b5f..0000000 --- a/JS/node_modules/apollo-client/util/Observable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/arrays.d.ts b/JS/node_modules/apollo-client/util/arrays.d.ts deleted file mode 100644 index 17d9b15..0000000 --- a/JS/node_modules/apollo-client/util/arrays.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function isNonEmptyArray(value?: ArrayLike): value is Array; -//# sourceMappingURL=arrays.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-client/util/arrays.d.ts.map b/JS/node_modules/apollo-client/util/arrays.d.ts.map deleted file mode 100644 index 2db55b3..0000000 --- a/JS/node_modules/apollo-client/util/arrays.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/arrays.js b/JS/node_modules/apollo-client/util/arrays.js deleted file mode 100644 index e388142..0000000 --- a/JS/node_modules/apollo-client/util/arrays.js +++ /dev/null @@ -1,7 +0,0 @@ -"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/JS/node_modules/apollo-client/util/arrays.js.map b/JS/node_modules/apollo-client/util/arrays.js.map deleted file mode 100644 index 9302fd1..0000000 --- a/JS/node_modules/apollo-client/util/arrays.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts b/JS/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts deleted file mode 100644 index dacd211..0000000 --- a/JS/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function capitalizeFirstLetter(str: string): string; -//# sourceMappingURL=capitalizeFirstLetter.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map b/JS/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map deleted file mode 100644 index ceb2059..0000000 --- a/JS/node_modules/apollo-client/util/capitalizeFirstLetter.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/capitalizeFirstLetter.js b/JS/node_modules/apollo-client/util/capitalizeFirstLetter.js deleted file mode 100644 index 1ee854f..0000000 --- a/JS/node_modules/apollo-client/util/capitalizeFirstLetter.js +++ /dev/null @@ -1,7 +0,0 @@ -"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/JS/node_modules/apollo-client/util/capitalizeFirstLetter.js.map b/JS/node_modules/apollo-client/util/capitalizeFirstLetter.js.map deleted file mode 100644 index 639769e..0000000 --- a/JS/node_modules/apollo-client/util/capitalizeFirstLetter.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/observableToPromise.d.ts b/JS/node_modules/apollo-client/util/observableToPromise.d.ts deleted file mode 100644 index dd54089..0000000 --- a/JS/node_modules/apollo-client/util/observableToPromise.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -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/JS/node_modules/apollo-client/util/observableToPromise.d.ts.map b/JS/node_modules/apollo-client/util/observableToPromise.d.ts.map deleted file mode 100644 index 7935d2b..0000000 --- a/JS/node_modules/apollo-client/util/observableToPromise.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/observableToPromise.js b/JS/node_modules/apollo-client/util/observableToPromise.js deleted file mode 100644 index 395647d..0000000 --- a/JS/node_modules/apollo-client/util/observableToPromise.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -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, tslib_1.__spreadArrays([options], cbs)).promise; -} -exports.default = default_1; -//# sourceMappingURL=observableToPromise.js.map \ No newline at end of file diff --git a/JS/node_modules/apollo-client/util/observableToPromise.js.map b/JS/node_modules/apollo-client/util/observableToPromise.js.map deleted file mode 100644 index 5bcb3df..0000000 --- a/JS/node_modules/apollo-client/util/observableToPromise.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,sBAAmB,EAAnB,wCAAmB;IAClE,aAAwB;SAAxB,UAAwB,EAAxB,qBAAwB,EAAxB,IAAwB;QAAxB,4BAAwB;;IAExB,IAAI,YAAY,GAAiB,IAAa,CAAC;IAC/C,IAAM,OAAO,GAAG,IAAI,OAAO,CAAQ,UAAC,OAAO,EAAE,MAAM;QACjD,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,IAAM,OAAO,GAAU,EAAE,CAAC;QAE1B,IAAM,YAAY,GAAG;YACnB,IAAI,CAAC,aAAa,EAAE;gBAClB,OAAO;aACR;YAED,IAAM,IAAI,GAAG;gBACX,YAAY,CAAC,WAAW,EAAE,CAAC;gBAE3B,OAAO,CAAC,OAAO,CAAC,CAAC;YACnB,CAAC,CAAC;YAEF,IAAI,OAAO,KAAK,GAAG,CAAC,MAAM,IAAI,UAAU,KAAK,cAAc,CAAC,MAAM,EAAE;gBAClE,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE;oBACf,IAAI,EAAE,CAAC;iBACR;qBAAM;oBACL,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;iBACxB;aACF;QACH,CAAC,CAAC;QAEF,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC;YAClC,IAAI,EAAJ,UAAK,MAA8B;gBACjC,IAAM,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC1B,IAAI,EAAE,EAAE;oBACN,IAAI;wBACF,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;qBAC1B;oBAAC,OAAO,CAAC,EAAE;wBACV,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;qBAClB;oBACD,YAAY,EAAE,CAAC;iBAChB;qBAAM;oBACL,MAAM,CAAC,IAAI,KAAK,CAAC,iCAA+B,GAAG,CAAC,MAAM,WAAQ,CAAC,CAAC,CAAC;iBACtE;YACH,CAAC;YACD,KAAK,EAAL,UAAM,KAAY;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,uCAAC,OAAO,GAAK,GAAG,GAAE,OAAO,CAAC;AACrE,CAAC;AALD,4BAKC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/util/observables.d.ts b/JS/node_modules/apollo-client/util/observables.d.ts deleted file mode 100644 index f366bba..0000000 --- a/JS/node_modules/apollo-client/util/observables.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/JS/node_modules/apollo-client/util/observables.d.ts.map b/JS/node_modules/apollo-client/util/observables.d.ts.map deleted file mode 100644 index 01993d3..0000000 --- a/JS/node_modules/apollo-client/util/observables.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/observables.js b/JS/node_modules/apollo-client/util/observables.js deleted file mode 100644 index 3384708..0000000 --- a/JS/node_modules/apollo-client/util/observables.js +++ /dev/null @@ -1,63 +0,0 @@ -"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/JS/node_modules/apollo-client/util/observables.js.map b/JS/node_modules/apollo-client/util/observables.js.map deleted file mode 100644 index e75fe71..0000000 --- a/JS/node_modules/apollo-client/util/observables.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CA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;oBACpB,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACrC;YACH,CAAC;SACF,CAAC;QAEF,IAAM,GAAG,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAO,cAAM,OAAA,GAAG,CAAC,WAAW,EAAE,EAAjB,CAAiB,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC;AAxCD,4BAwCC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/util/subscribeAndCount.d.ts b/JS/node_modules/apollo-client/util/subscribeAndCount.d.ts deleted file mode 100644 index fdcb0a9..0000000 --- a/JS/node_modules/apollo-client/util/subscribeAndCount.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -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/JS/node_modules/apollo-client/util/subscribeAndCount.d.ts.map b/JS/node_modules/apollo-client/util/subscribeAndCount.d.ts.map deleted file mode 100644 index 6d367b1..0000000 --- a/JS/node_modules/apollo-client/util/subscribeAndCount.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/subscribeAndCount.js b/JS/node_modules/apollo-client/util/subscribeAndCount.js deleted file mode 100644 index e809971..0000000 --- a/JS/node_modules/apollo-client/util/subscribeAndCount.js +++ /dev/null @@ -1,22 +0,0 @@ -"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/JS/node_modules/apollo-client/util/subscribeAndCount.js.map b/JS/node_modules/apollo-client/util/subscribeAndCount.js.map deleted file mode 100644 index 8d939c4..0000000 --- a/JS/node_modules/apollo-client/util/subscribeAndCount.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/wrap.d.ts b/JS/node_modules/apollo-client/util/wrap.d.ts deleted file mode 100644 index 1b8c7d4..0000000 --- a/JS/node_modules/apollo-client/util/wrap.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -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/JS/node_modules/apollo-client/util/wrap.d.ts.map b/JS/node_modules/apollo-client/util/wrap.d.ts.map deleted file mode 100644 index ba22fd9..0000000 --- a/JS/node_modules/apollo-client/util/wrap.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-client/util/wrap.js b/JS/node_modules/apollo-client/util/wrap.js deleted file mode 100644 index 9447e55..0000000 --- a/JS/node_modules/apollo-client/util/wrap.js +++ /dev/null @@ -1,40 +0,0 @@ -"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/JS/node_modules/apollo-client/util/wrap.js.map b/JS/node_modules/apollo-client/util/wrap.js.map deleted file mode 100644 index becadbf..0000000 --- a/JS/node_modules/apollo-client/util/wrap.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrap.js","sourceRoot":"","sources":["../../src/util/wrap.ts"],"names":[],"mappings":";;AAEA,mBAAe,UAAC,IAAuB,EAAE,EAA2B,IAAK,OAAA;IACvE,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,yBAAc;;IAEd,IAAI;QACF,OAAO,EAAE,eAAI,IAAI,EAAE;KACpB;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACd;AACH,CAAC,EARwE,CAQxE,EAAC;AAEF,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,SAAgB,SAAS,CAAC,IAAc,EAAE,KAAa;IACrD,IAAI,OAAO,GAAW,IAAa,CAAC;IACpC,IAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC;IAE/B,OAAO,CAAC,KAAK,GAAG,UAAC,CAAS,IAAK,OAAA,CAAC,OAAO,GAAG,CAAC,CAAC,EAAb,CAAa,CAAC;IAE7C,IAAI;QACF,IAAM,MAAM,GAAG,IAAI,EAAE,CAAC;QACtB,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC;KACf;YAAS;QACR,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC;KAC1B;AACH,CAAC;AAbD,8BAaC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/version.d.ts b/JS/node_modules/apollo-client/version.d.ts deleted file mode 100644 index e5bc4f9..0000000 --- a/JS/node_modules/apollo-client/version.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const version = "2.6.10"; -//# sourceMappingURL=version.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-client/version.d.ts.map b/JS/node_modules/apollo-client/version.d.ts.map deleted file mode 100644 index 674cd41..0000000 --- a/JS/node_modules/apollo-client/version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAA"} \ No newline at end of file diff --git a/JS/node_modules/apollo-client/version.js b/JS/node_modules/apollo-client/version.js deleted file mode 100644 index c40c18b..0000000 --- a/JS/node_modules/apollo-client/version.js +++ /dev/null @@ -1 +0,0 @@ -exports.version = "2.6.10" \ No newline at end of file diff --git a/JS/node_modules/apollo-client/version.js.map b/JS/node_modules/apollo-client/version.js.map deleted file mode 100644 index 4e080c9..0000000 --- a/JS/node_modules/apollo-client/version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-error/CHANGELOG.md b/JS/node_modules/apollo-link-error/CHANGELOG.md deleted file mode 100644 index aef8995..0000000 --- a/JS/node_modules/apollo-link-error/CHANGELOG.md +++ /dev/null @@ -1,52 +0,0 @@ -# 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/JS/node_modules/apollo-link-error/LICENSE b/JS/node_modules/apollo-link-error/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/JS/node_modules/apollo-link-error/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/apollo-link-error/README.md b/JS/node_modules/apollo-link-error/README.md deleted file mode 100644 index 43f757c..0000000 --- a/JS/node_modules/apollo-link-error/README.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -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.forEach(({ 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#errors) from [`apollo-link-http`](http). 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 = undefined;` within the error handler: - -```js -onError(({ response, operation }) => { - if (operation.operationName === "IgnoreErrorsQuery") { - response.errors = undefined; - } -}); -``` diff --git a/JS/node_modules/apollo-link-error/lib/bundle.cjs.js b/JS/node_modules/apollo-link-error/lib/bundle.cjs.js deleted file mode 100644 index b5afd68..0000000 --- a/JS/node_modules/apollo-link-error/lib/bundle.cjs.js +++ /dev/null @@ -1,89 +0,0 @@ -'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/JS/node_modules/apollo-link-error/lib/bundle.cjs.js.map b/JS/node_modules/apollo-link-error/lib/bundle.cjs.js.map deleted file mode 100644 index 9541978..0000000 --- a/JS/node_modules/apollo-link-error/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;AAC/B,IAAI,OAAO,IAAIA,qBAAU,CAAC,UAAU,SAAS,EAAE,OAAO,EAAE;A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E,IAAC,SAAS,IAAI,UAAU,MAAM,EAAE;AACnC,IAAIC,eAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACjC,IAAI,SAAS,SAAS,CAAC,YAAY,EAAE;AACrC,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAC3C,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,OAAO,EAAE;AAChE,QAAQ,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrD,KAAK,CAAC;AACN,IAAI,OAAO,SAAS,CAAC;AACrB,CAAC,CAACF,qBAAU,CAAC;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-error/lib/bundle.esm.js b/JS/node_modules/apollo-link-error/lib/bundle.esm.js deleted file mode 100644 index a7eb503..0000000 --- a/JS/node_modules/apollo-link-error/lib/bundle.esm.js +++ /dev/null @@ -1,84 +0,0 @@ -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/JS/node_modules/apollo-link-error/lib/bundle.esm.js.map b/JS/node_modules/apollo-link-error/lib/bundle.esm.js.map deleted file mode 100644 index dd978bc..0000000 --- a/JS/node_modules/apollo-link-error/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 ExecutionResult,\n} from 'apollo-link';\nimport { GraphQLError } 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":";;;SAiCgB,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,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,aA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F,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;AACL,CAAC;;IAE8BA,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;AAAD,CAbA,CAA+B,UAAU;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-error/lib/bundle.umd.js b/JS/node_modules/apollo-link-error/lib/bundle.umd.js deleted file mode 100644 index df8bbfa..0000000 --- a/JS/node_modules/apollo-link-error/lib/bundle.umd.js +++ /dev/null @@ -1,92 +0,0 @@ -(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/JS/node_modules/apollo-link-error/lib/bundle.umd.js.map b/JS/node_modules/apollo-link-error/lib/bundle.umd.js.map deleted file mode 100644 index f51c1d2..0000000 --- a/JS/node_modules/apollo-link-error/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 ExecutionResult,\n} from 'apollo-link';\nimport { GraphQLError } 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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,QAAQ,CAAC;kCAClC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;kCACpC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;+BAC3C,CAAC,CAAC;8BACH,OAAO;2BACR;0BACD,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;uBAC9B;sBACD,QAAQ,EAAE;0BAGR,IAAI,CAAC,aAAa,EAAE;8BAClB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;2BACpC;uBACF;mBACF,CAAC,CAAC;eACJ;cAAC,OAAO,CAAC,EAAE;kBACV,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;kBACtD,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;eACnB;cAED,OAAO;kBACL,IAAI,GAAG;sBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;kBAC3B,IAAI,UAAU;sBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;eACnC,CAAC;WACH,CAAC,CAAC;OACJ,CAAC,CAAC;EACL,CAAC;;MAE8BC,qCAAU;MAEvC,mBAAY,YAAoC;UAAhD,YACE,iBAAO,SAER;UADC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;;OACnC;MAEM,2BAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;UAEjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;OAC9C;MACH,gBAAC;EAAD,CAbA,CAA+BF,qBAAU;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-error/lib/index.d.ts b/JS/node_modules/apollo-link-error/lib/index.d.ts deleted file mode 100644 index fdea55c..0000000 --- a/JS/node_modules/apollo-link-error/lib/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ApolloLink, Observable, Operation, NextLink, FetchResult, ExecutionResult } from 'apollo-link'; -import { GraphQLError } 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/JS/node_modules/apollo-link-error/lib/index.d.ts.map b/JS/node_modules/apollo-link-error/lib/index.d.ts.map deleted file mode 100644 index ac5780a..0000000 --- a/JS/node_modules/apollo-link-error/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,EACX,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,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/JS/node_modules/apollo-link-error/lib/index.js b/JS/node_modules/apollo-link-error/lib/index.js deleted file mode 100644 index 5d44190..0000000 --- a/JS/node_modules/apollo-link-error/lib/index.js +++ /dev/null @@ -1,85 +0,0 @@ -"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/JS/node_modules/apollo-link-error/lib/index.js.map b/JS/node_modules/apollo-link-error/lib/index.js.map deleted file mode 100644 index 4a94840..0000000 --- a/JS/node_modules/apollo-link-error/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,2CAOqB;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,CAAC;oCACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;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E,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/JS/node_modules/apollo-link-error/package.json b/JS/node_modules/apollo-link-error/package.json deleted file mode 100644 index e78a4a0..0000000 --- a/JS/node_modules/apollo-link-error/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "apollo-link-error", - "version": "1.1.13", - "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.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "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": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/JS/node_modules/apollo-link-http-common/CHANGELOG.md b/JS/node_modules/apollo-link-http-common/CHANGELOG.md deleted file mode 100644 index 227e016..0000000 --- a/JS/node_modules/apollo-link-http-common/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# 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/JS/node_modules/apollo-link-http-common/LICENSE b/JS/node_modules/apollo-link-http-common/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/JS/node_modules/apollo-link-http-common/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/apollo-link-http-common/README.md b/JS/node_modules/apollo-link-http-common/README.md deleted file mode 100644 index 9dd9a16..0000000 --- a/JS/node_modules/apollo-link-http-common/README.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -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/JS/node_modules/apollo-link-http-common/lib/bundle.cjs.js b/JS/node_modules/apollo-link-http-common/lib/bundle.cjs.js deleted file mode 100644 index 60b8d29..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/bundle.cjs.js +++ /dev/null @@ -1,136 +0,0 @@ -'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/JS/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map b/JS/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map deleted file mode 100644 index 3da1d63..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;AACzB,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,iBAAiB,EAAE,KAAK;AAC5B,CAAC,CAAC;AACF,IAAI,cAAc,GAAG;AACrB,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,cAAc,EAAE,kBAAkB;AACtC,CAAC,CAAC;AACF,IAAI,cAAc,GAAG;AACrB,IAAI,MAAM,EAAE,MAAM;AAClB,CAAC,CAAC;AACC,IAAC,kBAAkB,GAAG;AACzB,IAAI,IAAI,EAAE,kBAAkB;AAC5B,IAAI,OAAO,E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AAE;AACpB,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,SAAS,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;AAChD,QAAQ,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;AACtC,KAAK;AACL,SAAS;AACT,QAAQ,OAAO,WAAW,IAAI,UAAU,CAAC;AACzC,KAAK;AACL;;;;;;;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http-common/lib/bundle.esm.js b/JS/node_modules/apollo-link-http-common/lib/bundle.esm.js deleted file mode 100644 index d84067e..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/bundle.esm.js +++ /dev/null @@ -1,125 +0,0 @@ -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/JS/node_modules/apollo-link-http-common/lib/bundle.esm.js.map b/JS/node_modules/apollo-link-http-common/lib/bundle.esm.js.map deleted file mode 100644 index b893800..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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?: WindowOrWorkerGlobalScope['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: WindowOrWorkerGlobalScope['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;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AU,EAAE;QAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;KAC/B;SAAM;QACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;KAC9C;AACH;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http-common/lib/bundle.umd.js b/JS/node_modules/apollo-link-http-common/lib/bundle.umd.js deleted file mode 100644 index 0d234d1..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/bundle.umd.js +++ /dev/null @@ -1,138 +0,0 @@ -(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/JS/node_modules/apollo-link-http-common/lib/bundle.umd.js.map b/JS/node_modules/apollo-link-http-common/lib/bundle.umd.js.map deleted file mode 100644 index 2ad167e..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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?: WindowOrWorkerGlobalScope['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: WindowOrWorkerGlobalScope['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;MAEW,kBAAkB,GAAG;MAChC,IAAI,EAAE,kBAAkB;MACxB,OAAO,EAAE,cAAc;MACvB,OAAO,EAAE,cAAc;IACvB;MAEW,gBAAgB,GAAG,UAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;MACxD,IAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAgB,CAAC;MAEhD,KAAK,CAAC,IAAI,GAAG,aAAa,CAAC;MAC3B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;MAC1B,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;MACnC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;MAEtB,MAAM,KAAK,CAAC;EACd,EAAE;MAGW,yBAAyB,GAAG,UAAA,UAAU,IAAI,OAAA,UAAC,QAAkB;MACxE,QACE,QAAQ;WACL,IAAI,EAAE;WACN,IAAI,CAAC,UAAA,QAAQ;UACZ,IAAI;cACF,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;WAC7B;UAAC,OAAO,GAAG,EAAE;cACZ,IAAM,UAAU,GAAG,GAAuB,CAAC;cAC3C,UAAU,CAAC,IAAI,GAAG,kBAAkB,CAAC;cACrC,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;cAC/B,UAAU,CAAC,UAAU,GAAG,QAAQ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,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;UAC1B,MAAM,UAAU,CAAC;OAClB;MACD,OAAO,UAAU,CAAC;EACpB,EAAE;MAGW,SAAS,GAAG,UACvB,SAAS,EACT,WAAyD;MAEzD,IAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;MACvC,IAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;MAE/B,IAAI,UAAU,EAAE;UACd,OAAO,UAAU,CAAC;OACnB;WAAM,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE;UAC5C,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;OAC/B;WAAM;UACL,OAAQ,WAAsB,IAAI,UAAU,CAAC;OAC9C;EACH;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http-common/lib/index.d.ts b/JS/node_modules/apollo-link-http-common/lib/index.d.ts deleted file mode 100644 index dbbe809..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -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?: WindowOrWorkerGlobalScope['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: RequestInfo, 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/JS/node_modules/apollo-link-http-common/lib/index.d.ts.map b/JS/node_modules/apollo-link-http-common/lib/index.d.ts.map deleted file mode 100644 index 262422a..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAY9C,oBAAY,WAAW,GAAG,KAAK,GAAG;IAChC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF,oBAAY,gBAAgB,GAAG,KAAK,GAAG;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oBAAY,gBAAgB,GAAG,cAAc,GAAG;IAC9C,UAAU,EAAE,KAAK,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,WAAW,CAAC,EAAE,GAAG,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAAC;CAChC;AAGD,MAAM,WAAW,IAAI;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,WAAW;IAM1B,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IAO3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAK5B,KAAK,CAAC,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAK3C,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,kFAcxB,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/JS/node_modules/apollo-link-http-common/lib/index.js b/JS/node_modules/apollo-link-http-common/lib/index.js deleted file mode 100644 index 05cd095..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/index.js +++ /dev/null @@ -1,124 +0,0 @@ -"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/JS/node_modules/apollo-link-http-common/lib/index.js.map b/JS/node_modules/apollo-link-http-common/lib/index.js.map deleted file mode 100644 index ca963ac..0000000 --- a/JS/node_modules/apollo-link-http-common/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,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C,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/JS/node_modules/apollo-link-http-common/package.json b/JS/node_modules/apollo-link-http-common/package.json deleted file mode 100644 index 90d1acd..0000000 --- a/JS/node_modules/apollo-link-http-common/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "apollo-link-http-common", - "version": "0.2.16", - "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.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "fetch-mock": "6.5.2", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "object-to-querystring": "1.0.8", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "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": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/JS/node_modules/apollo-link-http/CHANGELOG.md b/JS/node_modules/apollo-link-http/CHANGELOG.md deleted file mode 100644 index 33b0a2e..0000000 --- a/JS/node_modules/apollo-link-http/CHANGELOG.md +++ /dev/null @@ -1,85 +0,0 @@ -# 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/JS/node_modules/apollo-link-http/LICENSE b/JS/node_modules/apollo-link-http/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/JS/node_modules/apollo-link-http/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/apollo-link-http/README.md b/JS/node_modules/apollo-link-http/README.md deleted file mode 100644 index 1547f27..0000000 --- a/JS/node_modules/apollo-link-http/README.md +++ /dev/null @@ -1,315 +0,0 @@ ---- -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) provides an [interface](error#callback) 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/JS/node_modules/apollo-link-http/lib/bundle.cjs.js b/JS/node_modules/apollo-link-http/lib/bundle.cjs.js deleted file mode 100644 index 8199fb7..0000000 --- a/JS/node_modules/apollo-link-http/lib/bundle.cjs.js +++ /dev/null @@ -1,150 +0,0 @@ -'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/JS/node_modules/apollo-link-http/lib/bundle.cjs.js.map b/JS/node_modules/apollo-link-http/lib/bundle.cjs.js.map deleted file mode 100644 index 0a2c8fd..0000000 --- a/JS/node_modules/apollo-link-http/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __rest, __assign, __extends } from 'tslib';\nimport { ApolloLink, fromError, Observable } from 'apollo-link';\nimport { checkFetcher, selectURI, selectHttpOptionsAndBody, fallbackHttpConfig, createSignalIfSupported, serializeFetchParameter, parseAndCheckHttpResponse } from 'apollo-link-http-common';\n\nvar createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"includeExtensions\", \"useGETForQueries\"]);\n checkFetcher(fetcher);\n if (!fetcher) {\n fetcher = fetch;\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign({}, clientAwarenessHeaders, context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n fetcher(chosenURI, options)\n .then(function (response) {\n operation.setContext({ response: response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\nfunction rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(opts) {\n return _super.call(this, createHttpLink(opts).request) || this;\n }\n return HttpLink;\n}(ApolloLink));\n\nexport { HttpLink, createHttpLink };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["__rest","checkFetcher","ApolloLink","selectURI","__assign","selectHttpOptionsAndBody","fallbackHttpConfig","createSignalIfSupported","fromError","serializeFetchParameter","Observable","parseAndCheckHttpResponse","__extends"],"mappings":";;;;;;;;AAIG,IAAC,cAAc,GAAG,UAAU,WAAW,EAAE;AAC5C,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;AACrD,IAAI,IAAI,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAAC,iBAAiB,EAAE,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,EAAE,cAAc,GAAGA,YAAM,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAC,CAAC;AACtS,IAAIC,iCAAY,CAAC,OAAO,CAAC,CAAC;AAC1B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,GAAG,KAAK,CAAC;AACxB,KAAK;AACL,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,IAAI,EAAE,EAAE,iBAAiB,EAAE,iBAAiB,EAAE;AACtD,QAAQ,OAAO,EAAE,cAAc,CAAC,YAAY;AAC5C,QAAQ,WAAW,EAAE,cAAc,CAAC,WAAW;AAC/C,QAAQ,OAAO,EAAE,cAAc,CAAC,OAAO;AACvC,KAAK,CAAC;AACN,IAAI,OAAO,IAAIC,qBAAU,CAAC,UAAU,SAAS,EAAE;AAC/C,QAAQ,IAAI,SAAS,GAAGC,8BAAS,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAClD,QAAQ,IAAI,OAAO,GAAG,SAAS,CAAC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AACL,IAAI,IAAI,iBAAiB,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AACxE,IAAI,IAAI,MAAM,GAAG,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;AACpF,IAAI,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC;AACE,IAAC,QAAQ,IAAI,UAAU,MAAM,EAAE;AAClC,IAAIG,eAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAChC,IAAI,SAAS,QAAQ,CAAC,IAAI,EAAE;AAC5B,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;AACvE,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC;AACpB,CAAC,CAACV,qBAAU,CAAC;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http/lib/bundle.esm.js b/JS/node_modules/apollo-link-http/lib/bundle.esm.js deleted file mode 100644 index 88fe95d..0000000 --- a/JS/node_modules/apollo-link-http/lib/bundle.esm.js +++ /dev/null @@ -1,145 +0,0 @@ -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/JS/node_modules/apollo-link-http/lib/bundle.esm.js.map b/JS/node_modules/apollo-link-http/lib/bundle.esm.js.map deleted file mode 100644 index 1141d32..0000000 --- a/JS/node_modules/apollo-link-http/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,C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AO,UAAU,EAAE;YACnB,OAAO,EAAE,UAAU,YAAA,EAAE,CAAC;SACvB;QACD,aAAa,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;KACnD;IAQD,IAAI,QAAQ,GAAG,EAAE,EACf,WAAW,GAAG,SAAS,CAAC;IAC1B,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;QACxB,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,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;AACpB,CAAC;;IAE6BA,4BAAU;IAEtC,kBAAY,IAAuB;eACjC,kBAAM,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;KACpC;IACH,eAAC;AAAD,CALA,CAA8B,UAAU;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http/lib/bundle.umd.js b/JS/node_modules/apollo-link-http/lib/bundle.umd.js deleted file mode 100644 index 5e03c5c..0000000 --- a/JS/node_modules/apollo-link-http/lib/bundle.umd.js +++ /dev/null @@ -1,152 +0,0 @@ -(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/JS/node_modules/apollo-link-http/lib/bundle.umd.js.map b/JS/node_modules/apollo-link-http/lib/bundle.umd.js.map deleted file mode 100644 index 3414fad..0000000 --- a/JS/node_modules/apollo-link-http/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,M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V,WAAW,GAAG,iBAAiB,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;MACrE,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;EACpB,CAAC;;MAE6BG,oCAAU;MAEtC,kBAAY,IAAuB;iBACjC,kBAAM,cAAc,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;OACpC;MACH,eAAC;EAAD,CALA,CAA8BN,qBAAU;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http/lib/httpLink.d.ts b/JS/node_modules/apollo-link-http/lib/httpLink.d.ts deleted file mode 100644 index 042ab64..0000000 --- a/JS/node_modules/apollo-link-http/lib/httpLink.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -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/JS/node_modules/apollo-link-http/lib/httpLink.d.ts.map b/JS/node_modules/apollo-link-http/lib/httpLink.d.ts.map deleted file mode 100644 index dd44773..0000000 --- a/JS/node_modules/apollo-link-http/lib/httpLink.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link-http/lib/httpLink.js b/JS/node_modules/apollo-link-http/lib/httpLink.js deleted file mode 100644 index af0708b..0000000 --- a/JS/node_modules/apollo-link-http/lib/httpLink.js +++ /dev/null @@ -1,145 +0,0 @@ -"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/JS/node_modules/apollo-link-http/lib/httpLink.js.map b/JS/node_modules/apollo-link-http/lib/httpLink.js.map deleted file mode 100644 index c598864..0000000 --- a/JS/node_modules/apollo-link-http/lib/httpLink.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,WA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,IAAI,QAAQ,GAAG,EAAE,EACf,WAAW,GAAG,SAAS,CAAC;IAC1B,IAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;QACxB,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,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,CAAC,CAAC,CAAC,GAAG,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/JS/node_modules/apollo-link-http/lib/index.d.ts b/JS/node_modules/apollo-link-http/lib/index.d.ts deleted file mode 100644 index a59e5e7..0000000 --- a/JS/node_modules/apollo-link-http/lib/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './httpLink'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http/lib/index.d.ts.map b/JS/node_modules/apollo-link-http/lib/index.d.ts.map deleted file mode 100644 index 99cf802..0000000 --- a/JS/node_modules/apollo-link-http/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link-http/lib/index.js b/JS/node_modules/apollo-link-http/lib/index.js deleted file mode 100644 index 9aab4cf..0000000 --- a/JS/node_modules/apollo-link-http/lib/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"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/JS/node_modules/apollo-link-http/lib/index.js.map b/JS/node_modules/apollo-link-http/lib/index.js.map deleted file mode 100644 index 518010f..0000000 --- a/JS/node_modules/apollo-link-http/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAA2B"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link-http/package.json b/JS/node_modules/apollo-link-http/package.json deleted file mode 100644 index 578d133..0000000 --- a/JS/node_modules/apollo-link-http/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "apollo-link-http", - "version": "1.5.17", - "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.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "apollo-fetch": "0.7.0", - "fetch-mock": "6.5.2", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "object-to-querystring": "1.0.8", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "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": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/JS/node_modules/apollo-link/CHANGELOG.md b/JS/node_modules/apollo-link/CHANGELOG.md deleted file mode 100644 index a97f058..0000000 --- a/JS/node_modules/apollo-link/CHANGELOG.md +++ /dev/null @@ -1,57 +0,0 @@ -# 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/JS/node_modules/apollo-link/LICENSE b/JS/node_modules/apollo-link/LICENSE deleted file mode 100644 index 07ea662..0000000 --- a/JS/node_modules/apollo-link/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/apollo-link/README.md b/JS/node_modules/apollo-link/README.md deleted file mode 100644 index 8180388..0000000 --- a/JS/node_modules/apollo-link/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# 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/JS/node_modules/apollo-link/lib/bundle.cjs.js b/JS/node_modules/apollo-link/lib/bundle.cjs.js deleted file mode 100644 index 67ed928..0000000 --- a/JS/node_modules/apollo-link/lib/bundle.cjs.js +++ /dev/null @@ -1,212 +0,0 @@ -'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/JS/node_modules/apollo-link/lib/bundle.cjs.js.map b/JS/node_modules/apollo-link/lib/bundle.cjs.js.map deleted file mode 100644 index 45e1e8e..0000000 --- a/JS/node_modules/apollo-link/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,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C9D,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AACpF,KAAK,CAAC;AACN,IAAI,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,IAAI,EAAE;AAClD,QAAQ,OAAO,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAClC,KAAK,CAAC;AACN,IAAI,UAAU,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,OAAO,EAAE;AACjE,QAAQ,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,GAAG,IAAIF,0BAAc,CAAC,CAAC,CAAC,GAAG,IAAIA,0BAAc,CAAC,4BAA4B,CAAC,CAAC;AAC/H,KAAK,CAAC;AACN,IAAI,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;AAC7B,IAAI,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;AAC3B,IAAI,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;AAC7B,IAAI,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;AACjC,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC,EAAE,EAAE;AACL,SAAS,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE;AAClC,IAAI,QAAQ,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,EAAE,EAAE,EAAE;AACnI;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link/lib/bundle.esm.js b/JS/node_modules/apollo-link/lib/bundle.esm.js deleted file mode 100644 index c73d770..0000000 --- a/JS/node_modules/apollo-link/lib/bundle.esm.js +++ /dev/null @@ -1,191 +0,0 @@ -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/JS/node_modules/apollo-link/lib/bundle.esm.js.map b/JS/node_modules/apollo-link/lib/bundle.esm.js.map deleted file mode 100644 index 6612c81..0000000 --- a/JS/node_modules/apollo-link/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 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E,EACpB;AACJ,CAAC;;;;"} \ No newline at end of file diff --git a/JS/node_modules/apollo-link/lib/bundle.umd.js b/JS/node_modules/apollo-link/lib/bundle.umd.js deleted file mode 100644 index 5e978ca..0000000 --- a/JS/node_modules/apollo-link/lib/bundle.umd.js +++ /dev/null @@ -1,213 +0,0 @@ -(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/JS/node_modules/apollo-link/lib/bundle.umd.js.map b/JS/node_modules/apollo-link/lib/bundle.umd.js.map deleted file mode 100644 index ca934c4..0000000 --- a/JS/node_modules/apollo-link/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAAC,GAAG,CAAC,EAAE;cACrC,MAAM;WACP;OACF;MAED,OAAO,SAAS,CAAC;EACnB,CAAC;EAED;MAA+BA,qCAAK;MAElC,mBAAY,OAAgB,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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/JS/node_modules/apollo-link/lib/index.d.ts b/JS/node_modules/apollo-link/lib/index.d.ts deleted file mode 100644 index 94b9f78..0000000 --- a/JS/node_modules/apollo-link/lib/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/JS/node_modules/apollo-link/lib/index.d.ts.map b/JS/node_modules/apollo-link/lib/index.d.ts.map deleted file mode 100644 index ae8e854..0000000 --- a/JS/node_modules/apollo-link/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/index.js b/JS/node_modules/apollo-link/lib/index.js deleted file mode 100644 index 7a4f2ae..0000000 --- a/JS/node_modules/apollo-link/lib/index.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/JS/node_modules/apollo-link/lib/index.js.map b/JS/node_modules/apollo-link/lib/index.js.map deleted file mode 100644 index 2a40f7d..0000000 --- a/JS/node_modules/apollo-link/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/link.d.ts b/JS/node_modules/apollo-link/lib/link.d.ts deleted file mode 100644 index 9b83c28..0000000 --- a/JS/node_modules/apollo-link/lib/link.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -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/JS/node_modules/apollo-link/lib/link.d.ts.map b/JS/node_modules/apollo-link/lib/link.d.ts.map deleted file mode 100644 index 47cf776..0000000 --- a/JS/node_modules/apollo-link/lib/link.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/link.js b/JS/node_modules/apollo-link/lib/link.js deleted file mode 100644 index 561886f..0000000 --- a/JS/node_modules/apollo-link/lib/link.js +++ /dev/null @@ -1,87 +0,0 @@ -"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/JS/node_modules/apollo-link/lib/link.js.map b/JS/node_modules/apollo-link/lib/link.js.map deleted file mode 100644 index 7e94f97..0000000 --- a/JS/node_modules/apollo-link/lib/link.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,KAAmC;IAEnC,IAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAM,SAAS,GAAG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ACrB,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/JS/node_modules/apollo-link/lib/linkUtils.d.ts b/JS/node_modules/apollo-link/lib/linkUtils.d.ts deleted file mode 100644 index 058ccfe..0000000 --- a/JS/node_modules/apollo-link/lib/linkUtils.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -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/JS/node_modules/apollo-link/lib/linkUtils.d.ts.map b/JS/node_modules/apollo-link/lib/linkUtils.d.ts.map deleted file mode 100644 index 39109a3..0000000 --- a/JS/node_modules/apollo-link/lib/linkUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/linkUtils.js b/JS/node_modules/apollo-link/lib/linkUtils.js deleted file mode 100644 index be68bd3..0000000 --- a/JS/node_modules/apollo-link/lib/linkUtils.js +++ /dev/null @@ -1,122 +0,0 @@ -"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/JS/node_modules/apollo-link/lib/linkUtils.js.map b/JS/node_modules/apollo-link/lib/linkUtils.js.map deleted file mode 100644 index aabc150..0000000 --- a/JS/node_modules/apollo-link/lib/linkUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;;IACnB,CAAC;IACH,gBAAC;AAAD,CAAC,AAND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B;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/JS/node_modules/apollo-link/lib/test-utils.d.ts b/JS/node_modules/apollo-link/lib/test-utils.d.ts deleted file mode 100644 index 1a2cbdb..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -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/JS/node_modules/apollo-link/lib/test-utils.d.ts.map b/JS/node_modules/apollo-link/lib/test-utils.d.ts.map deleted file mode 100644 index f337f9d..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/test-utils.js b/JS/node_modules/apollo-link/lib/test-utils.js deleted file mode 100644 index feecc92..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils.js +++ /dev/null @@ -1,9 +0,0 @@ -"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/JS/node_modules/apollo-link/lib/test-utils.js.map b/JS/node_modules/apollo-link/lib/test-utils.js.map deleted file mode 100644 index ea03f9f..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/test-utils/mockLink.d.ts b/JS/node_modules/apollo-link/lib/test-utils/mockLink.d.ts deleted file mode 100644 index e61009f..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/mockLink.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -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/JS/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map b/JS/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map deleted file mode 100644 index 91d303f..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/mockLink.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/test-utils/mockLink.js b/JS/node_modules/apollo-link/lib/test-utils/mockLink.js deleted file mode 100644 index 166c100..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/mockLink.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/JS/node_modules/apollo-link/lib/test-utils/mockLink.js.map b/JS/node_modules/apollo-link/lib/test-utils/mockLink.js.map deleted file mode 100644 index 24bed60..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/mockLink.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/test-utils/setContext.d.ts b/JS/node_modules/apollo-link/lib/test-utils/setContext.d.ts deleted file mode 100644 index 41259d8..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/setContext.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -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/JS/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map b/JS/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map deleted file mode 100644 index 5ead879..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/setContext.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/test-utils/setContext.js b/JS/node_modules/apollo-link/lib/test-utils/setContext.js deleted file mode 100644 index 0f382ec..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/setContext.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/JS/node_modules/apollo-link/lib/test-utils/setContext.js.map b/JS/node_modules/apollo-link/lib/test-utils/setContext.js.map deleted file mode 100644 index 29d313a..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/setContext.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts b/JS/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts deleted file mode 100644 index e79b7f6..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -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/JS/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map b/JS/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map deleted file mode 100644 index 0e0cfa6..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/testingUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-link/lib/test-utils/testingUtils.js b/JS/node_modules/apollo-link/lib/test-utils/testingUtils.js deleted file mode 100644 index 694489b..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/testingUtils.js +++ /dev/null @@ -1,38 +0,0 @@ -"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/JS/node_modules/apollo-link/lib/test-utils/testingUtils.js.map b/JS/node_modules/apollo-link/lib/test-utils/testingUtils.js.map deleted file mode 100644 index 94130d9..0000000 --- a/JS/node_modules/apollo-link/lib/test-utils/testingUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,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git a/JS/node_modules/apollo-link/lib/types.d.ts b/JS/node_modules/apollo-link/lib/types.d.ts deleted file mode 100644 index ba9a75c..0000000 --- a/JS/node_modules/apollo-link/lib/types.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import Observable from 'zen-observable-ts'; -import { DocumentNode } from 'graphql/language/ast'; -import { ExecutionResult as GraphQLExecutionResult } from 'graphql'; -export { DocumentNode }; -export interface ExecutionResult extends GraphQLExecutionResult { - data?: TData | null; -} -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/JS/node_modules/apollo-link/lib/types.d.ts.map b/JS/node_modules/apollo-link/lib/types.d.ts.map deleted file mode 100644 index 64b6a64..0000000 --- a/JS/node_modules/apollo-link/lib/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,IAAI,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,MAAM,WAAW,eAAe,CAC9B,KAAK,GAAG;IACN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CACD,SAAQ,sBAAsB;IAC9B,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,YA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JS/node_modules/apollo-link/lib/types.js b/JS/node_modules/apollo-link/lib/types.js deleted file mode 100644 index 11e638d..0000000 --- a/JS/node_modules/apollo-link/lib/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/JS/node_modules/apollo-link/lib/types.js.map b/JS/node_modules/apollo-link/lib/types.js.map deleted file mode 100644 index c768b79..0000000 --- a/JS/node_modules/apollo-link/lib/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/apollo-link/package.json b/JS/node_modules/apollo-link/package.json deleted file mode 100644 index 9be5fd7..0000000 --- a/JS/node_modules/apollo-link/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "apollo-link", - "version": "1.2.14", - "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.21" - }, - "peerDependencies": { - "graphql": "^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "devDependencies": { - "@types/graphql": "14.2.3", - "@types/jest": "24.9.0", - "@types/node": "9.6.55", - "graphql": "15.0.0", - "graphql-tag": "2.10.1", - "jest": "24.9.0", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "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": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/JS/node_modules/apollo-utilities/.flowconfig b/JS/node_modules/apollo-utilities/.flowconfig deleted file mode 100644 index ffa2101..0000000 --- a/JS/node_modules/apollo-utilities/.flowconfig +++ /dev/null @@ -1,8 +0,0 @@ -[ignore] - -[include] - -[libs] - -[options] -suppress_comment= \\(.\\|\n\\)*\\$ExpectError diff --git a/JS/node_modules/apollo-utilities/CHANGELOG.md b/JS/node_modules/apollo-utilities/CHANGELOG.md deleted file mode 100644 index 2cabb60..0000000 --- a/JS/node_modules/apollo-utilities/CHANGELOG.md +++ /dev/null @@ -1,106 +0,0 @@ -# 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/JS/node_modules/apollo-utilities/LICENSE b/JS/node_modules/apollo-utilities/LICENSE deleted file mode 100644 index 278ee9d..0000000 --- a/JS/node_modules/apollo-utilities/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -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/JS/node_modules/apollo-utilities/jest.config.js b/JS/node_modules/apollo-utilities/jest.config.js deleted file mode 100644 index 48f0a89..0000000 --- a/JS/node_modules/apollo-utilities/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - ...require('../../config/jest.config.settings'), -}; diff --git a/JS/node_modules/apollo-utilities/lib/bundle.cjs.js b/JS/node_modules/apollo-utilities/lib/bundle.cjs.js deleted file mode 100644 index 49d9f00..0000000 --- a/JS/node_modules/apollo-utilities/lib/bundle.cjs.js +++ /dev/null @@ -1,1125 +0,0 @@ -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, 13) : (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, 14) : (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', 15) : (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'), 16) : (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(11) : 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, 12) : (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)((0, _tslib.__assign)({}, document), { - definitions: (0, _tslib.__spreadArrays)([{ - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [{ - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName - } - }] - } - }], 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, 1) : (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', 2) : (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(3) : 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, 4) : (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, 5) : (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', 6) : (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', 7) : (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, 8) : (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', 9) : (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(10) : 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, (0, _tslib.__spreadArrays)([{}], 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)((0, _tslib.__assign)({}, node), { - selections: (0, _tslib.__spreadArrays)(selections, [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)((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)((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)((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/JS/node_modules/apollo-utilities/lib/bundle.cjs.js.map b/JS/node_modules/apollo-utilities/lib/bundle.cjs.js.map deleted file mode 100644 index a445ea6..0000000 --- a/JS/node_modules/apollo-utilities/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,C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,CAAC,OAAN,CAAc,KAAd,CAAJ,EAA0B;AACxB,MAAA,KAAK,GAAI,KAAa,CAAC,KAAd,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/JS/node_modules/apollo-utilities/lib/bundle.cjs.min.js b/JS/node_modules/apollo-utilities/lib/bundle.cjs.min.js deleted file mode 100644 index a7ed4e2..0000000 --- a/JS/node_modules/apollo-utilities/lib/bundle.cjs.min.js +++ /dev/null @@ -1 +0,0 @@ -exports.__esModule=!0,exports.addTypenameToDocument=function(e){return(0,n.visit)(y(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 f(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))});if(!o){var a=t;if(!(f(a)&&a.directives&&a.directives.some(function(e){return"export"===e.name.value})))return(0,r.__assign)((0,r.__assign)({},e),{selections:(0,r.__spreadArrays)(i,[_])})}}}}}})},exports.argumentsObjectFromField=s,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)((0,r.__assign)({},e),{operation:"query"})}}})},exports.checkDocument=y,exports.cloneDeep=function(e){return function e(n,t){switch(M.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,(0,r.__spreadArrays)([{}],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]=s(e,n)}),t}return null},exports.getDirectiveNames=m,exports.getDirectivesFromDocument=function(e,t){var i;return y(t),E((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)((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(11);"FragmentDefinition"===e.kind&&o.push(e)}),void 0===i&&((0,t.invariant)(1===o.length,12),i=o[0].name.value);return(0,r.__assign)((0,r.__assign)({},e),{definitions:(0,r.__spreadArrays)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:i}}]}}],e.definitions)})},exports.getInclusionDirectives=g,exports.getMainDefinition=k,exports.getMutationDefinition=function(e){y(e);var n=e.definitions.filter(function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation})[0];return(0,t.invariant)(n,1),n},exports.getOperationDefinition=h,exports.getOperationDefinitionOrDie=function(e){var n=h(e);return(0,t.invariant)(n,5),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=h(e);return(0,t.invariant)(n&&"query"===n.operation,6),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=f,exports.isIdValue=function(e){return e&&"id"===e.type&&"boolean"==typeof e.generated},exports.isInlineFragment=l,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 s=(0,i.default)(n);c+="("+s+")"}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 s(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 f(e){return"Field"===e.kind}function l(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,14);var r=n[0];(0,t.invariant)(r.name&&"if"===r.name.value,15);var i=r.value;return(0,t.invariant)(i&&("Variable"===i.kind||"BooleanValue"===i.kind),16),{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, 13) : 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, 14) : 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', 15) : 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'), 16) : 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(11) : 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, 12) : 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(__assign({}, document), { definitions: __spreadArrays([ - { - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName, - }, - }, - ], - }, - } - ], 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, 1) : invariant(mutationDef, 'Must contain a mutation definition.'); - return mutationDef; -} -function checkDocument(doc) { - process.env.NODE_ENV === "production" ? invariant(doc && doc.kind === 'Document', 2) : 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(3) : new InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\""); - } - return definition; - }); - process.env.NODE_ENV === "production" ? invariant(operations.length <= 1, 4) : 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, 5) : 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', 6) : invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.'); - return queryDef; -} -function getFragmentDefinition(doc) { - process.env.NODE_ENV === "production" ? invariant(doc.kind === 'Document', 7) : 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, 8) : 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', 9) : 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(10) : 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, __spreadArrays([{}], 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(__assign({}, node), { selections: __spreadArrays(selections, [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(__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(__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(__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/JS/node_modules/apollo-utilities/lib/bundle.esm.js.map b/JS/node_modules/apollo-utilities/lib/bundle.esm.js.map deleted file mode 100644 index 2057809..0000000 --- a/JS/node_modules/apollo-utilities/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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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AAC,EAAE,CAAC,CAAC;AAUrC,SAAgB,qBAAqB,CAAC,GAAW,EAAE,IAAa;IAAb,qBAAA,EAAA,aAAa;IAC9D,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACvC,IAAI,CAAC,MAAM,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;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/JS/node_modules/apollo-utilities/lib/bundle.umd.js b/JS/node_modules/apollo-utilities/lib/bundle.umd.js deleted file mode 100644 index 4c8a17b..0000000 --- a/JS/node_modules/apollo-utilities/lib/bundle.umd.js +++ /dev/null @@ -1,1131 +0,0 @@ -(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; - } -})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : 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, 13) : (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, 14) : (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', 15) : (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'), 16) : (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(11) : 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, 12) : (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)((0, _tslib.__assign)({}, document), { - definitions: (0, _tslib.__spreadArrays)([{ - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [{ - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName - } - }] - } - }], 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, 1) : (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', 2) : (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(3) : 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, 4) : (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, 5) : (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', 6) : (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', 7) : (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, 8) : (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', 9) : (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(10) : 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, (0, _tslib.__spreadArrays)([{}], 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)((0, _tslib.__assign)({}, node), { - selections: (0, _tslib.__spreadArrays)(selections, [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)((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)((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)((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/JS/node_modules/apollo-utilities/lib/bundle.umd.js.map b/JS/node_modules/apollo-utilities/lib/bundle.umd.js.map deleted file mode 100644 index e69270f..0000000 --- a/JS/node_modules/apollo-utilities/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,WA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AAnB,IAA4B,CAH9B,EAIE;AACA,UAAI,KAAK,CAAC,OAAN,CAAc,KAAd,CAAJ,EAA0B;AACxB,QAAA,KAAK,GAAI,KAAa,CAAC,KAAd,CAAoB,CAApB,CAAT;AACD,OAFD,MAEO;AACL,QAAA,KAAK,GAAA,qBAAA;AACH,UAAA,SAAS,EAAE,MAAM,CAAC,cAAP,CAAsB,KAAtB;AADR,SAAA,EAEA,KAFA,CAAL;AAID;;AACD,MAAA,UAAU,CAAC,IAAX,CAAgB,KAAhB;AACD;;AACD,WAAO,KAAP;AACD;;AChHD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAP,CAAc,EAAd,CAAnB;;AAUA,WAAgB,qBAAhB,CAAsC,GAAtC,EAAmD,IAAnD,EAAgE;AAAb,QAAA,IAAA,KAAA,KAAA,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/JS/node_modules/apollo-utilities/lib/directives.d.ts b/JS/node_modules/apollo-utilities/lib/directives.d.ts deleted file mode 100644 index 5389a83..0000000 --- a/JS/node_modules/apollo-utilities/lib/directives.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/directives.d.ts.map b/JS/node_modules/apollo-utilities/lib/directives.d.ts.map deleted file mode 100644 index 4da04b6..0000000 --- a/JS/node_modules/apollo-utilities/lib/directives.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/directives.js b/JS/node_modules/apollo-utilities/lib/directives.js deleted file mode 100644 index 41a8a9d..0000000 --- a/JS/node_modules/apollo-utilities/lib/directives.js +++ /dev/null @@ -1,71 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/directives.js.map b/JS/node_modules/apollo-utilities/lib/directives.js.map deleted file mode 100644 index 915e07f..0000000 --- a/JS/node_modules/apollo-utilities/lib/directives.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CA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;AACV,CAAC;AA7BD,wDA6BC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/fragments.d.ts b/JS/node_modules/apollo-utilities/lib/fragments.d.ts deleted file mode 100644 index 8141196..0000000 --- a/JS/node_modules/apollo-utilities/lib/fragments.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/fragments.d.ts.map b/JS/node_modules/apollo-utilities/lib/fragments.d.ts.map deleted file mode 100644 index cbff38a..0000000 --- a/JS/node_modules/apollo-utilities/lib/fragments.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/fragments.js b/JS/node_modules/apollo-utilities/lib/fragments.js deleted file mode 100644 index 5b6e8f8..0000000 --- a/JS/node_modules/apollo-utilities/lib/fragments.js +++ /dev/null @@ -1,42 +0,0 @@ -"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(tslib_1.__assign({}, document), { definitions: tslib_1.__spreadArrays([ - { - kind: 'OperationDefinition', - operation: 'query', - selectionSet: { - kind: 'SelectionSet', - selections: [ - { - kind: 'FragmentSpread', - name: { - kind: 'Name', - value: actualFragmentName, - }, - }, - ], - }, - } - ], document.definitions) }); - return query; -} -exports.getFragmentQueryDocument = getFragmentQueryDocument; -//# sourceMappingURL=fragments.js.map \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/fragments.js.map b/JS/node_modules/apollo-utilities/lib/fragments.js.map deleted file mode 100644 index ece1e37..0000000 --- a/JS/node_modules/apollo-utilities/lib/fragments.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../src/fragments.ts"],"names":[],"mappings":";;;AACA,6CAAyD;AAwBzD,SAAgB,wBAAwB,CACtC,QAAsB,EACtB,YAAqB;IAErB,IAAI,kBAAkB,GAAG,YAAY,CAAC;IAKtC,IAAM,SAAS,GAAkC,EAAE,CAAC;IACpD,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,UAAA,UAAU;QAGrC,IAAI,UAAU,CAAC,IAAI,KAAK,qBAAqB,EAAE;YAC7C,MAAM,IAAI,6BAAc,CACtB,aAAW,UAAU,CAAC,SAAS,mBAC7B,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,aAAW,UAAU,CAAC,IAAI,CAAC,KAAK,MAAG,CAAC,CAAC,CAAC,EAAE,QACxD;gBACF,yFAAyF,CAC5F,CAAC;SACH;QAGD,IAAI,UAAU,CAAC,IAAI,KAAK,oBAAoB,EAAE;YAC5C,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC5B;IACH,CAAC,CAAC,CAAC;IAIH,IAAI,OAAO,kBAAkB,KAAK,WAAW,EAAE;QAC7C,wBAAS,CACP,SAAS,CAAC,MAAM,KAAK,CAAC,EACtB,WACE,SAAS,CAAC,MAAM,sFACmE,CACtF,CAAC;QACF,kBAAkB,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;KAC9C;IAID,IAAM,KAAK,yCACN,QAAQ,KACX,WAAW;YACT;gBACE,IAAI,EAAE,qBAAqB;gBAC3B,SAAS,EAAE,OAAO;gBAClB,YAAY,EAAE;oBACZ,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACV;4BACE,IAAI,EAAE,gBAAgB;4BACtB,IAAI,EAAE;gCACJ,IAAI,EAAE,MAAM;gCACZ,KAAK,EAAE,kBAAkB;6BAC1B;yBACF;qBACF;iBACF;aACF;WACE,QAAQ,CAAC,WAAW,IAE1B,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAlED,4DAkEC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/getFromAST.d.ts b/JS/node_modules/apollo-utilities/lib/getFromAST.d.ts deleted file mode 100644 index d002918..0000000 --- a/JS/node_modules/apollo-utilities/lib/getFromAST.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/getFromAST.d.ts.map b/JS/node_modules/apollo-utilities/lib/getFromAST.d.ts.map deleted file mode 100644 index ef2f994..0000000 --- a/JS/node_modules/apollo-utilities/lib/getFromAST.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/getFromAST.js b/JS/node_modules/apollo-utilities/lib/getFromAST.js deleted file mode 100644 index 39f4e5a..0000000 --- a/JS/node_modules/apollo-utilities/lib/getFromAST.js +++ /dev/null @@ -1,131 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var tslib_1 = require("tslib"); -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, tslib_1.__spreadArrays([{}], 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/JS/node_modules/apollo-utilities/lib/getFromAST.js.map b/JS/node_modules/apollo-utilities/lib/getFromAST.js.map deleted file mode 100644 index 88d74a5..0000000 --- a/JS/node_modules/apollo-utilities/lib/getFromAST.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CA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A2B,CACzB,eAAe,EACf,QAAQ,CAAC,IAAI,EACb,YAAyB,CAC1B,CAAC;YAEF,OAAO,eAAe,CAAC;QACzB,CAAC,CACF,CAAC;QAEJ,OAAO,eAAM,uCAAC,EAAE,GAAK,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/JS/node_modules/apollo-utilities/lib/index.d.ts b/JS/node_modules/apollo-utilities/lib/index.d.ts deleted file mode 100644 index 4aef870..0000000 --- a/JS/node_modules/apollo-utilities/lib/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/index.d.ts.map b/JS/node_modules/apollo-utilities/lib/index.d.ts.map deleted file mode 100644 index 65614a6..0000000 --- a/JS/node_modules/apollo-utilities/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/index.js b/JS/node_modules/apollo-utilities/lib/index.js deleted file mode 100644 index 0693303..0000000 --- a/JS/node_modules/apollo-utilities/lib/index.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/index.js.map b/JS/node_modules/apollo-utilities/lib/index.js.map deleted file mode 100644 index 3c41b70..0000000 --- a/JS/node_modules/apollo-utilities/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/storeUtils.d.ts b/JS/node_modules/apollo-utilities/lib/storeUtils.d.ts deleted file mode 100644 index 57ec870..0000000 --- a/JS/node_modules/apollo-utilities/lib/storeUtils.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/storeUtils.d.ts.map b/JS/node_modules/apollo-utilities/lib/storeUtils.d.ts.map deleted file mode 100644 index 531a964..0000000 --- a/JS/node_modules/apollo-utilities/lib/storeUtils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,EAEb,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,QAAQ,EACT,MAAM,SAAS,CAAC;AAKjB,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,GAAG,CAAC;CACX;AAED,oBAAY,SAAS,GAAG,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;AAE9C,oBAAY,UAAU,GAClB,MAAM,GACN,MAAM,GACN,MAAM,EAAE,GACR,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Y,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/JS/node_modules/apollo-utilities/lib/storeUtils.js b/JS/node_modules/apollo-utilities/lib/storeUtils.js deleted file mode 100644 index bf04bfb..0000000 --- a/JS/node_modules/apollo-utilities/lib/storeUtils.js +++ /dev/null @@ -1,225 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/storeUtils.js.map b/JS/node_modules/apollo-utilities/lib/storeUtils.js.map deleted file mode 100644 index bb07be7..0000000 --- a/JS/node_modules/apollo-utilities/lib/storeUtils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/E,CAAC;AAFD,sCAEC;AAID,SAAgB,aAAa,CAAC,KAAgB;IAC5C,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAFD,sCAEC;AAED,SAAS,aAAa,CAAC,KAAgB;IACrC,OAAO,KAAK,CAAC,IAAI,KAAK,aAAa,CAAC;AACtC,CAAC;AAED,SAAS,cAAc,CAAC,KAAgB;IACtC,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC;AACvC,CAAC;AAED,SAAS,UAAU,C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;QACD;YACE,OAAO,IAAI,CAAC,KAAK,CAAC;KACrB;AACH,CAAC;AAzBD,sCAyBC"} \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/transform.d.ts b/JS/node_modules/apollo-utilities/lib/transform.d.ts deleted file mode 100644 index 377bb5a..0000000 --- a/JS/node_modules/apollo-utilities/lib/transform.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/transform.d.ts.map b/JS/node_modules/apollo-utilities/lib/transform.d.ts.map deleted file mode 100644 index 5d6140b..0000000 --- a/JS/node_modules/apollo-utilities/lib/transform.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/transform.js b/JS/node_modules/apollo-utilities/lib/transform.js deleted file mode 100644 index b85155c..0000000 --- a/JS/node_modules/apollo-utilities/lib/transform.js +++ /dev/null @@ -1,311 +0,0 @@ -"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(tslib_1.__assign({}, node), { selections: tslib_1.__spreadArrays(selections, [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(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(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(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/JS/node_modules/apollo-utilities/lib/transform.js.map b/JS/node_modules/apollo-utilities/lib/transform.js.map deleted file mode 100644 index 4ea0981..0000000 --- a/JS/node_modules/apollo-utilities/lib/transform.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;AAaA,oDAAiD;AAEjD,2CAQsB;AACtB,sDAAqD;AACrD,6CAAyC;AACzC,2CAAyD;AAyBzD,IAAM,cAAc,GAAc;IAChC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,YAAY;KACpB;CACF,CAAC;AAEF,SAAS,OAAO,CACd,EAAoD,EACpD,SAAsB;IAEtB,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CACrC,UAAA,SAAS;QACP,OAAA,SAAS,CAAC,IAAI,KAAK,g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AAA,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/JS/node_modules/apollo-utilities/lib/util/assign.d.ts b/JS/node_modules/apollo-utilities/lib/util/assign.d.ts deleted file mode 100644 index 222d749..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/assign.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/util/assign.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/assign.d.ts.map deleted file mode 100644 index 20e9dbf..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/assign.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/assign.js b/JS/node_modules/apollo-utilities/lib/util/assign.js deleted file mode 100644 index 78e3901..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/assign.js +++ /dev/null @@ -1,19 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/assign.js.map b/JS/node_modules/apollo-utilities/lib/util/assign.js.map deleted file mode 100644 index 6a697cc..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/assign.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/canUse.d.ts b/JS/node_modules/apollo-utilities/lib/util/canUse.d.ts deleted file mode 100644 index 0975a35..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/canUse.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const canUseWeakMap: boolean; -//# sourceMappingURL=canUse.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/util/canUse.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/canUse.d.ts.map deleted file mode 100644 index 74a2206..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/canUse.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/canUse.js b/JS/node_modules/apollo-utilities/lib/util/canUse.js deleted file mode 100644 index c8caab9..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/canUse.js +++ /dev/null @@ -1,5 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/canUse.js.map b/JS/node_modules/apollo-utilities/lib/util/canUse.js.map deleted file mode 100644 index e0e5e56..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/canUse.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts b/JS/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts deleted file mode 100644 index f0f64fc..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function cloneDeep(value: T): T; -//# sourceMappingURL=cloneDeep.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map deleted file mode 100644 index a871948..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/cloneDeep.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/cloneDeep.js b/JS/node_modules/apollo-utilities/lib/util/cloneDeep.js deleted file mode 100644 index 8fbfb3f..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/cloneDeep.js +++ /dev/null @@ -1,34 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/cloneDeep.js.map b/JS/node_modules/apollo-utilities/lib/util/cloneDeep.js.map deleted file mode 100644 index 36015d2..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/cloneDeep.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/environment.d.ts b/JS/node_modules/apollo-utilities/lib/util/environment.d.ts deleted file mode 100644 index 238d252..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/environment.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/util/environment.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/environment.d.ts.map deleted file mode 100644 index ac39af2..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/environment.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/environment.js b/JS/node_modules/apollo-utilities/lib/util/environment.js deleted file mode 100644 index 13f120e..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/environment.js +++ /dev/null @@ -1,26 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/environment.js.map b/JS/node_modules/apollo-utilities/lib/util/environment.js.map deleted file mode 100644 index d7b9e1a..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/environment.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/errorHandling.d.ts b/JS/node_modules/apollo-utilities/lib/util/errorHandling.d.ts deleted file mode 100644 index adb1eb8..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/errorHandling.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map deleted file mode 100644 index 6955d01..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/errorHandling.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/errorHandling.js b/JS/node_modules/apollo-utilities/lib/util/errorHandling.js deleted file mode 100644 index a9955e1..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/errorHandling.js +++ /dev/null @@ -1,18 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/errorHandling.js.map b/JS/node_modules/apollo-utilities/lib/util/errorHandling.js.map deleted file mode 100644 index 52b9fb6..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/errorHandling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts b/JS/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts deleted file mode 100644 index 397458d..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map deleted file mode 100644 index c45757b..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/filterInPlace.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/filterInPlace.js b/JS/node_modules/apollo-utilities/lib/util/filterInPlace.js deleted file mode 100644 index 66b9dd6..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/filterInPlace.js +++ /dev/null @@ -1,14 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/filterInPlace.js.map b/JS/node_modules/apollo-utilities/lib/util/filterInPlace.js.map deleted file mode 100644 index d0e2a7d..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/filterInPlace.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/isEqual.d.ts b/JS/node_modules/apollo-utilities/lib/util/isEqual.d.ts deleted file mode 100644 index 08faeb9..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/isEqual.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { equal as isEqual } from '@wry/equality'; -//# sourceMappingURL=isEqual.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map deleted file mode 100644 index d2078c9..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/isEqual.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/isEqual.js b/JS/node_modules/apollo-utilities/lib/util/isEqual.js deleted file mode 100644 index f7d228c..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/isEqual.js +++ /dev/null @@ -1,5 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/isEqual.js.map b/JS/node_modules/apollo-utilities/lib/util/isEqual.js.map deleted file mode 100644 index c6fe9ba..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/isEqual.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts b/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts deleted file mode 100644 index 00bba45..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function maybeDeepFreeze(obj: any): any; -//# sourceMappingURL=maybeDeepFreeze.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map deleted file mode 100644 index 99cb3ef..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js b/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js deleted file mode 100644 index 2f7b836..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js +++ /dev/null @@ -1,25 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map b/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map deleted file mode 100644 index ea62a05..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/maybeDeepFreeze.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts b/JS/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts deleted file mode 100644 index cb0d13d..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -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/JS/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map deleted file mode 100644 index d95732f..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/mergeDeep.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/mergeDeep.js b/JS/node_modules/apollo-utilities/lib/util/mergeDeep.js deleted file mode 100644 index e4100a2..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/mergeDeep.js +++ /dev/null @@ -1,64 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/mergeDeep.js.map b/JS/node_modules/apollo-utilities/lib/util/mergeDeep.js.map deleted file mode 100644 index 20393f8..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/mergeDeep.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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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,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAC7B;QACA,IAAI,KAAK,CAAC,OAAO,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/JS/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts b/JS/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts deleted file mode 100644 index 3dad555..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function stripSymbols(data: T): T; -//# sourceMappingURL=stripSymbols.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map deleted file mode 100644 index 9e0384d..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/stripSymbols.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/stripSymbols.js b/JS/node_modules/apollo-utilities/lib/util/stripSymbols.js deleted file mode 100644 index bc978e5..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/stripSymbols.js +++ /dev/null @@ -1,7 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/stripSymbols.js.map b/JS/node_modules/apollo-utilities/lib/util/stripSymbols.js.map deleted file mode 100644 index 3bbcc9c..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/stripSymbols.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/warnOnce.d.ts b/JS/node_modules/apollo-utilities/lib/util/warnOnce.d.ts deleted file mode 100644 index bfc0dd1..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/warnOnce.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function warnOnceInDevelopment(msg: string, type?: string): void; -//# sourceMappingURL=warnOnce.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map b/JS/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map deleted file mode 100644 index 1b652a3..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/warnOnce.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/lib/util/warnOnce.js b/JS/node_modules/apollo-utilities/lib/util/warnOnce.js deleted file mode 100644 index 167ba8f..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/warnOnce.js +++ /dev/null @@ -1,20 +0,0 @@ -"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/JS/node_modules/apollo-utilities/lib/util/warnOnce.js.map b/JS/node_modules/apollo-utilities/lib/util/warnOnce.js.map deleted file mode 100644 index 63d8e3d..0000000 --- a/JS/node_modules/apollo-utilities/lib/util/warnOnce.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/apollo-utilities/package.json b/JS/node_modules/apollo-utilities/package.json deleted file mode 100644 index ae14ef6..0000000 --- a/JS/node_modules/apollo-utilities/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "apollo-utilities", - "version": "1.3.4", - "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": "npx 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 || ^15.0.0" - }, - "dependencies": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "gitHead": "d22394c419ff7d678afb5e7d4cd1df16ed803ead" -} diff --git a/JS/node_modules/apollo-utilities/src/__tests__/directives.ts b/JS/node_modules/apollo-utilities/src/__tests__/directives.ts deleted file mode 100644 index eea3500..0000000 --- a/JS/node_modules/apollo-utilities/src/__tests__/directives.ts +++ /dev/null @@ -1,274 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/__tests__/fragments.ts b/JS/node_modules/apollo-utilities/src/__tests__/fragments.ts deleted file mode 100644 index 1c6cfa1..0000000 --- a/JS/node_modules/apollo-utilities/src/__tests__/fragments.ts +++ /dev/null @@ -1,327 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/__tests__/getFromAST.ts b/JS/node_modules/apollo-utilities/src/__tests__/getFromAST.ts deleted file mode 100644 index a81a5f3..0000000 --- a/JS/node_modules/apollo-utilities/src/__tests__/getFromAST.ts +++ /dev/null @@ -1,316 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/__tests__/storeUtils.ts b/JS/node_modules/apollo-utilities/src/__tests__/storeUtils.ts deleted file mode 100644 index ba45943..0000000 --- a/JS/node_modules/apollo-utilities/src/__tests__/storeUtils.ts +++ /dev/null @@ -1,23 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/__tests__/transform.ts b/JS/node_modules/apollo-utilities/src/__tests__/transform.ts deleted file mode 100644 index 26835f4..0000000 --- a/JS/node_modules/apollo-utilities/src/__tests__/transform.ts +++ /dev/null @@ -1,1242 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/declarations.d.ts b/JS/node_modules/apollo-utilities/src/declarations.d.ts deleted file mode 100644 index 6954665..0000000 --- a/JS/node_modules/apollo-utilities/src/declarations.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'fast-json-stable-stringify'; diff --git a/JS/node_modules/apollo-utilities/src/directives.ts b/JS/node_modules/apollo-utilities/src/directives.ts deleted file mode 100644 index 84c14ab..0000000 --- a/JS/node_modules/apollo-utilities/src/directives.ts +++ /dev/null @@ -1,127 +0,0 @@ -// 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/JS/node_modules/apollo-utilities/src/fragments.ts b/JS/node_modules/apollo-utilities/src/fragments.ts deleted file mode 100644 index f60c86a..0000000 --- a/JS/node_modules/apollo-utilities/src/fragments.ts +++ /dev/null @@ -1,92 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/getFromAST.ts b/JS/node_modules/apollo-utilities/src/getFromAST.ts deleted file mode 100644 index febe526..0000000 --- a/JS/node_modules/apollo-utilities/src/getFromAST.ts +++ /dev/null @@ -1,233 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/index.js.flow b/JS/node_modules/apollo-utilities/src/index.js.flow deleted file mode 100644 index a7fc594..0000000 --- a/JS/node_modules/apollo-utilities/src/index.js.flow +++ /dev/null @@ -1,220 +0,0 @@ -// @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/JS/node_modules/apollo-utilities/src/index.ts b/JS/node_modules/apollo-utilities/src/index.ts deleted file mode 100644 index 18b0a81..0000000 --- a/JS/node_modules/apollo-utilities/src/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/storeUtils.ts b/JS/node_modules/apollo-utilities/src/storeUtils.ts deleted file mode 100644 index 2bd1e53..0000000 --- a/JS/node_modules/apollo-utilities/src/storeUtils.ts +++ /dev/null @@ -1,340 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/transform.ts b/JS/node_modules/apollo-utilities/src/transform.ts deleted file mode 100644 index d77b8e5..0000000 --- a/JS/node_modules/apollo-utilities/src/transform.ts +++ /dev/null @@ -1,542 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/assign.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/assign.ts deleted file mode 100644 index 6d3ef04..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/assign.ts +++ /dev/null @@ -1,47 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts deleted file mode 100644 index 52b491b..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/cloneDeep.ts +++ /dev/null @@ -1,70 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/environment.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/environment.ts deleted file mode 100644 index dcb7153..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/environment.ts +++ /dev/null @@ -1,70 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts deleted file mode 100644 index e621a83..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/isEqual.ts +++ /dev/null @@ -1,174 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts deleted file mode 100644 index c33cc60..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/maybeDeepFeeze.ts +++ /dev/null @@ -1,17 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts deleted file mode 100644 index 1377806..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/mergeDeep.ts +++ /dev/null @@ -1,139 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts deleted file mode 100644 index fd5594b..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/stripSymbols.ts +++ /dev/null @@ -1,15 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts b/JS/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts deleted file mode 100644 index 35c8753..0000000 --- a/JS/node_modules/apollo-utilities/src/util/__tests__/warnOnce.ts +++ /dev/null @@ -1,61 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/assign.ts b/JS/node_modules/apollo-utilities/src/util/assign.ts deleted file mode 100644 index 3a22432..0000000 --- a/JS/node_modules/apollo-utilities/src/util/assign.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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/JS/node_modules/apollo-utilities/src/util/canUse.ts b/JS/node_modules/apollo-utilities/src/util/canUse.ts deleted file mode 100644 index d985867..0000000 --- a/JS/node_modules/apollo-utilities/src/util/canUse.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const canUseWeakMap = typeof WeakMap === 'function' && !( - typeof navigator === 'object' && - navigator.product === 'ReactNative' -); diff --git a/JS/node_modules/apollo-utilities/src/util/cloneDeep.ts b/JS/node_modules/apollo-utilities/src/util/cloneDeep.ts deleted file mode 100644 index 961b4a8..0000000 --- a/JS/node_modules/apollo-utilities/src/util/cloneDeep.ts +++ /dev/null @@ -1,37 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/environment.ts b/JS/node_modules/apollo-utilities/src/util/environment.ts deleted file mode 100644 index f4ad04e..0000000 --- a/JS/node_modules/apollo-utilities/src/util/environment.ts +++ /dev/null @@ -1,24 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/errorHandling.ts b/JS/node_modules/apollo-utilities/src/util/errorHandling.ts deleted file mode 100644 index 25a16ca..0000000 --- a/JS/node_modules/apollo-utilities/src/util/errorHandling.ts +++ /dev/null @@ -1,15 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/filterInPlace.ts b/JS/node_modules/apollo-utilities/src/util/filterInPlace.ts deleted file mode 100644 index d5787ca..0000000 --- a/JS/node_modules/apollo-utilities/src/util/filterInPlace.ts +++ /dev/null @@ -1,14 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/isEqual.ts b/JS/node_modules/apollo-utilities/src/util/isEqual.ts deleted file mode 100644 index debf742..0000000 --- a/JS/node_modules/apollo-utilities/src/util/isEqual.ts +++ /dev/null @@ -1 +0,0 @@ -export { equal as isEqual } from '@wry/equality'; diff --git a/JS/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts b/JS/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts deleted file mode 100644 index d966d33..0000000 --- a/JS/node_modules/apollo-utilities/src/util/maybeDeepFreeze.ts +++ /dev/null @@ -1,33 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/mergeDeep.ts b/JS/node_modules/apollo-utilities/src/util/mergeDeep.ts deleted file mode 100644 index d83a33f..0000000 --- a/JS/node_modules/apollo-utilities/src/util/mergeDeep.ts +++ /dev/null @@ -1,115 +0,0 @@ -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/JS/node_modules/apollo-utilities/src/util/stripSymbols.ts b/JS/node_modules/apollo-utilities/src/util/stripSymbols.ts deleted file mode 100644 index 41cabae..0000000 --- a/JS/node_modules/apollo-utilities/src/util/stripSymbols.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * 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/JS/node_modules/apollo-utilities/src/util/warnOnce.ts b/JS/node_modules/apollo-utilities/src/util/warnOnce.ts deleted file mode 100644 index 90f3232..0000000 --- a/JS/node_modules/apollo-utilities/src/util/warnOnce.ts +++ /dev/null @@ -1,24 +0,0 @@ -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/JS/node_modules/cross-fetch/LICENSE b/JS/node_modules/cross-fetch/LICENSE deleted file mode 100644 index 9198b86..0000000 --- a/JS/node_modules/cross-fetch/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2017 Leonardo Quixadá - -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/JS/node_modules/cross-fetch/README.md b/JS/node_modules/cross-fetch/README.md deleted file mode 100644 index 92434d5..0000000 --- a/JS/node_modules/cross-fetch/README.md +++ /dev/null @@ -1,169 +0,0 @@ -cross-fetch
-[![NPM Version](https://img.shields.io/npm/v/cross-fetch.svg?branch=main)](https://www.npmjs.com/package/cross-fetch) -[![Downloads Per Week](https://img.shields.io/npm/dw/cross-fetch.svg?color=blue)](https://www.npmjs.com/package/cross-fetch) -[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) -![CI](https://github.com/lquixada/cross-fetch/workflows/CI/badge.svg) -[![codecov](https://codecov.io/gh/lquixada/cross-fetch/branch/main/graph/badge.svg)](https://codecov.io/gh/lquixada/cross-fetch) -================ - -Universal WHATWG Fetch API for Node, Browsers and React Native. The scenario that cross-fetch really shines is when the same JavaScript codebase needs to run on different platforms. - -- **Platform agnostic**: browsers, Node or React Native -- **Optional polyfill**: it's up to you if something is going to be added to the global object or not -- **Simple interface**: no instantiation, no configuration and no extra dependency -- **WHATWG compliant**: it works the same way wherever your code runs -- **TypeScript support**: better development experience with types. - - -* * * - -## Table of Contents - -- [Install](#install) -- [Usage](#usage) -- [Demo & API](#demo--api) -- [FAQ](#faq) -- [Thanks](#thanks) -- [License](#license) -- [Author](#author) - -* * * - -## Install - -```sh -npm install --save cross-fetch -``` - -As a [ponyfill](https://github.com/sindresorhus/ponyfill): - -```javascript -// Using ES6 modules with Babel or TypeScript -import fetch from 'cross-fetch'; - -// Using CommonJS modules -const fetch = require('cross-fetch'); -``` - -As a polyfill: - -```javascript -// Using ES6 modules -import 'cross-fetch/polyfill'; - -// Using CommonJS modules -require('cross-fetch/polyfill'); -``` - - -The CDN build is also available on unpkg: - -```html - -``` - -This adds the fetch function to the window object. Note that this is not UMD compatible. - - -* * * - -## Usage - -With [promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise): - -```javascript -import fetch from 'cross-fetch'; -// Or just: import 'cross-fetch/polyfill'; - -fetch('//api.github.com/users/lquixada') - .then(res => { - if (res.status >= 400) { - throw new Error("Bad response from server"); - } - return res.json(); - }) - .then(user => { - console.log(user); - }) - .catch(err => { - console.error(err); - }); -``` - -With [async/await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function): - -```javascript -import fetch from 'cross-fetch'; -// Or just: import 'cross-fetch/polyfill'; - -(async () => { - try { - const res = await fetch('//api.github.com/users/lquixada'); - - if (res.status >= 400) { - throw new Error("Bad response from server"); - } - - const user = await res.json(); - - console.log(user); - } catch (err) { - console.error(err); - } -})(); -``` - -> ⚠️ **Warning**: If you're in an environment that doesn't support Promises such as Internet Explorer, you must install an ES6 Promise compatible polyfill. [es6-promise](https://github.com/jakearchibald/es6-promise) is suggested. - - -## Demo & API - -You can find a comprehensive doc at [Github's fetch](https://github.github.io/fetch/) page. If you want to play with cross-fetch, check our [**JSFiddle playground**](https://jsfiddle.net/lquixada/3ypqgacp/). - -> **Tip**: Run the fiddle on various browsers and with different settings (for instance: cross-domain requests, wrong urls or text requests). Don't forget to open the console in the test suite page and play around. - - -## FAQ - -#### Yet another fetch library? - -I did a lot of research in order to find a fetch library that could be simple, cross-platform and provide polyfill as an option. There's a plethora of libs out there but none could match those requirements. - - -#### Why not isomorphic-fetch? - -My preferred library used to be [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) but it has this [bug](https://github.com/matthew-andrews/isomorphic-fetch/issues/125) that prevents it from running in a react native environment. It seems unlikely to be fixed since there haven't been any new commits to it since 2016. That means dependencies are outdated as well. - - -#### Why polyfill might not be a good idea? - -In a word? Risk. If the spec changes in the future, it might be problematic to debug. Read more about it on [sindresorhus's ponyfill](https://github.com/sindresorhus/ponyfill#how-are-ponyfills-better-than-polyfills) page. It's up to you if you're fine with it or not. - - -#### How does cross-fetch work? - -Just like isomorphic-fetch, it is just a proxy. If you're in node, it delivers you the [node-fetch](https://github.com/bitinn/node-fetch/) library, if you're in a browser or React Native, it delivers you the github's [whatwg-fetch](https://github.com/github/fetch/). The same strategy applies whether you're using polyfill or ponyfill. - - -## Who's Using It? - -|[![The New York Times](./docs/images/logo-nytimes.png)](https://www.nytimes.com/)|[![Apollo GraphQL](./docs/images/logo-apollo.png)](https://github.com/apollographql/apollo-client/)|[![Facebook](./docs/images/logo-facebook.png)](https://github.com/facebook/fbjs/)|[![Swagger](./docs/images/logo-swagger.png)](https://swagger.io/)|[![VulcanJS](./docs/images/logo-vulcanjs.png)](http://vulcanjs.org)|[![graphql-request](./docs/images/logo-graphql-request.png)](https://github.com/prisma/graphql-request)| -|:---:|:---:|:---:|:---:|:---:|:---:| -|The New York Times|Apollo GraphQL|Facebook|Swagger|VulcanJS|graphql-request| - - -## Thanks - -Heavily inspired by the works of [matthew-andrews](https://github.com/matthew-andrews). Kudos to him! - - -## License - -cross-fetch is licensed under the [MIT license](https://github.com/lquixada/cross-fetch/blob/main/LICENSE) © [Leonardo Quixadá](https://twitter.com/lquixada/) - - -## Author - -|[![@lquixada](https://avatars0.githubusercontent.com/u/195494?v=4&s=96)](https://github.com/lquixada)| -|:---:| -|[@lquixada](http://www.github.com/lquixada)| diff --git a/JS/node_modules/cross-fetch/dist/browser-polyfill.js b/JS/node_modules/cross-fetch/dist/browser-polyfill.js deleted file mode 100644 index da6342e..0000000 --- a/JS/node_modules/cross-fetch/dist/browser-polyfill.js +++ /dev/null @@ -1,532 +0,0 @@ -(function(self) { - -var irrelevant = (function (exports) { - - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: - 'FileReader' in self && - 'Blob' in self && - (function() { - try { - new Blob(); - return true - } catch (e) { - return false - } - })(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - - function isDataView(obj) { - return obj && DataView.prototype.isPrototypeOf(obj) - } - - if (support.arrayBuffer) { - var viewClasses = [ - '[object Int8Array]', - '[object Uint8Array]', - '[object Uint8ClampedArray]', - '[object Int16Array]', - '[object Uint16Array]', - '[object Int32Array]', - '[object Uint32Array]', - '[object Float32Array]', - '[object Float64Array]' - ]; - - var isArrayBufferView = - ArrayBuffer.isView || - function(obj) { - return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 - }; - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name') - } - return name.toLowerCase() - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function() { - var value = items.shift(); - return {done: value === undefined, value: value} - } - }; - - if (support.iterable) { - iterator[Symbol.iterator] = function() { - return iterator - }; - } - - return iterator - } - - function Headers(headers) { - this.map = {}; - - if (headers instanceof Headers) { - headers.forEach(function(value, name) { - this.append(name, value); - }, this); - } else if (Array.isArray(headers)) { - headers.forEach(function(header) { - this.append(header[0], header[1]); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function(name) { - this.append(name, headers[name]); - }, this); - } - } - - Headers.prototype.append = function(name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var oldValue = this.map[name]; - this.map[name] = oldValue ? oldValue + ', ' + value : value; - }; - - Headers.prototype['delete'] = function(name) { - delete this.map[normalizeName(name)]; - }; - - Headers.prototype.get = function(name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null - }; - - Headers.prototype.has = function(name) { - return this.map.hasOwnProperty(normalizeName(name)) - }; - - Headers.prototype.set = function(name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; - - Headers.prototype.forEach = function(callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); - } - } - }; - - Headers.prototype.keys = function() { - var items = []; - this.forEach(function(value, name) { - items.push(name); - }); - return iteratorFor(items) - }; - - Headers.prototype.values = function() { - var items = []; - this.forEach(function(value) { - items.push(value); - }); - return iteratorFor(items) - }; - - Headers.prototype.entries = function() { - var items = []; - this.forEach(function(value, name) { - items.push([name, value]); - }); - return iteratorFor(items) - }; - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')) - } - body.bodyUsed = true; - } - - function fileReaderReady(reader) { - return new Promise(function(resolve, reject) { - reader.onload = function() { - resolve(reader.result); - }; - reader.onerror = function() { - reject(reader.error); - }; - }) - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise - } - - function readBlobAsText(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise - } - - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf); - var chars = new Array(view.length); - - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); - } - return chars.join('') - } - - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0) - } else { - var view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer - } - } - - function Body() { - this.bodyUsed = false; - - this._initBody = function(body) { - this._bodyInit = body; - if (!body) { - this._bodyText = ''; - } else if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); - } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer); - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); - } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { - this._bodyArrayBuffer = bufferClone(body); - } else { - this._bodyText = body = Object.prototype.toString.call(body); - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - } - }; - - if (support.blob) { - this.blob = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob') - } else { - return Promise.resolve(new Blob([this._bodyText])) - } - }; - - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) - } else { - return this.blob().then(readBlobAsArrayBuffer) - } - }; - } - - this.text = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text') - } else { - return Promise.resolve(this._bodyText) - } - }; - - if (support.formData) { - this.formData = function() { - return this.text().then(decode) - }; - } - - this.json = function() { - return this.text().then(JSON.parse) - }; - - return this - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method - } - - function Request(input, options) { - options = options || {}; - var body = options.body; - - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError('Already read') - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - this.signal = input.signal; - if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = String(input); - } - - this.credentials = options.credentials || this.credentials || 'same-origin'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.signal = options.signal || this.signal; - this.referrer = null; - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests') - } - this._initBody(body); - } - - Request.prototype.clone = function() { - return new Request(this, {body: this._bodyInit}) - }; - - function decode(body) { - var form = new FormData(); - body - .trim() - .split('&') - .forEach(function(bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form - } - - function parseHeaders(rawHeaders) { - var headers = new Headers(); - // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space - // https://tools.ietf.org/html/rfc7230#section-3.2 - var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); - preProcessedHeaders.split(/\r?\n/).forEach(function(line) { - var parts = line.split(':'); - var key = parts.shift().trim(); - if (key) { - var value = parts.join(':').trim(); - headers.append(key, value); - } - }); - return headers - } - - Body.call(Request.prototype); - - function Response(bodyInit, options) { - if (!options) { - options = {}; - } - - this.type = 'default'; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = 'statusText' in options ? options.statusText : 'OK'; - this.headers = new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - - Body.call(Response.prototype); - - Response.prototype.clone = function() { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }) - }; - - Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}); - response.type = 'error'; - return response - }; - - var redirectStatuses = [301, 302, 303, 307, 308]; - - Response.redirect = function(url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code') - } - - return new Response(null, {status: status, headers: {location: url}}) - }; - - exports.DOMException = self.DOMException; - try { - new exports.DOMException(); - } catch (err) { - exports.DOMException = function(message, name) { - this.message = message; - this.name = name; - var error = Error(message); - this.stack = error.stack; - }; - exports.DOMException.prototype = Object.create(Error.prototype); - exports.DOMException.prototype.constructor = exports.DOMException; - } - - function fetch(input, init) { - return new Promise(function(resolve, reject) { - var request = new Request(input, init); - - if (request.signal && request.signal.aborted) { - return reject(new exports.DOMException('Aborted', 'AbortError')) - } - - var xhr = new XMLHttpRequest(); - - function abortXhr() { - xhr.abort(); - } - - xhr.onload = function() { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || '') - }; - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - - xhr.onerror = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.ontimeout = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.onabort = function() { - reject(new exports.DOMException('Aborted', 'AbortError')); - }; - - xhr.open(request.method, request.url, true); - - if (request.credentials === 'include') { - xhr.withCredentials = true; - } else if (request.credentials === 'omit') { - xhr.withCredentials = false; - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value); - }); - - if (request.signal) { - request.signal.addEventListener('abort', abortXhr); - - xhr.onreadystatechange = function() { - // DONE (success or failure) - if (xhr.readyState === 4) { - request.signal.removeEventListener('abort', abortXhr); - } - }; - } - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }) - } - - fetch.polyfill = true; - - if (!self.fetch) { - self.fetch = fetch; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - } - - exports.Headers = Headers; - exports.Request = Request; - exports.Response = Response; - exports.fetch = fetch; - - Object.defineProperty(exports, '__esModule', { value: true }); - - return exports; - -}({})); -})(typeof self !== 'undefined' ? self : this); diff --git a/JS/node_modules/cross-fetch/dist/browser-ponyfill.js b/JS/node_modules/cross-fetch/dist/browser-ponyfill.js deleted file mode 100644 index f26eb09..0000000 --- a/JS/node_modules/cross-fetch/dist/browser-ponyfill.js +++ /dev/null @@ -1,554 +0,0 @@ -var global = typeof self !== 'undefined' ? self : this; -var __self__ = (function () { -function F() { -this.fetch = false; -this.DOMException = global.DOMException -} -F.prototype = global; -return new F(); -})(); -(function(self) { - -var irrelevant = (function (exports) { - - var support = { - searchParams: 'URLSearchParams' in self, - iterable: 'Symbol' in self && 'iterator' in Symbol, - blob: - 'FileReader' in self && - 'Blob' in self && - (function() { - try { - new Blob(); - return true - } catch (e) { - return false - } - })(), - formData: 'FormData' in self, - arrayBuffer: 'ArrayBuffer' in self - }; - - function isDataView(obj) { - return obj && DataView.prototype.isPrototypeOf(obj) - } - - if (support.arrayBuffer) { - var viewClasses = [ - '[object Int8Array]', - '[object Uint8Array]', - '[object Uint8ClampedArray]', - '[object Int16Array]', - '[object Uint16Array]', - '[object Int32Array]', - '[object Uint32Array]', - '[object Float32Array]', - '[object Float64Array]' - ]; - - var isArrayBufferView = - ArrayBuffer.isView || - function(obj) { - return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 - }; - } - - function normalizeName(name) { - if (typeof name !== 'string') { - name = String(name); - } - if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) { - throw new TypeError('Invalid character in header field name') - } - return name.toLowerCase() - } - - function normalizeValue(value) { - if (typeof value !== 'string') { - value = String(value); - } - return value - } - - // Build a destructive iterator for the value list - function iteratorFor(items) { - var iterator = { - next: function() { - var value = items.shift(); - return {done: value === undefined, value: value} - } - }; - - if (support.iterable) { - iterator[Symbol.iterator] = function() { - return iterator - }; - } - - return iterator - } - - function Headers(headers) { - this.map = {}; - - if (headers instanceof Headers) { - headers.forEach(function(value, name) { - this.append(name, value); - }, this); - } else if (Array.isArray(headers)) { - headers.forEach(function(header) { - this.append(header[0], header[1]); - }, this); - } else if (headers) { - Object.getOwnPropertyNames(headers).forEach(function(name) { - this.append(name, headers[name]); - }, this); - } - } - - Headers.prototype.append = function(name, value) { - name = normalizeName(name); - value = normalizeValue(value); - var oldValue = this.map[name]; - this.map[name] = oldValue ? oldValue + ', ' + value : value; - }; - - Headers.prototype['delete'] = function(name) { - delete this.map[normalizeName(name)]; - }; - - Headers.prototype.get = function(name) { - name = normalizeName(name); - return this.has(name) ? this.map[name] : null - }; - - Headers.prototype.has = function(name) { - return this.map.hasOwnProperty(normalizeName(name)) - }; - - Headers.prototype.set = function(name, value) { - this.map[normalizeName(name)] = normalizeValue(value); - }; - - Headers.prototype.forEach = function(callback, thisArg) { - for (var name in this.map) { - if (this.map.hasOwnProperty(name)) { - callback.call(thisArg, this.map[name], name, this); - } - } - }; - - Headers.prototype.keys = function() { - var items = []; - this.forEach(function(value, name) { - items.push(name); - }); - return iteratorFor(items) - }; - - Headers.prototype.values = function() { - var items = []; - this.forEach(function(value) { - items.push(value); - }); - return iteratorFor(items) - }; - - Headers.prototype.entries = function() { - var items = []; - this.forEach(function(value, name) { - items.push([name, value]); - }); - return iteratorFor(items) - }; - - if (support.iterable) { - Headers.prototype[Symbol.iterator] = Headers.prototype.entries; - } - - function consumed(body) { - if (body.bodyUsed) { - return Promise.reject(new TypeError('Already read')) - } - body.bodyUsed = true; - } - - function fileReaderReady(reader) { - return new Promise(function(resolve, reject) { - reader.onload = function() { - resolve(reader.result); - }; - reader.onerror = function() { - reject(reader.error); - }; - }) - } - - function readBlobAsArrayBuffer(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsArrayBuffer(blob); - return promise - } - - function readBlobAsText(blob) { - var reader = new FileReader(); - var promise = fileReaderReady(reader); - reader.readAsText(blob); - return promise - } - - function readArrayBufferAsText(buf) { - var view = new Uint8Array(buf); - var chars = new Array(view.length); - - for (var i = 0; i < view.length; i++) { - chars[i] = String.fromCharCode(view[i]); - } - return chars.join('') - } - - function bufferClone(buf) { - if (buf.slice) { - return buf.slice(0) - } else { - var view = new Uint8Array(buf.byteLength); - view.set(new Uint8Array(buf)); - return view.buffer - } - } - - function Body() { - this.bodyUsed = false; - - this._initBody = function(body) { - this._bodyInit = body; - if (!body) { - this._bodyText = ''; - } else if (typeof body === 'string') { - this._bodyText = body; - } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { - this._bodyBlob = body; - } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { - this._bodyFormData = body; - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this._bodyText = body.toString(); - } else if (support.arrayBuffer && support.blob && isDataView(body)) { - this._bodyArrayBuffer = bufferClone(body.buffer); - // IE 10-11 can't handle a DataView body. - this._bodyInit = new Blob([this._bodyArrayBuffer]); - } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { - this._bodyArrayBuffer = bufferClone(body); - } else { - this._bodyText = body = Object.prototype.toString.call(body); - } - - if (!this.headers.get('content-type')) { - if (typeof body === 'string') { - this.headers.set('content-type', 'text/plain;charset=UTF-8'); - } else if (this._bodyBlob && this._bodyBlob.type) { - this.headers.set('content-type', this._bodyBlob.type); - } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { - this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); - } - } - }; - - if (support.blob) { - this.blob = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return Promise.resolve(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(new Blob([this._bodyArrayBuffer])) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as blob') - } else { - return Promise.resolve(new Blob([this._bodyText])) - } - }; - - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - return consumed(this) || Promise.resolve(this._bodyArrayBuffer) - } else { - return this.blob().then(readBlobAsArrayBuffer) - } - }; - } - - this.text = function() { - var rejected = consumed(this); - if (rejected) { - return rejected - } - - if (this._bodyBlob) { - return readBlobAsText(this._bodyBlob) - } else if (this._bodyArrayBuffer) { - return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) - } else if (this._bodyFormData) { - throw new Error('could not read FormData body as text') - } else { - return Promise.resolve(this._bodyText) - } - }; - - if (support.formData) { - this.formData = function() { - return this.text().then(decode) - }; - } - - this.json = function() { - return this.text().then(JSON.parse) - }; - - return this - } - - // HTTP methods whose capitalization should be normalized - var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; - - function normalizeMethod(method) { - var upcased = method.toUpperCase(); - return methods.indexOf(upcased) > -1 ? upcased : method - } - - function Request(input, options) { - options = options || {}; - var body = options.body; - - if (input instanceof Request) { - if (input.bodyUsed) { - throw new TypeError('Already read') - } - this.url = input.url; - this.credentials = input.credentials; - if (!options.headers) { - this.headers = new Headers(input.headers); - } - this.method = input.method; - this.mode = input.mode; - this.signal = input.signal; - if (!body && input._bodyInit != null) { - body = input._bodyInit; - input.bodyUsed = true; - } - } else { - this.url = String(input); - } - - this.credentials = options.credentials || this.credentials || 'same-origin'; - if (options.headers || !this.headers) { - this.headers = new Headers(options.headers); - } - this.method = normalizeMethod(options.method || this.method || 'GET'); - this.mode = options.mode || this.mode || null; - this.signal = options.signal || this.signal; - this.referrer = null; - - if ((this.method === 'GET' || this.method === 'HEAD') && body) { - throw new TypeError('Body not allowed for GET or HEAD requests') - } - this._initBody(body); - } - - Request.prototype.clone = function() { - return new Request(this, {body: this._bodyInit}) - }; - - function decode(body) { - var form = new FormData(); - body - .trim() - .split('&') - .forEach(function(bytes) { - if (bytes) { - var split = bytes.split('='); - var name = split.shift().replace(/\+/g, ' '); - var value = split.join('=').replace(/\+/g, ' '); - form.append(decodeURIComponent(name), decodeURIComponent(value)); - } - }); - return form - } - - function parseHeaders(rawHeaders) { - var headers = new Headers(); - // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space - // https://tools.ietf.org/html/rfc7230#section-3.2 - var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); - preProcessedHeaders.split(/\r?\n/).forEach(function(line) { - var parts = line.split(':'); - var key = parts.shift().trim(); - if (key) { - var value = parts.join(':').trim(); - headers.append(key, value); - } - }); - return headers - } - - Body.call(Request.prototype); - - function Response(bodyInit, options) { - if (!options) { - options = {}; - } - - this.type = 'default'; - this.status = options.status === undefined ? 200 : options.status; - this.ok = this.status >= 200 && this.status < 300; - this.statusText = 'statusText' in options ? options.statusText : 'OK'; - this.headers = new Headers(options.headers); - this.url = options.url || ''; - this._initBody(bodyInit); - } - - Body.call(Response.prototype); - - Response.prototype.clone = function() { - return new Response(this._bodyInit, { - status: this.status, - statusText: this.statusText, - headers: new Headers(this.headers), - url: this.url - }) - }; - - Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}); - response.type = 'error'; - return response - }; - - var redirectStatuses = [301, 302, 303, 307, 308]; - - Response.redirect = function(url, status) { - if (redirectStatuses.indexOf(status) === -1) { - throw new RangeError('Invalid status code') - } - - return new Response(null, {status: status, headers: {location: url}}) - }; - - exports.DOMException = self.DOMException; - try { - new exports.DOMException(); - } catch (err) { - exports.DOMException = function(message, name) { - this.message = message; - this.name = name; - var error = Error(message); - this.stack = error.stack; - }; - exports.DOMException.prototype = Object.create(Error.prototype); - exports.DOMException.prototype.constructor = exports.DOMException; - } - - function fetch(input, init) { - return new Promise(function(resolve, reject) { - var request = new Request(input, init); - - if (request.signal && request.signal.aborted) { - return reject(new exports.DOMException('Aborted', 'AbortError')) - } - - var xhr = new XMLHttpRequest(); - - function abortXhr() { - xhr.abort(); - } - - xhr.onload = function() { - var options = { - status: xhr.status, - statusText: xhr.statusText, - headers: parseHeaders(xhr.getAllResponseHeaders() || '') - }; - options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); - var body = 'response' in xhr ? xhr.response : xhr.responseText; - resolve(new Response(body, options)); - }; - - xhr.onerror = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.ontimeout = function() { - reject(new TypeError('Network request failed')); - }; - - xhr.onabort = function() { - reject(new exports.DOMException('Aborted', 'AbortError')); - }; - - xhr.open(request.method, request.url, true); - - if (request.credentials === 'include') { - xhr.withCredentials = true; - } else if (request.credentials === 'omit') { - xhr.withCredentials = false; - } - - if ('responseType' in xhr && support.blob) { - xhr.responseType = 'blob'; - } - - request.headers.forEach(function(value, name) { - xhr.setRequestHeader(name, value); - }); - - if (request.signal) { - request.signal.addEventListener('abort', abortXhr); - - xhr.onreadystatechange = function() { - // DONE (success or failure) - if (xhr.readyState === 4) { - request.signal.removeEventListener('abort', abortXhr); - } - }; - } - - xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); - }) - } - - fetch.polyfill = true; - - if (!self.fetch) { - self.fetch = fetch; - self.Headers = Headers; - self.Request = Request; - self.Response = Response; - } - - exports.Headers = Headers; - exports.Request = Request; - exports.Response = Response; - exports.fetch = fetch; - - Object.defineProperty(exports, '__esModule', { value: true }); - - return exports; - -}({})); -})(__self__); -__self__.fetch.ponyfill = true; -// Remove "polyfill" property added by whatwg-fetch -delete __self__.fetch.polyfill; -// Choose between native implementation (global) or custom implementation (__self__) -// var ctx = global.fetch ? global : __self__; -var ctx = __self__; // this line disable service worker support temporarily -exports = ctx.fetch // To enable: import fetch from 'cross-fetch' -exports.default = ctx.fetch // For TypeScript consumers without esModuleInterop. -exports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch' -exports.Headers = ctx.Headers -exports.Request = ctx.Request -exports.Response = ctx.Response -module.exports = exports diff --git a/JS/node_modules/cross-fetch/dist/cross-fetch.js b/JS/node_modules/cross-fetch/dist/cross-fetch.js deleted file mode 100644 index 865dd5d..0000000 --- a/JS/node_modules/cross-fetch/dist/cross-fetch.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t){!function(e){var r="URLSearchParams"in t,o="Symbol"in t&&"iterator"in Symbol,n="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,s="ArrayBuffer"in t;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(t){return t&&a.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function d(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function y(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function l(t){var e=new FileReader,r=y(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:n&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():s&&n&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(t)||h(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},n&&(this.blob=function(){var t=p(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var t,e,r,o=p(this);if(o)return o;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=y(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o-1?o:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function E(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),o=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(n))}})),e}function A(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},A.error=function(){var t=new A(null,{status:0,statusText:""});return t.type="error",t};var _=[301,302,303,307,308];A.redirect=function(t,e){if(-1===_.indexOf(e))throw new RangeError("Invalid status code");return new A(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function g(t,r){return new Promise((function(o,i){var s=new v(t,r);if(s.signal&&s.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var t,e,r={status:a.status,statusText:a.statusText,headers:(t=a.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),o=r.shift().trim();if(o){var n=r.join(":").trim();e.append(o,n)}})),e)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;o(new A(n,r))},a.onerror=function(){i(new TypeError("Network request failed"))},a.ontimeout=function(){i(new TypeError("Network request failed"))},a.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&n&&(a.responseType="blob"),s.headers.forEach((function(t,e){a.setRequestHeader(e,t)})),s.signal&&(s.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",h)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}g.polyfill=!0,t.fetch||(t.fetch=g,t.Headers=c,t.Request=v,t.Response=A),e.Headers=c,e.Request=v,e.Response=A,e.fetch=g,Object.defineProperty(e,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:this); -//# sourceMappingURL=cross-fetch.js.map diff --git a/JS/node_modules/cross-fetch/dist/cross-fetch.js.map b/JS/node_modules/cross-fetch/dist/cross-fetch.js.map deleted file mode 100644 index ddcd1e8..0000000 --- a/JS/node_modules/cross-fetch/dist/cross-fetch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cross-fetch.js","sources":["../node_modules/whatwg-fetch/fetch.js"],"sourcesContent":["var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = 'statusText' in options ? options.statusText : 'OK'\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = self.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n resolve(new Response(body, options))\n }\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'))\n }\n\n xhr.onabort = function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }\n\n xhr.open(request.method, request.url, true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob'\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!self.fetch) {\n self.fetch = fetch\n self.Headers = Headers\n self.Request = Request\n self.Response = Response\n}\n"],"names":["support","self","Symbol","Blob","e","viewClasses","isArrayBufferView","ArrayBuffer","isView","obj","indexOf","Object","prototype","toString","call","normalizeName","name","String","test","TypeError","toLowerCase","normalizeValue","value","iteratorFor","items","iterator","next","shift","done","undefined","Headers","headers","this","map","forEach","append","Array","isArray","header","getOwnPropertyNames","consumed","body","bodyUsed","Promise","reject","fileReaderReady","reader","resolve","onload","result","onerror","error","readBlobAsArrayBuffer","blob","FileReader","promise","readAsArrayBuffer","bufferClone","buf","slice","view","Uint8Array","byteLength","set","buffer","Body","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","FormData","_bodyFormData","URLSearchParams","DataView","_bodyArrayBuffer","get","type","rejected","Error","arrayBuffer","then","text","readAsText","chars","length","i","fromCharCode","join","readArrayBufferAsText","formData","decode","json","JSON","parse","oldValue","has","hasOwnProperty","callback","thisArg","keys","push","values","entries","methods","Request","input","options","method","upcased","url","credentials","mode","signal","toUpperCase","referrer","form","trim","split","bytes","replace","decodeURIComponent","Response","bodyInit","status","ok","statusText","clone","response","redirectStatuses","redirect","RangeError","location","DOMException","err","message","stack","create","constructor","fetch","init","request","aborted","xhr","XMLHttpRequest","abortXhr","abort","rawHeaders","getAllResponseHeaders","line","parts","key","responseURL","responseText","ontimeout","onabort","open","withCredentials","responseType","setRequestHeader","addEventListener","onreadystatechange","readyState","removeEventListener","send","polyfill"],"mappings":"0BAAA,IAAIA,EACY,oBAAqBC,EADjCD,EAEQ,WAAYC,GAAQ,aAAcC,OAF1CF,EAIA,eAAgBC,GAChB,SAAUA,GACV,WACE,IAEE,OADA,IAAIE,MACG,EACP,MAAOC,GACP,OAAO,GALX,GANAJ,EAcQ,aAAcC,EAdtBD,EAeW,gBAAiBC,EAOhC,GAAID,EACF,IAAIK,EAAc,CAChB,qBACA,sBACA,6BACA,sBACA,uBACA,sBACA,uBACA,wBACA,yBAGEC,EACFC,YAAYC,QACZ,SAASC,GACP,OAAOA,GAAOJ,EAAYK,QAAQC,OAAOC,UAAUC,SAASC,KAAKL,KAAS,GAIhF,SAASM,EAAcC,GAIrB,GAHoB,iBAATA,IACTA,EAAOC,OAAOD,IAEZ,4BAA4BE,KAAKF,GACnC,MAAM,IAAIG,UAAU,0CAEtB,OAAOH,EAAKI,cAGd,SAASC,EAAeC,GAItB,MAHqB,iBAAVA,IACTA,EAAQL,OAAOK,IAEVA,EAIT,SAASC,EAAYC,GACnB,IAAIC,EAAW,CACbC,KAAM,WACJ,IAAIJ,EAAQE,EAAMG,QAClB,MAAO,CAACC,UAAgBC,IAAVP,EAAqBA,MAAOA,KAU9C,OANItB,IACFyB,EAASvB,OAAOuB,UAAY,WAC1B,OAAOA,IAI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,EACfxG,EAAKyH,SAAWA"} \ No newline at end of file diff --git a/JS/node_modules/cross-fetch/dist/node-polyfill.js b/JS/node_modules/cross-fetch/dist/node-polyfill.js deleted file mode 100644 index d7b73d0..0000000 --- a/JS/node_modules/cross-fetch/dist/node-polyfill.js +++ /dev/null @@ -1,11 +0,0 @@ -const fetchNode = require('./node-ponyfill') -const fetch = fetchNode.fetch.bind({}) - -fetch.polyfill = true - -if (!global.fetch) { - global.fetch = fetch - global.Response = fetchNode.Response - global.Headers = fetchNode.Headers - global.Request = fetchNode.Request -} diff --git a/JS/node_modules/cross-fetch/dist/node-ponyfill.js b/JS/node_modules/cross-fetch/dist/node-ponyfill.js deleted file mode 100644 index e8b153f..0000000 --- a/JS/node_modules/cross-fetch/dist/node-ponyfill.js +++ /dev/null @@ -1,22 +0,0 @@ -const nodeFetch = require('node-fetch') -const realFetch = nodeFetch.default || nodeFetch - -const fetch = function (url, options) { - // Support schemaless URIs on the server for parity with the browser. - // Ex: //github.com/ -> https://github.com/ - if (/^\/\//.test(url)) { - url = 'https:' + url - } - return realFetch.call(this, url, options) -} - -fetch.ponyfill = true - -module.exports = exports = fetch -exports.fetch = fetch -exports.Headers = nodeFetch.Headers -exports.Request = nodeFetch.Request -exports.Response = nodeFetch.Response - -// Needed for TypeScript consumers without esModuleInterop. -exports.default = fetch diff --git a/JS/node_modules/cross-fetch/dist/react-native-polyfill.js b/JS/node_modules/cross-fetch/dist/react-native-polyfill.js deleted file mode 100644 index 57ad256..0000000 --- a/JS/node_modules/cross-fetch/dist/react-native-polyfill.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! - * VaporJS JavaScript Library v1.4.5 - * https://github.com/madrobby/vapor.js - * - * Copyright (c) 2010 Thomas Fuchs (http://script.aculo.us/thomas) - * Released under the MIT license - * https://github.com/madrobby/vapor.js/blob/master/MIT-LICENSE - * - * Date: 2019-05-25T03:04Z - */ - -// React Native already polyfills `fetch` so this code is intentionally handled to VaporJS. diff --git a/JS/node_modules/cross-fetch/dist/react-native-ponyfill.js b/JS/node_modules/cross-fetch/dist/react-native-ponyfill.js deleted file mode 100644 index 8e5baff..0000000 --- a/JS/node_modules/cross-fetch/dist/react-native-ponyfill.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = global.fetch // To enable: import fetch from 'cross-fetch' -module.exports.default = global.fetch // For TypeScript consumers without esModuleInterop. -module.exports.fetch = global.fetch // To enable: import {fetch} from 'cross-fetch' -module.exports.Headers = global.Headers -module.exports.Request = global.Request -module.exports.Response = global.Response diff --git a/JS/node_modules/cross-fetch/index.d.ts b/JS/node_modules/cross-fetch/index.d.ts deleted file mode 100644 index 3c030c0..0000000 --- a/JS/node_modules/cross-fetch/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// - -declare const _fetch: typeof fetch; -declare const _Request: typeof Request; -declare const _Response: typeof Response; -declare const _Headers: typeof Headers; - -declare module "cross-fetch" { - export const fetch: typeof _fetch; - export const Request: typeof _Request; - export const Response: typeof _Response; - export const Headers: typeof _Headers; - export default fetch; -} diff --git a/JS/node_modules/cross-fetch/package.json b/JS/node_modules/cross-fetch/package.json deleted file mode 100644 index c3dba2c..0000000 --- a/JS/node_modules/cross-fetch/package.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "name": "cross-fetch", - "version": "3.1.4", - "description": "Universal WHATWG Fetch API for Node, Browsers and React Native", - "homepage": "https://github.com/lquixada/cross-fetch", - "main": "dist/node-ponyfill.js", - "browser": "dist/browser-ponyfill.js", - "react-native": "dist/react-native-ponyfill.js", - "types": "index.d.ts", - "scripts": { - "prepare": "husky install" - }, - "lint-staged": { - "*.js": [ - "make build", - "standard --fix" - ] - }, - "standard": { - "env": [ - "mocha", - "browser" - ], - "globals": [ - "expect", - "assert", - "chai", - "sinon" - ], - "ignore": [ - "/dist/", - "bundle.js", - "test.js", - "test.*.js", - "api.spec.js", - "*.ts" - ] - }, - "mocha": { - "require": [ - "chai/register-expect", - "chai/register-assert" - ], - "check-leaks": true - }, - "nyc": { - "temp-dir": ".reports/.coverage" - }, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" - } - }, - "standard-version": { - "skip": { - "changelog": true - } - }, - "repository": { - "type": "git", - "url": "https://github.com/lquixada/cross-fetch.git" - }, - "author": "Leonardo Quixada ", - "license": "MIT", - "bugs": { - "url": "https://github.com/lquixada/cross-fetch/issues" - }, - "dependencies": { - "node-fetch": "2.6.1" - }, - "devDependencies": { - "@commitlint/cli": "12.0.1", - "@commitlint/config-conventional": "12.0.1", - "@types/chai": "4.2.15", - "@types/mocha": "8.2.2", - "@types/node": "14.14.37", - "body-parser": "1.19.0", - "chai": "4.3.4", - "codecov": "3.8.1", - "cz-conventional-changelog": "3.3.0", - "express": "4.17.1", - "husky": "6.0.0", - "lint-staged": "10.5.4", - "mocha": "8.3.2", - "mocha-headless-chrome": "3.1.0", - "nock": "13.0.11", - "nyc": "15.1.0", - "ora": "5.4.0", - "rollup": "2.44.0", - "rollup-plugin-copy": "3.4.0", - "rollup-plugin-terser": "7.0.2", - "semver": "7.3.5", - "serve-index": "1.9.1", - "sinon": "10.0.0", - "standard": "16.0.3", - "standard-version": "9.1.1", - "typescript": "4.2.3", - "webpack": "5.28.0", - "webpack-cli": "4.6.0", - "whatwg-fetch": "3.0.0" - }, - "files": [ - "dist", - "polyfill", - "index.d.ts" - ], - "keywords": [ - "fetch", - "http", - "url", - "promise", - "async", - "await", - "isomorphic", - "universal", - "node", - "react", - "native", - "browser", - "ponyfill", - "whatwg", - "xhr", - "ajax" - ] -} diff --git a/JS/node_modules/cross-fetch/polyfill/package.json b/JS/node_modules/cross-fetch/polyfill/package.json deleted file mode 100644 index 07e1d3e..0000000 --- a/JS/node_modules/cross-fetch/polyfill/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "cross-fetch-polyfill", - "version": "0.0.0", - "main": "../dist/node-polyfill.js", - "browser": "../dist/browser-polyfill.js", - "react-native": "../dist/react-native-polyfill.js", - "license": "MIT" -} diff --git a/JS/node_modules/fast-json-stable-stringify/.eslintrc.yml b/JS/node_modules/fast-json-stable-stringify/.eslintrc.yml deleted file mode 100644 index 1c77b0d..0000000 --- a/JS/node_modules/fast-json-stable-stringify/.eslintrc.yml +++ /dev/null @@ -1,26 +0,0 @@ -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/JS/node_modules/fast-json-stable-stringify/.github/FUNDING.yml b/JS/node_modules/fast-json-stable-stringify/.github/FUNDING.yml deleted file mode 100644 index 61f9daa..0000000 --- a/JS/node_modules/fast-json-stable-stringify/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -tidelift: "npm/fast-json-stable-stringify" diff --git a/JS/node_modules/fast-json-stable-stringify/.travis.yml b/JS/node_modules/fast-json-stable-stringify/.travis.yml deleted file mode 100644 index b61e8f0..0000000 --- a/JS/node_modules/fast-json-stable-stringify/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "8" - - "10" - - "12" - - "13" -after_script: - - coveralls < coverage/lcov.info diff --git a/JS/node_modules/fast-json-stable-stringify/LICENSE b/JS/node_modules/fast-json-stable-stringify/LICENSE deleted file mode 100644 index c932223..0000000 --- a/JS/node_modules/fast-json-stable-stringify/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -This software is released under the MIT license: - -Copyright (c) 2017 Evgeny Poberezkin -Copyright (c) 2013 James Halliday - -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/JS/node_modules/fast-json-stable-stringify/README.md b/JS/node_modules/fast-json-stable-stringify/README.md deleted file mode 100644 index 02cf49f..0000000 --- a/JS/node_modules/fast-json-stable-stringify/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# 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 -``` - - -## Enterprise support - -fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers. - - -## Security contact - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues. - - -# license - -[MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE) diff --git a/JS/node_modules/fast-json-stable-stringify/benchmark/index.js b/JS/node_modules/fast-json-stable-stringify/benchmark/index.js deleted file mode 100644 index e725f9f..0000000 --- a/JS/node_modules/fast-json-stable-stringify/benchmark/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'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/JS/node_modules/fast-json-stable-stringify/benchmark/test.json b/JS/node_modules/fast-json-stable-stringify/benchmark/test.json deleted file mode 100644 index c9118c1..0000000 --- a/JS/node_modules/fast-json-stable-stringify/benchmark/test.json +++ /dev/null @@ -1,137 +0,0 @@ -[ - { - "_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/JS/node_modules/fast-json-stable-stringify/example/key_cmp.js b/JS/node_modules/fast-json-stable-stringify/example/key_cmp.js deleted file mode 100644 index d5f6675..0000000 --- a/JS/node_modules/fast-json-stable-stringify/example/key_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -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/JS/node_modules/fast-json-stable-stringify/example/nested.js b/JS/node_modules/fast-json-stable-stringify/example/nested.js deleted file mode 100644 index 9a672fc..0000000 --- a/JS/node_modules/fast-json-stable-stringify/example/nested.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; -console.log(stringify(obj)); diff --git a/JS/node_modules/fast-json-stable-stringify/example/str.js b/JS/node_modules/fast-json-stable-stringify/example/str.js deleted file mode 100644 index 9b4b3cd..0000000 --- a/JS/node_modules/fast-json-stable-stringify/example/str.js +++ /dev/null @@ -1,3 +0,0 @@ -var stringify = require('../'); -var obj = { c: 6, b: [4,5], a: 3 }; -console.log(stringify(obj)); diff --git a/JS/node_modules/fast-json-stable-stringify/example/value_cmp.js b/JS/node_modules/fast-json-stable-stringify/example/value_cmp.js deleted file mode 100644 index 09f1c5f..0000000 --- a/JS/node_modules/fast-json-stable-stringify/example/value_cmp.js +++ /dev/null @@ -1,7 +0,0 @@ -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/JS/node_modules/fast-json-stable-stringify/index.d.ts b/JS/node_modules/fast-json-stable-stringify/index.d.ts deleted file mode 100644 index 23e46ca..0000000 --- a/JS/node_modules/fast-json-stable-stringify/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module 'fast-json-stable-stringify' { - function stringify(obj: any): string; - export = stringify; -} diff --git a/JS/node_modules/fast-json-stable-stringify/index.js b/JS/node_modules/fast-json-stable-stringify/index.js deleted file mode 100644 index c44e6a4..0000000 --- a/JS/node_modules/fast-json-stable-stringify/index.js +++ /dev/null @@ -1,59 +0,0 @@ -'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/JS/node_modules/fast-json-stable-stringify/package.json b/JS/node_modules/fast-json-stable-stringify/package.json deleted file mode 100644 index ad2c8bf..0000000 --- a/JS/node_modules/fast-json-stable-stringify/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "fast-json-stable-stringify", - "version": "2.1.0", - "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify", - "main": "index.js", - "types": "index.d.ts", - "dependencies": {}, - "devDependencies": { - "benchmark": "^2.1.4", - "coveralls": "^3.0.0", - "eslint": "^6.7.0", - "fast-stable-stringify": "latest", - "faster-stable-stringify": "latest", - "json-stable-stringify": "latest", - "nyc": "^14.1.0", - "pre-commit": "^1.2.2", - "tape": "^4.11.0" - }, - "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/JS/node_modules/fast-json-stable-stringify/test/cmp.js b/JS/node_modules/fast-json-stable-stringify/test/cmp.js deleted file mode 100644 index 4efd6b5..0000000 --- a/JS/node_modules/fast-json-stable-stringify/test/cmp.js +++ /dev/null @@ -1,13 +0,0 @@ -'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/JS/node_modules/fast-json-stable-stringify/test/nested.js b/JS/node_modules/fast-json-stable-stringify/test/nested.js deleted file mode 100644 index 167a358..0000000 --- a/JS/node_modules/fast-json-stable-stringify/test/nested.js +++ /dev/null @@ -1,44 +0,0 @@ -'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/JS/node_modules/fast-json-stable-stringify/test/str.js b/JS/node_modules/fast-json-stable-stringify/test/str.js deleted file mode 100644 index 99a9ade..0000000 --- a/JS/node_modules/fast-json-stable-stringify/test/str.js +++ /dev/null @@ -1,46 +0,0 @@ -'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/JS/node_modules/fast-json-stable-stringify/test/to-json.js b/JS/node_modules/fast-json-stable-stringify/test/to-json.js deleted file mode 100644 index 2fb2cfa..0000000 --- a/JS/node_modules/fast-json-stable-stringify/test/to-json.js +++ /dev/null @@ -1,22 +0,0 @@ -'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/JS/node_modules/graphql-tag/CHANGELOG.md b/JS/node_modules/graphql-tag/CHANGELOG.md deleted file mode 100644 index 1648037..0000000 --- a/JS/node_modules/graphql-tag/CHANGELOG.md +++ /dev/null @@ -1,231 +0,0 @@ -# Change log - -### v2.12.5 - -* Also publish `src/` directory to npm, enabling source maps.
- [@maclockard](https://github.com/maclockard) in [#403](https://github.com/apollographql/graphql-tag/pull/403) - -### v2.12.4 (2021-04-29) - -* Allow fragments to be imported by name when using the webpack loader.
- [@dobesv](https://github.com/dobesv) in [#257](https://github.com/apollographql/graphql-tag/pull/257) - -### v2.12.3 - -* Update `tslib` dependency to version 2.1.0.
- [@benjamn](http://github.com/benjamn) in [#381](https://github.com/apollographql/graphql-tag/pull/381) - -### v2.12.2 - -* Avoid using `Object.assign` to attach extra properties to `gql`.
- [@benjamn](http://github.com/benjamn) in [#380](https://github.com/apollographql/graphql-tag/pull/380) - -### v2.12.1 - -* To accommodate older versions of TypeScript, usage of the `import type ...` syntax (introduced by [#325](https://github.com/apollographql/graphql-tag/pull/325)) has been removed, fixing issue [#345](https://github.com/apollographql/graphql-tag/issues/345).
- [@benjamn](http://github.com/benjamn) in [#352](https://github.com/apollographql/graphql-tag/pull/352) - -### v2.12.0 - -* The `graphql-tag` repository has been converted to TypeScript, adding type safety and enabling both ECMAScript and CommonJS module exports. While these changes are intended to be as backwards-compatible as possible, we decided to bump the minor version to reflect the significant refactoring.
- [@PowerKiKi](http://github.com/PowerKiKi) and [@benjamn](http://github.com/benjamn) in [#325](https://github.com/apollographql/graphql-tag/pull/325) - -### v2.11.0 (2020-07-28) - -* `package.json` `sideEffects` changes to clearly identify that `graphql-tag` doesn't have side effects.
- [@hwillson](http://github.com/hwillson) in [#313](https://github.com/apollographql/graphql-tag/pull/313) - -### v2.10.4 (2020-07-08) - -* Bump dev/peer deps to accommodate `graphql` 15.
- [@adriencohen](https://github.com/adriencohen) in [#299](https://github.com/apollographql/graphql-tag/pull/299) - -### v2.10.3 (2020-02-05) - -* Further adjustments to the TS `index.d.ts` declaration file.
- [@Guillaumez](https://github.com/Guillaumez) in [#289](https://github.com/apollographql/graphql-tag/pull/289) - -### v2.10.2 (2020-02-04) - -* Update/fix the existing TS `index.d.ts` declaration file.
- [@hwillson](https://github.com/hwillson) in [#285](https://github.com/apollographql/graphql-tag/pull/285) - -### v2.10.1 - -* Fix failures in IE11 by avoiding unsupported (by IE11) constructor arguments to `Set` by [rocwang](https://github.com/rocwang) in [#190](https://github.com/apollographql/graphql-tag/pull/190) - -### 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/JS/node_modules/graphql-tag/LICENSE b/JS/node_modules/graphql-tag/LICENSE deleted file mode 100644 index 35bf148..0000000 --- a/JS/node_modules/graphql-tag/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2021 Apollo Graph, Inc. (Formerly 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/JS/node_modules/graphql-tag/README.md b/JS/node_modules/graphql-tag/README.md deleted file mode 100644 index 4e40600..0000000 --- a/JS/node_modules/graphql-tag/README.md +++ /dev/null @@ -1,251 +0,0 @@ -# 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`. - -### gql - -The `gql` template literal tag can be used to concisely write a GraphQL query that is parsed into a standard GraphQL AST. It is the recommended method for passing queries to [Apollo Client](https://github.com/apollographql/apollo-client). While it is primarily built for Apollo Client, it generates a generic GraphQL AST which can be used by any GraphQL client. - -```js -import gql from 'graphql-tag'; - -const query = gql` - { - user(id: 5) { - firstName - lastName - } - } -` -``` - -The above query now contains the following syntax tree. - -```js -{ - "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", - ... - } - } - ] - } - } - ] -} -``` - -#### Fragments - -The `gql` tag can also be used to define reusable fragments, which can easily be added to queries or other fragments. - -```js -import gql from 'graphql-tag'; - -const userFragment = gql` - fragment User_user on User { - firstName - lastName - } -` -``` - -The above `userFragment` document can be embedded in another document using a template literal placeholder. - -```js -const query = gql` - { - user(id: 5) { - ...User_user - } - } - ${userFragment} -` -``` - -**Note:** _While it may seem redundant to have to both embed the `userFragment` variable in the template literal **AND** spread the `...User_user` fragment in the graphQL selection set, this requirement makes static analysis by tools such as `eslint-plugin-graphql` possible._ - -#### 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/apollographql/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. - - -### Importing graphQL files - -_To add support for importing `.graphql`/`.gql` files, see [Webpack loading and preprocessing](#webpack-loading-and-preprocessing) below._ - -Given a file `MyQuery.graphql` - -```graphql -query MyQuery { - ... -} -``` - -If you have configured [the webpack graphql-tag/loader](#webpack-loading-and-preprocessing), you can import modules containing graphQL queries. The imported value will be the pre-built AST. - -```graphql -import MyQuery from 'query.graphql' -``` - -#### Importing queries by name - -You can also import query and fragment documents by name. - -```graphql -query MyQuery1 { - ... -} - -query MyQuery2 { - ... -} -``` - -And in your JavaScript: - -```javascript -import { MyQuery1, MyQuery2 } from 'query.graphql' -``` - -### Preprocessing queries and fragments - -Preprocessing GraphQL queries and fragments into ASTs at build time can greatly improve load times. - -#### 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 script initialization time and reduces bundle sizes by potentially removing the need for `graphql-tag` at runtime. - -#### TypeScript preprocessing - -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 and Next.js preprocessing - -Preprocessing queries via the webpack loader is not always possible. [babel-plugin-import-graphql](https://www.npmjs.com/package/babel-plugin-import-graphql) supports importing 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 { - ... -} -``` - -#### Webpack loading and preprocessing - -Using the included `graphql-tag/loader` it is possible to maintain query logic that is separate from the rest of your application logic. With the loader configured, imported graphQL files will be converted to AST during the webpack build process. - -_**Example webpack configuration**_ - -```js -{ - ... - loaders: [ - { - test: /\.(graphql|gql)$/, - exclude: /node_modules/, - loader: 'graphql-tag/loader' - } - ], - ... -} -``` - -#### Create React App - -Preprocessing GraphQL imports is supported in **create-react-app** >= v2 using [evenchange4/graphql.macro](https://github.com/evenchange4/graphql.macro). - -For **create-react-app** < v2, you'll either need to eject or use [react-app-rewire-inline-import-graphql-ast](https://www.npmjs.com/package/react-app-rewire-inline-import-graphql-ast). - -#### Testing - -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 fragments - -With the webpack loader, you can import fragments by name: - -In a file called `query.gql`: - -```graphql -fragment MyFragment1 on MyType1 { - ... -} - -fragment MyFragment2 on MyType2 { - ... -} -``` - -And in your JavaScript: - -```javascript -import { MyFragment1, MyFragment2 } from 'query.gql' -``` - -Note: If your fragment references other fragments, the resulting document will -have multiple fragments in it. In this case you must still specify the fragment name when using the fragment. For example, with `@apollo/client` you would specify the `fragmentName` option when using the fragment for cache operations. - -### 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 -} -``` - -### Resources - -You can easily generate and explore a GraphQL AST on [astexplorer.net](https://astexplorer.net/#/drYr8X1rnP/1). diff --git a/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js b/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js deleted file mode 100644 index 629f159..0000000 --- a/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js +++ /dev/null @@ -1,135 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('tslib'), require('graphql')) : - typeof define === 'function' && define.amd ? define(['exports', 'tslib', 'graphql'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['graphql-tag'] = {}, global.tslib, global.graphql)); -}(this, (function (exports, tslib, graphql) { 'use strict'; - - var docCache = new Map(); - var fragmentSourceMap = new Map(); - var printFragmentWarnings = true; - var experimentalFragmentVariables = false; - function normalize(string) { - return string.replace(/[\s,]+/g, ' ').trim(); - } - function cacheKeyFromLoc(loc) { - return normalize(loc.source.body.substring(loc.start, loc.end)); - } - function processFragments(ast) { - var seenKeys = new Set(); - var definitions = []; - ast.definitions.forEach(function (fragmentDefinition) { - if (fragmentDefinition.kind === 'FragmentDefinition') { - var fragmentName = fragmentDefinition.name.value; - var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); - var sourceKeySet = fragmentSourceMap.get(fragmentName); - if (sourceKeySet && !sourceKeySet.has(sourceKey)) { - 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"); - } - } - else if (!sourceKeySet) { - fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); - } - sourceKeySet.add(sourceKey); - if (!seenKeys.has(sourceKey)) { - seenKeys.add(sourceKey); - definitions.push(fragmentDefinition); - } - } - else { - definitions.push(fragmentDefinition); - } - }); - return tslib.__assign(tslib.__assign({}, ast), { definitions: definitions }); - } - function stripLoc(doc) { - var workSet = new Set(doc.definitions); - workSet.forEach(function (node) { - if (node.loc) - delete node.loc; - Object.keys(node).forEach(function (key) { - var value = node[key]; - if (value && typeof value === 'object') { - workSet.add(value); - } - }); - }); - var loc = doc.loc; - if (loc) { - delete loc.startToken; - delete loc.endToken; - } - return doc; - } - function parseDocument(source) { - var cacheKey = normalize(source); - if (!docCache.has(cacheKey)) { - var parsed = graphql.parse(source, { - experimentalFragmentVariables: experimentalFragmentVariables - }); - if (!parsed || parsed.kind !== 'Document') { - throw new Error('Not a valid GraphQL document.'); - } - docCache.set(cacheKey, stripLoc(processFragments(parsed))); - } - return docCache.get(cacheKey); - } - function gql(literals) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - if (typeof literals === 'string') { - literals = [literals]; - } - var result = literals[0]; - args.forEach(function (arg, i) { - if (arg && arg.kind === 'Document') { - result += arg.loc.source.body; - } - else { - result += arg; - } - result += literals[i + 1]; - }); - return parseDocument(result); - } - function resetCaches() { - docCache.clear(); - fragmentSourceMap.clear(); - } - function disableFragmentWarnings() { - printFragmentWarnings = false; - } - function enableExperimentalFragmentVariables() { - experimentalFragmentVariables = true; - } - function disableExperimentalFragmentVariables() { - experimentalFragmentVariables = false; - } - var extras = { - gql: gql, - resetCaches: resetCaches, - disableFragmentWarnings: disableFragmentWarnings, - enableExperimentalFragmentVariables: enableExperimentalFragmentVariables, - disableExperimentalFragmentVariables: disableExperimentalFragmentVariables - }; - (function (gql_1) { - gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables; - })(gql || (gql = {})); - gql["default"] = gql; - var gql$1 = gql; - - exports.default = gql$1; - exports.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables; - exports.disableFragmentWarnings = disableFragmentWarnings; - exports.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables; - exports.gql = gql; - exports.resetCaches = resetCaches; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=graphql-tag.umd.js.map diff --git a/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow b/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow deleted file mode 100644 index 7acb623..0000000 --- a/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js.flow +++ /dev/null @@ -1,7 +0,0 @@ -// @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/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js.map b/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js.map deleted file mode 100644 index 001321b..0000000 --- a/JS/node_modules/graphql-tag/lib/graphql-tag.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"graphql-tag.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { parse } from 'graphql';\n\nimport {\n DocumentNode,\n DefinitionNode,\n Location,\n} from 'graphql/language/ast';\n\n// A map docString -> graphql document\nconst docCache = new Map();\n\n// A map fragmentName -> [normalized source]\nconst fragmentSourceMap = new Map>();\n\nlet printFragmentWarnings = true;\nlet experimentalFragmentVariables = false;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string: string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\nfunction cacheKeyFromLoc(loc: Location) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\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.\nfunction processFragments(ast: DocumentNode) {\n const seenKeys = new Set();\n const definitions: DefinitionNode[] = [];\n\n ast.definitions.forEach(fragmentDefinition => {\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 let sourceKeySet = fragmentSourceMap.get(fragmentName)!;\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\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 } else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n\n sourceKeySet.add(sourceKey);\n\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n });\n\n return {\n ...ast,\n definitions,\n };\n}\n\nfunction stripLoc(doc: DocumentNode) {\n const workSet = new Set>(doc.definitions);\n\n workSet.forEach(node => {\n if (node.loc) delete node.loc;\n Object.keys(node).forEach(key => {\n const value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n\n const loc = doc.loc as Record;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n\n return doc;\n}\n\nfunction parseDocument(source: string) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n const parsed = parse(source, {\n experimentalFragmentVariables,\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(\n cacheKey,\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n stripLoc(processFragments(parsed)),\n );\n }\n return docCache.get(cacheKey)!;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nexport function gql(\n literals: string | readonly string[],\n ...args: any[]\n) {\n\n if (typeof literals === 'string') {\n literals = [literals];\n }\n\n let result = literals[0];\n\n args.forEach((arg, i) => {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n } else {\n result += arg;\n }\n result += literals[i + 1];\n });\n\n return parseDocument(result);\n}\n\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\n\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\nconst extras = {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n};\n\nexport namespace gql {\n export const {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n } = extras;\n}\n\ngql.default = gql;\n\nexport default gql;\n"],"names":["parse"],"mappings":";;;;;;IASA,IAAM,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAGjD,IAAM,iBAAiB,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEzD,IAAI,qBAAqB,GAAG,IAAI,CAAC;IACjC,IAAI,6BAA6B,GAAG,KAAK,CAAC;IAI1C,SAAS,SAAS,CAAC,MAAc;QAC/B,OAAO,MAAM,CAAC,OAAO,CAAC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AAuB,GAGrB,MAAM,wBAHe,EACvB,yCAAmC,GAEjC,MAAM,oCAF2B,EACnC,0CAAoC,GAClC,MAAM,qCAD4B,CAC3B;IACb,CAAC,EARgB,GAAG,KAAH,GAAG,QAQnB;IAED,GAAG,CAAC,SAAO,CAAA,GAAG,GAAG,CAAC;AAElB,gBAAe,GAAG;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/index.d.ts b/JS/node_modules/graphql-tag/lib/index.d.ts deleted file mode 100644 index 5164fac..0000000 --- a/JS/node_modules/graphql-tag/lib/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { DocumentNode } from 'graphql/language/ast'; -export declare function gql(literals: string | readonly string[], ...args: any[]): DocumentNode; -export declare namespace gql { - var _a: typeof import(".").gql; - export { _a as default }; -} -export declare function resetCaches(): void; -export declare function disableFragmentWarnings(): void; -export declare function enableExperimentalFragmentVariables(): void; -export declare function disableExperimentalFragmentVariables(): void; -export declare namespace gql { - const gql: typeof import(".").gql, resetCaches: typeof import(".").resetCaches, disableFragmentWarnings: typeof import(".").disableFragmentWarnings, enableExperimentalFragmentVariables: typeof import(".").enableExperimentalFragmentVariables, disableExperimentalFragmentVariables: typeof import(".").disableExperimentalFragmentVariables; -} -export default gql; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/index.d.ts.map b/JS/node_modules/graphql-tag/lib/index.d.ts.map deleted file mode 100644 index 7ee2411..0000000 --- a/JS/node_modules/graphql-tag/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAGb,MAAM,sBAAsB,CAAC;AA0G9B,wBAAgB,GAAG,CACjB,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACpC,GAAG,IAAI,EAAE,GAAG,EAAE,gBAmBf;yBArBe,GAAG;;;;AAuBnB,wBAAgB,WAAW,SAG1B;AAED,wBAAgB,uBAAuB,SAEtC;AAED,wBAAgB,mCAAmC,SAElD;AAED,wBAAgB,oCAAoC,SAEnD;AAUD,yBAAiB,GAAG,CAAC;IACZ,MACL,GAAG,0BACH,WAAW,kCACX,uBAAuB,8CACvB,mCAAmC,0DACnC,oCAAoC,yDAC5B,CAAC;CACZ;AAID,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/index.js b/JS/node_modules/graphql-tag/lib/index.js deleted file mode 100644 index 81db598..0000000 --- a/JS/node_modules/graphql-tag/lib/index.js +++ /dev/null @@ -1,120 +0,0 @@ -import { __assign } from "tslib"; -import { parse } from 'graphql'; -var docCache = new Map(); -var fragmentSourceMap = new Map(); -var printFragmentWarnings = true; -var experimentalFragmentVariables = false; -function normalize(string) { - return string.replace(/[\s,]+/g, ' ').trim(); -} -function cacheKeyFromLoc(loc) { - return normalize(loc.source.body.substring(loc.start, loc.end)); -} -function processFragments(ast) { - var seenKeys = new Set(); - var definitions = []; - ast.definitions.forEach(function (fragmentDefinition) { - if (fragmentDefinition.kind === 'FragmentDefinition') { - var fragmentName = fragmentDefinition.name.value; - var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); - var sourceKeySet = fragmentSourceMap.get(fragmentName); - if (sourceKeySet && !sourceKeySet.has(sourceKey)) { - 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"); - } - } - else if (!sourceKeySet) { - fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); - } - sourceKeySet.add(sourceKey); - if (!seenKeys.has(sourceKey)) { - seenKeys.add(sourceKey); - definitions.push(fragmentDefinition); - } - } - else { - definitions.push(fragmentDefinition); - } - }); - return __assign(__assign({}, ast), { definitions: definitions }); -} -function stripLoc(doc) { - var workSet = new Set(doc.definitions); - workSet.forEach(function (node) { - if (node.loc) - delete node.loc; - Object.keys(node).forEach(function (key) { - var value = node[key]; - if (value && typeof value === 'object') { - workSet.add(value); - } - }); - }); - var loc = doc.loc; - if (loc) { - delete loc.startToken; - delete loc.endToken; - } - return doc; -} -function parseDocument(source) { - var cacheKey = normalize(source); - if (!docCache.has(cacheKey)) { - var parsed = parse(source, { - experimentalFragmentVariables: experimentalFragmentVariables - }); - if (!parsed || parsed.kind !== 'Document') { - throw new Error('Not a valid GraphQL document.'); - } - docCache.set(cacheKey, stripLoc(processFragments(parsed))); - } - return docCache.get(cacheKey); -} -export function gql(literals) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - if (typeof literals === 'string') { - literals = [literals]; - } - var result = literals[0]; - args.forEach(function (arg, i) { - if (arg && arg.kind === 'Document') { - result += arg.loc.source.body; - } - else { - result += arg; - } - result += literals[i + 1]; - }); - return parseDocument(result); -} -export function resetCaches() { - docCache.clear(); - fragmentSourceMap.clear(); -} -export function disableFragmentWarnings() { - printFragmentWarnings = false; -} -export function enableExperimentalFragmentVariables() { - experimentalFragmentVariables = true; -} -export function disableExperimentalFragmentVariables() { - experimentalFragmentVariables = false; -} -var extras = { - gql: gql, - resetCaches: resetCaches, - disableFragmentWarnings: disableFragmentWarnings, - enableExperimentalFragmentVariables: enableExperimentalFragmentVariables, - disableExperimentalFragmentVariables: disableExperimentalFragmentVariables -}; -(function (gql_1) { - gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables; -})(gql || (gql = {})); -gql["default"] = gql; -export default gql; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/index.js.map b/JS/node_modules/graphql-tag/lib/index.js.map deleted file mode 100644 index c159e37..0000000 --- a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AC,KAAK,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,qBAAqB,GAAG,KAAK,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,mCAAmC;IACjD,6BAA6B,GAAG,IAAI,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,oCAAoC;IAClD,6BAA6B,GAAG,KAAK,CAAC;AACxC,CAAC;AAED,IAAM,MAAM,GAAG;IACb,GAAG,KAAA;IACH,WAAW,aAAA;IACX,uBAAuB,yBAAA;IACvB,mCAAmC,qCAAA;IACnC,oCAAoC,sCAAA;CACrC,CAAC;AAEF,WAAiB,KAAG;IAEhB,SAAG,GAKD,MAAM,IALL,EACH,iBAAW,GAIT,MAAM,YAJG,EACX,6BAAuB,GAGrB,MAAM,wBAHe,EACvB,yCAAmC,GAEjC,MAAM,oCAF2B,EACnC,0CAAoC,GAClC,MAAM,qCAD4B,CAC3B;AACb,CAAC,EARgB,GAAG,KAAH,GAAG,QAQnB;AAED,GAAG,CAAC,SAAO,CAAA,GAAG,GAAG,CAAC;AAElB,eAAe,GAAG,CAAC"} \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/tests.cjs.js b/JS/node_modules/graphql-tag/lib/tests.cjs.js deleted file mode 100644 index c095bcf..0000000 --- a/JS/node_modules/graphql-tag/lib/tests.cjs.js +++ /dev/null @@ -1,408 +0,0 @@ -'use strict'; - -var tslib = require('tslib'); -require('source-map-support/register'); -var chai = require('chai'); -var graphql = require('graphql'); - -var docCache = new Map(); -var fragmentSourceMap = new Map(); -var printFragmentWarnings = true; -var experimentalFragmentVariables = false; -function normalize(string) { - return string.replace(/[\s,]+/g, ' ').trim(); -} -function cacheKeyFromLoc(loc) { - return normalize(loc.source.body.substring(loc.start, loc.end)); -} -function processFragments(ast) { - var seenKeys = new Set(); - var definitions = []; - ast.definitions.forEach(function (fragmentDefinition) { - if (fragmentDefinition.kind === 'FragmentDefinition') { - var fragmentName = fragmentDefinition.name.value; - var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc); - var sourceKeySet = fragmentSourceMap.get(fragmentName); - if (sourceKeySet && !sourceKeySet.has(sourceKey)) { - 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"); - } - } - else if (!sourceKeySet) { - fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); - } - sourceKeySet.add(sourceKey); - if (!seenKeys.has(sourceKey)) { - seenKeys.add(sourceKey); - definitions.push(fragmentDefinition); - } - } - else { - definitions.push(fragmentDefinition); - } - }); - return tslib.__assign(tslib.__assign({}, ast), { definitions: definitions }); -} -function stripLoc(doc) { - var workSet = new Set(doc.definitions); - workSet.forEach(function (node) { - if (node.loc) - delete node.loc; - Object.keys(node).forEach(function (key) { - var value = node[key]; - if (value && typeof value === 'object') { - workSet.add(value); - } - }); - }); - var loc = doc.loc; - if (loc) { - delete loc.startToken; - delete loc.endToken; - } - return doc; -} -function parseDocument(source) { - var cacheKey = normalize(source); - if (!docCache.has(cacheKey)) { - var parsed = graphql.parse(source, { - experimentalFragmentVariables: experimentalFragmentVariables - }); - if (!parsed || parsed.kind !== 'Document') { - throw new Error('Not a valid GraphQL document.'); - } - docCache.set(cacheKey, stripLoc(processFragments(parsed))); - } - return docCache.get(cacheKey); -} -function gql(literals) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - if (typeof literals === 'string') { - literals = [literals]; - } - var result = literals[0]; - args.forEach(function (arg, i) { - if (arg && arg.kind === 'Document') { - result += arg.loc.source.body; - } - else { - result += arg; - } - result += literals[i + 1]; - }); - return parseDocument(result); -} -function resetCaches() { - docCache.clear(); - fragmentSourceMap.clear(); -} -function disableFragmentWarnings() { - printFragmentWarnings = false; -} -function enableExperimentalFragmentVariables() { - experimentalFragmentVariables = true; -} -function disableExperimentalFragmentVariables() { - experimentalFragmentVariables = false; -} -var extras = { - gql: gql, - resetCaches: resetCaches, - disableFragmentWarnings: disableFragmentWarnings, - enableExperimentalFragmentVariables: enableExperimentalFragmentVariables, - disableExperimentalFragmentVariables: disableExperimentalFragmentVariables -}; -(function (gql_1) { - gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables; -})(gql || (gql = {})); -gql["default"] = gql; -var gql$1 = gql; - -var loader = require('../loader'); -describe('gql', function () { - it('parses queries', function () { - chai.assert.equal(gql$1(templateObject_1 || (templateObject_1 = tslib.__makeTemplateObject(["{ testQuery }"], ["{ testQuery }"]))).kind, 'Document'); - }); - it('parses queries when called as a function', function () { - chai.assert.equal(gql$1('{ testQuery }').kind, 'Document'); - }); - it('parses queries with weird substitutions', function () { - var obj = Object.create(null); - chai.assert.equal(gql$1(templateObject_2 || (templateObject_2 = tslib.__makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), obj.missing).kind, 'Document'); - chai.assert.equal(gql$1(templateObject_3 || (templateObject_3 = tslib.__makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), null).kind, 'Document'); - chai.assert.equal(gql$1(templateObject_4 || (templateObject_4 = tslib.__makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), 0).kind, 'Document'); - }); - it('allows interpolation of documents generated by the webpack loader', function () { - var sameFragment = "fragment SomeFragmentName on SomeType { someField }"; - var jsSource = loader.call({ cacheable: function () { } }, sameFragment); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - var document = gql$1(templateObject_5 || (templateObject_5 = tslib.__makeTemplateObject(["query { ...SomeFragmentName } ", ""], ["query { ...SomeFragmentName } ", ""])), module.exports); - chai.assert.equal(document.kind, 'Document'); - chai.assert.equal(document.definitions.length, 2); - chai.assert.equal(document.definitions[0].kind, 'OperationDefinition'); - chai.assert.equal(document.definitions[1].kind, 'FragmentDefinition'); - }); - it('parses queries through webpack loader', function () { - var jsSource = loader.call({ cacheable: function () { } }, '{ testQuery }'); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.equal(module.exports.kind, 'Document'); - }); - it('parses single query through webpack loader', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.equal(module.exports.kind, 'Document'); - chai.assert.exists(module.exports.Q1); - chai.assert.equal(module.exports.Q1.kind, 'Document'); - chai.assert.equal(module.exports.Q1.definitions.length, 1); - }); - it('parses single query and exports as default', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions); - }); - it('parses multiple queries through webpack loader', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.exists(module.exports.Q1); - chai.assert.exists(module.exports.Q2); - chai.assert.equal(module.exports.Q1.kind, 'Document'); - chai.assert.equal(module.exports.Q2.kind, 'Document'); - chai.assert.equal(module.exports.Q1.definitions.length, 1); - chai.assert.equal(module.exports.Q2.definitions.length, 1); - }); - it('parses fragments with variable definitions', function () { - gql$1.enableExperimentalFragmentVariables(); - var parsed = gql$1(templateObject_6 || (templateObject_6 = tslib.__makeTemplateObject(["fragment A ($arg: String!) on Type { testQuery }"], ["fragment A ($arg: String!) on Type { testQuery }"]))); - chai.assert.equal(parsed.kind, 'Document'); - chai.assert.exists(parsed.definitions[0].variableDefinitions); - gql$1.disableExperimentalFragmentVariables(); - }); - it('does not nest queries needlessly in named exports', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n query Q3 { test Query3 }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.notExists(module.exports.Q2.Q1); - chai.assert.notExists(module.exports.Q3.Q1); - chai.assert.notExists(module.exports.Q3.Q2); - }); - it('tracks fragment dependencies from multiple queries through webpack loader', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F1 on F { testQuery }\n fragment F2 on F { testQuery2 }\n fragment F3 on F { testQuery3 }\n query Q1 { ...F1 }\n query Q2 { ...F2 }\n query Q3 {\n ...F1\n ...F2\n }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.exists(module.exports.Q1); - chai.assert.exists(module.exports.Q2); - chai.assert.exists(module.exports.Q3); - var Q1 = module.exports.Q1.definitions; - var Q2 = module.exports.Q2.definitions; - var Q3 = module.exports.Q3.definitions; - chai.assert.equal(Q1.length, 2); - chai.assert.equal(Q1[0].name.value, 'Q1'); - chai.assert.equal(Q1[1].name.value, 'F1'); - chai.assert.equal(Q2.length, 2); - chai.assert.equal(Q2[0].name.value, 'Q2'); - chai.assert.equal(Q2[1].name.value, 'F2'); - chai.assert.equal(Q3.length, 3); - chai.assert.equal(Q3[0].name.value, 'Q3'); - chai.assert.equal(Q3[1].name.value, 'F1'); - chai.assert.equal(Q3[2].name.value, 'F2'); - var F1 = module.exports.F1.definitions; - var F2 = module.exports.F2.definitions; - var F3 = module.exports.F3.definitions; - chai.assert.equal(F1.length, 1); - chai.assert.equal(F1[0].name.value, 'F1'); - chai.assert.equal(F2.length, 1); - chai.assert.equal(F2[0].name.value, 'F2'); - chai.assert.equal(F3.length, 1); - chai.assert.equal(F3[0].name.value, 'F3'); - }); - it('tracks fragment dependencies across nested fragments', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F11 on F { testQuery }\n fragment F22 on F {\n ...F11\n testQuery2\n }\n fragment F33 on F {\n ...F22\n testQuery3\n }\n\n query Q1 {\n ...F33\n }\n\n query Q2 {\n id\n }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.exists(module.exports.Q1); - chai.assert.exists(module.exports.Q2); - var Q1 = module.exports.Q1.definitions; - var Q2 = module.exports.Q2.definitions; - chai.assert.equal(Q1.length, 4); - chai.assert.equal(Q1[0].name.value, 'Q1'); - chai.assert.equal(Q1[1].name.value, 'F33'); - chai.assert.equal(Q1[2].name.value, 'F22'); - chai.assert.equal(Q1[3].name.value, 'F11'); - chai.assert.equal(Q2.length, 1); - var F11 = module.exports.F11.definitions; - var F22 = module.exports.F22.definitions; - var F33 = module.exports.F33.definitions; - chai.assert.equal(F11.length, 1); - chai.assert.equal(F11[0].name.value, 'F11'); - chai.assert.equal(F22.length, 2); - chai.assert.equal(F22[0].name.value, 'F22'); - chai.assert.equal(F22[1].name.value, 'F11'); - chai.assert.equal(F33.length, 3); - chai.assert.equal(F33[0].name.value, 'F33'); - chai.assert.equal(F33[1].name.value, 'F22'); - chai.assert.equal(F33[2].name.value, 'F11'); - }); - it('correctly imports other files through the webpack loader', function () { - var query = "#import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }"; - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - var require = function (path) { - chai.assert.equal(path, './fragment_definition.graphql'); - return gql$1(templateObject_7 || (templateObject_7 = tslib.__makeTemplateObject(["\n fragment authorDetails on Author {\n firstName\n lastName\n }"], ["\n fragment authorDetails on Author {\n firstName\n lastName\n }"]))); - }; - Function("module,require", jsSource)(module, require); - chai.assert.equal(module.exports.kind, 'Document'); - var definitions = module.exports.definitions; - chai.assert.equal(definitions.length, 2); - chai.assert.equal(definitions[0].kind, 'OperationDefinition'); - chai.assert.equal(definitions[1].kind, 'FragmentDefinition'); - }); - it('tracks fragment dependencies across fragments loaded via the webpack loader', function () { - var query = "#import \"./fragment_definition.graphql\"\n fragment F111 on F {\n ...F222\n }\n\n query Q1 {\n ...F111\n }\n\n query Q2 {\n a\n }\n "; - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - var require = function (path) { - chai.assert.equal(path, './fragment_definition.graphql'); - return gql$1(templateObject_8 || (templateObject_8 = tslib.__makeTemplateObject(["\n fragment F222 on F {\n f1\n f2\n }"], ["\n fragment F222 on F {\n f1\n f2\n }"]))); - }; - Function("module,require", jsSource)(module, require); - chai.assert.exists(module.exports.Q1); - chai.assert.exists(module.exports.Q2); - var Q1 = module.exports.Q1.definitions; - var Q2 = module.exports.Q2.definitions; - chai.assert.equal(Q1.length, 3); - chai.assert.equal(Q1[0].name.value, 'Q1'); - chai.assert.equal(Q1[1].name.value, 'F111'); - chai.assert.equal(Q1[2].name.value, 'F222'); - chai.assert.equal(Q2.length, 1); - }); - it('does not complain when presented with normal comments', function (done) { - chai.assert.doesNotThrow(function () { - var query = "#normal comment\n query {\n author {\n ...authorDetails\n }\n }"; - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - chai.assert.equal(module.exports.kind, 'Document'); - done(); - }); - }); - it('returns the same object for the same query', function () { - chai.assert.isTrue(gql$1(templateObject_9 || (templateObject_9 = tslib.__makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql$1(templateObject_10 || (templateObject_10 = tslib.__makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"])))); - }); - it('returns the same object for the same query, even with whitespace differences', function () { - chai.assert.isTrue(gql$1(templateObject_11 || (templateObject_11 = tslib.__makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql$1(templateObject_12 || (templateObject_12 = tslib.__makeTemplateObject([" { sameQuery, }"], [" { sameQuery, }"])))); - }); - var fragmentAst = gql$1(templateObject_13 || (templateObject_13 = tslib.__makeTemplateObject(["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"], ["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"]))); - it('returns the same object for the same fragment', function () { - chai.assert.isTrue(gql$1(templateObject_14 || (templateObject_14 = tslib.__makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"]))) === gql$1(templateObject_15 || (templateObject_15 = tslib.__makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"])))); - }); - it('returns the same object for the same document with substitution', function () { - chai.assert.isTrue(gql$1(templateObject_16 || (templateObject_16 = tslib.__makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst) === gql$1(templateObject_17 || (templateObject_17 = tslib.__makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst)); - }); - it('can reference a fragment that references as fragment', function () { - var secondFragmentAst = gql$1(templateObject_18 || (templateObject_18 = tslib.__makeTemplateObject(["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "], ["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "])), fragmentAst); - var ast = gql$1(templateObject_19 || (templateObject_19 = tslib.__makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "])), secondFragmentAst); - chai.assert.deepEqual(ast, gql$1(templateObject_20 || (templateObject_20 = tslib.__makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "])))); - }); - describe('fragment warnings', function () { - var warnings = []; - var oldConsoleWarn = console.warn; - beforeEach(function () { - gql$1.resetCaches(); - warnings = []; - console.warn = function (w) { return warnings.push(w); }; - }); - afterEach(function () { - console.warn = oldConsoleWarn; - }); - it('warns if you use the same fragment name for different fragments', function () { - var frag1 = gql$1(templateObject_21 || (templateObject_21 = tslib.__makeTemplateObject(["fragment TestSame on Bar { fieldOne }"], ["fragment TestSame on Bar { fieldOne }"]))); - var frag2 = gql$1(templateObject_22 || (templateObject_22 = tslib.__makeTemplateObject(["fragment TestSame on Bar { fieldTwo }"], ["fragment TestSame on Bar { fieldTwo }"]))); - chai.assert.isFalse(frag1 === frag2); - chai.assert.equal(warnings.length, 1); - }); - it('does not warn if you use the same fragment name for the same fragment', function () { - var frag1 = gql$1(templateObject_23 || (templateObject_23 = tslib.__makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"]))); - var frag2 = gql$1(templateObject_24 || (templateObject_24 = tslib.__makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"]))); - chai.assert.isTrue(frag1 === frag2); - chai.assert.equal(warnings.length, 0); - }); - it('does not warn if you use the same embedded fragment in two different queries', function () { - var frag1 = gql$1(templateObject_25 || (templateObject_25 = tslib.__makeTemplateObject(["fragment TestEmbedded on Bar { field }"], ["fragment TestEmbedded on Bar { field }"]))); - var query1 = gql$1(templateObject_26 || (templateObject_26 = tslib.__makeTemplateObject(["{ bar { fieldOne ...TestEmbedded } } ", ""], ["{ bar { fieldOne ...TestEmbedded } } ", ""])), frag1); - var query2 = gql$1(templateObject_27 || (templateObject_27 = tslib.__makeTemplateObject(["{ bar { fieldTwo ...TestEmbedded } } ", ""], ["{ bar { fieldTwo ...TestEmbedded } } ", ""])), frag1); - chai.assert.isFalse(query1 === query2); - chai.assert.equal(warnings.length, 0); - }); - it('does not warn if you use the same fragment name for embedded and non-embedded fragments', function () { - var frag1 = gql$1(templateObject_28 || (templateObject_28 = tslib.__makeTemplateObject(["fragment TestEmbeddedTwo on Bar { field }"], ["fragment TestEmbeddedTwo on Bar { field }"]))); - gql$1(templateObject_29 || (templateObject_29 = tslib.__makeTemplateObject(["{ bar { ...TestEmbedded } } ", ""], ["{ bar { ...TestEmbedded } } ", ""])), frag1); - gql$1(templateObject_30 || (templateObject_30 = tslib.__makeTemplateObject(["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"], ["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"]))); - chai.assert.equal(warnings.length, 0); - }); - }); - describe('unique fragments', function () { - beforeEach(function () { - gql$1.resetCaches(); - }); - it('strips duplicate fragments from the document', function () { - var frag1 = gql$1(templateObject_31 || (templateObject_31 = tslib.__makeTemplateObject(["fragment TestDuplicate on Bar { field }"], ["fragment TestDuplicate on Bar { field }"]))); - var query1 = gql$1(templateObject_32 || (templateObject_32 = tslib.__makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", " ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", " ", ""])), frag1, frag1); - var query2 = gql$1(templateObject_33 || (templateObject_33 = tslib.__makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", ""])), frag1); - chai.assert.equal(query1.definitions.length, 2); - chai.assert.equal(query1.definitions[1].kind, 'FragmentDefinition'); - chai.assert.deepEqual(query1.definitions, query2.definitions); - }); - it('ignores duplicate fragments from second-level imports when using the webpack loader', function () { - var load = function (require, query) { - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - Function("require,module", jsSource)(require, module); - return module.exports; - }; - var test_require = function (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; - } - }; - var result = load(test_require, [ - '#import "./friends.graphql"', - '#import "./enemies.graphql"', - 'query { hero { ...friends ...enemies } }', - ].join('\n')); - chai.assert.equal(result.kind, 'Document'); - chai.assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain'); - chai.assert.equal(result.definitions[0].kind, 'OperationDefinition'); - var fragments = result.definitions.slice(1); - chai.assert(fragments.every(function (fragment) { return fragment.kind === 'FragmentDefinition'; })); - chai.assert(fragments.some(function (fragment) { return fragment.name.value === 'friends'; })); - chai.assert(fragments.some(function (fragment) { return fragment.name.value === 'enemies'; })); - chai.assert(fragments.some(function (fragment) { return fragment.name.value === 'person'; })); - }); - }); -}); -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; -//# sourceMappingURL=tests.cjs.js.map diff --git a/JS/node_modules/graphql-tag/lib/tests.cjs.js.map b/JS/node_modules/graphql-tag/lib/tests.cjs.js.map deleted file mode 100644 index d39a58d..0000000 --- a/JS/node_modules/graphql-tag/lib/tests.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tests.cjs.js","sources":["../src/index.ts","../src/tests.ts"],"sourcesContent":["import { parse } from 'graphql';\n\nimport {\n DocumentNode,\n DefinitionNode,\n Location,\n} from 'graphql/language/ast';\n\n// A map docString -> graphql document\nconst docCache = new Map();\n\n// A map fragmentName -> [normalized source]\nconst fragmentSourceMap = new Map>();\n\nlet printFragmentWarnings = true;\nlet experimentalFragmentVariables = false;\n\n// Strip insignificant whitespace\n// Note that this could do a lot more, such as reorder fields etc.\nfunction normalize(string: string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\n\nfunction cacheKeyFromLoc(loc: Location) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\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.\nfunction processFragments(ast: DocumentNode) {\n const seenKeys = new Set();\n const definitions: DefinitionNode[] = [];\n\n ast.definitions.forEach(fragmentDefinition => {\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 let sourceKeySet = fragmentSourceMap.get(fragmentName)!;\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\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 } else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n\n sourceKeySet.add(sourceKey);\n\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n } else {\n definitions.push(fragmentDefinition);\n }\n });\n\n return {\n ...ast,\n definitions,\n };\n}\n\nfunction stripLoc(doc: DocumentNode) {\n const workSet = new Set>(doc.definitions);\n\n workSet.forEach(node => {\n if (node.loc) delete node.loc;\n Object.keys(node).forEach(key => {\n const value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n\n const loc = doc.loc as Record;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n\n return doc;\n}\n\nfunction parseDocument(source: string) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n const parsed = parse(source, {\n experimentalFragmentVariables,\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(\n cacheKey,\n // check that all \"new\" fragments inside the documents are consistent with\n // existing fragments of the same name\n stripLoc(processFragments(parsed)),\n );\n }\n return docCache.get(cacheKey)!;\n}\n\n// XXX This should eventually disallow arbitrary string interpolation, like Relay does\nexport function gql(\n literals: string | readonly string[],\n ...args: any[]\n) {\n\n if (typeof literals === 'string') {\n literals = [literals];\n }\n\n let result = literals[0];\n\n args.forEach((arg, i) => {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n } else {\n result += arg;\n }\n result += literals[i + 1];\n });\n\n return parseDocument(result);\n}\n\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\n\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\n\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\n\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\n\nconst extras = {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n};\n\nexport namespace gql {\n export const {\n gql,\n resetCaches,\n disableFragmentWarnings,\n enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables,\n } = extras;\n}\n\ngql.default = gql;\n\nexport default gql;\n","import 'source-map-support/register';\n\nimport { assert } from 'chai';\nimport { DocumentNode, FragmentDefinitionNode } from 'graphql';\n\nimport gql from './index';\nconst loader = require('../loader');\n\ndescribe('gql', () => {\n it('parses queries', () => {\n assert.equal(gql`{ testQuery }`.kind, 'Document');\n });\n\n it('parses queries when called as a function', () => {\n assert.equal(gql('{ testQuery }').kind, 'Document');\n });\n\n it('parses queries with weird substitutions', () => {\n const obj = Object.create(null);\n assert.equal(gql`{ field(input: \"${obj.missing}\") }`.kind, 'Document');\n assert.equal(gql`{ field(input: \"${null}\") }`.kind, 'Document');\n assert.equal(gql`{ field(input: \"${0}\") }`.kind, 'Document');\n });\n\n it('allows interpolation of documents generated by the webpack loader', () => {\n const sameFragment = \"fragment SomeFragmentName on SomeType { someField }\";\n\n const jsSource = loader.call(\n { cacheable() {} },\n sameFragment,\n );\n const module = { exports: Object.create(null) };\n\n Function(\"module\", jsSource)(module);\n\n const document = gql`query { ...SomeFragmentName } ${module.exports}`;\n assert.equal(document.kind, 'Document');\n assert.equal(document.definitions.length, 2);\n assert.equal(document.definitions[0].kind, 'OperationDefinition');\n assert.equal(document.definitions[1].kind, 'FragmentDefinition');\n });\n\n it('parses queries through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, '{ testQuery }');\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n assert.equal(module.exports.kind, 'Document');\n });\n\n it('parses single query through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.equal(module.exports.kind, 'Document');\n assert.exists(module.exports.Q1);\n assert.equal(module.exports.Q1.kind, 'Document');\n assert.equal(module.exports.Q1.definitions.length, 1);\n });\n\n it('parses single query and exports as default', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions);\n });\n\n it('parses multiple queries through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n assert.equal(module.exports.Q1.kind, 'Document');\n assert.equal(module.exports.Q2.kind, 'Document');\n assert.equal(module.exports.Q1.definitions.length, 1);\n assert.equal(module.exports.Q2.definitions.length, 1);\n });\n\n it('parses fragments with variable definitions', () => {\n gql.enableExperimentalFragmentVariables();\n\n const parsed: any = gql`fragment A ($arg: String!) on Type { testQuery }`;\n assert.equal(parsed.kind, 'Document');\n assert.exists(parsed.definitions[0].variableDefinitions);\n\n gql.disableExperimentalFragmentVariables()\n });\n\n // see https://github.com/apollographql/graphql-tag/issues/168\n it('does not nest queries needlessly in named exports', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n query Q3 { test Query3 }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.notExists(module.exports.Q2.Q1);\n assert.notExists(module.exports.Q3.Q1);\n assert.notExists(module.exports.Q3.Q2);\n });\n\n it('tracks fragment dependencies from multiple queries through webpack loader', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n fragment F1 on F { testQuery }\n fragment F2 on F { testQuery2 }\n fragment F3 on F { testQuery3 }\n query Q1 { ...F1 }\n query Q2 { ...F2 }\n query Q3 {\n ...F1\n ...F2\n }\n `);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n assert.exists(module.exports.Q3);\n const Q1 = module.exports.Q1.definitions;\n const Q2 = module.exports.Q2.definitions;\n const Q3 = module.exports.Q3.definitions;\n\n assert.equal(Q1.length, 2);\n assert.equal(Q1[0].name.value, 'Q1');\n assert.equal(Q1[1].name.value, 'F1');\n\n assert.equal(Q2.length, 2);\n assert.equal(Q2[0].name.value, 'Q2');\n assert.equal(Q2[1].name.value, 'F2');\n\n assert.equal(Q3.length, 3);\n assert.equal(Q3[0].name.value, 'Q3');\n assert.equal(Q3[1].name.value, 'F1');\n assert.equal(Q3[2].name.value, 'F2');\n\n const F1 = module.exports.F1.definitions;\n const F2 = module.exports.F2.definitions;\n const F3 = module.exports.F3.definitions;\n\n assert.equal(F1.length, 1);\n assert.equal(F1[0].name.value, 'F1');\n assert.equal(F2.length, 1);\n assert.equal(F2[0].name.value, 'F2');\n assert.equal(F3.length, 1);\n assert.equal(F3[0].name.value, 'F3');\n\n });\n\n it('tracks fragment dependencies across nested fragments', () => {\n const jsSource = loader.call({ cacheable() {} }, `\n fragment F11 on F { testQuery }\n fragment F22 on F {\n ...F11\n testQuery2\n }\n fragment F33 on F {\n ...F22\n testQuery3\n }\n\n query Q1 {\n ...F33\n }\n\n query Q2 {\n id\n }\n `);\n\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n\n const Q1 = module.exports.Q1.definitions;\n const Q2 = module.exports.Q2.definitions;\n\n assert.equal(Q1.length, 4);\n assert.equal(Q1[0].name.value, 'Q1');\n assert.equal(Q1[1].name.value, 'F33');\n assert.equal(Q1[2].name.value, 'F22');\n assert.equal(Q1[3].name.value, 'F11');\n\n assert.equal(Q2.length, 1);\n\n const F11 = module.exports.F11.definitions;\n const F22 = module.exports.F22.definitions;\n const F33 = module.exports.F33.definitions;\n\n assert.equal(F11.length, 1);\n assert.equal(F11[0].name.value, 'F11');\n assert.equal(F22.length, 2);\n assert.equal(F22[0].name.value, 'F22');\n assert.equal(F22[1].name.value, 'F11');\n assert.equal(F33.length, 3);\n assert.equal(F33[0].name.value, 'F33');\n assert.equal(F33[1].name.value, 'F22');\n assert.equal(F33[2].name.value, 'F11');\n });\n\n it('correctly imports other files through the webpack loader', () => {\n const query = `#import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }`;\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n const require = (path: string) => {\n assert.equal(path, './fragment_definition.graphql');\n return gql`\n fragment authorDetails on Author {\n firstName\n lastName\n }`;\n };\n Function(\"module,require\", jsSource)(module, require);\n assert.equal(module.exports.kind, 'Document');\n const definitions = module.exports.definitions;\n assert.equal(definitions.length, 2);\n assert.equal(definitions[0].kind, 'OperationDefinition');\n assert.equal(definitions[1].kind, 'FragmentDefinition');\n });\n\n it('tracks fragment dependencies across fragments loaded via the webpack loader', () => {\n const query = `#import \"./fragment_definition.graphql\"\n fragment F111 on F {\n ...F222\n }\n\n query Q1 {\n ...F111\n }\n\n query Q2 {\n a\n }\n `;\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n const require = (path: string) => {\n assert.equal(path, './fragment_definition.graphql');\n return gql`\n fragment F222 on F {\n f1\n f2\n }`;\n };\n Function(\"module,require\", jsSource)(module, require);\n\n assert.exists(module.exports.Q1);\n assert.exists(module.exports.Q2);\n\n const Q1 = module.exports.Q1.definitions;\n const Q2 = module.exports.Q2.definitions;\n\n assert.equal(Q1.length, 3);\n assert.equal(Q1[0].name.value, 'Q1');\n assert.equal(Q1[1].name.value, 'F111');\n assert.equal(Q1[2].name.value, 'F222');\n\n assert.equal(Q2.length, 1);\n });\n\n it('does not complain when presented with normal comments', (done) => {\n assert.doesNotThrow(() => {\n const query = `#normal comment\n query {\n author {\n ...authorDetails\n }\n }`;\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n Function(\"module\", jsSource)(module);\n assert.equal(module.exports.kind, 'Document');\n done();\n });\n });\n\n it('returns the same object for the same query', () => {\n assert.isTrue(gql`{ sameQuery }` === gql`{ sameQuery }`);\n });\n\n it('returns the same object for the same query, even with whitespace differences', () => {\n assert.isTrue(gql`{ sameQuery }` === gql` { sameQuery, }`);\n });\n\n const fragmentAst = gql`\n fragment UserFragment on User {\n firstName\n lastName\n }\n`;\n\n it('returns the same object for the same fragment', () => {\n assert.isTrue(gql`fragment same on Same { sameQuery }` ===\n gql`fragment same on Same { sameQuery }`);\n });\n\n it('returns the same object for the same document with substitution', () => {\n // We know that calling `gql` on a fragment string will always return\n // the same document, so we can reuse `fragmentAst`\n assert.isTrue(gql`{ ...UserFragment } ${fragmentAst}` ===\n gql`{ ...UserFragment } ${fragmentAst}`);\n });\n\n it('can reference a fragment that references as fragment', () => {\n const secondFragmentAst = gql`\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ${fragmentAst}\n `;\n\n const ast = gql`\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ${secondFragmentAst}\n `;\n\n assert.deepEqual(ast, gql`\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n `);\n });\n\n describe('fragment warnings', () => {\n let warnings = [];\n const oldConsoleWarn = console.warn;\n beforeEach(() => {\n gql.resetCaches();\n warnings = [];\n console.warn = (w: string) => warnings.push(w);\n });\n afterEach(() => {\n console.warn = oldConsoleWarn;\n });\n\n it('warns if you use the same fragment name for different fragments', () => {\n const frag1 = gql`fragment TestSame on Bar { fieldOne }`;\n const frag2 = gql`fragment TestSame on Bar { fieldTwo }`;\n\n assert.isFalse(frag1 === frag2);\n assert.equal(warnings.length, 1);\n });\n\n it('does not warn if you use the same fragment name for the same fragment', () => {\n const frag1 = gql`fragment TestDifferent on Bar { fieldOne }`;\n const frag2 = gql`fragment TestDifferent on Bar { fieldOne }`;\n\n assert.isTrue(frag1 === frag2);\n assert.equal(warnings.length, 0);\n });\n\n it('does not warn if you use the same embedded fragment in two different queries', () => {\n const frag1 = gql`fragment TestEmbedded on Bar { field }`;\n const query1 = gql`{ bar { fieldOne ...TestEmbedded } } ${frag1}`;\n const query2 = gql`{ bar { fieldTwo ...TestEmbedded } } ${frag1}`;\n\n assert.isFalse(query1 === query2);\n assert.equal(warnings.length, 0);\n });\n\n it('does not warn if you use the same fragment name for embedded and non-embedded fragments', () => {\n const frag1 = gql`fragment TestEmbeddedTwo on Bar { field }`;\n gql`{ bar { ...TestEmbedded } } ${frag1}`;\n gql`{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }`;\n\n assert.equal(warnings.length, 0);\n });\n });\n\n describe('unique fragments', () => {\n beforeEach(() => {\n gql.resetCaches();\n });\n\n it('strips duplicate fragments from the document', () => {\n const frag1 = gql`fragment TestDuplicate on Bar { field }`;\n const query1 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1} ${frag1}`;\n const query2 = gql`{ bar { fieldOne ...TestDuplicate } } ${frag1}`;\n\n assert.equal(query1.definitions.length, 2);\n assert.equal(query1.definitions[1].kind, 'FragmentDefinition');\n // We don't test strict equality between the two queries because the source.body parsed from the\n // document is not the same, but the set of definitions should be.\n assert.deepEqual(query1.definitions, query2.definitions);\n });\n\n it('ignores duplicate fragments from second-level imports when using the webpack loader', () => {\n // take a require function and a query string, use the webpack loader to process it\n const load = (\n require: (path: string) => DocumentNode | null,\n query: string,\n ): DocumentNode | null => {\n const jsSource = loader.call({ cacheable() {} }, query);\n const module = { exports: Object.create(null) };\n Function(\"require,module\", jsSource)(require, module);\n return module.exports;\n }\n\n const test_require = (path: string) => {\n switch (path) {\n case './friends.graphql':\n return load(test_require, [\n '#import \"./person.graphql\"',\n 'fragment friends on Hero { friends { ...person } }',\n ].join('\\n'));\n case './enemies.graphql':\n return load(test_require, [\n '#import \"./person.graphql\"',\n 'fragment enemies on Hero { enemies { ...person } }',\n ].join('\\n'));\n case './person.graphql':\n return load(test_require, 'fragment person on Person { name }\\n');\n default:\n return null;\n };\n };\n\n const result = load(test_require, [\n '#import \"./friends.graphql\"',\n '#import \"./enemies.graphql\"',\n 'query { hero { ...friends ...enemies } }',\n ].join('\\n'))!;\n\n assert.equal(result.kind, 'Document');\n assert.equal(result.definitions.length, 4, 'after deduplication, only 4 fragments should remain');\n assert.equal(result.definitions[0].kind, 'OperationDefinition');\n\n // the rest of the definitions should be fragments and contain one of\n // each: \"friends\", \"enemies\", \"person\". Order does not matter\n const fragments = result.definitions.slice(1) as FragmentDefinitionNode[];\n assert(fragments.every(fragment => fragment.kind === 'FragmentDefinition'))\n assert(fragments.some(fragment => fragment.name.value === 'friends'))\n assert(fragments.some(fragment => fragment.name.value === 'enemies'))\n assert(fragments.some(fragment => fragment.name.value === 'person'))\n });\n });\n\n // How to make this work?\n // it.only('can reference a fragment passed as a document via shorthand', () => {\n // const ast = gql`\n // {\n // user(id: 5) {\n // ...${userFragmentDocument}\n // }\n // }\n // `;\n //\n // assert.deepEqual(ast, gql`\n // {\n // user(id: 5) {\n // ...UserFragment\n // }\n // }\n // fragment UserFragment on User {\n // firstName\n // lastName\n // }\n // `);\n // });\n});\n"],"names":["parse","assert","gql"],"mappings":";;;;;;;AASA,I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,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YACtCA,WAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,qDAAqD,CAAC,CAAC;YAClGA,WAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;YAIhE,IAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAA6B,CAAC;YAC1EA,WAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,KAAK,oBAAoB,GAAA,CAAC,CAAC,CAAA;YAC3EA,WAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,GAAA,CAAC,CAAC,CAAA;YACrEA,WAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,GAAA,CAAC,CAAC,CAAA;YACrEA,WAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,GAAA,CAAC,CAAC,CAAA;SACrE,CAAC,CAAC;KACJ,CAAC,CAAC;AAwBL,CAAC,CAAC,CAAC;;;"} \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/tests.d.ts b/JS/node_modules/graphql-tag/lib/tests.d.ts deleted file mode 100644 index c85b6c3..0000000 --- a/JS/node_modules/graphql-tag/lib/tests.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import 'source-map-support/register'; -//# sourceMappingURL=tests.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/tests.d.ts.map b/JS/node_modules/graphql-tag/lib/tests.d.ts.map deleted file mode 100644 index fc32419..0000000 --- a/JS/node_modules/graphql-tag/lib/tests.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../src/tests.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC"} \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/tests.js b/JS/node_modules/graphql-tag/lib/tests.js deleted file mode 100644 index 866f9d5..0000000 --- a/JS/node_modules/graphql-tag/lib/tests.js +++ /dev/null @@ -1,288 +0,0 @@ -import { __makeTemplateObject } from "tslib"; -import 'source-map-support/register'; -import { assert } from 'chai'; -import gql from './index'; -var loader = require('../loader'); -describe('gql', function () { - it('parses queries', function () { - assert.equal(gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["{ testQuery }"], ["{ testQuery }"]))).kind, 'Document'); - }); - it('parses queries when called as a function', function () { - assert.equal(gql('{ testQuery }').kind, 'Document'); - }); - it('parses queries with weird substitutions', function () { - var obj = Object.create(null); - assert.equal(gql(templateObject_2 || (templateObject_2 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), obj.missing).kind, 'Document'); - assert.equal(gql(templateObject_3 || (templateObject_3 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), null).kind, 'Document'); - assert.equal(gql(templateObject_4 || (templateObject_4 = __makeTemplateObject(["{ field(input: \"", "\") }"], ["{ field(input: \"", "\") }"])), 0).kind, 'Document'); - }); - it('allows interpolation of documents generated by the webpack loader', function () { - var sameFragment = "fragment SomeFragmentName on SomeType { someField }"; - var jsSource = loader.call({ cacheable: function () { } }, sameFragment); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - var document = gql(templateObject_5 || (templateObject_5 = __makeTemplateObject(["query { ...SomeFragmentName } ", ""], ["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', function () { - var jsSource = loader.call({ cacheable: function () { } }, '{ testQuery }'); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - assert.equal(module.exports.kind, 'Document'); - }); - it('parses single query through webpack loader', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - 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', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - assert.deepEqual(module.exports.definitions, module.exports.Q1.definitions); - }); - it('parses multiple queries through webpack loader', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - 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', function () { - gql.enableExperimentalFragmentVariables(); - var parsed = gql(templateObject_6 || (templateObject_6 = __makeTemplateObject(["fragment A ($arg: String!) on Type { testQuery }"], ["fragment A ($arg: String!) on Type { testQuery }"]))); - assert.equal(parsed.kind, 'Document'); - assert.exists(parsed.definitions[0].variableDefinitions); - gql.disableExperimentalFragmentVariables(); - }); - it('does not nest queries needlessly in named exports', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n query Q1 { testQuery }\n query Q2 { testQuery2 }\n query Q3 { test Query3 }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - 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', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F1 on F { testQuery }\n fragment F2 on F { testQuery2 }\n fragment F3 on F { testQuery3 }\n query Q1 { ...F1 }\n query Q2 { ...F2 }\n query Q3 {\n ...F1\n ...F2\n }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - assert.exists(module.exports.Q1); - assert.exists(module.exports.Q2); - assert.exists(module.exports.Q3); - var Q1 = module.exports.Q1.definitions; - var Q2 = module.exports.Q2.definitions; - var 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'); - var F1 = module.exports.F1.definitions; - var F2 = module.exports.F2.definitions; - var F3 = module.exports.F3.definitions; - assert.equal(F1.length, 1); - assert.equal(F1[0].name.value, 'F1'); - assert.equal(F2.length, 1); - assert.equal(F2[0].name.value, 'F2'); - assert.equal(F3.length, 1); - assert.equal(F3[0].name.value, 'F3'); - }); - it('tracks fragment dependencies across nested fragments', function () { - var jsSource = loader.call({ cacheable: function () { } }, "\n fragment F11 on F { testQuery }\n fragment F22 on F {\n ...F11\n testQuery2\n }\n fragment F33 on F {\n ...F22\n testQuery3\n }\n\n query Q1 {\n ...F33\n }\n\n query Q2 {\n id\n }\n "); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - assert.exists(module.exports.Q1); - assert.exists(module.exports.Q2); - var Q1 = module.exports.Q1.definitions; - var 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); - var F11 = module.exports.F11.definitions; - var F22 = module.exports.F22.definitions; - var F33 = module.exports.F33.definitions; - assert.equal(F11.length, 1); - assert.equal(F11[0].name.value, 'F11'); - assert.equal(F22.length, 2); - assert.equal(F22[0].name.value, 'F22'); - assert.equal(F22[1].name.value, 'F11'); - assert.equal(F33.length, 3); - assert.equal(F33[0].name.value, 'F33'); - assert.equal(F33[1].name.value, 'F22'); - assert.equal(F33[2].name.value, 'F11'); - }); - it('correctly imports other files through the webpack loader', function () { - var query = "#import \"./fragment_definition.graphql\"\n query {\n author {\n ...authorDetails\n }\n }"; - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - var require = function (path) { - assert.equal(path, './fragment_definition.graphql'); - return gql(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n fragment authorDetails on Author {\n firstName\n lastName\n }"], ["\n fragment authorDetails on Author {\n firstName\n lastName\n }"]))); - }; - Function("module,require", jsSource)(module, require); - assert.equal(module.exports.kind, 'Document'); - var 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', function () { - var query = "#import \"./fragment_definition.graphql\"\n fragment F111 on F {\n ...F222\n }\n\n query Q1 {\n ...F111\n }\n\n query Q2 {\n a\n }\n "; - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - var require = function (path) { - assert.equal(path, './fragment_definition.graphql'); - return gql(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n fragment F222 on F {\n f1\n f2\n }"], ["\n fragment F222 on F {\n f1\n f2\n }"]))); - }; - Function("module,require", jsSource)(module, require); - assert.exists(module.exports.Q1); - assert.exists(module.exports.Q2); - var Q1 = module.exports.Q1.definitions; - var 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', function (done) { - assert.doesNotThrow(function () { - var query = "#normal comment\n query {\n author {\n ...authorDetails\n }\n }"; - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - assert.equal(module.exports.kind, 'Document'); - done(); - }); - }); - it('returns the same object for the same query', function () { - assert.isTrue(gql(templateObject_9 || (templateObject_9 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql(templateObject_10 || (templateObject_10 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"])))); - }); - it('returns the same object for the same query, even with whitespace differences', function () { - assert.isTrue(gql(templateObject_11 || (templateObject_11 = __makeTemplateObject(["{ sameQuery }"], ["{ sameQuery }"]))) === gql(templateObject_12 || (templateObject_12 = __makeTemplateObject([" { sameQuery, }"], [" { sameQuery, }"])))); - }); - var fragmentAst = gql(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"], ["\n fragment UserFragment on User {\n firstName\n lastName\n }\n"]))); - it('returns the same object for the same fragment', function () { - assert.isTrue(gql(templateObject_14 || (templateObject_14 = __makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"]))) === gql(templateObject_15 || (templateObject_15 = __makeTemplateObject(["fragment same on Same { sameQuery }"], ["fragment same on Same { sameQuery }"])))); - }); - it('returns the same object for the same document with substitution', function () { - assert.isTrue(gql(templateObject_16 || (templateObject_16 = __makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst) === gql(templateObject_17 || (templateObject_17 = __makeTemplateObject(["{ ...UserFragment } ", ""], ["{ ...UserFragment } ", ""])), fragmentAst)); - }); - it('can reference a fragment that references as fragment', function () { - var secondFragmentAst = gql(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "], ["\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n ", "\n "])), fragmentAst); - var ast = gql(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n ", "\n "])), secondFragmentAst); - assert.deepEqual(ast, gql(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "], ["\n {\n user(id: 5) {\n ...SecondUserFragment\n }\n }\n fragment SecondUserFragment on User {\n ...UserFragment\n }\n fragment UserFragment on User {\n firstName\n lastName\n }\n "])))); - }); - describe('fragment warnings', function () { - var warnings = []; - var oldConsoleWarn = console.warn; - beforeEach(function () { - gql.resetCaches(); - warnings = []; - console.warn = function (w) { return warnings.push(w); }; - }); - afterEach(function () { - console.warn = oldConsoleWarn; - }); - it('warns if you use the same fragment name for different fragments', function () { - var frag1 = gql(templateObject_21 || (templateObject_21 = __makeTemplateObject(["fragment TestSame on Bar { fieldOne }"], ["fragment TestSame on Bar { fieldOne }"]))); - var frag2 = gql(templateObject_22 || (templateObject_22 = __makeTemplateObject(["fragment TestSame on Bar { fieldTwo }"], ["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', function () { - var frag1 = gql(templateObject_23 || (templateObject_23 = __makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["fragment TestDifferent on Bar { fieldOne }"]))); - var frag2 = gql(templateObject_24 || (templateObject_24 = __makeTemplateObject(["fragment TestDifferent on Bar { fieldOne }"], ["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', function () { - var frag1 = gql(templateObject_25 || (templateObject_25 = __makeTemplateObject(["fragment TestEmbedded on Bar { field }"], ["fragment TestEmbedded on Bar { field }"]))); - var query1 = gql(templateObject_26 || (templateObject_26 = __makeTemplateObject(["{ bar { fieldOne ...TestEmbedded } } ", ""], ["{ bar { fieldOne ...TestEmbedded } } ", ""])), frag1); - var query2 = gql(templateObject_27 || (templateObject_27 = __makeTemplateObject(["{ bar { fieldTwo ...TestEmbedded } } ", ""], ["{ 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', function () { - var frag1 = gql(templateObject_28 || (templateObject_28 = __makeTemplateObject(["fragment TestEmbeddedTwo on Bar { field }"], ["fragment TestEmbeddedTwo on Bar { field }"]))); - gql(templateObject_29 || (templateObject_29 = __makeTemplateObject(["{ bar { ...TestEmbedded } } ", ""], ["{ bar { ...TestEmbedded } } ", ""])), frag1); - gql(templateObject_30 || (templateObject_30 = __makeTemplateObject(["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"], ["{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }"]))); - assert.equal(warnings.length, 0); - }); - }); - describe('unique fragments', function () { - beforeEach(function () { - gql.resetCaches(); - }); - it('strips duplicate fragments from the document', function () { - var frag1 = gql(templateObject_31 || (templateObject_31 = __makeTemplateObject(["fragment TestDuplicate on Bar { field }"], ["fragment TestDuplicate on Bar { field }"]))); - var query1 = gql(templateObject_32 || (templateObject_32 = __makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", " ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", " ", ""])), frag1, frag1); - var query2 = gql(templateObject_33 || (templateObject_33 = __makeTemplateObject(["{ bar { fieldOne ...TestDuplicate } } ", ""], ["{ bar { fieldOne ...TestDuplicate } } ", ""])), frag1); - assert.equal(query1.definitions.length, 2); - assert.equal(query1.definitions[1].kind, 'FragmentDefinition'); - assert.deepEqual(query1.definitions, query2.definitions); - }); - it('ignores duplicate fragments from second-level imports when using the webpack loader', function () { - var load = function (require, query) { - var jsSource = loader.call({ cacheable: function () { } }, query); - var module = { exports: Object.create(null) }; - Function("require,module", jsSource)(require, module); - return module.exports; - }; - var test_require = function (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; - } - ; - }; - var 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'); - var fragments = result.definitions.slice(1); - assert(fragments.every(function (fragment) { return fragment.kind === 'FragmentDefinition'; })); - assert(fragments.some(function (fragment) { return fragment.name.value === 'friends'; })); - assert(fragments.some(function (fragment) { return fragment.name.value === 'enemies'; })); - assert(fragments.some(function (fragment) { return fragment.name.value === 'person'; })); - }); - }); -}); -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; -//# sourceMappingURL=tests.js.map \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/lib/tests.js.map b/JS/node_modules/graphql-tag/lib/tests.js.map deleted file mode 100644 index b0b5550..0000000 --- a/JS/node_modules/graphql-tag/lib/tests.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tests.js","sourceRoot":"","sources":["../src/tests.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,OAAO,GAAG,MAAM,SAAS,CAAC;AAC1B,IAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEpC,QAAQ,CAAC,KAAK,EAAE;IACd,EAAE,CAAC,gBAAgB,EAAE;QACnB,MAAM,CAAC,KAAK,CAAC,GAAG,kFAAA,eAAe,KAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE;QAC5C,IAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,CAAC,KAAK,CAAC,GAAG,+FAAA,mBAAmB,EAAW,OAAM,KAAjB,GAAG,CAAC,OAAO,EAAO,IAAI,EAAE,UAAU,CAAC,CAAC;QACvE,MAAM,CAAC,KAAK,CAAC,GAAG,+FAAA,mBAAmB,EAAI,OAAM,KAAV,IAAI,EAAO,IAAI,EAAE,UAAU,CAAC,CAAC;QAChE,MAAM,CAAC,KAAK,CAAC,GAAG,+FAAA,mBAAmB,EAAC,OAAM,KAAP,CAAC,EAAO,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mEAAmE,EAAE;QACtE,IAAM,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AC3C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC;YAEf,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;YACtC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,qDAAqD,CAAC,CAAC;YAClG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;YAIhE,IAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAA6B,CAAC;YAC1E,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,KAAK,oBAAoB,EAAtC,CAAsC,CAAC,CAAC,CAAA;YAC3E,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,EAAjC,CAAiC,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,EAAjC,CAAiC,CAAC,CAAC,CAAA;YACrE,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAA,QAAQ,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAhC,CAAgC,CAAC,CAAC,CAAA;QACtE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AAwBL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/loader.js b/JS/node_modules/graphql-tag/loader.js deleted file mode 100644 index af1f88c..0000000 --- a/JS/node_modules/graphql-tag/loader.js +++ /dev/null @@ -1,190 +0,0 @@ -"use strict"; - -const os = require('os'); -const gql = require('./main.js'); - -// 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" || op.kind === "FragmentDefinition") { - 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" || op.kind === "FragmentDefinition") { - 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/JS/node_modules/graphql-tag/main.js b/JS/node_modules/graphql-tag/main.js deleted file mode 100644 index 2a4de05..0000000 --- a/JS/node_modules/graphql-tag/main.js +++ /dev/null @@ -1,3 +0,0 @@ -// For backwards compatibility, make sure require("graphql-tag") returns -// the gql function, rather than an exports object. -module.exports = require('./lib/graphql-tag.umd.js').gql; diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/CopyrightNotice.txt b/JS/node_modules/graphql-tag/node_modules/tslib/CopyrightNotice.txt deleted file mode 100644 index 3d4c823..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/CopyrightNotice.txt +++ /dev/null @@ -1,15 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/LICENSE.txt b/JS/node_modules/graphql-tag/node_modules/tslib/LICENSE.txt deleted file mode 100644 index bfe6430..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/LICENSE.txt +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/README.md b/JS/node_modules/graphql-tag/node_modules/tslib/README.md deleted file mode 100644 index 72ff8e7..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/README.md +++ /dev/null @@ -1,164 +0,0 @@ -# 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 3.9.2 or later -npm install tslib - -# TypeScript 3.8.4 or earlier -npm install tslib@^1 - -# TypeScript 2.3.2 or earlier -npm install tslib@1.6.1 -``` - -## yarn - -```sh -# TypeScript 3.9.2 or later -yarn add tslib - -# TypeScript 3.8.4 or earlier -yarn add tslib@^1 - -# TypeScript 2.3.2 or earlier -yarn add tslib@1.6.1 -``` - -## bower - -```sh -# TypeScript 3.9.2 or later -bower install tslib - -# TypeScript 3.8.4 or earlier -bower install tslib@^1 - -# TypeScript 2.3.2 or earlier -bower install tslib@1.6.1 -``` - -## JSPM - -```sh -# TypeScript 3.9.2 or later -jspm install tslib - -# TypeScript 3.8.4 or earlier -jspm install tslib@^1 - -# 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@2.x.y/tslib.d.ts"] - } - } -} -``` - -## Deployment - -- Choose your new version number -- Set it in `package.json` and `bower.json` -- Create a tag: `git tag [version]` -- Push the tag: `git push --tags` -- Create a [release in GitHub](https://github.com/microsoft/tslib/releases) -- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow - -Done. - -# 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). - -# Documentation - -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Homepage](http://www.typescriptlang.org/) diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/modules/index.js b/JS/node_modules/graphql-tag/node_modules/tslib/modules/index.js deleted file mode 100644 index c5afe4f..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/modules/index.js +++ /dev/null @@ -1,53 +0,0 @@ -import tslib from '../tslib.js'; -const { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, -} = tslib; -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, -}; diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/modules/package.json b/JS/node_modules/graphql-tag/node_modules/tslib/modules/package.json deleted file mode 100644 index aafa0e4..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/modules/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/package.json b/JS/node_modules/graphql-tag/node_modules/tslib/package.json deleted file mode 100644 index e528ac0..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "tslib", - "author": "Microsoft Corp.", - "homepage": "https://www.typescriptlang.org/", - "version": "2.3.1", - "license": "0BSD", - "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", - "sideEffects": false, - "exports": { - ".": { - "module": "./tslib.es6.js", - "import": "./modules/index.js", - "default": "./tslib.js" - }, - "./": "./" - } -} diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.d.ts b/JS/node_modules/graphql-tag/node_modules/tslib/tslib.d.ts deleted file mode 100644 index 76e89d1..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.d.ts +++ /dev/null @@ -1,130 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -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, o: any): void; -export declare function __values(o: any): any; -export declare function __read(o: any, n?: number): any[]; -/** @deprecated since TypeScript 4.2 */ -export declare function __spread(...args: any[][]): any[]; -/** @deprecated since TypeScript 4.2 */ -export declare function __spreadArrays(...args: any[][]): any[]; -export declare function __spreadArray(to: any[], from: any[], pack?: boolean): 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 }; -/** - * Reading from a private instance field - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean, get(o: T): V | undefined }, - kind?: "f" -): V; -/** - * Reading from a private static field - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "f", - f: { value: V } -): V; -/** - * Reading from a private instance get accessor - */ -export declare function __classPrivateFieldGet( - receiver: T, - state: { has(o: T): boolean }, - kind: "a", - f: () => V -): V; -/** - * Reading from a private static get accessor - */ -export declare function __classPrivateFieldGet unknown, V>( - receiver: T, - state: T, - kind: "a", - f: () => V -): V; -/** - * Reading from a private instance method - */ -export declare function __classPrivateFieldGet unknown>( - receiver: T, - state: { has(o: T): boolean }, - kind: "m", - f: V -): V; -/** - * Reading from a private static method - */ -export declare function __classPrivateFieldGet unknown, V extends (...args: any[]) => unknown>( - receiver: T, - state: T, - kind: "m", - f: V -): V; -/** - * Writing to a private instance field - */ - export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean, set(o: T, value: V): unknown }, - value: V, - kind?: "f" -): V; -/** - * Writing to a private static field - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "f", - f: { value: V } -): V; -/** - * Writing to a private instance set accessor - */ -export declare function __classPrivateFieldSet( - receiver: T, - state: { has(o: T): boolean }, - value: V, - kind: "a", - f: (v: V) => void -): V; -/** - * Writing to a private static set accessor - */ -export declare function __classPrivateFieldSet unknown, V>( - receiver: T, - state: T, - value: V, - kind: "a", - f: (v: V) => void -): V; -export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.es6.html b/JS/node_modules/graphql-tag/node_modules/tslib/tslib.es6.html deleted file mode 100644 index b122e41..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.es6.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.es6.js b/JS/node_modules/graphql-tag/node_modules/tslib/tslib.es6.js deleted file mode 100644 index 0c764b8..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.es6.js +++ /dev/null @@ -1,239 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* 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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -export function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - 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) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - 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) : adopt(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 var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -export function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -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; -} - -/** @deprecated */ -export function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -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 __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -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; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -export function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -export function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -export function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -export function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.html b/JS/node_modules/graphql-tag/node_modules/tslib/tslib.html deleted file mode 100644 index 44c9ba5..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.js b/JS/node_modules/graphql-tag/node_modules/tslib/tslib.js deleted file mode 100644 index 422d250..0000000 --- a/JS/node_modules/graphql-tag/node_modules/tslib/tslib.js +++ /dev/null @@ -1,306 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* 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 __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __createBinding; -(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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - 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) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - 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) : adopt(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, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __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; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __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; - }; - - __spreadArray = function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - - __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; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __importStar = function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - 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("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); -}); diff --git a/JS/node_modules/graphql-tag/package.json b/JS/node_modules/graphql-tag/package.json deleted file mode 100644 index 1a022a8..0000000 --- a/JS/node_modules/graphql-tag/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "graphql-tag", - "version": "2.12.5", - "description": "A JavaScript template literal tag that parses GraphQL queries", - "main": "./main.js", - "module": "./lib/index.js", - "jsnext:main": "./lib/index.js", - "types": "./lib/index.d.ts", - "sideEffects": false, - "scripts": { - "prebuild": "rimraf lib", - "build": "tsc && rollup -c && npm run flow", - "flow": "cp src/index.js.flow lib/graphql-tag.umd.js.flow", - "test": "npm run test:ts3 && npm run test:ts4", - "test:ts3": "npm i typescript@3.7.x && npm run test:mocha", - "test:ts4": "npm i typescript@4.x && npm run test:mocha", - "test:mocha": "npm run build && mocha lib/tests.cjs.js", - "prepublish": "npm run build" - }, - "files": [ - "lib/", - "src/", - "loader.js", - "main.js" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apollographql/graphql-tag.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/apollographql/graphql-tag/issues" - }, - "homepage": "https://github.com/apollographql/graphql-tag#readme", - "dependencies": { - "tslib": "^2.1.0" - }, - "devDependencies": { - "@types/chai": "^4.2.14", - "@types/mocha": "^8.2.0", - "@types/node": "^14.14.22", - "chai": "^4.2.0", - "graphql": "^15.4.0", - "mocha": "^9.0.1", - "rimraf": "^3.0.2", - "rollup": "^2.33.1", - "rollup-plugin-sourcemaps": "^0.6.3", - "source-map-support": "^0.5.19", - "test-all-versions": "^5.0.1", - "typescript": "^4.3.4" - }, - "peerDependencies": { - "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - }, - "engines": { - "node": ">=10" - } -} diff --git a/JS/node_modules/graphql-tag/src/index.js.flow b/JS/node_modules/graphql-tag/src/index.js.flow deleted file mode 100644 index 7acb623..0000000 --- a/JS/node_modules/graphql-tag/src/index.js.flow +++ /dev/null @@ -1,7 +0,0 @@ -// @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/JS/node_modules/graphql-tag/src/index.ts b/JS/node_modules/graphql-tag/src/index.ts deleted file mode 100644 index 6cca0be..0000000 --- a/JS/node_modules/graphql-tag/src/index.ts +++ /dev/null @@ -1,173 +0,0 @@ -import { parse } from 'graphql'; - -import { - DocumentNode, - DefinitionNode, - Location, -} from 'graphql/language/ast'; - -// A map docString -> graphql document -const docCache = new Map(); - -// A map fragmentName -> [normalized source] -const fragmentSourceMap = new Map>(); - -let printFragmentWarnings = true; -let experimentalFragmentVariables = false; - -// Strip insignificant whitespace -// Note that this could do a lot more, such as reorder fields etc. -function normalize(string: string) { - return string.replace(/[\s,]+/g, ' ').trim(); -} - -function cacheKeyFromLoc(loc: Location) { - return normalize(loc.source.body.substring(loc.start, loc.end)); -} - -// 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. -function processFragments(ast: DocumentNode) { - const seenKeys = new Set(); - const definitions: DefinitionNode[] = []; - - ast.definitions.forEach(fragmentDefinition => { - if (fragmentDefinition.kind === 'FragmentDefinition') { - var fragmentName = fragmentDefinition.name.value; - var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc!); - - // We know something about this fragment - let sourceKeySet = fragmentSourceMap.get(fragmentName)!; - if (sourceKeySet && !sourceKeySet.has(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"); - } - } else if (!sourceKeySet) { - fragmentSourceMap.set(fragmentName, sourceKeySet = new Set); - } - - sourceKeySet.add(sourceKey); - - if (!seenKeys.has(sourceKey)) { - seenKeys.add(sourceKey); - definitions.push(fragmentDefinition); - } - } else { - definitions.push(fragmentDefinition); - } - }); - - return { - ...ast, - definitions, - }; -} - -function stripLoc(doc: DocumentNode) { - const workSet = new Set>(doc.definitions); - - workSet.forEach(node => { - if (node.loc) delete node.loc; - Object.keys(node).forEach(key => { - const value = node[key]; - if (value && typeof value === 'object') { - workSet.add(value); - } - }); - }); - - const loc = doc.loc as Record; - if (loc) { - delete loc.startToken; - delete loc.endToken; - } - - return doc; -} - -function parseDocument(source: string) { - var cacheKey = normalize(source); - if (!docCache.has(cacheKey)) { - const parsed = parse(source, { - experimentalFragmentVariables, - }); - if (!parsed || parsed.kind !== 'Document') { - throw new Error('Not a valid GraphQL document.'); - } - docCache.set( - cacheKey, - // check that all "new" fragments inside the documents are consistent with - // existing fragments of the same name - stripLoc(processFragments(parsed)), - ); - } - return docCache.get(cacheKey)!; -} - -// XXX This should eventually disallow arbitrary string interpolation, like Relay does -export function gql( - literals: string | readonly string[], - ...args: any[] -) { - - if (typeof literals === 'string') { - literals = [literals]; - } - - let result = literals[0]; - - args.forEach((arg, i) => { - if (arg && arg.kind === 'Document') { - result += arg.loc.source.body; - } else { - result += arg; - } - result += literals[i + 1]; - }); - - return parseDocument(result); -} - -export function resetCaches() { - docCache.clear(); - fragmentSourceMap.clear(); -} - -export function disableFragmentWarnings() { - printFragmentWarnings = false; -} - -export function enableExperimentalFragmentVariables() { - experimentalFragmentVariables = true; -} - -export function disableExperimentalFragmentVariables() { - experimentalFragmentVariables = false; -} - -const extras = { - gql, - resetCaches, - disableFragmentWarnings, - enableExperimentalFragmentVariables, - disableExperimentalFragmentVariables, -}; - -export namespace gql { - export const { - gql, - resetCaches, - disableFragmentWarnings, - enableExperimentalFragmentVariables, - disableExperimentalFragmentVariables, - } = extras; -} - -gql.default = gql; - -export default gql; diff --git a/JS/node_modules/graphql-tag/src/tests.ts b/JS/node_modules/graphql-tag/src/tests.ts deleted file mode 100644 index 3a19b75..0000000 --- a/JS/node_modules/graphql-tag/src/tests.ts +++ /dev/null @@ -1,491 +0,0 @@ -import 'source-map-support/register'; - -import { assert } from 'chai'; -import { DocumentNode, FragmentDefinitionNode } from 'graphql'; - -import gql from './index'; -const loader = require('../loader'); - -describe('gql', () => { - 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 = Object.create(null); - 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() {} }, - sameFragment, - ); - const module = { exports: Object.create(null) }; - - Function("module", jsSource)(module); - - 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: Object.create(null) }; - Function("module", jsSource)(module); - assert.equal(module.exports.kind, 'Document'); - }); - - it('parses single query through webpack loader', () => { - const jsSource = loader.call({ cacheable() {} }, ` - query Q1 { testQuery } - `); - const module = { exports: Object.create(null) }; - Function("module", jsSource)(module); - - 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: Object.create(null) }; - Function("module", jsSource)(module); - 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: Object.create(null) }; - Function("module", jsSource)(module); - - 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: any = 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: Object.create(null) }; - Function("module", jsSource)(module); - - 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: Object.create(null) }; - Function("module", jsSource)(module); - - 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'); - - const F1 = module.exports.F1.definitions; - const F2 = module.exports.F2.definitions; - const F3 = module.exports.F3.definitions; - - assert.equal(F1.length, 1); - assert.equal(F1[0].name.value, 'F1'); - assert.equal(F2.length, 1); - assert.equal(F2[0].name.value, 'F2'); - assert.equal(F3.length, 1); - assert.equal(F3[0].name.value, 'F3'); - - }); - - 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: Object.create(null) }; - Function("module", jsSource)(module); - - 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); - - const F11 = module.exports.F11.definitions; - const F22 = module.exports.F22.definitions; - const F33 = module.exports.F33.definitions; - - assert.equal(F11.length, 1); - assert.equal(F11[0].name.value, 'F11'); - assert.equal(F22.length, 2); - assert.equal(F22[0].name.value, 'F22'); - assert.equal(F22[1].name.value, 'F11'); - assert.equal(F33.length, 3); - assert.equal(F33[0].name.value, 'F33'); - assert.equal(F33[1].name.value, 'F22'); - assert.equal(F33[2].name.value, 'F11'); - }); - - 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 module = { exports: Object.create(null) }; - const require = (path: string) => { - assert.equal(path, './fragment_definition.graphql'); - return gql` - fragment authorDetails on Author { - firstName - lastName - }`; - }; - Function("module,require", jsSource)(module, require); - 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 module = { exports: Object.create(null) }; - const require = (path: string) => { - assert.equal(path, './fragment_definition.graphql'); - return gql` - fragment F222 on F { - f1 - f2 - }`; - }; - Function("module,require", jsSource)(module, require); - - 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: Object.create(null) }; - Function("module", jsSource)(module); - 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(() => { - gql.resetCaches(); - warnings = []; - console.warn = (w: string) => 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 }`; - gql`{ bar { ...TestEmbedded } } ${frag1}`; - gql`{ bar { ...TestEmbedded } } fragment TestEmbeddedTwo on Bar { field }`; - - assert.equal(warnings.length, 0); - }); - }); - - describe('unique fragments', () => { - beforeEach(() => { - gql.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: (path: string) => DocumentNode | null, - query: string, - ): DocumentNode | null => { - const jsSource = loader.call({ cacheable() {} }, query); - const module = { exports: Object.create(null) }; - Function("require,module", jsSource)(require, module); - return module.exports; - } - - const test_require = (path: string) => { - 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) as FragmentDefinitionNode[]; - 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/JS/node_modules/graphql/LICENSE b/JS/node_modules/graphql/LICENSE deleted file mode 100644 index 7bbf892..0000000 --- a/JS/node_modules/graphql/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 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/JS/node_modules/graphql/README.md b/JS/node_modules/graphql/README.md deleted file mode 100644 index 733e424..0000000 --- a/JS/node_modules/graphql/README.md +++ /dev/null @@ -1,177 +0,0 @@ -# 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://github.com/graphql/graphql-js/workflows/CI/badge.svg?branch=master)](https://github.com/graphql/graphql-js/actions?query=branch%3Amaster) -[![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 - -A general overview of GraphQL 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 npm: - -```sh -npm install --save graphql -``` - -or using yarn: - -```sh -yarn add 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 codebase. - -```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); -}); -``` - -**Note**: Please don't forget to set `NODE_ENV=production` if you are running a production server. It will disable some checks that can be useful during development but will significantly improve performance. - -### 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 -``` - -### Experimental features - -Each release of GraphQL.js will be accompanied by an experimental release containing support for the `@defer` and `@stream` directive proposal. We are hoping to get community feedback on these releases before the proposal is accepted into the GraphQL specification. You can use this experimental release of GraphQL.js by adding the following to your project's `package.json` file. - -``` -"graphql": "experimental-stream-defer" -``` - -Community feedback on this experimental release is much appreciated and can be provided on the [issue created for this purpose](https://github.com/graphql/graphql-js/issues/2848). - -### 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](./.github/CONTRIBUTING.md). - -### Changelog - -Changes are tracked as [GitHub releases](https://github.com/graphql/graphql-js/releases). - -### License - -GraphQL.js is [MIT-licensed](./LICENSE). - -### Credits - -The `*.d.ts` files in this project are based on [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/54712a7e28090c5b1253b746d1878003c954f3ff/types/graphql) definitions written by: - - - -- TonyYang https://github.com/TonyPythoneer -- Caleb Meredith https://github.com/calebmer -- Dominic Watson https://github.com/intellix -- Firede https://github.com/firede -- Kepennar https://github.com/kepennar -- Mikhail Novikov https://github.com/freiksenet -- Ivan Goncharov https://github.com/IvanGoncharov -- Hagai Cohen https://github.com/DxCx -- Ricardo Portugal https://github.com/rportugal -- Tim Griesser https://github.com/tgriesser -- Dylan Stewart https://github.com/dyst5422 -- Alessio Dionisi https://github.com/adnsio -- Divyendu Singh https://github.com/divyenduz -- Brad Zacher https://github.com/bradzacher -- Curtis Layne https://github.com/clayne11 -- Jonathan Cardoso https://github.com/JCMais -- Pavel Lang https://github.com/langpavel -- Mark Caudill https://github.com/mc0 -- Martijn Walraven https://github.com/martijnwalraven -- Jed Mao https://github.com/jedmao diff --git a/JS/node_modules/graphql/error/GraphQLError.d.ts b/JS/node_modules/graphql/error/GraphQLError.d.ts deleted file mode 100644 index 99001fd..0000000 --- a/JS/node_modules/graphql/error/GraphQLError.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { ASTNode } from '../language/ast'; -import { Source } from '../language/source'; -import { SourceLocation } from '../language/location'; - -/** - * 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 class GraphQLError extends Error { - constructor( - message: string, - nodes?: Maybe | ASTNode>, - source?: Maybe, - positions?: Maybe>, - path?: Maybe>, - originalError?: Maybe, - extensions?: Maybe<{ [key: string]: any }>, - ); - - /** - * 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(). - */ - readonly locations: ReadonlyArray | undefined; - - /** - * 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(). - */ - readonly path: ReadonlyArray | undefined; - - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - readonly nodes: ReadonlyArray | undefined; - - /** - * The source GraphQL document corresponding to this error. - * - * Note that if this Error represents more than one node, the source may not - * represent nodes after the first node. - */ - readonly source: Source | undefined; - - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - readonly positions: ReadonlyArray | undefined; - - /** - * The original error thrown from a field resolver during execution. - */ - readonly originalError: Maybe; - - /** - * Extension fields to add to the formatted error. - */ - readonly extensions: { [key: string]: any } | undefined; -} - -/** - * Prints a GraphQLError to a string, representing useful location information - * about the error's position in the source. - */ -export function printError(error: GraphQLError): string; diff --git a/JS/node_modules/graphql/error/GraphQLError.js b/JS/node_modules/graphql/error/GraphQLError.js deleted file mode 100644 index babdd8a..0000000 --- a/JS/node_modules/graphql/error/GraphQLError.js +++ /dev/null @@ -1,288 +0,0 @@ -"use strict"; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.printError = printError; -exports.GraphQLError = void 0; - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _symbols = require("../polyfills/symbols.js"); - -var _location = require("../language/location.js"); - -var _printLocation = require("../language/printLocation.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } - -function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -/** - * 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. - */ -var GraphQLError = /*#__PURE__*/function (_Error) { - _inherits(GraphQLError, _Error); - - var _super = _createSuper(GraphQLError); - - /** - * 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. - */ - - /** - * 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(). - */ - - /** - * 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(). - */ - - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - - /** - * 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. - */ - - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - - /** - * The original error thrown from a field resolver during execution. - */ - - /** - * Extension fields to add to the formatted error. - */ - function GraphQLError(message, nodes, source, positions, path, originalError, extensions) { - var _locations2, _source2, _positions2, _extensions2; - - var _this; - - _classCallCheck(this, GraphQLError); - - _this = _super.call(this, message); // 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 _nodes$0$loc; - - _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$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(_assertThisInitialized(_this), { - name: { - value: 'GraphQLError' - }, - 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 falsy values to undefined ensures they will not be included - // in JSON.stringify() when not provided. - value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : 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: _locations != null - }, - path: { - // Coercing falsy values to undefined ensures they will not be included - // in JSON.stringify() when not provided. - value: path !== null && path !== void 0 ? 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: path != null - }, - nodes: { - value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined - }, - source: { - value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined - }, - positions: { - value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined - }, - originalError: { - value: originalError - }, - extensions: { - // Coercing falsy values to undefined ensures they will not be included - // in JSON.stringify() when not provided. - value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : 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: _extensions != null - } - }); // Include (non-enumerable) stack trace. - - if (originalError !== null && originalError !== void 0 && originalError.stack) { - Object.defineProperty(_assertThisInitialized(_this), 'stack', { - value: originalError.stack, - writable: true, - configurable: true - }); - return _possibleConstructorReturn(_this); - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - - - if (Error.captureStackTrace) { - Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError); - } else { - Object.defineProperty(_assertThisInitialized(_this), 'stack', { - value: Error().stack, - writable: true, - configurable: true - }); - } - - return _this; - } - - _createClass(GraphQLError, [{ - key: "toString", - value: function toString() { - return printError(this); - } // FIXME: workaround to not break chai comparisons, should be remove in v16 - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - - }, { - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'Object'; - } - }]); - - return GraphQLError; -}( /*#__PURE__*/_wrapNativeSuper(Error)); -/** - * Prints a GraphQLError to a string, representing useful location information - * about the error's position in the source. - */ - - -exports.GraphQLError = GraphQLError; - -function printError(error) { - var output = error.message; - - if (error.nodes) { - for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) { - var node = _error$nodes2[_i2]; - - if (node.loc) { - output += '\n\n' + (0, _printLocation.printLocation)(node.loc); - } - } - } else if (error.source && error.locations) { - for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) { - var location = _error$locations2[_i4]; - output += '\n\n' + (0, _printLocation.printSourceLocation)(error.source, location); - } - } - - return output; -} diff --git a/JS/node_modules/graphql/error/GraphQLError.js.flow b/JS/node_modules/graphql/error/GraphQLError.js.flow deleted file mode 100644 index 9289a90..0000000 --- a/JS/node_modules/graphql/error/GraphQLError.js.flow +++ /dev/null @@ -1,242 +0,0 @@ -// @flow strict -// FIXME: -// flowlint uninitialized-instance-property:off - -import isObjectLike from '../jsutils/isObjectLike'; -import { SYMBOL_TO_STRING_TAG } from '../polyfills/symbols'; - -import type { ASTNode } from '../language/ast'; -import type { Source } from '../language/source'; -import type { SourceLocation } from '../language/location'; -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 class GraphQLError extends Error { - /** - * 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; - - constructor( - message: string, - nodes?: $ReadOnlyArray | ASTNode | void | null, - source?: ?Source, - positions?: ?$ReadOnlyArray, - path?: ?$ReadOnlyArray, - originalError?: ?(Error & { +extensions?: mixed, ... }), - extensions?: ?{ [key: string]: mixed, ... }, - ) { - super(message); - - // 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) { - _source = _nodes[0].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: any), { - name: { value: 'GraphQLError' }, - 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 falsy 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: _locations != null, - }, - path: { - // Coercing falsy 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: path != null, - }, - nodes: { - value: _nodes ?? undefined, - }, - source: { - value: _source ?? undefined, - }, - positions: { - value: _positions ?? undefined, - }, - originalError: { - value: originalError, - }, - extensions: { - // Coercing falsy 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: _extensions != null, - }, - }); - - // Include (non-enumerable) stack trace. - if (originalError?.stack) { - Object.defineProperty(this, 'stack', { - value: originalError.stack, - writable: true, - configurable: true, - }); - return; - } - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - if (Error.captureStackTrace) { - Error.captureStackTrace(this, GraphQLError); - } else { - Object.defineProperty(this, 'stack', { - value: Error().stack, - writable: true, - configurable: true, - }); - } - } - - toString(): string { - return printError(this); - } - - // FIXME: workaround to not break chai comparisons, should be remove in v16 - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG](): string { - return 'Object'; - } -} - -/** - * 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/JS/node_modules/graphql/error/GraphQLError.mjs b/JS/node_modules/graphql/error/GraphQLError.mjs deleted file mode 100644 index 78b3d63..0000000 --- a/JS/node_modules/graphql/error/GraphQLError.mjs +++ /dev/null @@ -1,274 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } - -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } - -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - -function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); } - -function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } - -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } - -function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; } - -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } - -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -// FIXME: -// flowlint uninitialized-instance-property:off -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs"; -import { getLocation } from "../language/location.mjs"; -import { printLocation, printSourceLocation } from "../language/printLocation.mjs"; -/** - * 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 var GraphQLError = /*#__PURE__*/function (_Error) { - _inherits(GraphQLError, _Error); - - var _super = _createSuper(GraphQLError); - - /** - * 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. - */ - - /** - * 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(). - */ - - /** - * 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(). - */ - - /** - * An array of GraphQL AST Nodes corresponding to this error. - */ - - /** - * 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. - */ - - /** - * An array of character offsets within the source GraphQL document - * which correspond to this error. - */ - - /** - * The original error thrown from a field resolver during execution. - */ - - /** - * Extension fields to add to the formatted error. - */ - function GraphQLError(message, nodes, source, positions, path, originalError, extensions) { - var _locations2, _source2, _positions2, _extensions2; - - var _this; - - _classCallCheck(this, GraphQLError); - - _this = _super.call(this, message); // 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 _nodes$0$loc; - - _source = (_nodes$0$loc = _nodes[0].loc) === null || _nodes$0$loc === void 0 ? void 0 : _nodes$0$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(_assertThisInitialized(_this), { - name: { - value: 'GraphQLError' - }, - 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 falsy values to undefined ensures they will not be included - // in JSON.stringify() when not provided. - value: (_locations2 = _locations) !== null && _locations2 !== void 0 ? _locations2 : 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: _locations != null - }, - path: { - // Coercing falsy values to undefined ensures they will not be included - // in JSON.stringify() when not provided. - value: path !== null && path !== void 0 ? 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: path != null - }, - nodes: { - value: _nodes !== null && _nodes !== void 0 ? _nodes : undefined - }, - source: { - value: (_source2 = _source) !== null && _source2 !== void 0 ? _source2 : undefined - }, - positions: { - value: (_positions2 = _positions) !== null && _positions2 !== void 0 ? _positions2 : undefined - }, - originalError: { - value: originalError - }, - extensions: { - // Coercing falsy values to undefined ensures they will not be included - // in JSON.stringify() when not provided. - value: (_extensions2 = _extensions) !== null && _extensions2 !== void 0 ? _extensions2 : 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: _extensions != null - } - }); // Include (non-enumerable) stack trace. - - if (originalError !== null && originalError !== void 0 && originalError.stack) { - Object.defineProperty(_assertThisInitialized(_this), 'stack', { - value: originalError.stack, - writable: true, - configurable: true - }); - return _possibleConstructorReturn(_this); - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - - - if (Error.captureStackTrace) { - Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError); - } else { - Object.defineProperty(_assertThisInitialized(_this), 'stack', { - value: Error().stack, - writable: true, - configurable: true - }); - } - - return _this; - } - - _createClass(GraphQLError, [{ - key: "toString", - value: function toString() { - return printError(this); - } // FIXME: workaround to not break chai comparisons, should be remove in v16 - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - - }, { - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'Object'; - } - }]); - - return GraphQLError; -}( /*#__PURE__*/_wrapNativeSuper(Error)); -/** - * 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) { - for (var _i2 = 0, _error$nodes2 = error.nodes; _i2 < _error$nodes2.length; _i2++) { - var node = _error$nodes2[_i2]; - - if (node.loc) { - output += '\n\n' + printLocation(node.loc); - } - } - } else if (error.source && error.locations) { - for (var _i4 = 0, _error$locations2 = error.locations; _i4 < _error$locations2.length; _i4++) { - var location = _error$locations2[_i4]; - output += '\n\n' + printSourceLocation(error.source, location); - } - } - - return output; -} diff --git a/JS/node_modules/graphql/error/formatError.d.ts b/JS/node_modules/graphql/error/formatError.d.ts deleted file mode 100644 index fb3451b..0000000 --- a/JS/node_modules/graphql/error/formatError.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { SourceLocation } from '../language/location'; - -import { GraphQLError } from './GraphQLError'; - -/** - * 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; - -/** - * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors - */ -export interface GraphQLFormattedError< - TExtensions extends Record = Record -> { - /** - * A short, human-readable summary of the problem that **SHOULD NOT** change - * from occurrence to occurrence of the problem, except for purposes of - * localization. - */ - readonly message: string; - /** - * If an error can be associated to a particular point in the requested - * GraphQL document, it should contain a list of locations. - */ - readonly locations?: ReadonlyArray; - /** - * If an error can be associated to a particular field in the GraphQL result, - * it _must_ contain an entry with the key `path` that details the path of - * the response field which experienced the error. This allows clients to - * identify whether a null result is intentional or caused by a runtime error. - */ - readonly path?: ReadonlyArray; - /** - * Reserved for implementors to extend the protocol however they see fit, - * and hence there are no additional restrictions on its contents. - */ - readonly extensions?: TExtensions; -} diff --git a/JS/node_modules/graphql/error/formatError.js b/JS/node_modules/graphql/error/formatError.js deleted file mode 100644 index 88cd931..0000000 --- a/JS/node_modules/graphql/error/formatError.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.formatError = formatError; - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -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) { - var _error$message; - - error || (0, _devAssert.default)(0, 'Received null or undefined error.'); - var message = (_error$message = error.message) !== null && _error$message !== void 0 ? _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 - }; -} -/** - * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors - */ diff --git a/JS/node_modules/graphql/error/formatError.js.flow b/JS/node_modules/graphql/error/formatError.js.flow deleted file mode 100644 index 94d8753..0000000 --- a/JS/node_modules/graphql/error/formatError.js.flow +++ /dev/null @@ -1,51 +0,0 @@ -// @flow strict -import devAssert from '../jsutils/devAssert'; - -import type { SourceLocation } from '../language/location'; - -import type { GraphQLError } from './GraphQLError'; - -/** - * 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 { - devAssert(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 }; -} - -/** - * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors - */ -export type GraphQLFormattedError = {| - /** - * A short, human-readable summary of the problem that **SHOULD NOT** change - * from occurrence to occurrence of the problem, except for purposes of - * localization. - */ - +message: string, - /** - * If an error can be associated to a particular point in the requested - * GraphQL document, it should contain a list of locations. - */ - +locations: $ReadOnlyArray | void, - /** - * If an error can be associated to a particular field in the GraphQL result, - * it _must_ contain an entry with the key `path` that details the path of - * the response field which experienced the error. This allows clients to - * identify whether a null result is intentional or caused by a runtime error. - */ - +path: $ReadOnlyArray | void, - /** - * Reserved for implementors to extend the protocol however they see fit, - * and hence there are no additional restrictions on its contents. - */ - +extensions?: { [key: string]: mixed, ... }, -|}; diff --git a/JS/node_modules/graphql/error/formatError.mjs b/JS/node_modules/graphql/error/formatError.mjs deleted file mode 100644 index 3f80411..0000000 --- a/JS/node_modules/graphql/error/formatError.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import devAssert from "../jsutils/devAssert.mjs"; - -/** - * Given a GraphQLError, format it according to the rules described by the - * Response Format, Errors section of the GraphQL Specification. - */ -export function formatError(error) { - var _error$message; - - error || devAssert(0, 'Received null or undefined error.'); - var message = (_error$message = error.message) !== null && _error$message !== void 0 ? _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 - }; -} -/** - * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors - */ diff --git a/JS/node_modules/graphql/error/index.d.ts b/JS/node_modules/graphql/error/index.d.ts deleted file mode 100644 index 9373b71..0000000 --- a/JS/node_modules/graphql/error/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { GraphQLError, printError } from './GraphQLError'; -export { syntaxError } from './syntaxError'; -export { locatedError } from './locatedError'; -export { formatError, GraphQLFormattedError } from './formatError'; diff --git a/JS/node_modules/graphql/error/index.js b/JS/node_modules/graphql/error/index.js deleted file mode 100644 index ee164b8..0000000 --- a/JS/node_modules/graphql/error/index.js +++ /dev/null @@ -1,43 +0,0 @@ -"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.js"); - -var _syntaxError = require("./syntaxError.js"); - -var _locatedError = require("./locatedError.js"); - -var _formatError = require("./formatError.js"); diff --git a/JS/node_modules/graphql/error/index.js.flow b/JS/node_modules/graphql/error/index.js.flow deleted file mode 100644 index eeaa96e..0000000 --- a/JS/node_modules/graphql/error/index.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @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/JS/node_modules/graphql/error/index.mjs b/JS/node_modules/graphql/error/index.mjs deleted file mode 100644 index 5ac29d1..0000000 --- a/JS/node_modules/graphql/error/index.mjs +++ /dev/null @@ -1,4 +0,0 @@ -export { GraphQLError, printError } from "./GraphQLError.mjs"; -export { syntaxError } from "./syntaxError.mjs"; -export { locatedError } from "./locatedError.mjs"; -export { formatError } from "./formatError.mjs"; diff --git a/JS/node_modules/graphql/error/locatedError.d.ts b/JS/node_modules/graphql/error/locatedError.d.ts deleted file mode 100644 index 8693757..0000000 --- a/JS/node_modules/graphql/error/locatedError.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { ASTNode } from '../language/ast'; - -import { GraphQLError } from './GraphQLError'; - -/** - * Given an arbitrary value, 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( - rawOriginalError: any, - nodes: ASTNode | ReadonlyArray | undefined, - path?: Maybe>, -): GraphQLError; diff --git a/JS/node_modules/graphql/error/locatedError.js b/JS/node_modules/graphql/error/locatedError.js deleted file mode 100644 index 658c439..0000000 --- a/JS/node_modules/graphql/error/locatedError.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.locatedError = locatedError; - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _GraphQLError = require("./GraphQLError.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Given an arbitrary value, 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(rawOriginalError, nodes, path) { - var _nodes; - - // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. - var originalError = rawOriginalError instanceof Error ? rawOriginalError : new Error('Unexpected error value: ' + (0, _inspect.default)(rawOriginalError)); // Note: this uses a brand-check to support GraphQL errors originating from other contexts. - - if (Array.isArray(originalError.path)) { - return originalError; - } - - return new _GraphQLError.GraphQLError(originalError.message, (_nodes = originalError.nodes) !== null && _nodes !== void 0 ? _nodes : nodes, originalError.source, originalError.positions, path, originalError); -} diff --git a/JS/node_modules/graphql/error/locatedError.js.flow b/JS/node_modules/graphql/error/locatedError.js.flow deleted file mode 100644 index 3ef40c8..0000000 --- a/JS/node_modules/graphql/error/locatedError.js.flow +++ /dev/null @@ -1,37 +0,0 @@ -// @flow strict -import inspect from '../jsutils/inspect'; - -import type { ASTNode } from '../language/ast'; - -import { GraphQLError } from './GraphQLError'; - -/** - * Given an arbitrary value, 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( - rawOriginalError: mixed, - nodes: ASTNode | $ReadOnlyArray | void | null, - path?: ?$ReadOnlyArray, -): GraphQLError { - // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. - const originalError: Error | GraphQLError = - rawOriginalError instanceof Error - ? rawOriginalError - : new Error('Unexpected error value: ' + inspect(rawOriginalError)); - - // Note: this uses a brand-check to support GraphQL errors originating from other contexts. - if (Array.isArray(originalError.path)) { - return (originalError: any); - } - - return new GraphQLError( - originalError.message, - (originalError: any).nodes ?? nodes, - (originalError: any).source, - (originalError: any).positions, - path, - originalError, - ); -} diff --git a/JS/node_modules/graphql/error/locatedError.mjs b/JS/node_modules/graphql/error/locatedError.mjs deleted file mode 100644 index 48f4d54..0000000 --- a/JS/node_modules/graphql/error/locatedError.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import inspect from "../jsutils/inspect.mjs"; -import { GraphQLError } from "./GraphQLError.mjs"; -/** - * Given an arbitrary value, 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(rawOriginalError, nodes, path) { - var _nodes; - - // Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface. - var originalError = rawOriginalError instanceof Error ? rawOriginalError : new Error('Unexpected error value: ' + inspect(rawOriginalError)); // Note: this uses a brand-check to support GraphQL errors originating from other contexts. - - if (Array.isArray(originalError.path)) { - return originalError; - } - - return new GraphQLError(originalError.message, (_nodes = originalError.nodes) !== null && _nodes !== void 0 ? _nodes : nodes, originalError.source, originalError.positions, path, originalError); -} diff --git a/JS/node_modules/graphql/error/syntaxError.d.ts b/JS/node_modules/graphql/error/syntaxError.d.ts deleted file mode 100644 index 1c5413c..0000000 --- a/JS/node_modules/graphql/error/syntaxError.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { 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; diff --git a/JS/node_modules/graphql/error/syntaxError.js b/JS/node_modules/graphql/error/syntaxError.js deleted file mode 100644 index 4804584..0000000 --- a/JS/node_modules/graphql/error/syntaxError.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.syntaxError = syntaxError; - -var _GraphQLError = require("./GraphQLError.js"); - -/** - * 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/JS/node_modules/graphql/error/syntaxError.js.flow b/JS/node_modules/graphql/error/syntaxError.js.flow deleted file mode 100644 index cdddcc3..0000000 --- a/JS/node_modules/graphql/error/syntaxError.js.flow +++ /dev/null @@ -1,18 +0,0 @@ -// @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/JS/node_modules/graphql/error/syntaxError.mjs b/JS/node_modules/graphql/error/syntaxError.mjs deleted file mode 100644 index 33aae5a..0000000 --- a/JS/node_modules/graphql/error/syntaxError.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { GraphQLError } from "./GraphQLError.mjs"; -/** - * 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/JS/node_modules/graphql/execution/execute.d.ts b/JS/node_modules/graphql/execution/execute.d.ts deleted file mode 100644 index a20db8c..0000000 --- a/JS/node_modules/graphql/execution/execute.d.ts +++ /dev/null @@ -1,195 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { PromiseOrValue } from '../jsutils/PromiseOrValue'; -import { Path } from '../jsutils/Path'; - -import { GraphQLError } from '../error/GraphQLError'; -import { GraphQLFormattedError } from '../error/formatError'; - -import { - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, - FieldNode, - FragmentDefinitionNode, -} from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; -import { - GraphQLField, - GraphQLFieldResolver, - GraphQLResolveInfo, - GraphQLTypeResolver, - GraphQLObjectType, -} from '../type/definition'; - -/** - * 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 interface ExecutionContext { - schema: GraphQLSchema; - fragments: { [key: string]: FragmentDefinitionNode }; - rootValue: any; - contextValue: any; - operation: OperationDefinitionNode; - variableValues: { [key: string]: any }; - fieldResolver: GraphQLFieldResolver; - 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. - * - `extensions` is reserved for adding non-standard properties. - */ -export interface ExecutionResult< - TData = { [key: string]: any }, - TExtensions = { [key: string]: any } -> { - errors?: ReadonlyArray; - // TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229 - data?: TData | null; - extensions?: TExtensions; -} - -export interface FormattedExecutionResult< - TData = { [key: string]: any }, - TExtensions = { [key: string]: any } -> { - errors?: ReadonlyArray; - // TS_SPECIFIC: TData. Motivation: https://github.com/graphql/graphql-js/pull/2490#issuecomment-639154229 - data?: TData | null; - extensions?: TExtensions; -} - -export interface ExecutionArgs { - schema: GraphQLSchema; - document: DocumentNode; - rootValue?: any; - contextValue?: any; - variableValues?: Maybe<{ [key: string]: any }>; - operationName?: Maybe; - fieldResolver?: Maybe>; - typeResolver?: Maybe>; -} - -/** - * 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. - */ -export function execute(args: ExecutionArgs): PromiseOrValue; -export function execute( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: Maybe<{ [key: string]: any }>, - operationName?: Maybe, - fieldResolver?: Maybe>, - typeResolver?: Maybe>, -): PromiseOrValue; - -/** - * Also implements the "Evaluating requests" section of the GraphQL specification. - * However, it guarantees to complete synchronously (or throw an error) assuming - * that all field resolvers are also synchronous. - */ -export function executeSync(args: ExecutionArgs): ExecutionResult; - -/** - * Essential assertions before executing to provide developer feedback for - * improper use of the GraphQL library. - */ -export function assertValidExecutionArguments( - schema: GraphQLSchema, - document: DocumentNode, - rawVariableValues: Maybe<{ [key: string]: any }>, -): void; - -/** - * 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: any, - contextValue: any, - rawVariableValues: Maybe<{ [key: string]: any }>, - operationName: Maybe, - fieldResolver: Maybe>, - typeResolver?: Maybe>, -): ReadonlyArray | ExecutionContext; - -/** - * 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: { [key: string]: Array }, - visitedFragmentNames: { [key: string]: boolean }, -): { [key: string]: Array }; - -export function buildResolveInfo( - exeContext: ExecutionContext, - fieldDef: GraphQLField, - fieldNodes: ReadonlyArray, - parentType: GraphQLObjectType, - path: Path, -): GraphQLResolveInfo; - -/** - * 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; - -/** - * 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. - */ -export const defaultFieldResolver: GraphQLFieldResolver; - -/** - * 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, -): Maybe>; diff --git a/JS/node_modules/graphql/execution/execute.js b/JS/node_modules/graphql/execution/execute.js deleted file mode 100644 index cf4e628..0000000 --- a/JS/node_modules/graphql/execution/execute.js +++ /dev/null @@ -1,866 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.execute = execute; -exports.executeSync = executeSync; -exports.assertValidExecutionArguments = assertValidExecutionArguments; -exports.buildExecutionContext = buildExecutionContext; -exports.collectFields = collectFields; -exports.buildResolveInfo = buildResolveInfo; -exports.getFieldDef = getFieldDef; -exports.defaultFieldResolver = exports.defaultTypeResolver = void 0; - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _memoize = _interopRequireDefault(require("../jsutils/memoize3.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _isPromise = _interopRequireDefault(require("../jsutils/isPromise.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _safeArrayFrom = _interopRequireDefault(require("../jsutils/safeArrayFrom.js")); - -var _promiseReduce = _interopRequireDefault(require("../jsutils/promiseReduce.js")); - -var _promiseForObject = _interopRequireDefault(require("../jsutils/promiseForObject.js")); - -var _Path = require("../jsutils/Path.js"); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _locatedError = require("../error/locatedError.js"); - -var _kinds = require("../language/kinds.js"); - -var _validate = require("../type/validate.js"); - -var _introspection = require("../type/introspection.js"); - -var _directives = require("../type/directives.js"); - -var _definition = require("../type/definition.js"); - -var _typeFromAST = require("../utilities/typeFromAST.js"); - -var _getOperationRootType = require("../utilities/getOperationRootType.js"); - -var _values = require("./values.js"); - -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 - }); -} -/** - * Also implements the "Evaluating requests" section of the GraphQL specification. - * However, it guarantees to complete synchronously (or throw an error) assuming - * that all field resolvers are also synchronous. - */ - - -function executeSync(args) { - var result = executeImpl(args); // Assert that the execution was synchronous. - - if ((0, _isPromise.default)(result)) { - throw new Error('GraphQL execution failed to complete synchronously.'); - } - - return result; -} - -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 - }; -} -/** - * Essential assertions before executing to provide developer feedback for - * improper use of the GraphQL library. - * - * @internal - */ - - -function assertValidExecutionArguments(schema, document, rawVariableValues) { - document || (0, _devAssert.default)(0, 'Must provide document.'); // 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, _devAssert.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.'); -} -/** - * 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. - * - * @internal - */ - - -function buildExecutionContext(schema, document, rootValue, contextValue, rawVariableValues, operationName, fieldResolver, typeResolver) { - var _definition$name, _operation$variableDe; - - var operation; - var fragments = Object.create(null); - - for (var _i2 = 0, _document$definitions2 = document.definitions; _i2 < _document$definitions2.length; _i2++) { - var definition = _document$definitions2[_i2]; - - switch (definition.kind) { - case _kinds.Kind.OPERATION_DEFINITION: - if (operationName == null) { - if (operation !== undefined) { - return [new _GraphQLError.GraphQLError('Must provide operation name if query contains multiple operations.')]; - } - - operation = definition; - } else if (((_definition$name = definition.name) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) { - operation = definition; - } - - break; - - case _kinds.Kind.FRAGMENT_DEFINITION: - fragments[definition.name.value] = definition; - break; - } - } - - if (!operation) { - if (operationName != null) { - return [new _GraphQLError.GraphQLError("Unknown operation named \"".concat(operationName, "\"."))]; - } - - return [new _GraphQLError.GraphQLError('Must provide an operation.')]; - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var variableDefinitions = (_operation$variableDe = operation.variableDefinitions) !== null && _operation$variableDe !== void 0 ? _operation$variableDe : []; - var coercedVariableValues = (0, _values.getVariableValues)(schema, variableDefinitions, rawVariableValues !== null && rawVariableValues !== void 0 ? rawVariableValues : {}, { - maxErrors: 50 - }); - - if (coercedVariableValues.errors) { - return coercedVariableValues.errors; - } - - return { - schema: schema, - fragments: fragments, - rootValue: rootValue, - contextValue: contextValue, - operation: operation, - variableValues: coercedVariableValues.coerced, - fieldResolver: fieldResolver !== null && fieldResolver !== void 0 ? fieldResolver : defaultFieldResolver, - typeResolver: typeResolver !== null && typeResolver !== void 0 ? typeResolver : defaultTypeResolver, - 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. - - 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 = (0, _Path.addPath)(path, responseName, parentType.name); - 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 _i4 = 0, _Object$keys2 = Object.keys(fields); _i4 < _Object$keys2.length; _i4++) { - var responseName = _Object$keys2[_i4]; - var fieldNodes = fields[responseName]; - var fieldPath = (0, _Path.addPath)(path, responseName, parentType.name); - var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); - - if (result !== undefined) { - results[responseName] = result; - - if ((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. - * - * @internal - */ - - -function collectFields(exeContext, runtimeType, selectionSet, fields, visitedFragmentNames) { - for (var _i6 = 0, _selectionSet$selecti2 = selectionSet.selections; _i6 < _selectionSet$selecti2.length; _i6++) { - var selection = _selectionSet$selecti2[_i6]; - - 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 === null || skip === void 0 ? void 0 : skip.if) === true) { - return false; - } - - var include = (0, _values.getDirectiveValues)(_directives.GraphQLIncludeDirective, node, exeContext.variableValues); - - if ((include === null || include === void 0 ? void 0 : 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.isSubType(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 _fieldDef$resolve; - - var fieldNode = fieldNodes[0]; - var fieldName = fieldNode.name.value; - var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); - - if (!fieldDef) { - return; - } - - var returnType = fieldDef.type; - var resolveFn = (_fieldDef$resolve = fieldDef.resolve) !== null && _fieldDef$resolve !== void 0 ? _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). - - 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); - 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 (rawError) { - var error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(path)); - return handleFieldError(error, returnType, exeContext); - }); - } - - return completed; - } catch (rawError) { - var error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(path)); - return handleFieldError(error, returnType, exeContext); - } -} -/** - * @internal - */ - - -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 - }; -} - -function handleFieldError(error, returnType, exeContext) { - // 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 or undefined then return null. - - - if (result == null) { - 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. - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isObjectType)(returnType)) { - return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result); - } // istanbul ignore next (Not reachable. All possible output types have been considered) - - - false || (0, _invariant.default)(0, 'Cannot complete value of unexpected output type: ' + (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) { - // 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, _safeArrayFrom.default)(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 itemPath = (0, _Path.addPath)(path, index, undefined); - - try { - var completedItem; - - if ((0, _isPromise.default)(item)) { - completedItem = item.then(function (resolved) { - return completeValue(exeContext, itemType, fieldNodes, info, itemPath, resolved); - }); - } else { - completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item); - } - - if ((0, _isPromise.default)(completedItem)) { - containsPromise = true; // Note: we don't rely on a `catch` method, but we do expect "thenable" - // to take a second callback for the error case. - - return completedItem.then(undefined, function (rawError) { - var error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(itemPath)); - return handleFieldError(error, itemType, exeContext); - }); - } - - return completedItem; - } catch (rawError) { - var error = (0, _locatedError.locatedError)(rawError, fieldNodes, (0, _Path.pathToArray)(itemPath)); - return handleFieldError(error, itemType, exeContext); - } - }); - - if (completedResults == null) { - throw new _GraphQLError.GraphQLError("Expected Iterable, but did not find one for field \"".concat(info.parentType.name, ".").concat(info.fieldName, "\".")); - } - - 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) { - var serializedResult = returnType.serialize(result); - - if (serializedResult === undefined) { - 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 _returnType$resolveTy; - - var resolveTypeFn = (_returnType$resolveTy = returnType.resolveType) !== null && _returnType$resolveTy !== void 0 ? _returnType$resolveTy : 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) { - if (runtimeTypeOrName == null) { - 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, "\". Either the \"").concat(returnType.name, "\" type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."), fieldNodes); - } // FIXME: temporary workaround until support for passing object types would be removed in v16.0.0 - - - var runtimeTypeName = (0, _definition.isNamedType)(runtimeTypeOrName) ? runtimeTypeOrName.name : runtimeTypeOrName; - - if (typeof runtimeTypeName !== 'string') { - 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)(runtimeTypeOrName), "\".")); - } - - var runtimeType = exeContext.schema.getType(runtimeTypeName); - - if (runtimeType == null) { - throw new _GraphQLError.GraphQLError("Abstract type \"".concat(returnType.name, "\" was resolve to a type \"").concat(runtimeTypeName, "\" that does not exist inside schema."), fieldNodes); - } - - if (!(0, _definition.isObjectType)(runtimeType)) { - throw new _GraphQLError.GraphQLError("Abstract type \"".concat(returnType.name, "\" was resolve to a non-object type \"").concat(runtimeTypeName, "\"."), fieldNodes); - } - - if (!exeContext.schema.isSubType(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 _i8 = 0; _i8 < fieldNodes.length; _i8++) { - var node = fieldNodes[_i8]; - - if (node.selectionSet) { - subFieldNodes = collectFields(exeContext, returnType, node.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.name; - } - } - } - - if (promisedIsTypeOfResults.length) { - return Promise.all(promisedIsTypeOfResults).then(function (isTypeOfResults) { - for (var _i9 = 0; _i9 < isTypeOfResults.length; _i9++) { - if (isTypeOfResults[_i9]) { - return possibleTypes[_i9].name; - } - } - }); - } -}; -/** - * 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 three introspection fields, - * __schema, __type 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 and __type - * could get automatically added to the query type, but that would - * require mutating type definitions, which would cause issues. - * - * @internal - */ - - -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/JS/node_modules/graphql/execution/execute.js.flow b/JS/node_modules/graphql/execution/execute.js.flow deleted file mode 100644 index 604061d..0000000 --- a/JS/node_modules/graphql/execution/execute.js.flow +++ /dev/null @@ -1,1246 +0,0 @@ -// @flow strict -import type { Path } from '../jsutils/Path'; -import type { ObjMap } from '../jsutils/ObjMap'; -import type { PromiseOrValue } from '../jsutils/PromiseOrValue'; -import inspect from '../jsutils/inspect'; -import memoize3 from '../jsutils/memoize3'; -import invariant from '../jsutils/invariant'; -import devAssert from '../jsutils/devAssert'; -import isPromise from '../jsutils/isPromise'; -import isObjectLike from '../jsutils/isObjectLike'; -import safeArrayFrom from '../jsutils/safeArrayFrom'; -import promiseReduce from '../jsutils/promiseReduce'; -import promiseForObject from '../jsutils/promiseForObject'; -import { addPath, pathToArray } from '../jsutils/Path'; - -import type { GraphQLFormattedError } from '../error/formatError'; -import { GraphQLError } from '../error/GraphQLError'; -import { locatedError } from '../error/locatedError'; - -import type { - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, - FieldNode, - FragmentSpreadNode, - InlineFragmentNode, - FragmentDefinitionNode, -} from '../language/ast'; -import { Kind } from '../language/kinds'; - -import type { GraphQLSchema } from '../type/schema'; -import type { - GraphQLObjectType, - GraphQLOutputType, - GraphQLLeafType, - GraphQLAbstractType, - GraphQLField, - GraphQLFieldResolver, - GraphQLResolveInfo, - GraphQLTypeResolver, - GraphQLList, -} from '../type/definition'; -import { assertValidSchema } from '../type/validate'; -import { - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, -} from '../type/introspection'; -import { - GraphQLIncludeDirective, - GraphQLSkipDirective, -} from '../type/directives'; -import { - isNamedType, - isObjectType, - isAbstractType, - isLeafType, - isListType, - isNonNullType, -} from '../type/definition'; - -import { typeFromAST } from '../utilities/typeFromAST'; -import { getOperationRootType } from '../utilities/getOperationRootType'; - -import { - getVariableValues, - getArgumentValues, - getDirectiveValues, -} from './values'; - -/** - * 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. - * - `extensions` is reserved for adding non-standard properties. - */ -export type ExecutionResult = {| - errors?: $ReadOnlyArray, - data?: ObjMap | null, - extensions?: ObjMap, -|}; - -export type FormattedExecutionResult = {| - errors?: $ReadOnlyArray, - data?: ObjMap | null, - extensions?: ObjMap, -|}; - -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, - }); -} - -/** - * Also implements the "Evaluating requests" section of the GraphQL specification. - * However, it guarantees to complete synchronously (or throw an error) assuming - * that all field resolvers are also synchronous. - */ -export function executeSync(args: ExecutionArgs): ExecutionResult { - const result = executeImpl(args); - - // Assert that the execution was synchronous. - if (isPromise(result)) { - throw new Error('GraphQL execution failed to complete synchronously.'); - } - - return result; -} - -function executeImpl(args: ExecutionArgs): PromiseOrValue { - 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>, -): PromiseOrValue { - if (isPromise(data)) { - return data.then((resolved) => buildResponse(exeContext, resolved)); - } - return exeContext.errors.length === 0 - ? { data } - : { errors: exeContext.errors, data }; -} - -/** - * Essential assertions before executing to provide developer feedback for - * improper use of the GraphQL library. - * - * @internal - */ -export function assertValidExecutionArguments( - schema: GraphQLSchema, - document: DocumentNode, - rawVariableValues: ?{ +[variable: string]: mixed, ... }, -): void { - devAssert(document, 'Must provide document.'); - - // If the schema used for execution is invalid, throw an error. - assertValidSchema(schema); - - // Variables, if provided, must be an object. - devAssert( - 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. - * - * @internal - */ -export function buildExecutionContext( - schema: GraphQLSchema, - document: DocumentNode, - rootValue: mixed, - contextValue: mixed, - rawVariableValues: ?{ +[variable: string]: mixed, ... }, - operationName: ?string, - fieldResolver: ?GraphQLFieldResolver, - typeResolver?: ?GraphQLTypeResolver, -): $ReadOnlyArray | ExecutionContext { - let operation: OperationDefinitionNode | void; - const fragments: ObjMap = Object.create(null); - for (const definition of document.definitions) { - switch (definition.kind) { - case Kind.OPERATION_DEFINITION: - if (operationName == null) { - if (operation !== undefined) { - return [ - new GraphQLError( - 'Must provide operation name if query contains multiple operations.', - ), - ]; - } - operation = definition; - } else if (definition.name?.value === operationName) { - operation = definition; - } - break; - case Kind.FRAGMENT_DEFINITION: - fragments[definition.name.value] = definition; - break; - } - } - - if (!operation) { - if (operationName != null) { - return [new GraphQLError(`Unknown operation named "${operationName}".`)]; - } - return [new GraphQLError('Must provide an operation.')]; - } - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const variableDefinitions = operation.variableDefinitions ?? []; - - const coercedVariableValues = getVariableValues( - schema, - variableDefinitions, - rawVariableValues ?? {}, - { maxErrors: 50 }, - ); - - if (coercedVariableValues.errors) { - return coercedVariableValues.errors; - } - - return { - schema, - fragments, - rootValue, - contextValue, - operation, - variableValues: coercedVariableValues.coerced, - 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. - 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: Path | void, - fields: ObjMap>, -): PromiseOrValue> { - return promiseReduce( - Object.keys(fields), - (results, responseName) => { - const fieldNodes = fields[responseName]; - const fieldPath = addPath(path, responseName, parentType.name); - 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: Path | void, - fields: ObjMap>, -): PromiseOrValue> { - const results = Object.create(null); - let containsPromise = false; - - for (const responseName of Object.keys(fields)) { - const fieldNodes = fields[responseName]; - const fieldPath = addPath(path, responseName, parentType.name); - const result = resolveField( - exeContext, - parentType, - sourceValue, - fieldNodes, - fieldPath, - ); - - if (result !== undefined) { - results[responseName] = result; - if (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. - * - * @internal - */ -export function collectFields( - exeContext: ExecutionContext, - runtimeType: GraphQLObjectType, - selectionSet: SelectionSetNode, - fields: ObjMap>, - visitedFragmentNames: ObjMap, -): ObjMap> { - for (const selection of selectionSet.selections) { - 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?.if === true) { - return false; - } - - const include = getDirectiveValues( - GraphQLIncludeDirective, - node, - exeContext.variableValues, - ); - if (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.isSubType(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: Path, -): PromiseOrValue { - const fieldNode = fieldNodes[0]; - const fieldName = fieldNode.name.value; - - const fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); - if (!fieldDef) { - return; - } - - const returnType = fieldDef.type; - 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). - 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); - - 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, (rawError) => { - const error = locatedError(rawError, fieldNodes, pathToArray(path)); - return handleFieldError(error, returnType, exeContext); - }); - } - return completed; - } catch (rawError) { - const error = locatedError(rawError, fieldNodes, pathToArray(path)); - return handleFieldError(error, returnType, exeContext); - } -} - -/** - * @internal - */ -export function buildResolveInfo( - exeContext: ExecutionContext, - fieldDef: GraphQLField, - fieldNodes: $ReadOnlyArray, - parentType: GraphQLObjectType, - path: Path, -): 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, - }; -} - -function handleFieldError( - error: GraphQLError, - returnType: GraphQLOutputType, - exeContext: ExecutionContext, -): null { - // 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: Path, - 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 or undefined then return null. - if (result == null) { - 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. - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isObjectType(returnType)) { - return completeObjectValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result, - ); - } - - // istanbul ignore next (Not reachable. All possible output types have been considered) - invariant( - false, - '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: Path, - result: mixed, -): PromiseOrValue<$ReadOnlyArray> { - // 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 = safeArrayFrom(result, (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 itemPath = addPath(path, index, undefined); - try { - let completedItem; - if (isPromise(item)) { - completedItem = item.then((resolved) => - completeValue( - exeContext, - itemType, - fieldNodes, - info, - itemPath, - resolved, - ), - ); - } else { - completedItem = completeValue( - exeContext, - itemType, - fieldNodes, - info, - itemPath, - item, - ); - } - - if (isPromise(completedItem)) { - containsPromise = true; - // Note: we don't rely on a `catch` method, but we do expect "thenable" - // to take a second callback for the error case. - return completedItem.then(undefined, (rawError) => { - const error = locatedError( - rawError, - fieldNodes, - pathToArray(itemPath), - ); - return handleFieldError(error, itemType, exeContext); - }); - } - return completedItem; - } catch (rawError) { - const error = locatedError(rawError, fieldNodes, pathToArray(itemPath)); - return handleFieldError(error, itemType, exeContext); - } - }); - - if (completedResults == null) { - throw new GraphQLError( - `Expected Iterable, but did not find one for field "${info.parentType.name}.${info.fieldName}".`, - ); - } - - 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 { - const serializedResult = returnType.serialize(result); - if (serializedResult === undefined) { - 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: Path, - 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: mixed, - exeContext: ExecutionContext, - returnType: GraphQLAbstractType, - fieldNodes: $ReadOnlyArray, - info: GraphQLResolveInfo, - result: mixed, -): GraphQLObjectType { - if (runtimeTypeOrName == null) { - throw new GraphQLError( - `Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}". Either the "${returnType.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`, - fieldNodes, - ); - } - - // FIXME: temporary workaround until support for passing object types would be removed in v16.0.0 - const runtimeTypeName = isNamedType(runtimeTypeOrName) - ? runtimeTypeOrName.name - : runtimeTypeOrName; - - if (typeof runtimeTypeName !== 'string') { - 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(runtimeTypeOrName)}".`, - ); - } - - const runtimeType = exeContext.schema.getType(runtimeTypeName); - if (runtimeType == null) { - throw new GraphQLError( - `Abstract type "${returnType.name}" was resolve to a type "${runtimeTypeName}" that does not exist inside schema.`, - fieldNodes, - ); - } - - if (!isObjectType(runtimeType)) { - throw new GraphQLError( - `Abstract type "${returnType.name}" was resolve to a non-object type "${runtimeTypeName}".`, - fieldNodes, - ); - } - - if (!exeContext.schema.isSubType(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: Path, - 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: Path, - 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 (const node of fieldNodes) { - if (node.selectionSet) { - subFieldNodes = collectFields( - exeContext, - returnType, - node.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.name; - } - } - } - - if (promisedIsTypeOfResults.length) { - return Promise.all(promisedIsTypeOfResults).then((isTypeOfResults) => { - for (let i = 0; i < isTypeOfResults.length; i++) { - if (isTypeOfResults[i]) { - return possibleTypes[i].name; - } - } - }); - } -}; - -/** - * 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< - mixed, - mixed, -> = function (source: any, 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 three introspection fields, - * __schema, __type 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 and __type - * could get automatically added to the query type, but that would - * require mutating type definitions, which would cause issues. - * - * @internal - */ -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/JS/node_modules/graphql/execution/execute.mjs b/JS/node_modules/graphql/execution/execute.mjs deleted file mode 100644 index 9cf5b92..0000000 --- a/JS/node_modules/graphql/execution/execute.mjs +++ /dev/null @@ -1,847 +0,0 @@ -import inspect from "../jsutils/inspect.mjs"; -import memoize3 from "../jsutils/memoize3.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import devAssert from "../jsutils/devAssert.mjs"; -import isPromise from "../jsutils/isPromise.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import safeArrayFrom from "../jsutils/safeArrayFrom.mjs"; -import promiseReduce from "../jsutils/promiseReduce.mjs"; -import promiseForObject from "../jsutils/promiseForObject.mjs"; -import { addPath, pathToArray } from "../jsutils/Path.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { locatedError } from "../error/locatedError.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { assertValidSchema } from "../type/validate.mjs"; -import { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from "../type/introspection.mjs"; -import { GraphQLIncludeDirective, GraphQLSkipDirective } from "../type/directives.mjs"; -import { isNamedType, isObjectType, isAbstractType, isLeafType, isListType, isNonNullType } from "../type/definition.mjs"; -import { typeFromAST } from "../utilities/typeFromAST.mjs"; -import { getOperationRootType } from "../utilities/getOperationRootType.mjs"; -import { getVariableValues, getArgumentValues, getDirectiveValues } from "./values.mjs"; -/** - * 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 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 - }); -} -/** - * Also implements the "Evaluating requests" section of the GraphQL specification. - * However, it guarantees to complete synchronously (or throw an error) assuming - * that all field resolvers are also synchronous. - */ - -export function executeSync(args) { - var result = executeImpl(args); // Assert that the execution was synchronous. - - if (isPromise(result)) { - throw new Error('GraphQL execution failed to complete synchronously.'); - } - - return result; -} - -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 - }; -} -/** - * Essential assertions before executing to provide developer feedback for - * improper use of the GraphQL library. - * - * @internal - */ - - -export function assertValidExecutionArguments(schema, document, rawVariableValues) { - document || devAssert(0, 'Must provide document.'); // If the schema used for execution is invalid, throw an error. - - assertValidSchema(schema); // Variables, if provided, must be an object. - - rawVariableValues == null || isObjectLike(rawVariableValues) || devAssert(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.'); -} -/** - * 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. - * - * @internal - */ - -export function buildExecutionContext(schema, document, rootValue, contextValue, rawVariableValues, operationName, fieldResolver, typeResolver) { - var _definition$name, _operation$variableDe; - - var operation; - var fragments = Object.create(null); - - for (var _i2 = 0, _document$definitions2 = document.definitions; _i2 < _document$definitions2.length; _i2++) { - var definition = _document$definitions2[_i2]; - - switch (definition.kind) { - case Kind.OPERATION_DEFINITION: - if (operationName == null) { - if (operation !== undefined) { - return [new GraphQLError('Must provide operation name if query contains multiple operations.')]; - } - - operation = definition; - } else if (((_definition$name = definition.name) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) { - operation = definition; - } - - break; - - case Kind.FRAGMENT_DEFINITION: - fragments[definition.name.value] = definition; - break; - } - } - - if (!operation) { - if (operationName != null) { - return [new GraphQLError("Unknown operation named \"".concat(operationName, "\"."))]; - } - - return [new GraphQLError('Must provide an operation.')]; - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var variableDefinitions = (_operation$variableDe = operation.variableDefinitions) !== null && _operation$variableDe !== void 0 ? _operation$variableDe : []; - var coercedVariableValues = getVariableValues(schema, variableDefinitions, rawVariableValues !== null && rawVariableValues !== void 0 ? rawVariableValues : {}, { - maxErrors: 50 - }); - - if (coercedVariableValues.errors) { - return coercedVariableValues.errors; - } - - return { - schema: schema, - fragments: fragments, - rootValue: rootValue, - contextValue: contextValue, - operation: operation, - variableValues: coercedVariableValues.coerced, - fieldResolver: fieldResolver !== null && fieldResolver !== void 0 ? fieldResolver : defaultFieldResolver, - typeResolver: typeResolver !== null && typeResolver !== void 0 ? typeResolver : defaultTypeResolver, - 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. - - 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, parentType.name); - 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 _i4 = 0, _Object$keys2 = Object.keys(fields); _i4 < _Object$keys2.length; _i4++) { - var responseName = _Object$keys2[_i4]; - var fieldNodes = fields[responseName]; - var fieldPath = addPath(path, responseName, parentType.name); - var result = resolveField(exeContext, parentType, sourceValue, fieldNodes, fieldPath); - - if (result !== undefined) { - results[responseName] = result; - - if (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. - * - * @internal - */ - - -export function collectFields(exeContext, runtimeType, selectionSet, fields, visitedFragmentNames) { - for (var _i6 = 0, _selectionSet$selecti2 = selectionSet.selections; _i6 < _selectionSet$selecti2.length; _i6++) { - var selection = _selectionSet$selecti2[_i6]; - - 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 === null || skip === void 0 ? void 0 : skip.if) === true) { - return false; - } - - var include = getDirectiveValues(GraphQLIncludeDirective, node, exeContext.variableValues); - - if ((include === null || include === void 0 ? void 0 : 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.isSubType(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 _fieldDef$resolve; - - var fieldNode = fieldNodes[0]; - var fieldName = fieldNode.name.value; - var fieldDef = getFieldDef(exeContext.schema, parentType, fieldName); - - if (!fieldDef) { - return; - } - - var returnType = fieldDef.type; - var resolveFn = (_fieldDef$resolve = fieldDef.resolve) !== null && _fieldDef$resolve !== void 0 ? _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). - - 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); - 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 (rawError) { - var error = locatedError(rawError, fieldNodes, pathToArray(path)); - return handleFieldError(error, returnType, exeContext); - }); - } - - return completed; - } catch (rawError) { - var error = locatedError(rawError, fieldNodes, pathToArray(path)); - return handleFieldError(error, returnType, exeContext); - } -} -/** - * @internal - */ - - -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 - }; -} - -function handleFieldError(error, returnType, exeContext) { - // 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 or undefined then return null. - - - if (result == null) { - 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. - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isObjectType(returnType)) { - return completeObjectValue(exeContext, returnType, fieldNodes, info, path, result); - } // istanbul ignore next (Not reachable. All possible output types have been considered) - - - false || invariant(0, 'Cannot complete value of unexpected output type: ' + 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) { - // 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 = safeArrayFrom(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 itemPath = addPath(path, index, undefined); - - try { - var completedItem; - - if (isPromise(item)) { - completedItem = item.then(function (resolved) { - return completeValue(exeContext, itemType, fieldNodes, info, itemPath, resolved); - }); - } else { - completedItem = completeValue(exeContext, itemType, fieldNodes, info, itemPath, item); - } - - if (isPromise(completedItem)) { - containsPromise = true; // Note: we don't rely on a `catch` method, but we do expect "thenable" - // to take a second callback for the error case. - - return completedItem.then(undefined, function (rawError) { - var error = locatedError(rawError, fieldNodes, pathToArray(itemPath)); - return handleFieldError(error, itemType, exeContext); - }); - } - - return completedItem; - } catch (rawError) { - var error = locatedError(rawError, fieldNodes, pathToArray(itemPath)); - return handleFieldError(error, itemType, exeContext); - } - }); - - if (completedResults == null) { - throw new GraphQLError("Expected Iterable, but did not find one for field \"".concat(info.parentType.name, ".").concat(info.fieldName, "\".")); - } - - 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) { - var serializedResult = returnType.serialize(result); - - if (serializedResult === undefined) { - 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 _returnType$resolveTy; - - var resolveTypeFn = (_returnType$resolveTy = returnType.resolveType) !== null && _returnType$resolveTy !== void 0 ? _returnType$resolveTy : 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) { - if (runtimeTypeOrName == null) { - 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, "\". Either the \"").concat(returnType.name, "\" type should provide a \"resolveType\" function or each possible type should provide an \"isTypeOf\" function."), fieldNodes); - } // FIXME: temporary workaround until support for passing object types would be removed in v16.0.0 - - - var runtimeTypeName = isNamedType(runtimeTypeOrName) ? runtimeTypeOrName.name : runtimeTypeOrName; - - if (typeof runtimeTypeName !== 'string') { - 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(runtimeTypeOrName), "\".")); - } - - var runtimeType = exeContext.schema.getType(runtimeTypeName); - - if (runtimeType == null) { - throw new GraphQLError("Abstract type \"".concat(returnType.name, "\" was resolve to a type \"").concat(runtimeTypeName, "\" that does not exist inside schema."), fieldNodes); - } - - if (!isObjectType(runtimeType)) { - throw new GraphQLError("Abstract type \"".concat(returnType.name, "\" was resolve to a non-object type \"").concat(runtimeTypeName, "\"."), fieldNodes); - } - - if (!exeContext.schema.isSubType(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 _i8 = 0; _i8 < fieldNodes.length; _i8++) { - var node = fieldNodes[_i8]; - - if (node.selectionSet) { - subFieldNodes = collectFields(exeContext, returnType, node.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.name; - } - } - } - - if (promisedIsTypeOfResults.length) { - return Promise.all(promisedIsTypeOfResults).then(function (isTypeOfResults) { - for (var _i9 = 0; _i9 < isTypeOfResults.length; _i9++) { - if (isTypeOfResults[_i9]) { - return possibleTypes[_i9].name; - } - } - }); - } -}; -/** - * 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 three introspection fields, - * __schema, __type 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 and __type - * could get automatically added to the query type, but that would - * require mutating type definitions, which would cause issues. - * - * @internal - */ - -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/JS/node_modules/graphql/execution/index.d.ts b/JS/node_modules/graphql/execution/index.d.ts deleted file mode 100644 index d70ba3a..0000000 --- a/JS/node_modules/graphql/execution/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export { pathToArray as responsePathAsArray } from '../jsutils/Path'; - -export { - execute, - executeSync, - defaultFieldResolver, - defaultTypeResolver, - ExecutionArgs, - ExecutionResult, - FormattedExecutionResult, -} from './execute'; - -export { getDirectiveValues } from './values'; diff --git a/JS/node_modules/graphql/execution/index.js b/JS/node_modules/graphql/execution/index.js deleted file mode 100644 index 3d5fe46..0000000 --- a/JS/node_modules/graphql/execution/index.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "responsePathAsArray", { - enumerable: true, - get: function get() { - return _Path.pathToArray; - } -}); -Object.defineProperty(exports, "execute", { - enumerable: true, - get: function get() { - return _execute.execute; - } -}); -Object.defineProperty(exports, "executeSync", { - enumerable: true, - get: function get() { - return _execute.executeSync; - } -}); -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, "getDirectiveValues", { - enumerable: true, - get: function get() { - return _values.getDirectiveValues; - } -}); - -var _Path = require("../jsutils/Path.js"); - -var _execute = require("./execute.js"); - -var _values = require("./values.js"); diff --git a/JS/node_modules/graphql/execution/index.js.flow b/JS/node_modules/graphql/execution/index.js.flow deleted file mode 100644 index c8a2ee1..0000000 --- a/JS/node_modules/graphql/execution/index.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -// @flow strict -export { pathToArray as responsePathAsArray } from '../jsutils/Path'; - -export { - execute, - executeSync, - defaultFieldResolver, - defaultTypeResolver, -} from './execute'; - -export type { - ExecutionArgs, - ExecutionResult, - FormattedExecutionResult, -} from './execute'; - -export { getDirectiveValues } from './values'; diff --git a/JS/node_modules/graphql/execution/index.mjs b/JS/node_modules/graphql/execution/index.mjs deleted file mode 100644 index f8c087d..0000000 --- a/JS/node_modules/graphql/execution/index.mjs +++ /dev/null @@ -1,3 +0,0 @@ -export { pathToArray as responsePathAsArray } from "../jsutils/Path.mjs"; -export { execute, executeSync, defaultFieldResolver, defaultTypeResolver } from "./execute.mjs"; -export { getDirectiveValues } from "./values.mjs"; diff --git a/JS/node_modules/graphql/execution/values.d.ts b/JS/node_modules/graphql/execution/values.d.ts deleted file mode 100644 index 8b17b54..0000000 --- a/JS/node_modules/graphql/execution/values.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { GraphQLError } from '../error/GraphQLError'; -import { - FieldNode, - DirectiveNode, - VariableDefinitionNode, -} from '../language/ast'; - -import { GraphQLDirective } from '../type/directives'; -import { GraphQLSchema } from '../type/schema'; -import { GraphQLField } from '../type/definition'; - -type CoercedVariableValues = - | { errors: ReadonlyArray; coerced?: never } - | { errors?: never; coerced: { [key: string]: any } }; - -/** - * 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: { [key: string]: any }, - options?: { maxErrors?: number }, -): CoercedVariableValues; - -/** - * 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?: Maybe<{ [key: string]: any }>, -): { [key: string]: any }; - -/** - * 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: { - readonly directives?: ReadonlyArray; - }, - variableValues?: Maybe<{ [key: string]: any }>, -): undefined | { [key: string]: any }; diff --git a/JS/node_modules/graphql/execution/values.js b/JS/node_modules/graphql/execution/values.js deleted file mode 100644 index ac4bba9..0000000 --- a/JS/node_modules/graphql/execution/values.js +++ /dev/null @@ -1,228 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getVariableValues = getVariableValues; -exports.getArgumentValues = getArgumentValues; -exports.getDirectiveValues = getDirectiveValues; - -var _find = _interopRequireDefault(require("../polyfills/find.js")); - -var _keyMap = _interopRequireDefault(require("../jsutils/keyMap.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _printPathArray = _interopRequireDefault(require("../jsutils/printPathArray.js")); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _kinds = require("../language/kinds.js"); - -var _printer = require("../language/printer.js"); - -var _definition = require("../type/definition.js"); - -var _typeFromAST = require("../utilities/typeFromAST.js"); - -var _valueFromAST = require("../utilities/valueFromAST.js"); - -var _coerceInputValue = require("../utilities/coerceInputValue.js"); - -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. - * - * @internal - */ -function getVariableValues(schema, varDefNodes, inputs, options) { - var errors = []; - var maxErrors = options === null || options === void 0 ? void 0 : options.maxErrors; - - try { - var coerced = coerceVariableValues(schema, varDefNodes, inputs, function (error) { - if (maxErrors != null && errors.length >= maxErrors) { - throw new _GraphQLError.GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.'); - } - - errors.push(error); - }); - - if (errors.length === 0) { - return { - coerced: coerced - }; - } - } catch (error) { - errors.push(error); - } - - return { - errors: errors - }; -} - -function coerceVariableValues(schema, varDefNodes, inputs, onError) { - var coercedValues = {}; - - var _loop = function _loop(_i2) { - var varDefNode = varDefNodes[_i2]; - 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. - var varTypeStr = (0, _printer.print)(varDefNode.type); - onError(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" expected value of type \"").concat(varTypeStr, "\" which cannot be used as an input type."), varDefNode.type)); - return "continue"; - } - - if (!hasOwnProperty(inputs, varName)) { - if (varDefNode.defaultValue) { - coercedValues[varName] = (0, _valueFromAST.valueFromAST)(varDefNode.defaultValue, varType); - } else if ((0, _definition.isNonNullType)(varType)) { - var _varTypeStr = (0, _inspect.default)(varType); - - onError(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" of required type \"").concat(_varTypeStr, "\" was not provided."), varDefNode)); - } - - return "continue"; - } - - var value = inputs[varName]; - - if (value === null && (0, _definition.isNonNullType)(varType)) { - var _varTypeStr2 = (0, _inspect.default)(varType); - - onError(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" of non-null type \"").concat(_varTypeStr2, "\" must not be null."), varDefNode)); - return "continue"; - } - - coercedValues[varName] = (0, _coerceInputValue.coerceInputValue)(value, varType, function (path, invalidValue, error) { - var prefix = "Variable \"$".concat(varName, "\" got invalid value ") + (0, _inspect.default)(invalidValue); - - if (path.length > 0) { - prefix += " at \"".concat(varName).concat((0, _printPathArray.default)(path), "\""); - } - - onError(new _GraphQLError.GraphQLError(prefix + '; ' + error.message, varDefNode, undefined, undefined, undefined, error.originalError)); - }); - }; - - for (var _i2 = 0; _i2 < varDefNodes.length; _i2++) { - var _ret = _loop(_i2); - - if (_ret === "continue") continue; - } - - return coercedValues; -} -/** - * 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. - * - * @internal - */ - - -function getArgumentValues(def, node, variableValues) { - var _node$arguments; - - var coercedValues = {}; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - var argumentNodes = (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 ? _node$arguments : []; - var argNodeMap = (0, _keyMap.default)(argumentNodes, function (arg) { - return arg.name.value; - }); - - for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) { - var argDef = _def$args2[_i4]; - var name = argDef.name; - var argType = argDef.type; - var argumentNode = argNodeMap[name]; - - if (!argumentNode) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if ((0, _definition.isNonNullType)(argType)) { - throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of required type \"").concat((0, _inspect.default)(argType), "\" ") + 'was not provided.', node); - } - - continue; - } - - var valueNode = argumentNode.value; - var isNull = valueNode.kind === _kinds.Kind.NULL; - - if (valueNode.kind === _kinds.Kind.VARIABLE) { - var variableName = valueNode.name.value; - - if (variableValues == null || !hasOwnProperty(variableValues, variableName)) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if ((0, _definition.isNonNullType)(argType)) { - 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."), valueNode); - } - - continue; - } - - isNull = variableValues[variableName] == null; - } - - if (isNull && (0, _definition.isNonNullType)(argType)) { - throw new _GraphQLError.GraphQLError("Argument \"".concat(name, "\" of non-null type \"").concat((0, _inspect.default)(argType), "\" ") + 'must not be null.', valueNode); - } - - var coercedValue = (0, _valueFromAST.valueFromAST)(valueNode, argType, variableValues); - - if (coercedValue === undefined) { - // Note: ValuesOfCorrectTypeRule 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), "."), valueNode); - } - - 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/JS/node_modules/graphql/execution/values.js.flow b/JS/node_modules/graphql/execution/values.js.flow deleted file mode 100644 index ef3e390..0000000 --- a/JS/node_modules/graphql/execution/values.js.flow +++ /dev/null @@ -1,267 +0,0 @@ -// @flow strict -import find from '../polyfills/find'; - -import type { ObjMap } from '../jsutils/ObjMap'; -import keyMap from '../jsutils/keyMap'; -import inspect from '../jsutils/inspect'; -import printPathArray from '../jsutils/printPathArray'; - -import { GraphQLError } from '../error/GraphQLError'; - -import type { - FieldNode, - DirectiveNode, - VariableDefinitionNode, -} from '../language/ast'; -import { Kind } from '../language/kinds'; -import { print } from '../language/printer'; - -import type { GraphQLSchema } from '../type/schema'; -import type { GraphQLField } from '../type/definition'; -import type { GraphQLDirective } from '../type/directives'; -import { isInputType, isNonNullType } from '../type/definition'; - -import { typeFromAST } from '../utilities/typeFromAST'; -import { valueFromAST } from '../utilities/valueFromAST'; -import { coerceInputValue } from '../utilities/coerceInputValue'; - -type CoercedVariableValues = - | {| errors: $ReadOnlyArray |} - | {| coerced: { [variable: string]: mixed, ... } |}; - -/** - * 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. - * - * @internal - */ -export function getVariableValues( - schema: GraphQLSchema, - varDefNodes: $ReadOnlyArray, - inputs: { +[variable: string]: mixed, ... }, - options?: {| maxErrors?: number |}, -): CoercedVariableValues { - const errors = []; - const maxErrors = options?.maxErrors; - try { - const coerced = coerceVariableValues( - schema, - varDefNodes, - inputs, - (error) => { - if (maxErrors != null && errors.length >= maxErrors) { - throw new GraphQLError( - 'Too many errors processing variables, error limit reached. Execution aborted.', - ); - } - errors.push(error); - }, - ); - - if (errors.length === 0) { - return { coerced }; - } - } catch (error) { - errors.push(error); - } - - return { errors }; -} - -function coerceVariableValues( - schema: GraphQLSchema, - varDefNodes: $ReadOnlyArray, - inputs: { +[variable: string]: mixed, ... }, - onError: (GraphQLError) => void, -): { [variable: string]: mixed, ... } { - const coercedValues = {}; - for (const varDefNode of varDefNodes) { - 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. - const varTypeStr = print(varDefNode.type); - onError( - new GraphQLError( - `Variable "$${varName}" expected value of type "${varTypeStr}" which cannot be used as an input type.`, - varDefNode.type, - ), - ); - continue; - } - - if (!hasOwnProperty(inputs, varName)) { - if (varDefNode.defaultValue) { - coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType); - } else if (isNonNullType(varType)) { - const varTypeStr = inspect(varType); - onError( - new GraphQLError( - `Variable "$${varName}" of required type "${varTypeStr}" was not provided.`, - varDefNode, - ), - ); - } - continue; - } - - const value = inputs[varName]; - if (value === null && isNonNullType(varType)) { - const varTypeStr = inspect(varType); - onError( - new GraphQLError( - `Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`, - varDefNode, - ), - ); - continue; - } - - coercedValues[varName] = coerceInputValue( - value, - varType, - (path, invalidValue, error) => { - let prefix = - `Variable "$${varName}" got invalid value ` + inspect(invalidValue); - if (path.length > 0) { - prefix += ` at "${varName}${printPathArray(path)}"`; - } - onError( - new GraphQLError( - prefix + '; ' + error.message, - varDefNode, - undefined, - undefined, - undefined, - error.originalError, - ), - ); - }, - ); - } - - return coercedValues; -} - -/** - * 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. - * - * @internal - */ -export function getArgumentValues( - def: GraphQLField | GraphQLDirective, - node: FieldNode | DirectiveNode, - variableValues?: ?ObjMap, -): { [argument: string]: mixed, ... } { - const coercedValues = {}; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const argumentNodes = node.arguments ?? []; - const argNodeMap = keyMap(argumentNodes, (arg) => arg.name.value); - - for (const argDef of def.args) { - const name = argDef.name; - const argType = argDef.type; - const argumentNode = argNodeMap[name]; - - if (!argumentNode) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if (isNonNullType(argType)) { - throw new GraphQLError( - `Argument "${name}" of required type "${inspect(argType)}" ` + - 'was not provided.', - node, - ); - } - continue; - } - - const valueNode = argumentNode.value; - let isNull = valueNode.kind === Kind.NULL; - - if (valueNode.kind === Kind.VARIABLE) { - const variableName = valueNode.name.value; - if ( - variableValues == null || - !hasOwnProperty(variableValues, variableName) - ) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if (isNonNullType(argType)) { - throw new GraphQLError( - `Argument "${name}" of required type "${inspect(argType)}" ` + - `was provided the variable "$${variableName}" which was not provided a runtime value.`, - valueNode, - ); - } - continue; - } - isNull = variableValues[variableName] == null; - } - - if (isNull && isNonNullType(argType)) { - throw new GraphQLError( - `Argument "${name}" of non-null type "${inspect(argType)}" ` + - 'must not be null.', - valueNode, - ); - } - - const coercedValue = valueFromAST(valueNode, argType, variableValues); - if (coercedValue === undefined) { - // Note: ValuesOfCorrectTypeRule 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)}.`, - valueNode, - ); - } - 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/JS/node_modules/graphql/execution/values.mjs b/JS/node_modules/graphql/execution/values.mjs deleted file mode 100644 index 485a210..0000000 --- a/JS/node_modules/graphql/execution/values.mjs +++ /dev/null @@ -1,206 +0,0 @@ -import find from "../polyfills/find.mjs"; -import keyMap from "../jsutils/keyMap.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import printPathArray from "../jsutils/printPathArray.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { print } from "../language/printer.mjs"; -import { isInputType, isNonNullType } from "../type/definition.mjs"; -import { typeFromAST } from "../utilities/typeFromAST.mjs"; -import { valueFromAST } from "../utilities/valueFromAST.mjs"; -import { coerceInputValue } from "../utilities/coerceInputValue.mjs"; - -/** - * 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. - * - * @internal - */ -export function getVariableValues(schema, varDefNodes, inputs, options) { - var errors = []; - var maxErrors = options === null || options === void 0 ? void 0 : options.maxErrors; - - try { - var coerced = coerceVariableValues(schema, varDefNodes, inputs, function (error) { - if (maxErrors != null && errors.length >= maxErrors) { - throw new GraphQLError('Too many errors processing variables, error limit reached. Execution aborted.'); - } - - errors.push(error); - }); - - if (errors.length === 0) { - return { - coerced: coerced - }; - } - } catch (error) { - errors.push(error); - } - - return { - errors: errors - }; -} - -function coerceVariableValues(schema, varDefNodes, inputs, onError) { - var coercedValues = {}; - - var _loop = function _loop(_i2) { - var varDefNode = varDefNodes[_i2]; - 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. - var varTypeStr = print(varDefNode.type); - onError(new GraphQLError("Variable \"$".concat(varName, "\" expected value of type \"").concat(varTypeStr, "\" which cannot be used as an input type."), varDefNode.type)); - return "continue"; - } - - if (!hasOwnProperty(inputs, varName)) { - if (varDefNode.defaultValue) { - coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType); - } else if (isNonNullType(varType)) { - var _varTypeStr = inspect(varType); - - onError(new GraphQLError("Variable \"$".concat(varName, "\" of required type \"").concat(_varTypeStr, "\" was not provided."), varDefNode)); - } - - return "continue"; - } - - var value = inputs[varName]; - - if (value === null && isNonNullType(varType)) { - var _varTypeStr2 = inspect(varType); - - onError(new GraphQLError("Variable \"$".concat(varName, "\" of non-null type \"").concat(_varTypeStr2, "\" must not be null."), varDefNode)); - return "continue"; - } - - coercedValues[varName] = coerceInputValue(value, varType, function (path, invalidValue, error) { - var prefix = "Variable \"$".concat(varName, "\" got invalid value ") + inspect(invalidValue); - - if (path.length > 0) { - prefix += " at \"".concat(varName).concat(printPathArray(path), "\""); - } - - onError(new GraphQLError(prefix + '; ' + error.message, varDefNode, undefined, undefined, undefined, error.originalError)); - }); - }; - - for (var _i2 = 0; _i2 < varDefNodes.length; _i2++) { - var _ret = _loop(_i2); - - if (_ret === "continue") continue; - } - - return coercedValues; -} -/** - * 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. - * - * @internal - */ - - -export function getArgumentValues(def, node, variableValues) { - var _node$arguments; - - var coercedValues = {}; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - var argumentNodes = (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 ? _node$arguments : []; - var argNodeMap = keyMap(argumentNodes, function (arg) { - return arg.name.value; - }); - - for (var _i4 = 0, _def$args2 = def.args; _i4 < _def$args2.length; _i4++) { - var argDef = _def$args2[_i4]; - var name = argDef.name; - var argType = argDef.type; - var argumentNode = argNodeMap[name]; - - if (!argumentNode) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if (isNonNullType(argType)) { - throw new GraphQLError("Argument \"".concat(name, "\" of required type \"").concat(inspect(argType), "\" ") + 'was not provided.', node); - } - - continue; - } - - var valueNode = argumentNode.value; - var isNull = valueNode.kind === Kind.NULL; - - if (valueNode.kind === Kind.VARIABLE) { - var variableName = valueNode.name.value; - - if (variableValues == null || !hasOwnProperty(variableValues, variableName)) { - if (argDef.defaultValue !== undefined) { - coercedValues[name] = argDef.defaultValue; - } else if (isNonNullType(argType)) { - 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."), valueNode); - } - - continue; - } - - isNull = variableValues[variableName] == null; - } - - if (isNull && isNonNullType(argType)) { - throw new GraphQLError("Argument \"".concat(name, "\" of non-null type \"").concat(inspect(argType), "\" ") + 'must not be null.', valueNode); - } - - var coercedValue = valueFromAST(valueNode, argType, variableValues); - - if (coercedValue === undefined) { - // Note: ValuesOfCorrectTypeRule 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), "."), valueNode); - } - - 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/JS/node_modules/graphql/graphql.d.ts b/JS/node_modules/graphql/graphql.d.ts deleted file mode 100644 index 8ba8ef7..0000000 --- a/JS/node_modules/graphql/graphql.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { Maybe } from './jsutils/Maybe'; - -import { Source } from './language/source'; -import { GraphQLSchema } from './type/schema'; -import { GraphQLFieldResolver, GraphQLTypeResolver } from './type/definition'; -import { ExecutionResult } from './execution/execute'; - -/** - * 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). - */ -export interface GraphQLArgs { - schema: GraphQLSchema; - source: string | Source; - rootValue?: any; - contextValue?: any; - variableValues?: Maybe<{ [key: string]: any }>; - operationName?: Maybe; - fieldResolver?: Maybe>; - typeResolver?: Maybe>; -} - -export function graphql(args: GraphQLArgs): Promise; -export function graphql( - schema: GraphQLSchema, - source: Source | string, - rootValue?: any, - contextValue?: any, - variableValues?: Maybe<{ [key: string]: any }>, - operationName?: Maybe, - fieldResolver?: Maybe>, - typeResolver?: Maybe>, -): Promise; - -/** - * 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(args: GraphQLArgs): ExecutionResult; -export function graphqlSync( - schema: GraphQLSchema, - source: Source | string, - rootValue?: any, - contextValue?: any, - variableValues?: Maybe<{ [key: string]: any }>, - operationName?: Maybe, - fieldResolver?: Maybe>, - typeResolver?: Maybe>, -): ExecutionResult; diff --git a/JS/node_modules/graphql/graphql.js b/JS/node_modules/graphql/graphql.js deleted file mode 100644 index f5f4b1d..0000000 --- a/JS/node_modules/graphql/graphql.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.graphql = graphql; -exports.graphqlSync = graphqlSync; - -var _isPromise = _interopRequireDefault(require("./jsutils/isPromise.js")); - -var _parser = require("./language/parser.js"); - -var _validate = require("./validation/validate.js"); - -var _validate2 = require("./type/validate.js"); - -var _execute = require("./execution/execute.js"); - -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, _validate2.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, _validate.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/JS/node_modules/graphql/graphql.js.flow b/JS/node_modules/graphql/graphql.js.flow deleted file mode 100644 index cc24308..0000000 --- a/JS/node_modules/graphql/graphql.js.flow +++ /dev/null @@ -1,207 +0,0 @@ -// @flow strict -import type { PromiseOrValue } from './jsutils/PromiseOrValue'; -import isPromise from './jsutils/isPromise'; - -import type { Source } from './language/source'; -import { parse } from './language/parser'; - -import { validate } from './validation/validate'; - -import type { - GraphQLFieldResolver, - GraphQLTypeResolver, -} from './type/definition'; -import type { GraphQLSchema } from './type/schema'; -import { validateSchema } from './type/validate'; - -import type { ExecutionResult } from './execution/execute'; -import { execute } from './execution/execute'; - -/** - * 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/JS/node_modules/graphql/graphql.mjs b/JS/node_modules/graphql/graphql.mjs deleted file mode 100644 index aa3cb91..0000000 --- a/JS/node_modules/graphql/graphql.mjs +++ /dev/null @@ -1,142 +0,0 @@ -import isPromise from "./jsutils/isPromise.mjs"; -import { parse } from "./language/parser.mjs"; -import { validate } from "./validation/validate.mjs"; -import { validateSchema } from "./type/validate.mjs"; -import { execute } from "./execution/execute.mjs"; -/** - * 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 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/JS/node_modules/graphql/index.d.ts b/JS/node_modules/graphql/index.d.ts deleted file mode 100644 index 0776078..0000000 --- a/JS/node_modules/graphql/index.d.ts +++ /dev/null @@ -1,465 +0,0 @@ -// Minimum TypeScript Version: 2.6 - -/** - * 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 { GraphQLArgs, 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, - GraphQLSpecifiedByDirective, - // "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/index'; - -export { - GraphQLType, - GraphQLInputType, - GraphQLOutputType, - GraphQLLeafType, - GraphQLCompositeType, - GraphQLAbstractType, - GraphQLWrappingType, - GraphQLNullableType, - GraphQLNamedType, - Thunk, - GraphQLSchemaConfig, - GraphQLSchemaExtensions, - GraphQLDirectiveConfig, - GraphQLDirectiveExtensions, - GraphQLArgument, - GraphQLArgumentConfig, - GraphQLArgumentExtensions, - GraphQLEnumTypeConfig, - GraphQLEnumTypeExtensions, - GraphQLEnumValue, - GraphQLEnumValueConfig, - GraphQLEnumValueExtensions, - GraphQLEnumValueConfigMap, - GraphQLField, - GraphQLFieldConfig, - GraphQLFieldExtensions, - GraphQLFieldConfigArgumentMap, - GraphQLFieldConfigMap, - GraphQLFieldMap, - GraphQLFieldResolver, - GraphQLInputField, - GraphQLInputFieldConfig, - GraphQLInputFieldExtensions, - GraphQLInputFieldConfigMap, - GraphQLInputFieldMap, - GraphQLInputObjectTypeConfig, - GraphQLInputObjectTypeExtensions, - GraphQLInterfaceTypeConfig, - GraphQLInterfaceTypeExtensions, - GraphQLIsTypeOfFn, - GraphQLObjectTypeConfig, - GraphQLObjectTypeExtensions, - GraphQLResolveInfo, - ResponsePath, - GraphQLScalarTypeConfig, - GraphQLScalarTypeExtensions, - GraphQLTypeResolver, - GraphQLUnionTypeConfig, - GraphQLUnionTypeExtensions, - GraphQLScalarSerializer, - GraphQLScalarValueParser, - GraphQLScalarLiteralParser, -} from './type/index'; - -// Parse and operate on GraphQL language source files. -export { - Token, - Source, - Location, - getLocation, - // Print source location - printLocation, - printSourceLocation, - // Lex - Lexer, - TokenKind, - // Parse - parse, - parseValue, - parseType, - // Print - print, - // Visit - visit, - visitInParallel, - getVisitFn, - BREAK, - Kind, - DirectiveLocation, - // Predicates - isDefinitionNode, - isExecutableDefinitionNode, - isSelectionNode, - isValueNode, - isTypeNode, - isTypeSystemDefinitionNode, - isTypeDefinitionNode, - isTypeSystemExtensionNode, - isTypeExtensionNode, -} from './language/index'; - -export { - ParseOptions, - SourceLocation, - 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/index'; - -// Execute GraphQL queries. -export { - execute, - executeSync, - defaultFieldResolver, - defaultTypeResolver, - responsePathAsArray, - getDirectiveValues, - ExecutionArgs, - ExecutionResult, - FormattedExecutionResult, -} from './execution/index'; - -export { - subscribe, - createSourceEventStream, - SubscriptionArgs, -} from './subscription/index'; - -// Validate GraphQL documents. -export { - validate, - ValidationContext, - // All validation rules in the GraphQL Specification. - specifiedRules, - // Individual validation rules. - ExecutableDefinitionsRule, - 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, - // SDL-specific validation rules - LoneSchemaDefinitionRule, - UniqueOperationTypesRule, - UniqueTypeNamesRule, - UniqueEnumValueNamesRule, - UniqueFieldDefinitionNamesRule, - UniqueDirectiveNamesRule, - PossibleTypeExtensionsRule, - // Custom validation rules - NoDeprecatedCustomRule, - NoSchemaIntrospectionCustomRule, - ValidationRule, -} from './validation/index'; - -// Create, format, and print GraphQL errors. -export { - GraphQLError, - syntaxError, - locatedError, - printError, - formatError, - GraphQLFormattedError, -} from './error/index'; - -// 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, - // 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, - visitWithTypeInfo, - // Coerces a JavaScript value to a GraphQL type, or produces errors. - coerceInputValue, - // 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, - // @deprecated: Report all deprecated usage within a GraphQL document. - findDeprecatedUsages, -} from './utilities/index'; - -export { - 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, - TypedQueryDocumentNode, -} from './utilities/index'; diff --git a/JS/node_modules/graphql/index.js b/JS/node_modules/graphql/index.js deleted file mode 100644 index 8822148..0000000 --- a/JS/node_modules/graphql/index.js +++ /dev/null @@ -1,1205 +0,0 @@ -"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 _index.GraphQLSchema; - } -}); -Object.defineProperty(exports, "GraphQLDirective", { - enumerable: true, - get: function get() { - return _index.GraphQLDirective; - } -}); -Object.defineProperty(exports, "GraphQLScalarType", { - enumerable: true, - get: function get() { - return _index.GraphQLScalarType; - } -}); -Object.defineProperty(exports, "GraphQLObjectType", { - enumerable: true, - get: function get() { - return _index.GraphQLObjectType; - } -}); -Object.defineProperty(exports, "GraphQLInterfaceType", { - enumerable: true, - get: function get() { - return _index.GraphQLInterfaceType; - } -}); -Object.defineProperty(exports, "GraphQLUnionType", { - enumerable: true, - get: function get() { - return _index.GraphQLUnionType; - } -}); -Object.defineProperty(exports, "GraphQLEnumType", { - enumerable: true, - get: function get() { - return _index.GraphQLEnumType; - } -}); -Object.defineProperty(exports, "GraphQLInputObjectType", { - enumerable: true, - get: function get() { - return _index.GraphQLInputObjectType; - } -}); -Object.defineProperty(exports, "GraphQLList", { - enumerable: true, - get: function get() { - return _index.GraphQLList; - } -}); -Object.defineProperty(exports, "GraphQLNonNull", { - enumerable: true, - get: function get() { - return _index.GraphQLNonNull; - } -}); -Object.defineProperty(exports, "specifiedScalarTypes", { - enumerable: true, - get: function get() { - return _index.specifiedScalarTypes; - } -}); -Object.defineProperty(exports, "GraphQLInt", { - enumerable: true, - get: function get() { - return _index.GraphQLInt; - } -}); -Object.defineProperty(exports, "GraphQLFloat", { - enumerable: true, - get: function get() { - return _index.GraphQLFloat; - } -}); -Object.defineProperty(exports, "GraphQLString", { - enumerable: true, - get: function get() { - return _index.GraphQLString; - } -}); -Object.defineProperty(exports, "GraphQLBoolean", { - enumerable: true, - get: function get() { - return _index.GraphQLBoolean; - } -}); -Object.defineProperty(exports, "GraphQLID", { - enumerable: true, - get: function get() { - return _index.GraphQLID; - } -}); -Object.defineProperty(exports, "specifiedDirectives", { - enumerable: true, - get: function get() { - return _index.specifiedDirectives; - } -}); -Object.defineProperty(exports, "GraphQLIncludeDirective", { - enumerable: true, - get: function get() { - return _index.GraphQLIncludeDirective; - } -}); -Object.defineProperty(exports, "GraphQLSkipDirective", { - enumerable: true, - get: function get() { - return _index.GraphQLSkipDirective; - } -}); -Object.defineProperty(exports, "GraphQLDeprecatedDirective", { - enumerable: true, - get: function get() { - return _index.GraphQLDeprecatedDirective; - } -}); -Object.defineProperty(exports, "GraphQLSpecifiedByDirective", { - enumerable: true, - get: function get() { - return _index.GraphQLSpecifiedByDirective; - } -}); -Object.defineProperty(exports, "TypeKind", { - enumerable: true, - get: function get() { - return _index.TypeKind; - } -}); -Object.defineProperty(exports, "DEFAULT_DEPRECATION_REASON", { - enumerable: true, - get: function get() { - return _index.DEFAULT_DEPRECATION_REASON; - } -}); -Object.defineProperty(exports, "introspectionTypes", { - enumerable: true, - get: function get() { - return _index.introspectionTypes; - } -}); -Object.defineProperty(exports, "__Schema", { - enumerable: true, - get: function get() { - return _index.__Schema; - } -}); -Object.defineProperty(exports, "__Directive", { - enumerable: true, - get: function get() { - return _index.__Directive; - } -}); -Object.defineProperty(exports, "__DirectiveLocation", { - enumerable: true, - get: function get() { - return _index.__DirectiveLocation; - } -}); -Object.defineProperty(exports, "__Type", { - enumerable: true, - get: function get() { - return _index.__Type; - } -}); -Object.defineProperty(exports, "__Field", { - enumerable: true, - get: function get() { - return _index.__Field; - } -}); -Object.defineProperty(exports, "__InputValue", { - enumerable: true, - get: function get() { - return _index.__InputValue; - } -}); -Object.defineProperty(exports, "__EnumValue", { - enumerable: true, - get: function get() { - return _index.__EnumValue; - } -}); -Object.defineProperty(exports, "__TypeKind", { - enumerable: true, - get: function get() { - return _index.__TypeKind; - } -}); -Object.defineProperty(exports, "SchemaMetaFieldDef", { - enumerable: true, - get: function get() { - return _index.SchemaMetaFieldDef; - } -}); -Object.defineProperty(exports, "TypeMetaFieldDef", { - enumerable: true, - get: function get() { - return _index.TypeMetaFieldDef; - } -}); -Object.defineProperty(exports, "TypeNameMetaFieldDef", { - enumerable: true, - get: function get() { - return _index.TypeNameMetaFieldDef; - } -}); -Object.defineProperty(exports, "isSchema", { - enumerable: true, - get: function get() { - return _index.isSchema; - } -}); -Object.defineProperty(exports, "isDirective", { - enumerable: true, - get: function get() { - return _index.isDirective; - } -}); -Object.defineProperty(exports, "isType", { - enumerable: true, - get: function get() { - return _index.isType; - } -}); -Object.defineProperty(exports, "isScalarType", { - enumerable: true, - get: function get() { - return _index.isScalarType; - } -}); -Object.defineProperty(exports, "isObjectType", { - enumerable: true, - get: function get() { - return _index.isObjectType; - } -}); -Object.defineProperty(exports, "isInterfaceType", { - enumerable: true, - get: function get() { - return _index.isInterfaceType; - } -}); -Object.defineProperty(exports, "isUnionType", { - enumerable: true, - get: function get() { - return _index.isUnionType; - } -}); -Object.defineProperty(exports, "isEnumType", { - enumerable: true, - get: function get() { - return _index.isEnumType; - } -}); -Object.defineProperty(exports, "isInputObjectType", { - enumerable: true, - get: function get() { - return _index.isInputObjectType; - } -}); -Object.defineProperty(exports, "isListType", { - enumerable: true, - get: function get() { - return _index.isListType; - } -}); -Object.defineProperty(exports, "isNonNullType", { - enumerable: true, - get: function get() { - return _index.isNonNullType; - } -}); -Object.defineProperty(exports, "isInputType", { - enumerable: true, - get: function get() { - return _index.isInputType; - } -}); -Object.defineProperty(exports, "isOutputType", { - enumerable: true, - get: function get() { - return _index.isOutputType; - } -}); -Object.defineProperty(exports, "isLeafType", { - enumerable: true, - get: function get() { - return _index.isLeafType; - } -}); -Object.defineProperty(exports, "isCompositeType", { - enumerable: true, - get: function get() { - return _index.isCompositeType; - } -}); -Object.defineProperty(exports, "isAbstractType", { - enumerable: true, - get: function get() { - return _index.isAbstractType; - } -}); -Object.defineProperty(exports, "isWrappingType", { - enumerable: true, - get: function get() { - return _index.isWrappingType; - } -}); -Object.defineProperty(exports, "isNullableType", { - enumerable: true, - get: function get() { - return _index.isNullableType; - } -}); -Object.defineProperty(exports, "isNamedType", { - enumerable: true, - get: function get() { - return _index.isNamedType; - } -}); -Object.defineProperty(exports, "isRequiredArgument", { - enumerable: true, - get: function get() { - return _index.isRequiredArgument; - } -}); -Object.defineProperty(exports, "isRequiredInputField", { - enumerable: true, - get: function get() { - return _index.isRequiredInputField; - } -}); -Object.defineProperty(exports, "isSpecifiedScalarType", { - enumerable: true, - get: function get() { - return _index.isSpecifiedScalarType; - } -}); -Object.defineProperty(exports, "isIntrospectionType", { - enumerable: true, - get: function get() { - return _index.isIntrospectionType; - } -}); -Object.defineProperty(exports, "isSpecifiedDirective", { - enumerable: true, - get: function get() { - return _index.isSpecifiedDirective; - } -}); -Object.defineProperty(exports, "assertSchema", { - enumerable: true, - get: function get() { - return _index.assertSchema; - } -}); -Object.defineProperty(exports, "assertDirective", { - enumerable: true, - get: function get() { - return _index.assertDirective; - } -}); -Object.defineProperty(exports, "assertType", { - enumerable: true, - get: function get() { - return _index.assertType; - } -}); -Object.defineProperty(exports, "assertScalarType", { - enumerable: true, - get: function get() { - return _index.assertScalarType; - } -}); -Object.defineProperty(exports, "assertObjectType", { - enumerable: true, - get: function get() { - return _index.assertObjectType; - } -}); -Object.defineProperty(exports, "assertInterfaceType", { - enumerable: true, - get: function get() { - return _index.assertInterfaceType; - } -}); -Object.defineProperty(exports, "assertUnionType", { - enumerable: true, - get: function get() { - return _index.assertUnionType; - } -}); -Object.defineProperty(exports, "assertEnumType", { - enumerable: true, - get: function get() { - return _index.assertEnumType; - } -}); -Object.defineProperty(exports, "assertInputObjectType", { - enumerable: true, - get: function get() { - return _index.assertInputObjectType; - } -}); -Object.defineProperty(exports, "assertListType", { - enumerable: true, - get: function get() { - return _index.assertListType; - } -}); -Object.defineProperty(exports, "assertNonNullType", { - enumerable: true, - get: function get() { - return _index.assertNonNullType; - } -}); -Object.defineProperty(exports, "assertInputType", { - enumerable: true, - get: function get() { - return _index.assertInputType; - } -}); -Object.defineProperty(exports, "assertOutputType", { - enumerable: true, - get: function get() { - return _index.assertOutputType; - } -}); -Object.defineProperty(exports, "assertLeafType", { - enumerable: true, - get: function get() { - return _index.assertLeafType; - } -}); -Object.defineProperty(exports, "assertCompositeType", { - enumerable: true, - get: function get() { - return _index.assertCompositeType; - } -}); -Object.defineProperty(exports, "assertAbstractType", { - enumerable: true, - get: function get() { - return _index.assertAbstractType; - } -}); -Object.defineProperty(exports, "assertWrappingType", { - enumerable: true, - get: function get() { - return _index.assertWrappingType; - } -}); -Object.defineProperty(exports, "assertNullableType", { - enumerable: true, - get: function get() { - return _index.assertNullableType; - } -}); -Object.defineProperty(exports, "assertNamedType", { - enumerable: true, - get: function get() { - return _index.assertNamedType; - } -}); -Object.defineProperty(exports, "getNullableType", { - enumerable: true, - get: function get() { - return _index.getNullableType; - } -}); -Object.defineProperty(exports, "getNamedType", { - enumerable: true, - get: function get() { - return _index.getNamedType; - } -}); -Object.defineProperty(exports, "validateSchema", { - enumerable: true, - get: function get() { - return _index.validateSchema; - } -}); -Object.defineProperty(exports, "assertValidSchema", { - enumerable: true, - get: function get() { - return _index.assertValidSchema; - } -}); -Object.defineProperty(exports, "Token", { - enumerable: true, - get: function get() { - return _index2.Token; - } -}); -Object.defineProperty(exports, "Source", { - enumerable: true, - get: function get() { - return _index2.Source; - } -}); -Object.defineProperty(exports, "Location", { - enumerable: true, - get: function get() { - return _index2.Location; - } -}); -Object.defineProperty(exports, "getLocation", { - enumerable: true, - get: function get() { - return _index2.getLocation; - } -}); -Object.defineProperty(exports, "printLocation", { - enumerable: true, - get: function get() { - return _index2.printLocation; - } -}); -Object.defineProperty(exports, "printSourceLocation", { - enumerable: true, - get: function get() { - return _index2.printSourceLocation; - } -}); -Object.defineProperty(exports, "Lexer", { - enumerable: true, - get: function get() { - return _index2.Lexer; - } -}); -Object.defineProperty(exports, "TokenKind", { - enumerable: true, - get: function get() { - return _index2.TokenKind; - } -}); -Object.defineProperty(exports, "parse", { - enumerable: true, - get: function get() { - return _index2.parse; - } -}); -Object.defineProperty(exports, "parseValue", { - enumerable: true, - get: function get() { - return _index2.parseValue; - } -}); -Object.defineProperty(exports, "parseType", { - enumerable: true, - get: function get() { - return _index2.parseType; - } -}); -Object.defineProperty(exports, "print", { - enumerable: true, - get: function get() { - return _index2.print; - } -}); -Object.defineProperty(exports, "visit", { - enumerable: true, - get: function get() { - return _index2.visit; - } -}); -Object.defineProperty(exports, "visitInParallel", { - enumerable: true, - get: function get() { - return _index2.visitInParallel; - } -}); -Object.defineProperty(exports, "getVisitFn", { - enumerable: true, - get: function get() { - return _index2.getVisitFn; - } -}); -Object.defineProperty(exports, "BREAK", { - enumerable: true, - get: function get() { - return _index2.BREAK; - } -}); -Object.defineProperty(exports, "Kind", { - enumerable: true, - get: function get() { - return _index2.Kind; - } -}); -Object.defineProperty(exports, "DirectiveLocation", { - enumerable: true, - get: function get() { - return _index2.DirectiveLocation; - } -}); -Object.defineProperty(exports, "isDefinitionNode", { - enumerable: true, - get: function get() { - return _index2.isDefinitionNode; - } -}); -Object.defineProperty(exports, "isExecutableDefinitionNode", { - enumerable: true, - get: function get() { - return _index2.isExecutableDefinitionNode; - } -}); -Object.defineProperty(exports, "isSelectionNode", { - enumerable: true, - get: function get() { - return _index2.isSelectionNode; - } -}); -Object.defineProperty(exports, "isValueNode", { - enumerable: true, - get: function get() { - return _index2.isValueNode; - } -}); -Object.defineProperty(exports, "isTypeNode", { - enumerable: true, - get: function get() { - return _index2.isTypeNode; - } -}); -Object.defineProperty(exports, "isTypeSystemDefinitionNode", { - enumerable: true, - get: function get() { - return _index2.isTypeSystemDefinitionNode; - } -}); -Object.defineProperty(exports, "isTypeDefinitionNode", { - enumerable: true, - get: function get() { - return _index2.isTypeDefinitionNode; - } -}); -Object.defineProperty(exports, "isTypeSystemExtensionNode", { - enumerable: true, - get: function get() { - return _index2.isTypeSystemExtensionNode; - } -}); -Object.defineProperty(exports, "isTypeExtensionNode", { - enumerable: true, - get: function get() { - return _index2.isTypeExtensionNode; - } -}); -Object.defineProperty(exports, "execute", { - enumerable: true, - get: function get() { - return _index3.execute; - } -}); -Object.defineProperty(exports, "executeSync", { - enumerable: true, - get: function get() { - return _index3.executeSync; - } -}); -Object.defineProperty(exports, "defaultFieldResolver", { - enumerable: true, - get: function get() { - return _index3.defaultFieldResolver; - } -}); -Object.defineProperty(exports, "defaultTypeResolver", { - enumerable: true, - get: function get() { - return _index3.defaultTypeResolver; - } -}); -Object.defineProperty(exports, "responsePathAsArray", { - enumerable: true, - get: function get() { - return _index3.responsePathAsArray; - } -}); -Object.defineProperty(exports, "getDirectiveValues", { - enumerable: true, - get: function get() { - return _index3.getDirectiveValues; - } -}); -Object.defineProperty(exports, "subscribe", { - enumerable: true, - get: function get() { - return _index4.subscribe; - } -}); -Object.defineProperty(exports, "createSourceEventStream", { - enumerable: true, - get: function get() { - return _index4.createSourceEventStream; - } -}); -Object.defineProperty(exports, "validate", { - enumerable: true, - get: function get() { - return _index5.validate; - } -}); -Object.defineProperty(exports, "ValidationContext", { - enumerable: true, - get: function get() { - return _index5.ValidationContext; - } -}); -Object.defineProperty(exports, "specifiedRules", { - enumerable: true, - get: function get() { - return _index5.specifiedRules; - } -}); -Object.defineProperty(exports, "ExecutableDefinitionsRule", { - enumerable: true, - get: function get() { - return _index5.ExecutableDefinitionsRule; - } -}); -Object.defineProperty(exports, "FieldsOnCorrectTypeRule", { - enumerable: true, - get: function get() { - return _index5.FieldsOnCorrectTypeRule; - } -}); -Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", { - enumerable: true, - get: function get() { - return _index5.FragmentsOnCompositeTypesRule; - } -}); -Object.defineProperty(exports, "KnownArgumentNamesRule", { - enumerable: true, - get: function get() { - return _index5.KnownArgumentNamesRule; - } -}); -Object.defineProperty(exports, "KnownDirectivesRule", { - enumerable: true, - get: function get() { - return _index5.KnownDirectivesRule; - } -}); -Object.defineProperty(exports, "KnownFragmentNamesRule", { - enumerable: true, - get: function get() { - return _index5.KnownFragmentNamesRule; - } -}); -Object.defineProperty(exports, "KnownTypeNamesRule", { - enumerable: true, - get: function get() { - return _index5.KnownTypeNamesRule; - } -}); -Object.defineProperty(exports, "LoneAnonymousOperationRule", { - enumerable: true, - get: function get() { - return _index5.LoneAnonymousOperationRule; - } -}); -Object.defineProperty(exports, "NoFragmentCyclesRule", { - enumerable: true, - get: function get() { - return _index5.NoFragmentCyclesRule; - } -}); -Object.defineProperty(exports, "NoUndefinedVariablesRule", { - enumerable: true, - get: function get() { - return _index5.NoUndefinedVariablesRule; - } -}); -Object.defineProperty(exports, "NoUnusedFragmentsRule", { - enumerable: true, - get: function get() { - return _index5.NoUnusedFragmentsRule; - } -}); -Object.defineProperty(exports, "NoUnusedVariablesRule", { - enumerable: true, - get: function get() { - return _index5.NoUnusedVariablesRule; - } -}); -Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", { - enumerable: true, - get: function get() { - return _index5.OverlappingFieldsCanBeMergedRule; - } -}); -Object.defineProperty(exports, "PossibleFragmentSpreadsRule", { - enumerable: true, - get: function get() { - return _index5.PossibleFragmentSpreadsRule; - } -}); -Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", { - enumerable: true, - get: function get() { - return _index5.ProvidedRequiredArgumentsRule; - } -}); -Object.defineProperty(exports, "ScalarLeafsRule", { - enumerable: true, - get: function get() { - return _index5.ScalarLeafsRule; - } -}); -Object.defineProperty(exports, "SingleFieldSubscriptionsRule", { - enumerable: true, - get: function get() { - return _index5.SingleFieldSubscriptionsRule; - } -}); -Object.defineProperty(exports, "UniqueArgumentNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueArgumentNamesRule; - } -}); -Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", { - enumerable: true, - get: function get() { - return _index5.UniqueDirectivesPerLocationRule; - } -}); -Object.defineProperty(exports, "UniqueFragmentNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueFragmentNamesRule; - } -}); -Object.defineProperty(exports, "UniqueInputFieldNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueInputFieldNamesRule; - } -}); -Object.defineProperty(exports, "UniqueOperationNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueOperationNamesRule; - } -}); -Object.defineProperty(exports, "UniqueVariableNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueVariableNamesRule; - } -}); -Object.defineProperty(exports, "ValuesOfCorrectTypeRule", { - enumerable: true, - get: function get() { - return _index5.ValuesOfCorrectTypeRule; - } -}); -Object.defineProperty(exports, "VariablesAreInputTypesRule", { - enumerable: true, - get: function get() { - return _index5.VariablesAreInputTypesRule; - } -}); -Object.defineProperty(exports, "VariablesInAllowedPositionRule", { - enumerable: true, - get: function get() { - return _index5.VariablesInAllowedPositionRule; - } -}); -Object.defineProperty(exports, "LoneSchemaDefinitionRule", { - enumerable: true, - get: function get() { - return _index5.LoneSchemaDefinitionRule; - } -}); -Object.defineProperty(exports, "UniqueOperationTypesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueOperationTypesRule; - } -}); -Object.defineProperty(exports, "UniqueTypeNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueTypeNamesRule; - } -}); -Object.defineProperty(exports, "UniqueEnumValueNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueEnumValueNamesRule; - } -}); -Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueFieldDefinitionNamesRule; - } -}); -Object.defineProperty(exports, "UniqueDirectiveNamesRule", { - enumerable: true, - get: function get() { - return _index5.UniqueDirectiveNamesRule; - } -}); -Object.defineProperty(exports, "PossibleTypeExtensionsRule", { - enumerable: true, - get: function get() { - return _index5.PossibleTypeExtensionsRule; - } -}); -Object.defineProperty(exports, "NoDeprecatedCustomRule", { - enumerable: true, - get: function get() { - return _index5.NoDeprecatedCustomRule; - } -}); -Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", { - enumerable: true, - get: function get() { - return _index5.NoSchemaIntrospectionCustomRule; - } -}); -Object.defineProperty(exports, "GraphQLError", { - enumerable: true, - get: function get() { - return _index6.GraphQLError; - } -}); -Object.defineProperty(exports, "syntaxError", { - enumerable: true, - get: function get() { - return _index6.syntaxError; - } -}); -Object.defineProperty(exports, "locatedError", { - enumerable: true, - get: function get() { - return _index6.locatedError; - } -}); -Object.defineProperty(exports, "printError", { - enumerable: true, - get: function get() { - return _index6.printError; - } -}); -Object.defineProperty(exports, "formatError", { - enumerable: true, - get: function get() { - return _index6.formatError; - } -}); -Object.defineProperty(exports, "getIntrospectionQuery", { - enumerable: true, - get: function get() { - return _index7.getIntrospectionQuery; - } -}); -Object.defineProperty(exports, "getOperationAST", { - enumerable: true, - get: function get() { - return _index7.getOperationAST; - } -}); -Object.defineProperty(exports, "getOperationRootType", { - enumerable: true, - get: function get() { - return _index7.getOperationRootType; - } -}); -Object.defineProperty(exports, "introspectionFromSchema", { - enumerable: true, - get: function get() { - return _index7.introspectionFromSchema; - } -}); -Object.defineProperty(exports, "buildClientSchema", { - enumerable: true, - get: function get() { - return _index7.buildClientSchema; - } -}); -Object.defineProperty(exports, "buildASTSchema", { - enumerable: true, - get: function get() { - return _index7.buildASTSchema; - } -}); -Object.defineProperty(exports, "buildSchema", { - enumerable: true, - get: function get() { - return _index7.buildSchema; - } -}); -Object.defineProperty(exports, "getDescription", { - enumerable: true, - get: function get() { - return _index7.getDescription; - } -}); -Object.defineProperty(exports, "extendSchema", { - enumerable: true, - get: function get() { - return _index7.extendSchema; - } -}); -Object.defineProperty(exports, "lexicographicSortSchema", { - enumerable: true, - get: function get() { - return _index7.lexicographicSortSchema; - } -}); -Object.defineProperty(exports, "printSchema", { - enumerable: true, - get: function get() { - return _index7.printSchema; - } -}); -Object.defineProperty(exports, "printType", { - enumerable: true, - get: function get() { - return _index7.printType; - } -}); -Object.defineProperty(exports, "printIntrospectionSchema", { - enumerable: true, - get: function get() { - return _index7.printIntrospectionSchema; - } -}); -Object.defineProperty(exports, "typeFromAST", { - enumerable: true, - get: function get() { - return _index7.typeFromAST; - } -}); -Object.defineProperty(exports, "valueFromAST", { - enumerable: true, - get: function get() { - return _index7.valueFromAST; - } -}); -Object.defineProperty(exports, "valueFromASTUntyped", { - enumerable: true, - get: function get() { - return _index7.valueFromASTUntyped; - } -}); -Object.defineProperty(exports, "astFromValue", { - enumerable: true, - get: function get() { - return _index7.astFromValue; - } -}); -Object.defineProperty(exports, "TypeInfo", { - enumerable: true, - get: function get() { - return _index7.TypeInfo; - } -}); -Object.defineProperty(exports, "visitWithTypeInfo", { - enumerable: true, - get: function get() { - return _index7.visitWithTypeInfo; - } -}); -Object.defineProperty(exports, "coerceInputValue", { - enumerable: true, - get: function get() { - return _index7.coerceInputValue; - } -}); -Object.defineProperty(exports, "concatAST", { - enumerable: true, - get: function get() { - return _index7.concatAST; - } -}); -Object.defineProperty(exports, "separateOperations", { - enumerable: true, - get: function get() { - return _index7.separateOperations; - } -}); -Object.defineProperty(exports, "stripIgnoredCharacters", { - enumerable: true, - get: function get() { - return _index7.stripIgnoredCharacters; - } -}); -Object.defineProperty(exports, "isEqualType", { - enumerable: true, - get: function get() { - return _index7.isEqualType; - } -}); -Object.defineProperty(exports, "isTypeSubTypeOf", { - enumerable: true, - get: function get() { - return _index7.isTypeSubTypeOf; - } -}); -Object.defineProperty(exports, "doTypesOverlap", { - enumerable: true, - get: function get() { - return _index7.doTypesOverlap; - } -}); -Object.defineProperty(exports, "assertValidName", { - enumerable: true, - get: function get() { - return _index7.assertValidName; - } -}); -Object.defineProperty(exports, "isValidNameError", { - enumerable: true, - get: function get() { - return _index7.isValidNameError; - } -}); -Object.defineProperty(exports, "BreakingChangeType", { - enumerable: true, - get: function get() { - return _index7.BreakingChangeType; - } -}); -Object.defineProperty(exports, "DangerousChangeType", { - enumerable: true, - get: function get() { - return _index7.DangerousChangeType; - } -}); -Object.defineProperty(exports, "findBreakingChanges", { - enumerable: true, - get: function get() { - return _index7.findBreakingChanges; - } -}); -Object.defineProperty(exports, "findDangerousChanges", { - enumerable: true, - get: function get() { - return _index7.findDangerousChanges; - } -}); -Object.defineProperty(exports, "findDeprecatedUsages", { - enumerable: true, - get: function get() { - return _index7.findDeprecatedUsages; - } -}); - -var _version = require("./version.js"); - -var _graphql = require("./graphql.js"); - -var _index = require("./type/index.js"); - -var _index2 = require("./language/index.js"); - -var _index3 = require("./execution/index.js"); - -var _index4 = require("./subscription/index.js"); - -var _index5 = require("./validation/index.js"); - -var _index6 = require("./error/index.js"); - -var _index7 = require("./utilities/index.js"); diff --git a/JS/node_modules/graphql/index.js.flow b/JS/node_modules/graphql/index.js.flow deleted file mode 100644 index 78a9bc4..0000000 --- a/JS/node_modules/graphql/index.js.flow +++ /dev/null @@ -1,454 +0,0 @@ -// @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, - GraphQLSpecifiedByDirective, - // "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/index'; - -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/index'; - -// Parse and operate on GraphQL language source files. -export { - Token, - Source, - Location, - getLocation, - // Print source location - printLocation, - printSourceLocation, - // Lex - Lexer, - TokenKind, - // Parse - parse, - parseValue, - parseType, - // Print - print, - // Visit - visit, - visitInParallel, - getVisitFn, - BREAK, - Kind, - DirectiveLocation, - // Predicates - isDefinitionNode, - isExecutableDefinitionNode, - isSelectionNode, - isValueNode, - isTypeNode, - isTypeSystemDefinitionNode, - isTypeDefinitionNode, - isTypeSystemExtensionNode, - isTypeExtensionNode, -} from './language/index'; - -export type { - ParseOptions, - SourceLocation, - 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/index'; - -// Execute GraphQL queries. -export { - execute, - executeSync, - defaultFieldResolver, - defaultTypeResolver, - responsePathAsArray, - getDirectiveValues, -} from './execution/index'; - -export type { - ExecutionArgs, - ExecutionResult, - FormattedExecutionResult, -} from './execution/index'; - -export { subscribe, createSourceEventStream } from './subscription/index'; -export type { SubscriptionArgs } from './subscription/index'; - -// Validate GraphQL documents. -export { - validate, - ValidationContext, - // All validation rules in the GraphQL Specification. - specifiedRules, - // Individual validation rules. - ExecutableDefinitionsRule, - 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, - // SDL-specific validation rules - LoneSchemaDefinitionRule, - UniqueOperationTypesRule, - UniqueTypeNamesRule, - UniqueEnumValueNamesRule, - UniqueFieldDefinitionNamesRule, - UniqueDirectiveNamesRule, - PossibleTypeExtensionsRule, - // Custom validation rules - NoDeprecatedCustomRule, - NoSchemaIntrospectionCustomRule, -} from './validation/index'; - -export type { ValidationRule } from './validation/index'; - -// Create, format, and print GraphQL errors. -export { - GraphQLError, - syntaxError, - locatedError, - printError, - formatError, -} from './error/index'; - -export type { GraphQLFormattedError } from './error/index'; - -// 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, - // 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, - visitWithTypeInfo, - // Coerces a JavaScript value to a GraphQL type, or produces errors. - coerceInputValue, - // 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, - // @deprecated: Report all deprecated usage within a GraphQL document. - findDeprecatedUsages, -} from './utilities/index'; - -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/index'; diff --git a/JS/node_modules/graphql/index.mjs b/JS/node_modules/graphql/index.mjs deleted file mode 100644 index 952630a..0000000 --- a/JS/node_modules/graphql/index.mjs +++ /dev/null @@ -1,94 +0,0 @@ -/** - * 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.mjs"; // The primary entry point into fulfilling a GraphQL request. - -export { graphql, graphqlSync } from "./graphql.mjs"; // 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, GraphQLSpecifiedByDirective // "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/index.mjs"; -// Parse and operate on GraphQL language source files. -export { Token, Source, Location, getLocation // Print source location -, printLocation, printSourceLocation // Lex -, Lexer, TokenKind // Parse -, parse, parseValue, parseType // Print -, print // Visit -, visit, visitInParallel, getVisitFn, BREAK, Kind, DirectiveLocation // Predicates -, isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from "./language/index.mjs"; -// Execute GraphQL queries. -export { execute, executeSync, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getDirectiveValues } from "./execution/index.mjs"; -export { subscribe, createSourceEventStream } from "./subscription/index.mjs"; -// Validate GraphQL documents. -export { validate, ValidationContext // All validation rules in the GraphQL Specification. -, specifiedRules // Individual validation rules. -, ExecutableDefinitionsRule, 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 // SDL-specific validation rules -, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule // Custom validation rules -, NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule } from "./validation/index.mjs"; -// Create, format, and print GraphQL errors. -export { GraphQLError, syntaxError, locatedError, printError, formatError } from "./error/index.mjs"; -// 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 // 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, visitWithTypeInfo // Coerces a JavaScript value to a GraphQL type, or produces errors. -, coerceInputValue // 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 // @deprecated: Report all deprecated usage within a GraphQL document. -, findDeprecatedUsages } from "./utilities/index.mjs"; diff --git a/JS/node_modules/graphql/jsutils/Maybe.d.ts b/JS/node_modules/graphql/jsutils/Maybe.d.ts deleted file mode 100644 index e8b5e21..0000000 --- a/JS/node_modules/graphql/jsutils/Maybe.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Conveniently represents flow's "Maybe" type https://flow.org/en/docs/types/maybe/ -export type Maybe = null | undefined | T; diff --git a/JS/node_modules/graphql/jsutils/ObjMap.js b/JS/node_modules/graphql/jsutils/ObjMap.js deleted file mode 100644 index 3918c74..0000000 --- a/JS/node_modules/graphql/jsutils/ObjMap.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/JS/node_modules/graphql/jsutils/ObjMap.js.flow b/JS/node_modules/graphql/jsutils/ObjMap.js.flow deleted file mode 100644 index a37d728..0000000 --- a/JS/node_modules/graphql/jsutils/ObjMap.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow strict -export type ObjMap = { [key: string]: T, __proto__: null, ... }; -export type ObjMapLike = ObjMap | { [key: string]: T, ... }; - -export type ReadOnlyObjMap = { +[key: string]: T, __proto__: null, ... }; -export type ReadOnlyObjMapLike = - | ReadOnlyObjMap - | { +[key: string]: T, ... }; diff --git a/JS/node_modules/graphql/jsutils/ObjMap.mjs b/JS/node_modules/graphql/jsutils/ObjMap.mjs deleted file mode 100644 index 8b13789..0000000 --- a/JS/node_modules/graphql/jsutils/ObjMap.mjs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/JS/node_modules/graphql/jsutils/Path.d.ts b/JS/node_modules/graphql/jsutils/Path.d.ts deleted file mode 100644 index 9a2233d..0000000 --- a/JS/node_modules/graphql/jsutils/Path.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export interface Path { - prev: Path | undefined; - key: string | number; - typename: string | undefined; -} - -/** - * Given a Path and a key, return a new Path containing the new key. - */ -export function addPath( - prev: Path | undefined, - key: string | number, - typename: string | undefined, -): Path; - -/** - * Given a Path, return an Array of the path keys. - */ -export function pathToArray(path: Path): Array; diff --git a/JS/node_modules/graphql/jsutils/Path.js b/JS/node_modules/graphql/jsutils/Path.js deleted file mode 100644 index 9eb2517..0000000 --- a/JS/node_modules/graphql/jsutils/Path.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.addPath = addPath; -exports.pathToArray = pathToArray; - -/** - * Given a Path and a key, return a new Path containing the new key. - */ -function addPath(prev, key, typename) { - return { - prev: prev, - key: key, - typename: typename - }; -} -/** - * Given a Path, return an Array of the path keys. - */ - - -function pathToArray(path) { - var flattened = []; - var curr = path; - - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - - return flattened.reverse(); -} diff --git a/JS/node_modules/graphql/jsutils/Path.js.flow b/JS/node_modules/graphql/jsutils/Path.js.flow deleted file mode 100644 index 4b0e23c..0000000 --- a/JS/node_modules/graphql/jsutils/Path.js.flow +++ /dev/null @@ -1,30 +0,0 @@ -// @flow strict -export type Path = {| - +prev: Path | void, - +key: string | number, - +typename: string | void, -|}; - -/** - * Given a Path and a key, return a new Path containing the new key. - */ -export function addPath( - prev: $ReadOnly | void, - key: string | number, - typename: string | void, -): Path { - return { prev, key, typename }; -} - -/** - * Given a Path, return an Array of the path keys. - */ -export function pathToArray(path: ?$ReadOnly): Array { - const flattened = []; - let curr = path; - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - return flattened.reverse(); -} diff --git a/JS/node_modules/graphql/jsutils/Path.mjs b/JS/node_modules/graphql/jsutils/Path.mjs deleted file mode 100644 index af448f0..0000000 --- a/JS/node_modules/graphql/jsutils/Path.mjs +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Given a Path and a key, return a new Path containing the new key. - */ -export function addPath(prev, key, typename) { - return { - prev: prev, - key: key, - typename: typename - }; -} -/** - * Given a Path, return an Array of the path keys. - */ - -export function pathToArray(path) { - var flattened = []; - var curr = path; - - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - - return flattened.reverse(); -} diff --git a/JS/node_modules/graphql/jsutils/PromiseOrValue.d.ts b/JS/node_modules/graphql/jsutils/PromiseOrValue.d.ts deleted file mode 100644 index 6b2517e..0000000 --- a/JS/node_modules/graphql/jsutils/PromiseOrValue.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type PromiseOrValue = Promise | T; diff --git a/JS/node_modules/graphql/jsutils/PromiseOrValue.js b/JS/node_modules/graphql/jsutils/PromiseOrValue.js deleted file mode 100644 index 3918c74..0000000 --- a/JS/node_modules/graphql/jsutils/PromiseOrValue.js +++ /dev/null @@ -1 +0,0 @@ -"use strict"; diff --git a/JS/node_modules/graphql/jsutils/PromiseOrValue.js.flow b/JS/node_modules/graphql/jsutils/PromiseOrValue.js.flow deleted file mode 100644 index dc8df50..0000000 --- a/JS/node_modules/graphql/jsutils/PromiseOrValue.js.flow +++ /dev/null @@ -1,2 +0,0 @@ -// @flow strict -export type PromiseOrValue<+T> = Promise | T; diff --git a/JS/node_modules/graphql/jsutils/PromiseOrValue.mjs b/JS/node_modules/graphql/jsutils/PromiseOrValue.mjs deleted file mode 100644 index 8b13789..0000000 --- a/JS/node_modules/graphql/jsutils/PromiseOrValue.mjs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/JS/node_modules/graphql/jsutils/defineInspect.js b/JS/node_modules/graphql/jsutils/defineInspect.js deleted file mode 100644 index 9bcdcf5..0000000 --- a/JS/node_modules/graphql/jsutils/defineInspect.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = defineInspect; - -var _invariant = _interopRequireDefault(require("./invariant.js")); - -var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` - */ -function defineInspect(classObject) { - var fn = classObject.prototype.toJSON; - typeof fn === 'function' || (0, _invariant.default)(0); - classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') - - if (_nodejsCustomInspectSymbol.default) { - classObject.prototype[_nodejsCustomInspectSymbol.default] = fn; - } -} diff --git a/JS/node_modules/graphql/jsutils/defineInspect.js.flow b/JS/node_modules/graphql/jsutils/defineInspect.js.flow deleted file mode 100644 index 5359f76..0000000 --- a/JS/node_modules/graphql/jsutils/defineInspect.js.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow strict -import invariant from './invariant'; -import nodejsCustomInspectSymbol from './nodejsCustomInspectSymbol'; - -/** - * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` - */ -export default function defineInspect( - classObject: Class | ((...args: Array) => mixed), -): void { - const fn = classObject.prototype.toJSON; - invariant(typeof fn === 'function'); - - classObject.prototype.inspect = fn; - - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') - if (nodejsCustomInspectSymbol) { - classObject.prototype[nodejsCustomInspectSymbol] = fn; - } -} diff --git a/JS/node_modules/graphql/jsutils/defineInspect.mjs b/JS/node_modules/graphql/jsutils/defineInspect.mjs deleted file mode 100644 index 33f6fdb..0000000 --- a/JS/node_modules/graphql/jsutils/defineInspect.mjs +++ /dev/null @@ -1,15 +0,0 @@ -import invariant from "./invariant.mjs"; -import nodejsCustomInspectSymbol from "./nodejsCustomInspectSymbol.mjs"; -/** - * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON` - */ - -export default function defineInspect(classObject) { - var fn = classObject.prototype.toJSON; - typeof fn === 'function' || invariant(0); - classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317') - - if (nodejsCustomInspectSymbol) { - classObject.prototype[nodejsCustomInspectSymbol] = fn; - } -} diff --git a/JS/node_modules/graphql/jsutils/devAssert.js b/JS/node_modules/graphql/jsutils/devAssert.js deleted file mode 100644 index 25e6d11..0000000 --- a/JS/node_modules/graphql/jsutils/devAssert.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = devAssert; - -function devAssert(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message); - } -} diff --git a/JS/node_modules/graphql/jsutils/devAssert.js.flow b/JS/node_modules/graphql/jsutils/devAssert.js.flow deleted file mode 100644 index 691eae7..0000000 --- a/JS/node_modules/graphql/jsutils/devAssert.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow strict -export default function devAssert(condition: mixed, message: string): void { - const booleanCondition = Boolean(condition); - // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - if (!booleanCondition) { - throw new Error(message); - } -} diff --git a/JS/node_modules/graphql/jsutils/devAssert.mjs b/JS/node_modules/graphql/jsutils/devAssert.mjs deleted file mode 100644 index e19b7eb..0000000 --- a/JS/node_modules/graphql/jsutils/devAssert.mjs +++ /dev/null @@ -1,7 +0,0 @@ -export default function devAssert(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message); - } -} diff --git a/JS/node_modules/graphql/jsutils/didYouMean.js b/JS/node_modules/graphql/jsutils/didYouMean.js deleted file mode 100644 index d6b0d90..0000000 --- a/JS/node_modules/graphql/jsutils/didYouMean.js +++ /dev/null @@ -1,42 +0,0 @@ -"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], - suggestionsArg = _ref[1]; - - var message = ' Did you mean '; - - if (subMessage) { - message += subMessage + ' '; - } - - var suggestions = suggestionsArg.map(function (x) { - return "\"".concat(x, "\""); - }); - - 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/JS/node_modules/graphql/jsutils/didYouMean.js.flow b/JS/node_modules/graphql/jsutils/didYouMean.js.flow deleted file mode 100644 index fc4e9e1..0000000 --- a/JS/node_modules/graphql/jsutils/didYouMean.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -// @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, suggestionsArg] = - typeof firstArg === 'string' - ? [firstArg, secondArg] - : [undefined, firstArg]; - - let message = ' Did you mean '; - if (subMessage) { - message += subMessage + ' '; - } - - const suggestions = suggestionsArg.map((x) => `"${x}"`); - 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/JS/node_modules/graphql/jsutils/didYouMean.mjs b/JS/node_modules/graphql/jsutils/didYouMean.mjs deleted file mode 100644 index 19e26cc..0000000 --- a/JS/node_modules/graphql/jsutils/didYouMean.mjs +++ /dev/null @@ -1,36 +0,0 @@ -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], - suggestionsArg = _ref[1]; - - var message = ' Did you mean '; - - if (subMessage) { - message += subMessage + ' '; - } - - var suggestions = suggestionsArg.map(function (x) { - return "\"".concat(x, "\""); - }); - - 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/JS/node_modules/graphql/jsutils/identityFunc.js b/JS/node_modules/graphql/jsutils/identityFunc.js deleted file mode 100644 index 630772f..0000000 --- a/JS/node_modules/graphql/jsutils/identityFunc.js +++ /dev/null @@ -1,13 +0,0 @@ -"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/JS/node_modules/graphql/jsutils/identityFunc.js.flow b/JS/node_modules/graphql/jsutils/identityFunc.js.flow deleted file mode 100644 index a37961e..0000000 --- a/JS/node_modules/graphql/jsutils/identityFunc.js.flow +++ /dev/null @@ -1,7 +0,0 @@ -// @flow strict -/** - * Returns the first argument it receives. - */ -export default function identityFunc(x: T): T { - return x; -} diff --git a/JS/node_modules/graphql/jsutils/identityFunc.mjs b/JS/node_modules/graphql/jsutils/identityFunc.mjs deleted file mode 100644 index daf2391..0000000 --- a/JS/node_modules/graphql/jsutils/identityFunc.mjs +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Returns the first argument it receives. - */ -export default function identityFunc(x) { - return x; -} diff --git a/JS/node_modules/graphql/jsutils/inspect.js b/JS/node_modules/graphql/jsutils/inspect.js deleted file mode 100644 index 8d3a16c..0000000 --- a/JS/node_modules/graphql/jsutils/inspect.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = inspect; - -var _nodejsCustomInspectSymbol = _interopRequireDefault(require("./nodejsCustomInspectSymbol.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -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) { - 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' && name !== '') { - return name; - } - } - - return tag; -} diff --git a/JS/node_modules/graphql/jsutils/inspect.js.flow b/JS/node_modules/graphql/jsutils/inspect.js.flow deleted file mode 100644 index 77a2b2c..0000000 --- a/JS/node_modules/graphql/jsutils/inspect.js.flow +++ /dev/null @@ -1,128 +0,0 @@ -// @flow strict -/* eslint-disable flowtype/no-weak-types */ -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: mixed, seenValues: Array): string { - 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: Object, - previouslySeenValues: Array, -): string { - if (previouslySeenValues.indexOf(value) !== -1) { - return '[Circular]'; - } - - const seenValues = [...previouslySeenValues, value]; - const customInspectFn = getCustomFn(value); - - if (customInspectFn !== undefined) { - 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: Object, seenValues: Array): string { - 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: Array, seenValues: Array): string { - 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: Object) { - const customInspectFn = object[String(nodejsCustomInspectSymbol)]; - - if (typeof customInspectFn === 'function') { - return customInspectFn; - } - - if (typeof object.inspect === 'function') { - return object.inspect; - } -} - -function getObjectTag(object: Object): string { - 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' && name !== '') { - return name; - } - } - - return tag; -} diff --git a/JS/node_modules/graphql/jsutils/inspect.mjs b/JS/node_modules/graphql/jsutils/inspect.mjs deleted file mode 100644 index caaf7dc..0000000 --- a/JS/node_modules/graphql/jsutils/inspect.mjs +++ /dev/null @@ -1,124 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/* eslint-disable flowtype/no-weak-types */ -import nodejsCustomInspectSymbol from "./nodejsCustomInspectSymbol.mjs"; -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) { - 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' && name !== '') { - return name; - } - } - - return tag; -} diff --git a/JS/node_modules/graphql/jsutils/instanceOf.js b/JS/node_modules/graphql/jsutils/instanceOf.js deleted file mode 100644 index 7098094..0000000 --- a/JS/node_modules/graphql/jsutils/instanceOf.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _inspect = _interopRequireDefault(require("./inspect.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -// 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' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -// 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 (_typeof(value) === 'object' && value !== null) { - var _value$constructor; - - var className = constructor.prototype[Symbol.toStringTag]; - var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name; - - if (className === valueClassName) { - var stringifiedValue = (0, _inspect.default)(value); - throw new Error("Cannot use ".concat(className, " \"").concat(stringifiedValue, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); - } - } - - return false; -}; - -exports.default = _default; diff --git a/JS/node_modules/graphql/jsutils/instanceOf.js.flow b/JS/node_modules/graphql/jsutils/instanceOf.js.flow deleted file mode 100644 index 58faa02..0000000 --- a/JS/node_modules/graphql/jsutils/instanceOf.js.flow +++ /dev/null @@ -1,52 +0,0 @@ -// @flow strict -import inspect from './inspect'; - -/** - * 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' - ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - // eslint-disable-next-line no-shadow - function instanceOf(value: mixed, constructor: mixed): boolean { - return value instanceof constructor; - } - : // eslint-disable-next-line no-shadow - function instanceOf(value: any, constructor: any): boolean { - if (value instanceof constructor) { - return true; - } - if (typeof value === 'object' && value !== null) { - const className = constructor.prototype[Symbol.toStringTag]; - const valueClassName = - // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value - ? value[Symbol.toStringTag] - : value.constructor?.name; - if (className === valueClassName) { - const stringifiedValue = inspect(value); - throw new Error( - `Cannot use ${className} "${stringifiedValue}" 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/JS/node_modules/graphql/jsutils/instanceOf.mjs b/JS/node_modules/graphql/jsutils/instanceOf.mjs deleted file mode 100644 index ff46fca..0000000 --- a/JS/node_modules/graphql/jsutils/instanceOf.mjs +++ /dev/null @@ -1,35 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -import inspect from "./inspect.mjs"; -/** - * 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' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -// 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 (_typeof(value) === 'object' && value !== null) { - var _value$constructor; - - var className = constructor.prototype[Symbol.toStringTag]; - var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library. - Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name; - - if (className === valueClassName) { - var stringifiedValue = inspect(value); - throw new Error("Cannot use ".concat(className, " \"").concat(stringifiedValue, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.")); - } - } - - return false; -}; diff --git a/JS/node_modules/graphql/jsutils/invariant.js b/JS/node_modules/graphql/jsutils/invariant.js deleted file mode 100644 index 2e9e16b..0000000 --- a/JS/node_modules/graphql/jsutils/invariant.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = invariant; - -function invariant(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message != null ? message : 'Unexpected invariant triggered.'); - } -} diff --git a/JS/node_modules/graphql/jsutils/invariant.js.flow b/JS/node_modules/graphql/jsutils/invariant.js.flow deleted file mode 100644 index 6268571..0000000 --- a/JS/node_modules/graphql/jsutils/invariant.js.flow +++ /dev/null @@ -1,10 +0,0 @@ -// @flow strict -export default function invariant(condition: mixed, message?: string): void { - const booleanCondition = Boolean(condition); - // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - if (!booleanCondition) { - throw new Error( - message != null ? message : 'Unexpected invariant triggered.', - ); - } -} diff --git a/JS/node_modules/graphql/jsutils/invariant.mjs b/JS/node_modules/graphql/jsutils/invariant.mjs deleted file mode 100644 index f1aa4a6..0000000 --- a/JS/node_modules/graphql/jsutils/invariant.mjs +++ /dev/null @@ -1,7 +0,0 @@ -export default function invariant(condition, message) { - var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js') - - if (!booleanCondition) { - throw new Error(message != null ? message : 'Unexpected invariant triggered.'); - } -} diff --git a/JS/node_modules/graphql/jsutils/isAsyncIterable.js b/JS/node_modules/graphql/jsutils/isAsyncIterable.js deleted file mode 100644 index 3f59f2b..0000000 --- a/JS/node_modules/graphql/jsutils/isAsyncIterable.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isAsyncIterable; - -var _symbols = require("../polyfills/symbols.js"); - -// eslint-disable-next-line no-redeclare -function isAsyncIterable(maybeAsyncIterable) { - return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[_symbols.SYMBOL_ASYNC_ITERATOR]) === 'function'; -} diff --git a/JS/node_modules/graphql/jsutils/isAsyncIterable.js.flow b/JS/node_modules/graphql/jsutils/isAsyncIterable.js.flow deleted file mode 100644 index e81f94e..0000000 --- a/JS/node_modules/graphql/jsutils/isAsyncIterable.js.flow +++ /dev/null @@ -1,14 +0,0 @@ -// @flow strict -import { SYMBOL_ASYNC_ITERATOR } from '../polyfills/symbols'; - -/** - * Returns true if the provided object implements the AsyncIterator protocol via - * either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. - */ -declare function isAsyncIterable(value: mixed): boolean %checks(value instanceof - AsyncIterable); - -// eslint-disable-next-line no-redeclare -export default function isAsyncIterable(maybeAsyncIterable) { - return typeof maybeAsyncIterable?.[SYMBOL_ASYNC_ITERATOR] === 'function'; -} diff --git a/JS/node_modules/graphql/jsutils/isAsyncIterable.mjs b/JS/node_modules/graphql/jsutils/isAsyncIterable.mjs deleted file mode 100644 index 444e87c..0000000 --- a/JS/node_modules/graphql/jsutils/isAsyncIterable.mjs +++ /dev/null @@ -1,10 +0,0 @@ -import { SYMBOL_ASYNC_ITERATOR } from "../polyfills/symbols.mjs"; -/** - * Returns true if the provided object implements the AsyncIterator protocol via - * either implementing a `Symbol.asyncIterator` or `"@@asyncIterator"` method. - */ - -// eslint-disable-next-line no-redeclare -export default function isAsyncIterable(maybeAsyncIterable) { - return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[SYMBOL_ASYNC_ITERATOR]) === 'function'; -} diff --git a/JS/node_modules/graphql/jsutils/isObjectLike.js b/JS/node_modules/graphql/jsutils/isObjectLike.js deleted file mode 100644 index 19c9a89..0000000 --- a/JS/node_modules/graphql/jsutils/isObjectLike.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = isObjectLike; - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * 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/JS/node_modules/graphql/jsutils/isObjectLike.js.flow b/JS/node_modules/graphql/jsutils/isObjectLike.js.flow deleted file mode 100644 index 86886ab..0000000 --- a/JS/node_modules/graphql/jsutils/isObjectLike.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @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/JS/node_modules/graphql/jsutils/isObjectLike.mjs b/JS/node_modules/graphql/jsutils/isObjectLike.mjs deleted file mode 100644 index 41dc3cd..0000000 --- a/JS/node_modules/graphql/jsutils/isObjectLike.mjs +++ /dev/null @@ -1,9 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * 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/JS/node_modules/graphql/jsutils/isPromise.js b/JS/node_modules/graphql/jsutils/isPromise.js deleted file mode 100644 index bca6ccc..0000000 --- a/JS/node_modules/graphql/jsutils/isPromise.js +++ /dev/null @@ -1,15 +0,0 @@ -"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 typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; -} diff --git a/JS/node_modules/graphql/jsutils/isPromise.js.flow b/JS/node_modules/graphql/jsutils/isPromise.js.flow deleted file mode 100644 index f5c9f75..0000000 --- a/JS/node_modules/graphql/jsutils/isPromise.js.flow +++ /dev/null @@ -1,12 +0,0 @@ -// @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 typeof value?.then === 'function'; -} diff --git a/JS/node_modules/graphql/jsutils/isPromise.mjs b/JS/node_modules/graphql/jsutils/isPromise.mjs deleted file mode 100644 index 2d9079b..0000000 --- a/JS/node_modules/graphql/jsutils/isPromise.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 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 typeof (value === null || value === void 0 ? void 0 : value.then) === 'function'; -} diff --git a/JS/node_modules/graphql/jsutils/keyMap.js b/JS/node_modules/graphql/jsutils/keyMap.js deleted file mode 100644 index c067210..0000000 --- a/JS/node_modules/graphql/jsutils/keyMap.js +++ /dev/null @@ -1,36 +0,0 @@ -"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/JS/node_modules/graphql/jsutils/keyMap.js.flow b/JS/node_modules/graphql/jsutils/keyMap.js.flow deleted file mode 100644 index b165360..0000000 --- a/JS/node_modules/graphql/jsutils/keyMap.js.flow +++ /dev/null @@ -1,35 +0,0 @@ -// @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/JS/node_modules/graphql/jsutils/keyMap.mjs b/JS/node_modules/graphql/jsutils/keyMap.mjs deleted file mode 100644 index 567dd86..0000000 --- a/JS/node_modules/graphql/jsutils/keyMap.mjs +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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/JS/node_modules/graphql/jsutils/keyValMap.js b/JS/node_modules/graphql/jsutils/keyValMap.js deleted file mode 100644 index 0b2dab5..0000000 --- a/JS/node_modules/graphql/jsutils/keyValMap.js +++ /dev/null @@ -1,30 +0,0 @@ -"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/JS/node_modules/graphql/jsutils/keyValMap.js.flow b/JS/node_modules/graphql/jsutils/keyValMap.js.flow deleted file mode 100644 index d3aa602..0000000 --- a/JS/node_modules/graphql/jsutils/keyValMap.js.flow +++ /dev/null @@ -1,30 +0,0 @@ -// @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/JS/node_modules/graphql/jsutils/keyValMap.mjs b/JS/node_modules/graphql/jsutils/keyValMap.mjs deleted file mode 100644 index 5061c66..0000000 --- a/JS/node_modules/graphql/jsutils/keyValMap.mjs +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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/JS/node_modules/graphql/jsutils/mapValue.js b/JS/node_modules/graphql/jsutils/mapValue.js deleted file mode 100644 index 77d9038..0000000 --- a/JS/node_modules/graphql/jsutils/mapValue.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = mapValue; - -var _objectEntries3 = _interopRequireDefault(require("../polyfills/objectEntries.js")); - -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); - - for (var _i2 = 0, _objectEntries2 = (0, _objectEntries3.default)(map); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var _key = _ref2[0]; - var _value = _ref2[1]; - result[_key] = fn(_value, _key); - } - - return result; -} diff --git a/JS/node_modules/graphql/jsutils/mapValue.js.flow b/JS/node_modules/graphql/jsutils/mapValue.js.flow deleted file mode 100644 index d6b5da4..0000000 --- a/JS/node_modules/graphql/jsutils/mapValue.js.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow strict -import objectEntries from '../polyfills/objectEntries'; - -import type { ObjMap } from './ObjMap'; - -/** - * 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/JS/node_modules/graphql/jsutils/mapValue.mjs b/JS/node_modules/graphql/jsutils/mapValue.mjs deleted file mode 100644 index 7992abb..0000000 --- a/JS/node_modules/graphql/jsutils/mapValue.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import objectEntries from "../polyfills/objectEntries.mjs"; - -/** - * 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); - - for (var _i2 = 0, _objectEntries2 = objectEntries(map); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var _key = _ref2[0]; - var _value = _ref2[1]; - result[_key] = fn(_value, _key); - } - - return result; -} diff --git a/JS/node_modules/graphql/jsutils/memoize3.js b/JS/node_modules/graphql/jsutils/memoize3.js deleted file mode 100644 index db98f3f..0000000 --- a/JS/node_modules/graphql/jsutils/memoize3.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = memoize3; - -/** - * Memoizes the provided three-argument function. - */ -function memoize3(fn) { - var cache0; - return 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; - }; -} diff --git a/JS/node_modules/graphql/jsutils/memoize3.js.flow b/JS/node_modules/graphql/jsutils/memoize3.js.flow deleted file mode 100644 index cd4ccd5..0000000 --- a/JS/node_modules/graphql/jsutils/memoize3.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -// @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; - - return 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; - }; -} diff --git a/JS/node_modules/graphql/jsutils/memoize3.mjs b/JS/node_modules/graphql/jsutils/memoize3.mjs deleted file mode 100644 index cfaeb77..0000000 --- a/JS/node_modules/graphql/jsutils/memoize3.mjs +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Memoizes the provided three-argument function. - */ -export default function memoize3(fn) { - var cache0; - return 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; - }; -} diff --git a/JS/node_modules/graphql/jsutils/naturalCompare.js b/JS/node_modules/graphql/jsutils/naturalCompare.js deleted file mode 100644 index bd8ef34..0000000 --- a/JS/node_modules/graphql/jsutils/naturalCompare.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = naturalCompare; - -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -function naturalCompare(aStr, bStr) { - var aIdx = 0; - var bIdx = 0; - - while (aIdx < aStr.length && bIdx < bStr.length) { - var aChar = aStr.charCodeAt(aIdx); - var bChar = bStr.charCodeAt(bIdx); - - if (isDigit(aChar) && isDigit(bChar)) { - var aNum = 0; - - do { - ++aIdx; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIdx); - } while (isDigit(aChar) && aNum > 0); - - var bNum = 0; - - do { - ++bIdx; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIdx); - } while (isDigit(bChar) && bNum > 0); - - if (aNum < bNum) { - return -1; - } - - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - - if (aChar > bChar) { - return 1; - } - - ++aIdx; - ++bIdx; - } - } - - return aStr.length - bStr.length; -} - -var DIGIT_0 = 48; -var DIGIT_9 = 57; - -function isDigit(code) { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} diff --git a/JS/node_modules/graphql/jsutils/naturalCompare.js.flow b/JS/node_modules/graphql/jsutils/naturalCompare.js.flow deleted file mode 100644 index 556e613..0000000 --- a/JS/node_modules/graphql/jsutils/naturalCompare.js.flow +++ /dev/null @@ -1,59 +0,0 @@ -// @flow strict -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -export default function naturalCompare(aStr: string, bStr: string): number { - let aIdx = 0; - let bIdx = 0; - - while (aIdx < aStr.length && bIdx < bStr.length) { - let aChar = aStr.charCodeAt(aIdx); - let bChar = bStr.charCodeAt(bIdx); - - if (isDigit(aChar) && isDigit(bChar)) { - let aNum = 0; - do { - ++aIdx; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIdx); - } while (isDigit(aChar) && aNum > 0); - - let bNum = 0; - do { - ++bIdx; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIdx); - } while (isDigit(bChar) && bNum > 0); - - if (aNum < bNum) { - return -1; - } - - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - if (aChar > bChar) { - return 1; - } - ++aIdx; - ++bIdx; - } - } - - return aStr.length - bStr.length; -} - -const DIGIT_0 = 48; -const DIGIT_9 = 57; - -function isDigit(code: number): boolean { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} diff --git a/JS/node_modules/graphql/jsutils/naturalCompare.mjs b/JS/node_modules/graphql/jsutils/naturalCompare.mjs deleted file mode 100644 index 4313627..0000000 --- a/JS/node_modules/graphql/jsutils/naturalCompare.mjs +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Returns a number indicating whether a reference string comes before, or after, - * or is the same as the given string in natural sort order. - * - * See: https://en.wikipedia.org/wiki/Natural_sort_order - * - */ -export default function naturalCompare(aStr, bStr) { - var aIdx = 0; - var bIdx = 0; - - while (aIdx < aStr.length && bIdx < bStr.length) { - var aChar = aStr.charCodeAt(aIdx); - var bChar = bStr.charCodeAt(bIdx); - - if (isDigit(aChar) && isDigit(bChar)) { - var aNum = 0; - - do { - ++aIdx; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIdx); - } while (isDigit(aChar) && aNum > 0); - - var bNum = 0; - - do { - ++bIdx; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIdx); - } while (isDigit(bChar) && bNum > 0); - - if (aNum < bNum) { - return -1; - } - - if (aNum > bNum) { - return 1; - } - } else { - if (aChar < bChar) { - return -1; - } - - if (aChar > bChar) { - return 1; - } - - ++aIdx; - ++bIdx; - } - } - - return aStr.length - bStr.length; -} -var DIGIT_0 = 48; -var DIGIT_9 = 57; - -function isDigit(code) { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} diff --git a/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js b/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js deleted file mode 100644 index 3a12833..0000000 --- a/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -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/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow b/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow deleted file mode 100644 index 114489c..0000000 --- a/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.js.flow +++ /dev/null @@ -1,8 +0,0 @@ -// @flow strict -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -const nodejsCustomInspectSymbol = - typeof Symbol === 'function' && typeof Symbol.for === 'function' - ? Symbol.for('nodejs.util.inspect.custom') - : undefined; - -export default nodejsCustomInspectSymbol; diff --git a/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs b/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs deleted file mode 100644 index afaf3e6..0000000 --- a/JS/node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs +++ /dev/null @@ -1,3 +0,0 @@ -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined; -export default nodejsCustomInspectSymbol; diff --git a/JS/node_modules/graphql/jsutils/printPathArray.js b/JS/node_modules/graphql/jsutils/printPathArray.js deleted file mode 100644 index 31224eb..0000000 --- a/JS/node_modules/graphql/jsutils/printPathArray.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = printPathArray; - -/** - * Build a string describing the path. - */ -function printPathArray(path) { - return path.map(function (key) { - return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key; - }).join(''); -} diff --git a/JS/node_modules/graphql/jsutils/printPathArray.js.flow b/JS/node_modules/graphql/jsutils/printPathArray.js.flow deleted file mode 100644 index 552a415..0000000 --- a/JS/node_modules/graphql/jsutils/printPathArray.js.flow +++ /dev/null @@ -1,13 +0,0 @@ -// @flow strict -/** - * Build a string describing the path. - */ -export default function printPathArray( - path: $ReadOnlyArray, -): string { - return path - .map((key) => - typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key, - ) - .join(''); -} diff --git a/JS/node_modules/graphql/jsutils/printPathArray.mjs b/JS/node_modules/graphql/jsutils/printPathArray.mjs deleted file mode 100644 index 6bf077a..0000000 --- a/JS/node_modules/graphql/jsutils/printPathArray.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Build a string describing the path. - */ -export default function printPathArray(path) { - return path.map(function (key) { - return typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key; - }).join(''); -} diff --git a/JS/node_modules/graphql/jsutils/promiseForObject.js b/JS/node_modules/graphql/jsutils/promiseForObject.js deleted file mode 100644 index f291f9b..0000000 --- a/JS/node_modules/graphql/jsutils/promiseForObject.js +++ /dev/null @@ -1,26 +0,0 @@ -"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/JS/node_modules/graphql/jsutils/promiseForObject.js.flow b/JS/node_modules/graphql/jsutils/promiseForObject.js.flow deleted file mode 100644 index 5c2c65b..0000000 --- a/JS/node_modules/graphql/jsutils/promiseForObject.js.flow +++ /dev/null @@ -1,22 +0,0 @@ -// @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/JS/node_modules/graphql/jsutils/promiseForObject.mjs b/JS/node_modules/graphql/jsutils/promiseForObject.mjs deleted file mode 100644 index ee36ed4..0000000 --- a/JS/node_modules/graphql/jsutils/promiseForObject.mjs +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 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/JS/node_modules/graphql/jsutils/promiseReduce.js b/JS/node_modules/graphql/jsutils/promiseReduce.js deleted file mode 100644 index 6606926..0000000 --- a/JS/node_modules/graphql/jsutils/promiseReduce.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = promiseReduce; - -var _isPromise = _interopRequireDefault(require("./isPromise.js")); - -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/JS/node_modules/graphql/jsutils/promiseReduce.js.flow b/JS/node_modules/graphql/jsutils/promiseReduce.js.flow deleted file mode 100644 index ea333bc..0000000 --- a/JS/node_modules/graphql/jsutils/promiseReduce.js.flow +++ /dev/null @@ -1,25 +0,0 @@ -// @flow strict -import type { PromiseOrValue } from './PromiseOrValue'; - -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: $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/JS/node_modules/graphql/jsutils/promiseReduce.mjs b/JS/node_modules/graphql/jsutils/promiseReduce.mjs deleted file mode 100644 index db99d5d..0000000 --- a/JS/node_modules/graphql/jsutils/promiseReduce.mjs +++ /dev/null @@ -1,16 +0,0 @@ -import isPromise from "./isPromise.mjs"; -/** - * 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/JS/node_modules/graphql/jsutils/safeArrayFrom.js b/JS/node_modules/graphql/jsutils/safeArrayFrom.js deleted file mode 100644 index 3c80dee..0000000 --- a/JS/node_modules/graphql/jsutils/safeArrayFrom.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = safeArrayFrom; - -var _symbols = require("../polyfills/symbols.js"); - -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -/** - * Safer version of `Array.from` that return `null` if value isn't convertible to array. - * Also protects against Array-like objects without items. - * - * @example - * - * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3] - * safeArrayFrom('ABC') // null - * safeArrayFrom({ length: 1 }) // null - * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha'] - * safeArrayFrom({ key: 'value' }) // null - * safeArrayFrom(new Map()) // [] - * - */ -function safeArrayFrom(collection) { - var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) { - return item; - }; - - if (collection == null || _typeof(collection) !== 'object') { - return null; - } - - if (Array.isArray(collection)) { - return collection.map(mapFn); - } // Is Iterable? - - - var iteratorMethod = collection[_symbols.SYMBOL_ITERATOR]; - - if (typeof iteratorMethod === 'function') { - // $FlowFixMe[incompatible-use] - var iterator = iteratorMethod.call(collection); - var result = []; - var step; - - for (var i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn(step.value, i)); - } - - return result; - } // Is Array like? - - - var length = collection.length; - - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - var _result = []; - - for (var _i = 0; _i < length; ++_i) { - if (!Object.prototype.hasOwnProperty.call(collection, _i)) { - return null; - } - - _result.push(mapFn(collection[String(_i)], _i)); - } - - return _result; - } - - return null; -} diff --git a/JS/node_modules/graphql/jsutils/safeArrayFrom.js.flow b/JS/node_modules/graphql/jsutils/safeArrayFrom.js.flow deleted file mode 100644 index db2bdea..0000000 --- a/JS/node_modules/graphql/jsutils/safeArrayFrom.js.flow +++ /dev/null @@ -1,59 +0,0 @@ -// @flow strict -import { SYMBOL_ITERATOR } from '../polyfills/symbols'; - -/** - * Safer version of `Array.from` that return `null` if value isn't convertible to array. - * Also protects against Array-like objects without items. - * - * @example - * - * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3] - * safeArrayFrom('ABC') // null - * safeArrayFrom({ length: 1 }) // null - * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha'] - * safeArrayFrom({ key: 'value' }) // null - * safeArrayFrom(new Map()) // [] - * - */ -export default function safeArrayFrom( - collection: mixed, - mapFn: (elem: mixed, index: number) => T = (item) => ((item: any): T), -): Array | null { - if (collection == null || typeof collection !== 'object') { - return null; - } - - if (Array.isArray(collection)) { - return collection.map(mapFn); - } - - // Is Iterable? - const iteratorMethod = collection[SYMBOL_ITERATOR]; - if (typeof iteratorMethod === 'function') { - // $FlowFixMe[incompatible-use] - const iterator = iteratorMethod.call(collection); - const result = []; - let step; - - for (let i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn(step.value, i)); - } - return result; - } - - // Is Array like? - const length = collection.length; - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - const result = []; - for (let i = 0; i < length; ++i) { - if (!Object.prototype.hasOwnProperty.call(collection, i)) { - return null; - } - result.push(mapFn(collection[String(i)], i)); - } - - return result; - } - - return null; -} diff --git a/JS/node_modules/graphql/jsutils/safeArrayFrom.mjs b/JS/node_modules/graphql/jsutils/safeArrayFrom.mjs deleted file mode 100644 index f8b357d..0000000 --- a/JS/node_modules/graphql/jsutils/safeArrayFrom.mjs +++ /dev/null @@ -1,66 +0,0 @@ -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -import { SYMBOL_ITERATOR } from "../polyfills/symbols.mjs"; -/** - * Safer version of `Array.from` that return `null` if value isn't convertible to array. - * Also protects against Array-like objects without items. - * - * @example - * - * safeArrayFrom([ 1, 2, 3 ]) // [1, 2, 3] - * safeArrayFrom('ABC') // null - * safeArrayFrom({ length: 1 }) // null - * safeArrayFrom({ length: 1, 0: 'Alpha' }) // ['Alpha'] - * safeArrayFrom({ key: 'value' }) // null - * safeArrayFrom(new Map()) // [] - * - */ - -export default function safeArrayFrom(collection) { - var mapFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (item) { - return item; - }; - - if (collection == null || _typeof(collection) !== 'object') { - return null; - } - - if (Array.isArray(collection)) { - return collection.map(mapFn); - } // Is Iterable? - - - var iteratorMethod = collection[SYMBOL_ITERATOR]; - - if (typeof iteratorMethod === 'function') { - // $FlowFixMe[incompatible-use] - var iterator = iteratorMethod.call(collection); - var result = []; - var step; - - for (var i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn(step.value, i)); - } - - return result; - } // Is Array like? - - - var length = collection.length; - - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - var _result = []; - - for (var _i = 0; _i < length; ++_i) { - if (!Object.prototype.hasOwnProperty.call(collection, _i)) { - return null; - } - - _result.push(mapFn(collection[String(_i)], _i)); - } - - return _result; - } - - return null; -} diff --git a/JS/node_modules/graphql/jsutils/suggestionList.js b/JS/node_modules/graphql/jsutils/suggestionList.js deleted file mode 100644 index 6d38ff6..0000000 --- a/JS/node_modules/graphql/jsutils/suggestionList.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = suggestionList; - -var _naturalCompare = _interopRequireDefault(require("./naturalCompare.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * 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 lexicalDistance = new LexicalDistance(input); - var threshold = Math.floor(input.length * 0.4) + 1; - - for (var _i2 = 0; _i2 < options.length; _i2++) { - var option = options[_i2]; - var distance = lexicalDistance.measure(option, threshold); - - if (distance !== undefined) { - optionsByDistance[option] = distance; - } - } - - return Object.keys(optionsByDistance).sort(function (a, b) { - var distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : (0, _naturalCompare.default)(a, 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 - */ - - -var LexicalDistance = /*#__PURE__*/function () { - function LexicalDistance(input) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)]; - } - - var _proto = LexicalDistance.prototype; - - _proto.measure = function measure(option, threshold) { - if (this._input === option) { - return 0; - } - - var optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit - - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - - var a = stringToArray(optionLowerCase); - var b = this._inputArray; - - if (a.length < b.length) { - var tmp = a; - a = b; - b = tmp; - } - - var aLength = a.length; - var bLength = b.length; - - if (aLength - bLength > threshold) { - return undefined; - } - - var rows = this._rows; - - for (var j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - - for (var i = 1; i <= aLength; i++) { - var upRow = rows[(i - 1) % 3]; - var currentRow = rows[i % 3]; - var smallestCell = currentRow[0] = i; - - for (var _j = 1; _j <= bLength; _j++) { - var cost = a[i - 1] === b[_j - 1] ? 0 : 1; - var currentCell = Math.min(upRow[_j] + 1, // delete - currentRow[_j - 1] + 1, // insert - upRow[_j - 1] + cost // substitute - ); - - if (i > 1 && _j > 1 && a[i - 1] === b[_j - 2] && a[i - 2] === b[_j - 1]) { - // transposition - var doubleDiagonalCell = rows[(i - 2) % 3][_j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - - currentRow[_j] = currentCell; - } // Early exit, since distance can't go smaller than smallest element of the previous row. - - - if (smallestCell > threshold) { - return undefined; - } - } - - var distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - }; - - return LexicalDistance; -}(); - -function stringToArray(str) { - var strLength = str.length; - var array = new Array(strLength); - - for (var i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - - return array; -} diff --git a/JS/node_modules/graphql/jsutils/suggestionList.js.flow b/JS/node_modules/graphql/jsutils/suggestionList.js.flow deleted file mode 100644 index 017e779..0000000 --- a/JS/node_modules/graphql/jsutils/suggestionList.js.flow +++ /dev/null @@ -1,138 +0,0 @@ -// @flow strict -import naturalCompare from './naturalCompare'; - -/** - * 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 lexicalDistance = new LexicalDistance(input); - - const threshold = Math.floor(input.length * 0.4) + 1; - for (const option of options) { - const distance = lexicalDistance.measure(option, threshold); - if (distance !== undefined) { - optionsByDistance[option] = distance; - } - } - - return Object.keys(optionsByDistance).sort((a, b) => { - const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, 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 - */ -class LexicalDistance { - _input: string; - _inputLowerCase: string; - _inputArray: Array; - _rows: [Array, Array, Array]; - - constructor(input: string) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - - this._rows = [ - new Array(input.length + 1).fill(0), - new Array(input.length + 1).fill(0), - new Array(input.length + 1).fill(0), - ]; - } - - measure(option: string, threshold: number): number | void { - if (this._input === option) { - return 0; - } - - const optionLowerCase = option.toLowerCase(); - - // Any case change counts as a single edit - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - - let a = stringToArray(optionLowerCase); - let b = this._inputArray; - - if (a.length < b.length) { - const tmp = a; - a = b; - b = tmp; - } - const aLength = a.length; - const bLength = b.length; - - if (aLength - bLength > threshold) { - return undefined; - } - - const rows = this._rows; - for (let j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - - for (let i = 1; i <= aLength; i++) { - const upRow = rows[(i - 1) % 3]; - const currentRow = rows[i % 3]; - - let smallestCell = (currentRow[0] = i); - for (let j = 1; j <= bLength; j++) { - const cost = a[i - 1] === b[j - 1] ? 0 : 1; - - let currentCell = Math.min( - upRow[j] + 1, // delete - currentRow[j - 1] + 1, // insert - upRow[j - 1] + cost, // substitute - ); - - if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { - // transposition - const doubleDiagonalCell = rows[(i - 2) % 3][j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - - currentRow[j] = currentCell; - } - - // Early exit, since distance can't go smaller than smallest element of the previous row. - if (smallestCell > threshold) { - return undefined; - } - } - - const distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - } -} - -function stringToArray(str: string): Array { - const strLength = str.length; - const array = new Array(strLength); - for (let i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - return array; -} diff --git a/JS/node_modules/graphql/jsutils/suggestionList.mjs b/JS/node_modules/graphql/jsutils/suggestionList.mjs deleted file mode 100644 index 154560a..0000000 --- a/JS/node_modules/graphql/jsutils/suggestionList.mjs +++ /dev/null @@ -1,131 +0,0 @@ -import naturalCompare from "./naturalCompare.mjs"; -/** - * 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 lexicalDistance = new LexicalDistance(input); - var threshold = Math.floor(input.length * 0.4) + 1; - - for (var _i2 = 0; _i2 < options.length; _i2++) { - var option = options[_i2]; - var distance = lexicalDistance.measure(option, threshold); - - if (distance !== undefined) { - optionsByDistance[option] = distance; - } - } - - return Object.keys(optionsByDistance).sort(function (a, b) { - var distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, 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 - */ - -var LexicalDistance = /*#__PURE__*/function () { - function LexicalDistance(input) { - this._input = input; - this._inputLowerCase = input.toLowerCase(); - this._inputArray = stringToArray(this._inputLowerCase); - this._rows = [new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0), new Array(input.length + 1).fill(0)]; - } - - var _proto = LexicalDistance.prototype; - - _proto.measure = function measure(option, threshold) { - if (this._input === option) { - return 0; - } - - var optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit - - if (this._inputLowerCase === optionLowerCase) { - return 1; - } - - var a = stringToArray(optionLowerCase); - var b = this._inputArray; - - if (a.length < b.length) { - var tmp = a; - a = b; - b = tmp; - } - - var aLength = a.length; - var bLength = b.length; - - if (aLength - bLength > threshold) { - return undefined; - } - - var rows = this._rows; - - for (var j = 0; j <= bLength; j++) { - rows[0][j] = j; - } - - for (var i = 1; i <= aLength; i++) { - var upRow = rows[(i - 1) % 3]; - var currentRow = rows[i % 3]; - var smallestCell = currentRow[0] = i; - - for (var _j = 1; _j <= bLength; _j++) { - var cost = a[i - 1] === b[_j - 1] ? 0 : 1; - var currentCell = Math.min(upRow[_j] + 1, // delete - currentRow[_j - 1] + 1, // insert - upRow[_j - 1] + cost // substitute - ); - - if (i > 1 && _j > 1 && a[i - 1] === b[_j - 2] && a[i - 2] === b[_j - 1]) { - // transposition - var doubleDiagonalCell = rows[(i - 2) % 3][_j - 2]; - currentCell = Math.min(currentCell, doubleDiagonalCell + 1); - } - - if (currentCell < smallestCell) { - smallestCell = currentCell; - } - - currentRow[_j] = currentCell; - } // Early exit, since distance can't go smaller than smallest element of the previous row. - - - if (smallestCell > threshold) { - return undefined; - } - } - - var distance = rows[aLength % 3][bLength]; - return distance <= threshold ? distance : undefined; - }; - - return LexicalDistance; -}(); - -function stringToArray(str) { - var strLength = str.length; - var array = new Array(strLength); - - for (var i = 0; i < strLength; ++i) { - array[i] = str.charCodeAt(i); - } - - return array; -} diff --git a/JS/node_modules/graphql/jsutils/toObjMap.js b/JS/node_modules/graphql/jsutils/toObjMap.js deleted file mode 100644 index 1768d74..0000000 --- a/JS/node_modules/graphql/jsutils/toObjMap.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = toObjMap; - -var _objectEntries3 = _interopRequireDefault(require("../polyfills/objectEntries.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function toObjMap(obj) { - /* eslint-enable no-redeclare */ - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - - var map = Object.create(null); - - for (var _i2 = 0, _objectEntries2 = (0, _objectEntries3.default)(obj); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var key = _ref2[0]; - var value = _ref2[1]; - map[key] = value; - } - - return map; -} diff --git a/JS/node_modules/graphql/jsutils/toObjMap.js.flow b/JS/node_modules/graphql/jsutils/toObjMap.js.flow deleted file mode 100644 index 81c1113..0000000 --- a/JS/node_modules/graphql/jsutils/toObjMap.js.flow +++ /dev/null @@ -1,26 +0,0 @@ -// @flow strict -import objectEntries from '../polyfills/objectEntries'; - -import type { - ObjMap, - ObjMapLike, - ReadOnlyObjMap, - ReadOnlyObjMapLike, -} from './ObjMap'; - -/* eslint-disable no-redeclare */ -declare function toObjMap(obj: ObjMapLike): ObjMap; -declare function toObjMap(obj: ReadOnlyObjMapLike): ReadOnlyObjMap; - -export default function toObjMap(obj) { - /* eslint-enable no-redeclare */ - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - - const map = Object.create(null); - for (const [key, value] of objectEntries(obj)) { - map[key] = value; - } - return map; -} diff --git a/JS/node_modules/graphql/jsutils/toObjMap.mjs b/JS/node_modules/graphql/jsutils/toObjMap.mjs deleted file mode 100644 index b0ddf05..0000000 --- a/JS/node_modules/graphql/jsutils/toObjMap.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import objectEntries from "../polyfills/objectEntries.mjs"; -export default function toObjMap(obj) { - /* eslint-enable no-redeclare */ - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - - var map = Object.create(null); - - for (var _i2 = 0, _objectEntries2 = objectEntries(obj); _i2 < _objectEntries2.length; _i2++) { - var _ref2 = _objectEntries2[_i2]; - var key = _ref2[0]; - var value = _ref2[1]; - map[key] = value; - } - - return map; -} diff --git a/JS/node_modules/graphql/language/ast.d.ts b/JS/node_modules/graphql/language/ast.d.ts deleted file mode 100644 index 61cb9f4..0000000 --- a/JS/node_modules/graphql/language/ast.d.ts +++ /dev/null @@ -1,602 +0,0 @@ -import { Source } from './source'; -import { 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 class Location { - /** - * The character offset at which this Node begins. - */ - readonly start: number; - - /** - * The character offset at which this Node ends. - */ - readonly end: number; - - /** - * The Token at which this Node begins. - */ - readonly startToken: Token; - - /** - * The Token at which this Node ends. - */ - readonly endToken: Token; - - /** - * The Source document the AST represents. - */ - readonly source: Source; - - constructor(startToken: Token, endToken: Token, source: Source); - - toJSON(): { start: number; end: number }; -} - -/** - * Represents a range of characters represented by a lexical token - * within a Source. - */ -export class Token { - /** - * The kind of Token. - */ - readonly kind: TokenKindEnum; - - /** - * The character offset at which this Node begins. - */ - readonly start: number; - - /** - * The character offset at which this Node ends. - */ - readonly end: number; - - /** - * The 1-indexed line number on which this Token appears. - */ - readonly line: number; - - /** - * The 1-indexed column number at which this Token begins. - */ - readonly column: number; - - /** - * For non-punctuation tokens, represents the interpreted value of the token. - */ - readonly value: string | undefined; - - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - readonly prev: Token | null; - readonly next: Token | null; - - constructor( - kind: TokenKindEnum, - start: number, - end: number, - line: number, - column: number, - prev: Token | null, - value?: string, - ); - - toJSON(): { - kind: TokenKindEnum; - value: string | undefined; - line: number; - column: number; - }; -} - -/** - * @internal - */ -export function isNode(maybeNode: any): maybeNode is ASTNode; - -/** - * 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 interface 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 interface NameNode { - readonly kind: 'Name'; - readonly loc?: Location; - readonly value: string; -} - -// Document - -export interface DocumentNode { - readonly kind: 'Document'; - readonly loc?: Location; - readonly definitions: ReadonlyArray; -} - -export type DefinitionNode = - | ExecutableDefinitionNode - | TypeSystemDefinitionNode - | TypeSystemExtensionNode; - -export type ExecutableDefinitionNode = - | OperationDefinitionNode - | FragmentDefinitionNode; - -export interface OperationDefinitionNode { - readonly kind: 'OperationDefinition'; - readonly loc?: Location; - readonly operation: OperationTypeNode; - readonly name?: NameNode; - readonly variableDefinitions?: ReadonlyArray; - readonly directives?: ReadonlyArray; - readonly selectionSet: SelectionSetNode; -} - -export type OperationTypeNode = 'query' | 'mutation' | 'subscription'; - -export interface VariableDefinitionNode { - readonly kind: 'VariableDefinition'; - readonly loc?: Location; - readonly variable: VariableNode; - readonly type: TypeNode; - readonly defaultValue?: ValueNode; - readonly directives?: ReadonlyArray; -} - -export interface VariableNode { - readonly kind: 'Variable'; - readonly loc?: Location; - readonly name: NameNode; -} - -export interface SelectionSetNode { - kind: 'SelectionSet'; - loc?: Location; - selections: ReadonlyArray; -} - -export type SelectionNode = FieldNode | FragmentSpreadNode | InlineFragmentNode; - -export interface FieldNode { - readonly kind: 'Field'; - readonly loc?: Location; - readonly alias?: NameNode; - readonly name: NameNode; - readonly arguments?: ReadonlyArray; - readonly directives?: ReadonlyArray; - readonly selectionSet?: SelectionSetNode; -} - -export interface ArgumentNode { - readonly kind: 'Argument'; - readonly loc?: Location; - readonly name: NameNode; - readonly value: ValueNode; -} - -// Fragments - -export interface FragmentSpreadNode { - readonly kind: 'FragmentSpread'; - readonly loc?: Location; - readonly name: NameNode; - readonly directives?: ReadonlyArray; -} - -export interface InlineFragmentNode { - readonly kind: 'InlineFragment'; - readonly loc?: Location; - readonly typeCondition?: NamedTypeNode; - readonly directives?: ReadonlyArray; - readonly selectionSet: SelectionSetNode; -} - -export interface FragmentDefinitionNode { - readonly kind: 'FragmentDefinition'; - readonly loc?: Location; - readonly name: NameNode; - // Note: fragment variable definitions are experimental and may be changed - // or removed in the future. - readonly variableDefinitions?: ReadonlyArray; - readonly typeCondition: NamedTypeNode; - readonly directives?: ReadonlyArray; - readonly selectionSet: SelectionSetNode; -} - -// Values - -export type ValueNode = - | VariableNode - | IntValueNode - | FloatValueNode - | StringValueNode - | BooleanValueNode - | NullValueNode - | EnumValueNode - | ListValueNode - | ObjectValueNode; - -export interface IntValueNode { - readonly kind: 'IntValue'; - readonly loc?: Location; - readonly value: string; -} - -export interface FloatValueNode { - readonly kind: 'FloatValue'; - readonly loc?: Location; - readonly value: string; -} - -export interface StringValueNode { - readonly kind: 'StringValue'; - readonly loc?: Location; - readonly value: string; - readonly block?: boolean; -} - -export interface BooleanValueNode { - readonly kind: 'BooleanValue'; - readonly loc?: Location; - readonly value: boolean; -} - -export interface NullValueNode { - readonly kind: 'NullValue'; - readonly loc?: Location; -} - -export interface EnumValueNode { - readonly kind: 'EnumValue'; - readonly loc?: Location; - readonly value: string; -} - -export interface ListValueNode { - readonly kind: 'ListValue'; - readonly loc?: Location; - readonly values: ReadonlyArray; -} - -export interface ObjectValueNode { - readonly kind: 'ObjectValue'; - readonly loc?: Location; - readonly fields: ReadonlyArray; -} - -export interface ObjectFieldNode { - readonly kind: 'ObjectField'; - readonly loc?: Location; - readonly name: NameNode; - readonly value: ValueNode; -} - -// Directives - -export interface DirectiveNode { - readonly kind: 'Directive'; - readonly loc?: Location; - readonly name: NameNode; - readonly arguments?: ReadonlyArray; -} - -// Type Reference - -export type TypeNode = NamedTypeNode | ListTypeNode | NonNullTypeNode; - -export interface NamedTypeNode { - readonly kind: 'NamedType'; - readonly loc?: Location; - readonly name: NameNode; -} - -export interface ListTypeNode { - readonly kind: 'ListType'; - readonly loc?: Location; - readonly type: TypeNode; -} - -export interface NonNullTypeNode { - readonly kind: 'NonNullType'; - readonly loc?: Location; - readonly type: NamedTypeNode | ListTypeNode; -} - -// Type System Definition - -export type TypeSystemDefinitionNode = - | SchemaDefinitionNode - | TypeDefinitionNode - | DirectiveDefinitionNode; - -export interface SchemaDefinitionNode { - readonly kind: 'SchemaDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly directives?: ReadonlyArray; - readonly operationTypes: ReadonlyArray; -} - -export interface OperationTypeDefinitionNode { - readonly kind: 'OperationTypeDefinition'; - readonly loc?: Location; - readonly operation: OperationTypeNode; - readonly type: NamedTypeNode; -} - -// Type Definition - -export type TypeDefinitionNode = - | ScalarTypeDefinitionNode - | ObjectTypeDefinitionNode - | InterfaceTypeDefinitionNode - | UnionTypeDefinitionNode - | EnumTypeDefinitionNode - | InputObjectTypeDefinitionNode; - -export interface ScalarTypeDefinitionNode { - readonly kind: 'ScalarTypeDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly directives?: ReadonlyArray; -} - -export interface ObjectTypeDefinitionNode { - readonly kind: 'ObjectTypeDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly interfaces?: ReadonlyArray; - readonly directives?: ReadonlyArray; - readonly fields?: ReadonlyArray; -} - -export interface FieldDefinitionNode { - readonly kind: 'FieldDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly arguments?: ReadonlyArray; - readonly type: TypeNode; - readonly directives?: ReadonlyArray; -} - -export interface InputValueDefinitionNode { - readonly kind: 'InputValueDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly type: TypeNode; - readonly defaultValue?: ValueNode; - readonly directives?: ReadonlyArray; -} - -export interface InterfaceTypeDefinitionNode { - readonly kind: 'InterfaceTypeDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly interfaces?: ReadonlyArray; - readonly directives?: ReadonlyArray; - readonly fields?: ReadonlyArray; -} - -export interface UnionTypeDefinitionNode { - readonly kind: 'UnionTypeDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly directives?: ReadonlyArray; - readonly types?: ReadonlyArray; -} - -export interface EnumTypeDefinitionNode { - readonly kind: 'EnumTypeDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly directives?: ReadonlyArray; - readonly values?: ReadonlyArray; -} - -export interface EnumValueDefinitionNode { - readonly kind: 'EnumValueDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly directives?: ReadonlyArray; -} - -export interface InputObjectTypeDefinitionNode { - readonly kind: 'InputObjectTypeDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly directives?: ReadonlyArray; - readonly fields?: ReadonlyArray; -} - -// Directive Definitions - -export interface DirectiveDefinitionNode { - readonly kind: 'DirectiveDefinition'; - readonly loc?: Location; - readonly description?: StringValueNode; - readonly name: NameNode; - readonly arguments?: ReadonlyArray; - readonly repeatable: boolean; - readonly locations: ReadonlyArray; -} - -// Type System Extensions - -export type TypeSystemExtensionNode = SchemaExtensionNode | TypeExtensionNode; - -export interface SchemaExtensionNode { - readonly kind: 'SchemaExtension'; - readonly loc?: Location; - readonly directives?: ReadonlyArray; - readonly operationTypes?: ReadonlyArray; -} - -// Type Extensions - -export type TypeExtensionNode = - | ScalarTypeExtensionNode - | ObjectTypeExtensionNode - | InterfaceTypeExtensionNode - | UnionTypeExtensionNode - | EnumTypeExtensionNode - | InputObjectTypeExtensionNode; - -export interface ScalarTypeExtensionNode { - readonly kind: 'ScalarTypeExtension'; - readonly loc?: Location; - readonly name: NameNode; - readonly directives?: ReadonlyArray; -} - -export interface ObjectTypeExtensionNode { - readonly kind: 'ObjectTypeExtension'; - readonly loc?: Location; - readonly name: NameNode; - readonly interfaces?: ReadonlyArray; - readonly directives?: ReadonlyArray; - readonly fields?: ReadonlyArray; -} - -export interface InterfaceTypeExtensionNode { - readonly kind: 'InterfaceTypeExtension'; - readonly loc?: Location; - readonly name: NameNode; - readonly interfaces?: ReadonlyArray; - readonly directives?: ReadonlyArray; - readonly fields?: ReadonlyArray; -} - -export interface UnionTypeExtensionNode { - readonly kind: 'UnionTypeExtension'; - readonly loc?: Location; - readonly name: NameNode; - readonly directives?: ReadonlyArray; - readonly types?: ReadonlyArray; -} - -export interface EnumTypeExtensionNode { - readonly kind: 'EnumTypeExtension'; - readonly loc?: Location; - readonly name: NameNode; - readonly directives?: ReadonlyArray; - readonly values?: ReadonlyArray; -} - -export interface InputObjectTypeExtensionNode { - readonly kind: 'InputObjectTypeExtension'; - readonly loc?: Location; - readonly name: NameNode; - readonly directives?: ReadonlyArray; - readonly fields?: ReadonlyArray; -} diff --git a/JS/node_modules/graphql/language/ast.js b/JS/node_modules/graphql/language/ast.js deleted file mode 100644 index 3f8eef2..0000000 --- a/JS/node_modules/graphql/language/ast.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isNode = isNode; -exports.Token = exports.Location = void 0; - -var _defineInspect = _interopRequireDefault(require("../jsutils/defineInspect.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Contains a range of UTF-8 character offsets and token references that - * identify the region of the source from which the AST derived. - */ -var Location = /*#__PURE__*/function () { - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The Token at which this Node begins. - */ - - /** - * The Token at which this Node ends. - */ - - /** - * The Source document the AST represents. - */ - function Location(startToken, endToken, source) { - this.start = startToken.start; - this.end = endToken.end; - this.startToken = startToken; - this.endToken = endToken; - this.source = source; - } - - var _proto = Location.prototype; - - _proto.toJSON = function toJSON() { - return { - start: this.start, - end: this.end - }; - }; - - return Location; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.Location = Location; -(0, _defineInspect.default)(Location); -/** - * Represents a range of characters represented by a lexical token - * within a Source. - */ - -var Token = /*#__PURE__*/function () { - /** - * The kind of Token. - */ - - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The 1-indexed line number on which this Token appears. - */ - - /** - * The 1-indexed column number at which this Token begins. - */ - - /** - * For non-punctuation tokens, represents the interpreted value of the token. - */ - - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - function Token(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; - } - - var _proto2 = Token.prototype; - - _proto2.toJSON = function toJSON() { - return { - kind: this.kind, - value: this.value, - line: this.line, - column: this.column - }; - }; - - return Token; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.Token = Token; -(0, _defineInspect.default)(Token); -/** - * @internal - */ - -function isNode(maybeNode) { - return maybeNode != null && typeof maybeNode.kind === 'string'; -} -/** - * The list of all possible AST node types. - */ diff --git a/JS/node_modules/graphql/language/ast.js.flow b/JS/node_modules/graphql/language/ast.js.flow deleted file mode 100644 index 42ea6e3..0000000 --- a/JS/node_modules/graphql/language/ast.js.flow +++ /dev/null @@ -1,637 +0,0 @@ -// @flow strict -import defineInspect from '../jsutils/defineInspect'; - -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 class 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; - - constructor(startToken: Token, endToken: Token, source: Source) { - this.start = startToken.start; - this.end = endToken.end; - this.startToken = startToken; - this.endToken = endToken; - this.source = source; - } - - toJSON(): {| start: number, end: number |} { - return { start: this.start, end: this.end }; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(Location); - -/** - * Represents a range of characters represented by a lexical token - * within a Source. - */ -export class 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; - - constructor( - 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; - } - - toJSON(): {| - kind: TokenKindEnum, - value: string | void, - line: number, - column: number, - |} { - return { - kind: this.kind, - value: this.value, - line: this.line, - column: this.column, - }; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(Token); - -/** - * @internal - */ -export function isNode(maybeNode: mixed): boolean %checks { - return maybeNode != null && typeof maybeNode.kind === 'string'; -} - -/** - * 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, - +description?: StringValueNode, - +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, - +interfaces?: $ReadOnlyArray, - +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, - +interfaces?: $ReadOnlyArray, - +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/JS/node_modules/graphql/language/ast.mjs b/JS/node_modules/graphql/language/ast.mjs deleted file mode 100644 index 6085488..0000000 --- a/JS/node_modules/graphql/language/ast.mjs +++ /dev/null @@ -1,118 +0,0 @@ -import defineInspect from "../jsutils/defineInspect.mjs"; - -/** - * Contains a range of UTF-8 character offsets and token references that - * identify the region of the source from which the AST derived. - */ -export var Location = /*#__PURE__*/function () { - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The Token at which this Node begins. - */ - - /** - * The Token at which this Node ends. - */ - - /** - * The Source document the AST represents. - */ - function Location(startToken, endToken, source) { - this.start = startToken.start; - this.end = endToken.end; - this.startToken = startToken; - this.endToken = endToken; - this.source = source; - } - - var _proto = Location.prototype; - - _proto.toJSON = function toJSON() { - return { - start: this.start, - end: this.end - }; - }; - - return Location; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(Location); -/** - * Represents a range of characters represented by a lexical token - * within a Source. - */ - -export var Token = /*#__PURE__*/function () { - /** - * The kind of Token. - */ - - /** - * The character offset at which this Node begins. - */ - - /** - * The character offset at which this Node ends. - */ - - /** - * The 1-indexed line number on which this Token appears. - */ - - /** - * The 1-indexed column number at which this Token begins. - */ - - /** - * For non-punctuation tokens, represents the interpreted value of the token. - */ - - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - */ - function Token(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; - } - - var _proto2 = Token.prototype; - - _proto2.toJSON = function toJSON() { - return { - kind: this.kind, - value: this.value, - line: this.line, - column: this.column - }; - }; - - return Token; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(Token); -/** - * @internal - */ - -export function isNode(maybeNode) { - return maybeNode != null && typeof maybeNode.kind === 'string'; -} -/** - * The list of all possible AST node types. - */ diff --git a/JS/node_modules/graphql/language/blockString.d.ts b/JS/node_modules/graphql/language/blockString.d.ts deleted file mode 100644 index 70ffc66..0000000 --- a/JS/node_modules/graphql/language/blockString.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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; - -/** - * @internal - */ -export function getBlockStringIndentation(body: string): number; - -/** - * 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, -): string; diff --git a/JS/node_modules/graphql/language/blockString.js b/JS/node_modules/graphql/language/blockString.js deleted file mode 100644 index a195041..0000000 --- a/JS/node_modules/graphql/language/blockString.js +++ /dev/null @@ -1,134 +0,0 @@ -"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. - * - * @internal - */ -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(rawString); - - if (commonIndent !== 0) { - for (var i = 1; i < lines.length; i++) { - lines[i] = lines[i].slice(commonIndent); - } - } // Remove leading and trailing blank lines. - - - var startLine = 0; - - while (startLine < lines.length && isBlank(lines[startLine])) { - ++startLine; - } - - var endLine = lines.length; - - while (endLine > startLine && isBlank(lines[endLine - 1])) { - --endLine; - } // Return a string of the lines joined with U+000A. - - - return lines.slice(startLine, endLine).join('\n'); -} - -function isBlank(str) { - for (var i = 0; i < str.length; ++i) { - if (str[i] !== ' ' && str[i] !== '\t') { - return false; - } - } - - return true; -} -/** - * @internal - */ - - -function getBlockStringIndentation(value) { - var _commonIndent; - - var isFirstLine = true; - var isEmptyLine = true; - var indent = 0; - var commonIndent = null; - - for (var i = 0; i < value.length; ++i) { - switch (value.charCodeAt(i)) { - case 13: - // \r - if (value.charCodeAt(i + 1) === 10) { - ++i; // skip \r\n as one symbol - } - - // falls through - - case 10: - // \n - isFirstLine = false; - isEmptyLine = true; - indent = 0; - break; - - case 9: // \t - - case 32: - // - ++indent; - break; - - default: - if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) { - commonIndent = indent; - } - - isEmptyLine = false; - } - } - - return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0; -} -/** - * 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. - * - * @internal - */ - - -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 hasTrailingSlash = value[value.length - 1] === '\\'; - var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || 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/JS/node_modules/graphql/language/blockString.js.flow b/JS/node_modules/graphql/language/blockString.js.flow deleted file mode 100644 index 2c967c3..0000000 --- a/JS/node_modules/graphql/language/blockString.js.flow +++ /dev/null @@ -1,121 +0,0 @@ -// @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. - * - * @internal - */ -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(rawString); - - if (commonIndent !== 0) { - for (let i = 1; i < lines.length; i++) { - lines[i] = lines[i].slice(commonIndent); - } - } - - // Remove leading and trailing blank lines. - let startLine = 0; - while (startLine < lines.length && isBlank(lines[startLine])) { - ++startLine; - } - - let endLine = lines.length; - while (endLine > startLine && isBlank(lines[endLine - 1])) { - --endLine; - } - - // Return a string of the lines joined with U+000A. - return lines.slice(startLine, endLine).join('\n'); -} - -function isBlank(str: string): boolean { - for (let i = 0; i < str.length; ++i) { - if (str[i] !== ' ' && str[i] !== '\t') { - return false; - } - } - - return true; -} - -/** - * @internal - */ -export function getBlockStringIndentation(value: string): number { - let isFirstLine = true; - let isEmptyLine = true; - let indent = 0; - let commonIndent = null; - - for (let i = 0; i < value.length; ++i) { - switch (value.charCodeAt(i)) { - case 13: // \r - if (value.charCodeAt(i + 1) === 10) { - ++i; // skip \r\n as one symbol - } - // falls through - case 10: // \n - isFirstLine = false; - isEmptyLine = true; - indent = 0; - break; - case 9: // \t - case 32: // - ++indent; - break; - default: - if ( - isEmptyLine && - !isFirstLine && - (commonIndent === null || indent < commonIndent) - ) { - commonIndent = indent; - } - isEmptyLine = false; - } - } - - return commonIndent ?? 0; -} - -/** - * 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. - * - * @internal - */ -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 hasTrailingSlash = value[value.length - 1] === '\\'; - const printAsMultipleLines = - !isSingleLine || - hasTrailingQuote || - hasTrailingSlash || - 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/JS/node_modules/graphql/language/blockString.mjs b/JS/node_modules/graphql/language/blockString.mjs deleted file mode 100644 index 9ee1098..0000000 --- a/JS/node_modules/graphql/language/blockString.mjs +++ /dev/null @@ -1,124 +0,0 @@ -/** - * 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. - * - * @internal - */ -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(rawString); - - if (commonIndent !== 0) { - for (var i = 1; i < lines.length; i++) { - lines[i] = lines[i].slice(commonIndent); - } - } // Remove leading and trailing blank lines. - - - var startLine = 0; - - while (startLine < lines.length && isBlank(lines[startLine])) { - ++startLine; - } - - var endLine = lines.length; - - while (endLine > startLine && isBlank(lines[endLine - 1])) { - --endLine; - } // Return a string of the lines joined with U+000A. - - - return lines.slice(startLine, endLine).join('\n'); -} - -function isBlank(str) { - for (var i = 0; i < str.length; ++i) { - if (str[i] !== ' ' && str[i] !== '\t') { - return false; - } - } - - return true; -} -/** - * @internal - */ - - -export function getBlockStringIndentation(value) { - var _commonIndent; - - var isFirstLine = true; - var isEmptyLine = true; - var indent = 0; - var commonIndent = null; - - for (var i = 0; i < value.length; ++i) { - switch (value.charCodeAt(i)) { - case 13: - // \r - if (value.charCodeAt(i + 1) === 10) { - ++i; // skip \r\n as one symbol - } - - // falls through - - case 10: - // \n - isFirstLine = false; - isEmptyLine = true; - indent = 0; - break; - - case 9: // \t - - case 32: - // - ++indent; - break; - - default: - if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) { - commonIndent = indent; - } - - isEmptyLine = false; - } - } - - return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0; -} -/** - * 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. - * - * @internal - */ - -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 hasTrailingSlash = value[value.length - 1] === '\\'; - var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || 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/JS/node_modules/graphql/language/directiveLocation.d.ts b/JS/node_modules/graphql/language/directiveLocation.d.ts deleted file mode 100644 index 225e129..0000000 --- a/JS/node_modules/graphql/language/directiveLocation.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * The set of allowed directive location values. - */ -export const DirectiveLocation: { - // 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 = typeof DirectiveLocation[keyof typeof DirectiveLocation]; diff --git a/JS/node_modules/graphql/language/directiveLocation.js b/JS/node_modules/graphql/language/directiveLocation.js deleted file mode 100644 index 57bb417..0000000 --- a/JS/node_modules/graphql/language/directiveLocation.js +++ /dev/null @@ -1,38 +0,0 @@ -"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/JS/node_modules/graphql/language/directiveLocation.js.flow b/JS/node_modules/graphql/language/directiveLocation.js.flow deleted file mode 100644 index 3534059..0000000 --- a/JS/node_modules/graphql/language/directiveLocation.js.flow +++ /dev/null @@ -1,32 +0,0 @@ -// @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/JS/node_modules/graphql/language/directiveLocation.mjs b/JS/node_modules/graphql/language/directiveLocation.mjs deleted file mode 100644 index 82823b7..0000000 --- a/JS/node_modules/graphql/language/directiveLocation.mjs +++ /dev/null @@ -1,29 +0,0 @@ -/** - * 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/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.d.ts b/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.d.ts deleted file mode 100644 index 6e71a66..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.d.ts +++ /dev/null @@ -1,1006 +0,0 @@ -export interface GraphQLGrammarType { - [name: string]: GraphQLGrammarRule; -} - -export type GraphQLGrammarRule = - | GraphQLGrammarRuleName - | GraphQLGrammarRuleConstraint - | GraphQLGrammarConstraintsSet; - -export type GraphQLGrammarRuleName = string; - -export type GraphQLGrammarRuleConstraint = - | GraphQLGrammarTokenConstraint - | GraphQLGrammarOfTypeConstraint - | GraphQLGrammarListOfTypeConstraint - | GraphQLGrammarPeekConstraint; - -export type GraphQLGrammarConstraintsSet = Array< - GraphQLGrammarRuleName | GraphQLGrammarRuleConstraint ->; - -export interface GraphQLGrammarBaseRuleConstraint { - butNot?: GraphQLGrammarTokenConstraint | Array; - optional?: boolean; - eatNextOnFail?: boolean; -} - -export interface GraphQLGrammarTokenConstraint - extends GraphQLGrammarBaseRuleConstraint { - token: - | '!' - | '$' - | '&' - | '(' - | ')' - | '...' - | ':' - | '=' - | '@' - | '[' - | ']' - | '{' - | '}' - | '|' - | 'Name' - | 'Int' - | 'Float' - | 'String' - | 'BlockString' - | 'Comment'; - ofValue?: string; - oneOf?: Array; - tokenName?: string; - definitionName?: boolean; - typeName?: boolean; -} - -export interface GraphQLGrammarOfTypeConstraint - extends GraphQLGrammarBaseRuleConstraint { - ofType: GraphQLGrammarRule; - tokenName?: string; -} - -export interface GraphQLGrammarListOfTypeConstraint - extends GraphQLGrammarBaseRuleConstraint { - listOfType: GraphQLGrammarRuleName; -} - -export interface GraphQLGrammarPeekConstraint - extends GraphQLGrammarBaseRuleConstraint { - peek: Array; -} - -export interface GraphQLGrammarPeekConstraintCondition { - ifCondition: GraphQLGrammarTokenConstraint; - expect: GraphQLGrammarRule; - end?: boolean; -} - -const grammar: GraphQLGrammarType = { - Name: { token: 'Name' }, - String: { token: 'String' }, - BlockString: { token: 'BlockString' }, - - Document: { listOfType: 'Definition' }, - Definition: { - peek: [ - { - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - }, - expect: 'OperationDefinition', - }, - { - ifCondition: { token: 'Name', ofValue: 'fragment' }, - expect: 'FragmentDefinition', - }, - { - ifCondition: { - token: 'Name', - oneOf: [ - 'schema', - 'scalar', - 'type', - 'interface', - 'union', - 'enum', - 'input', - 'directive', - ], - }, - expect: 'TypeSystemDefinition', - }, - { - ifCondition: { token: 'Name', ofValue: 'extend' }, - expect: 'TypeSystemExtension', - }, - { - ifCondition: { token: '{' }, - expect: 'OperationDefinition', - }, - { - ifCondition: 'String', - expect: 'TypeSystemDefinition', - }, - { - ifCondition: 'BlockString', - expect: 'TypeSystemDefinition', - }, - ], - }, - - OperationDefinition: { - peek: [ - { - ifCondition: { token: '{' }, - expect: 'SelectionSet', - }, - { - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - }, - expect: [ - 'OperationType', - { - token: 'Name', - optional: true, - tokenName: 'OperationName', - definitionName: true, - }, - { ofType: 'VariableDefinitions', optional: true }, - { ofType: 'Directives', optional: true }, - 'SelectionSet', - ], - }, - ], - }, - OperationType: { - ofType: 'OperationTypeName', - }, - OperationTypeName: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - definitionName: true, - }, - SelectionSet: [{ token: '{' }, { listOfType: 'Selection' }, { token: '}' }], - Selection: { - peek: [ - { - ifCondition: { token: '...' }, - expect: 'Fragment', - }, - { - ifCondition: { token: 'Name' }, - expect: 'Field', - }, - ], - }, - - Field: [ - { - ofType: 'Alias', - optional: true, - eatNextOnFail: true, - definitionName: true, - }, - { token: 'Name', tokenName: 'FieldName', definitionName: true }, - { ofType: 'Arguments', optional: true }, - { ofType: 'Directives', optional: true }, - { ofType: 'SelectionSet', optional: true }, - ], - - Arguments: [{ token: '(' }, { listOfType: 'Argument' }, { token: ')' }], - Argument: [ - { token: 'Name', tokenName: 'ArgumentName', definitionName: true }, - { token: ':' }, - 'Value', - ], - - Alias: [ - { token: 'Name', tokenName: 'AliasName', definitionName: true }, - { token: ':' }, - ], - - Fragment: [ - { token: '...' }, - { - peek: [ - { - ifCondition: 'FragmentName', - expect: 'FragmentSpread', - }, - { - ifCondition: { token: 'Name', ofValue: 'on' }, - expect: 'InlineFragment', - }, - { - ifCondition: { token: '@' }, - expect: 'InlineFragment', - }, - { - ifCondition: { token: '{' }, - expect: 'InlineFragment', - }, - ], - }, - ], - - FragmentSpread: ['FragmentName', { ofType: 'Directives', optional: true }], - FragmentDefinition: [ - { - token: 'Name', - ofValue: 'fragment', - tokenName: 'FragmentDefinitionKeyword', - }, - 'FragmentName', - 'TypeCondition', - { ofType: 'Directives', optional: true }, - 'SelectionSet', - ], - FragmentName: { - token: 'Name', - butNot: { token: 'Name', ofValue: 'on' }, - definitionName: true, - }, - - TypeCondition: [ - { token: 'Name', ofValue: 'on', tokenName: 'OnKeyword' }, - 'TypeName', - ], - - InlineFragment: [ - { ofType: 'TypeCondition', optional: true }, - { ofType: 'Directives', optional: true }, - 'SelectionSet', - ], - - Value: { - peek: [ - { - ifCondition: { token: '$' }, - expect: 'Variable', - }, - { - ifCondition: 'IntValue', - expect: { ofType: 'IntValue', tokenName: 'NumberValue' }, - }, - { - ifCondition: 'FloatValue', - expect: { ofType: 'FloatValue', tokenName: 'NumberValue' }, - }, - { - ifCondition: 'BooleanValue', - expect: { ofType: 'BooleanValue', tokenName: 'BooleanValue' }, - }, - { - ifCondition: 'EnumValue', - expect: { ofType: 'EnumValue', tokenName: 'EnumValue' }, - }, - { - ifCondition: 'String', - expect: { ofType: 'String', tokenName: 'StringValue' }, - }, - { - ifCondition: 'BlockString', - expect: { ofType: 'BlockString', tokenName: 'StringValue' }, - }, - { - ifCondition: 'NullValue', - expect: { ofType: 'NullValue', tokenName: 'NullValue' }, - }, - { - ifCondition: { token: '[' }, - expect: 'ListValue', - }, - { - ifCondition: { token: '{' }, - expect: 'ObjectValue', - }, - ], - }, - - ConstValue: { - peek: [ - { - ifCondition: 'IntValue', - expect: { ofType: 'IntValue' }, - }, - { - ifCondition: 'FloatValue', - expect: { ofType: 'FloatValue' }, - }, - { - ifCondition: 'BooleanValue', - expect: 'BooleanValue', - }, - { - ifCondition: 'EnumValue', - expect: 'EnumValue', - }, - { - ifCondition: 'String', - expect: { ofType: 'String', tokenName: 'StringValue' }, - }, - { - ifCondition: 'BlockString', - expect: { token: 'BlockString', tokenName: 'StringValue' }, - }, - { - ifCondition: 'NullValue', - expect: 'NullValue', - }, - { - ifCondition: { token: '[' }, - expect: 'ConstListValue', - }, - { - ifCondition: { token: '{' }, - expect: 'ObjectValue', - }, - ], - }, - - IntValue: { token: 'Int' }, - - FloatValue: { token: 'Float' }, - - StringValue: { - peek: [ - { - ifCondition: { token: 'String' }, - expect: { token: 'String', tokenName: 'StringValue' }, - }, - { - ifCondition: { token: 'BlockString' }, - expect: { token: 'BlockString', tokenName: 'StringValue' }, - }, - ], - }, - - BooleanValue: { - token: 'Name', - oneOf: ['true', 'false'], - tokenName: 'BooleanValue', - }, - - NullValue: { - token: 'Name', - ofValue: 'null', - tokenName: 'NullValue', - }, - - EnumValue: { - token: 'Name', - butNot: { token: 'Name', oneOf: ['null', 'true', 'false'] }, - tokenName: 'EnumValue', - }, - - ListValue: [ - { token: '[' }, - { listOfType: 'Value', optional: true }, - { token: ']' }, - ], - - ConstListValue: [ - { token: '[' }, - { listOfType: 'ConstValue', optional: true }, - { token: ']' }, - ], - - ObjectValue: [ - { token: '{' }, - { listOfType: 'ObjectField', optional: true }, - { token: '}' }, - ], - ObjectField: [ - { token: 'Name', tokenName: 'ObjectFieldName' }, - { token: ':' }, - { ofType: 'ConstValue' }, - ], - - Variable: [ - { token: '$', tokenName: 'VariableName' }, - { token: 'Name', tokenName: 'VariableName' }, - ], - VariableDefinitions: [ - { token: '(' }, - { listOfType: 'VariableDefinition' }, - { token: ')' }, - ], - VariableDefinition: [ - 'Variable', - { token: ':' }, - 'Type', - { ofType: 'DefaultValue', optional: true }, - ], - DefaultValue: [{ token: '=' }, 'ConstValue'], - - TypeName: { token: 'Name', tokenName: 'TypeName', typeName: true }, - - Type: { - peek: [ - { - ifCondition: { token: 'Name' }, - expect: ['TypeName', { token: '!', optional: true }], - }, - { - ifCondition: { token: '[' }, - expect: 'ListType', - }, - ], - }, - ListType: [ - { token: '[' }, - { listOfType: 'Type' }, - { token: ']' }, - { token: '!', optional: true }, - ], - - Directives: { listOfType: 'Directive' }, - Directive: [ - { token: '@', tokenName: 'DirectiveName' }, - { token: 'Name', tokenName: 'DirectiveName' }, - { ofType: 'Arguments', optional: true }, - ], - - TypeSystemDefinition: [ - { ofType: 'Description', optional: true }, - { - peek: [ - { - ifCondition: { - target: 'Name', - ofValue: 'schema', - }, - expect: 'SchemaDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'scalar', - }, - expect: 'ScalarTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'type', - }, - expect: 'ObjectTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'interface', - }, - expect: 'InterfaceTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'union', - }, - expect: 'UnionTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'enum', - }, - expect: 'EnumTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'input', - }, - expect: 'InputObjectTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'directive', - }, - expect: 'DirectiveDefinition', - }, - ], - }, - ], - - TypeSystemExtension: { - peek: [ - { - ifCondition: { - target: 'Name', - ofValue: 'schema', - }, - expect: 'SchemaExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'scalar', - }, - expect: 'ScalarTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'type', - }, - expect: 'ObjectTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'interface', - }, - expect: 'InterfaceTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'union', - }, - expect: 'UnionTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'enum', - }, - expect: 'EnumTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'input', - }, - expect: 'InputObjectTypeExtension', - }, - ], - }, - - SchemaDefinition: [ - { - token: 'Name', - ofValue: 'schema', - tokenName: 'SchemaDefinitionKeyword', - }, - { ofType: 'Directives', optional: true }, - { token: '{' }, - { listOfType: 'RootOperationTypeDefinition' }, - { token: '}' }, - ], - RootOperationTypeDefinition: [ - 'OperationType', - { token: ':' }, - { token: 'Name', tokenName: 'OperationTypeDefinitionName' }, - ], - - SchemaExtension: [ - { token: 'Name', ofValue: 'extend' }, - { token: 'Name', ofValue: 'schema' }, - 'Name', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { - ofType: [ - { token: '{' }, - { listOfType: 'RootOperationTypeDefinition' }, - { token: '}' }, - ], - optional: true, - }, - ], - }, - { - ifCondition: { token: '{' }, - expect: [ - { token: '{' }, - { listOfType: 'RootOperationTypeDefinition' }, - { token: '}' }, - ], - }, - ], - }, - ], - - Description: 'StringValue', - - ScalarTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - ], - - ScalarTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword', - }, - 'TypeName', - 'Directives', - ], - - ObjectTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword', - }, - 'TypeName', - { ofType: 'ImplementsInterfaces', optional: true }, - { ofType: 'Directives', optional: true }, - { ofType: 'FieldsDefinition', optional: true }, - ], - ImplementsInterfaces: [ - { - token: 'Name', - ofValue: 'implements', - tokenName: 'ImplementsKeyword', - }, - { token: '&', optional: true }, - 'TypeName', - { - listOfType: 'ImplementsAdditionalInterfaceName', - optional: true, - }, - ], - ImplementsAdditionalInterfaceName: [{ token: '&' }, 'TypeName'], - FieldsDefinition: [ - { token: '{' }, - { listOfType: 'FieldDefinition' }, - { token: '}' }, - ], - FieldDefinition: [ - { ofType: 'Description', optional: true }, - { token: 'Name', tokenName: 'AliasName', definitionName: true }, - { ofType: 'ArgumentsDefinition', optional: true }, - { token: ':' }, - 'Type', - { ofType: 'Directives', optional: true }, - ], - - ArgumentsDefinition: [ - { token: '(' }, - { listOfType: 'InputValueDefinition' }, - { token: ')' }, - ], - InputValueDefinition: [ - { ofType: 'Description', optional: true }, - { token: 'Name', tokenName: 'ArgumentName' }, - { token: ':' }, - 'Type', - { ofType: 'DefaultValue', optional: true }, - { ofType: 'Directives', optional: true }, - ], - - ObjectTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: 'Name', ofValue: 'interface' }, - expect: [ - 'ImplementsInterfaces', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'FieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'FieldsDefinition', - }, - ], - optional: true, - }, - ], - }, - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'FieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'FieldsDefinition', - }, - ], - }, - ], - - InterfaceTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'FieldsDefinition', optional: true }, - ], - - InterfaceTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'FieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'FieldsDefinition', - }, - ], - }, - ], - - UnionTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'UnionMemberTypes', optional: true }, - ], - - UnionMemberTypes: [ - { token: '=' }, - { token: '|', optional: true }, - 'Name', - { - listOfType: 'UnionMemberAdditionalTypeName', - optional: true, - }, - ], - - UnionMemberAdditionalTypeName: [{ token: '|' }, 'TypeName'], - - UnionTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'UnionMemberTypes', optional: true }, - ], - }, - { - ifCondition: { token: '=' }, - expect: 'UnionMemberTypes', - }, - ], - }, - ], - - EnumTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'EnumValuesDefinition', optional: true }, - ], - EnumValuesDefinition: [ - { token: '{' }, - { listOfType: 'EnumValueDefinition' }, - { token: '}' }, - ], - EnumValueDefinition: [ - { ofType: 'Description', optional: true }, - 'EnumValue', - { ofType: 'Directives', optional: true }, - ], - - EnumTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'EnumValuesDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'EnumValuesDefinition', - }, - ], - }, - ], - - InputObjectTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'InputFieldsDefinition', optional: true }, - ], - InputFieldsDefinition: [ - { token: '{' }, - { listOfType: 'InputValueDefinition' }, - { token: '}' }, - ], - - InputObjectTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'InputFieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'InputFieldsDefinition', - }, - ], - }, - ], - - DirectiveDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'directive', - tokenName: 'DirectiveDefinitionKeyword', - }, - { token: '@', tokenName: 'DirectiveName' }, - { token: 'Name', tokenName: 'DirectiveName' }, - { ofType: 'ArgumentsDefinition', optional: true }, - { token: 'Name', ofValue: 'on', tokenName: 'OnKeyword' }, - 'DirectiveLocations', - ], - DirectiveLocations: [ - { token: '|', optional: true }, - 'DirectiveLocation', - { - listOfType: 'DirectiveLocationAdditionalName', - optional: true, - }, - ], - DirectiveLocationAdditionalName: [{ token: '|' }, 'DirectiveLocation'], - DirectiveLocation: { - peek: [ - { - ifCondition: 'ExecutableDirectiveLocation', - expect: 'ExecutableDirectiveLocation', - }, - { - ifCondition: 'TypeSystemDirectiveLocation', - expect: 'TypeSystemDirectiveLocation', - }, - ], - }, - ExecutableDirectiveLocation: { - token: 'Name', - oneOf: [ - 'QUERY', - 'MUTATION', - 'SUBSCRIPTION', - 'FIELD', - 'FRAGMENT_DEFINITION', - 'FRAGMENT_SPREAD', - 'INLINE_FRAGMENT', - ], - tokenName: 'EnumValue', - }, - TypeSystemDirectiveLocation: { - token: 'Name', - oneOf: [ - 'SCHEMA', - 'SCALAR', - 'OBJECT', - 'FIELD_DEFINITION', - 'ARGUMENT_DEFINITION', - 'INTERFACE', - 'UNION', - 'ENUM', - 'ENUM_VALUE', - 'INPUT_OBJECT', - 'INPUT_FIELD_DEFINITION', - ], - tokenName: 'EnumValue', - }, -}; - -export default grammar; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.js b/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.js deleted file mode 100644 index 45c8f7a..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.js +++ /dev/null @@ -1,987 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; -var grammar = { - Name: { - token: 'Name' - }, - String: { - token: 'String' - }, - BlockString: { - token: 'BlockString' - }, - Document: { - listOfType: 'Definition' - }, - Definition: { - peek: [{ - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'] - }, - expect: 'OperationDefinition' - }, { - ifCondition: { - token: 'Name', - ofValue: 'fragment' - }, - expect: 'FragmentDefinition' - }, { - ifCondition: { - token: 'Name', - oneOf: ['schema', 'scalar', 'type', 'interface', 'union', 'enum', 'input', 'directive'] - }, - expect: 'TypeSystemDefinition' - }, { - ifCondition: { - token: 'Name', - ofValue: 'extend' - }, - expect: 'TypeSystemExtension' - }, { - ifCondition: { - token: '{' - }, - expect: 'OperationDefinition' - }, { - ifCondition: 'String', - expect: 'TypeSystemDefinition' - }, { - ifCondition: 'BlockString', - expect: 'TypeSystemDefinition' - }] - }, - OperationDefinition: { - peek: [{ - ifCondition: { - token: '{' - }, - expect: 'SelectionSet' - }, { - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'] - }, - expect: ['OperationType', { - token: 'Name', - optional: true, - tokenName: 'OperationName', - definitionName: true - }, { - ofType: 'VariableDefinitions', - optional: true - }, { - ofType: 'Directives', - optional: true - }, 'SelectionSet'] - }] - }, - OperationType: { - ofType: 'OperationTypeName' - }, - OperationTypeName: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - definitionName: true - }, - SelectionSet: [{ - token: '{' - }, { - listOfType: 'Selection' - }, { - token: '}' - }], - Selection: { - peek: [{ - ifCondition: { - token: '...' - }, - expect: 'Fragment' - }, { - ifCondition: { - token: 'Name' - }, - expect: 'Field' - }] - }, - Field: [{ - ofType: 'Alias', - optional: true, - eatNextOnFail: true, - definitionName: true - }, { - token: 'Name', - tokenName: 'FieldName', - definitionName: true - }, { - ofType: 'Arguments', - optional: true - }, { - ofType: 'Directives', - optional: true - }, { - ofType: 'SelectionSet', - optional: true - }], - Arguments: [{ - token: '(' - }, { - listOfType: 'Argument' - }, { - token: ')' - }], - Argument: [{ - token: 'Name', - tokenName: 'ArgumentName', - definitionName: true - }, { - token: ':' - }, 'Value'], - Alias: [{ - token: 'Name', - tokenName: 'AliasName', - definitionName: true - }, { - token: ':' - }], - Fragment: [{ - token: '...' - }, { - peek: [{ - ifCondition: 'FragmentName', - expect: 'FragmentSpread' - }, { - ifCondition: { - token: 'Name', - ofValue: 'on' - }, - expect: 'InlineFragment' - }, { - ifCondition: { - token: '@' - }, - expect: 'InlineFragment' - }, { - ifCondition: { - token: '{' - }, - expect: 'InlineFragment' - }] - }], - FragmentSpread: ['FragmentName', { - ofType: 'Directives', - optional: true - }], - FragmentDefinition: [{ - token: 'Name', - ofValue: 'fragment', - tokenName: 'FragmentDefinitionKeyword' - }, 'FragmentName', 'TypeCondition', { - ofType: 'Directives', - optional: true - }, 'SelectionSet'], - FragmentName: { - token: 'Name', - butNot: { - token: 'Name', - ofValue: 'on' - }, - definitionName: true - }, - TypeCondition: [{ - token: 'Name', - ofValue: 'on', - tokenName: 'OnKeyword' - }, 'TypeName'], - InlineFragment: [{ - ofType: 'TypeCondition', - optional: true - }, { - ofType: 'Directives', - optional: true - }, 'SelectionSet'], - Value: { - peek: [{ - ifCondition: { - token: '$' - }, - expect: 'Variable' - }, { - ifCondition: 'IntValue', - expect: { - ofType: 'IntValue', - tokenName: 'NumberValue' - } - }, { - ifCondition: 'FloatValue', - expect: { - ofType: 'FloatValue', - tokenName: 'NumberValue' - } - }, { - ifCondition: 'BooleanValue', - expect: { - ofType: 'BooleanValue', - tokenName: 'BooleanValue' - } - }, { - ifCondition: 'EnumValue', - expect: { - ofType: 'EnumValue', - tokenName: 'EnumValue' - } - }, { - ifCondition: 'String', - expect: { - ofType: 'String', - tokenName: 'StringValue' - } - }, { - ifCondition: 'BlockString', - expect: { - ofType: 'BlockString', - tokenName: 'StringValue' - } - }, { - ifCondition: 'NullValue', - expect: { - ofType: 'NullValue', - tokenName: 'NullValue' - } - }, { - ifCondition: { - token: '[' - }, - expect: 'ListValue' - }, { - ifCondition: { - token: '{' - }, - expect: 'ObjectValue' - }] - }, - ConstValue: { - peek: [{ - ifCondition: 'IntValue', - expect: { - ofType: 'IntValue' - } - }, { - ifCondition: 'FloatValue', - expect: { - ofType: 'FloatValue' - } - }, { - ifCondition: 'BooleanValue', - expect: 'BooleanValue' - }, { - ifCondition: 'EnumValue', - expect: 'EnumValue' - }, { - ifCondition: 'String', - expect: { - ofType: 'String', - tokenName: 'StringValue' - } - }, { - ifCondition: 'BlockString', - expect: { - token: 'BlockString', - tokenName: 'StringValue' - } - }, { - ifCondition: 'NullValue', - expect: 'NullValue' - }, { - ifCondition: { - token: '[' - }, - expect: 'ConstListValue' - }, { - ifCondition: { - token: '{' - }, - expect: 'ObjectValue' - }] - }, - IntValue: { - token: 'Int' - }, - FloatValue: { - token: 'Float' - }, - StringValue: { - peek: [{ - ifCondition: { - token: 'String' - }, - expect: { - token: 'String', - tokenName: 'StringValue' - } - }, { - ifCondition: { - token: 'BlockString' - }, - expect: { - token: 'BlockString', - tokenName: 'StringValue' - } - }] - }, - BooleanValue: { - token: 'Name', - oneOf: ['true', 'false'], - tokenName: 'BooleanValue' - }, - NullValue: { - token: 'Name', - ofValue: 'null', - tokenName: 'NullValue' - }, - EnumValue: { - token: 'Name', - butNot: { - token: 'Name', - oneOf: ['null', 'true', 'false'] - }, - tokenName: 'EnumValue' - }, - ListValue: [{ - token: '[' - }, { - listOfType: 'Value', - optional: true - }, { - token: ']' - }], - ConstListValue: [{ - token: '[' - }, { - listOfType: 'ConstValue', - optional: true - }, { - token: ']' - }], - ObjectValue: [{ - token: '{' - }, { - listOfType: 'ObjectField', - optional: true - }, { - token: '}' - }], - ObjectField: [{ - token: 'Name', - tokenName: 'ObjectFieldName' - }, { - token: ':' - }, { - ofType: 'ConstValue' - }], - Variable: [{ - token: '$', - tokenName: 'VariableName' - }, { - token: 'Name', - tokenName: 'VariableName' - }], - VariableDefinitions: [{ - token: '(' - }, { - listOfType: 'VariableDefinition' - }, { - token: ')' - }], - VariableDefinition: ['Variable', { - token: ':' - }, 'Type', { - ofType: 'DefaultValue', - optional: true - }], - DefaultValue: [{ - token: '=' - }, 'ConstValue'], - TypeName: { - token: 'Name', - tokenName: 'TypeName', - typeName: true - }, - Type: { - peek: [{ - ifCondition: { - token: 'Name' - }, - expect: ['TypeName', { - token: '!', - optional: true - }] - }, { - ifCondition: { - token: '[' - }, - expect: 'ListType' - }] - }, - ListType: [{ - token: '[' - }, { - listOfType: 'Type' - }, { - token: ']' - }, { - token: '!', - optional: true - }], - Directives: { - listOfType: 'Directive' - }, - Directive: [{ - token: '@', - tokenName: 'DirectiveName' - }, { - token: 'Name', - tokenName: 'DirectiveName' - }, { - ofType: 'Arguments', - optional: true - }], - TypeSystemDefinition: [{ - ofType: 'Description', - optional: true - }, { - peek: [{ - ifCondition: { - target: 'Name', - ofValue: 'schema' - }, - expect: 'SchemaDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'scalar' - }, - expect: 'ScalarTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'type' - }, - expect: 'ObjectTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'interface' - }, - expect: 'InterfaceTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'union' - }, - expect: 'UnionTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'enum' - }, - expect: 'EnumTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'input' - }, - expect: 'InputObjectTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'directive' - }, - expect: 'DirectiveDefinition' - }] - }], - TypeSystemExtension: { - peek: [{ - ifCondition: { - target: 'Name', - ofValue: 'schema' - }, - expect: 'SchemaExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'scalar' - }, - expect: 'ScalarTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'type' - }, - expect: 'ObjectTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'interface' - }, - expect: 'InterfaceTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'union' - }, - expect: 'UnionTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'enum' - }, - expect: 'EnumTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'input' - }, - expect: 'InputObjectTypeExtension' - }] - }, - SchemaDefinition: [{ - token: 'Name', - ofValue: 'schema', - tokenName: 'SchemaDefinitionKeyword' - }, { - ofType: 'Directives', - optional: true - }, { - token: '{' - }, { - listOfType: 'RootOperationTypeDefinition' - }, { - token: '}' - }], - RootOperationTypeDefinition: ['OperationType', { - token: ':' - }, { - token: 'Name', - tokenName: 'OperationTypeDefinitionName' - }], - SchemaExtension: [{ - token: 'Name', - ofValue: 'extend' - }, { - token: 'Name', - ofValue: 'schema' - }, 'Name', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: [{ - token: '{' - }, { - listOfType: 'RootOperationTypeDefinition' - }, { - token: '}' - }], - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: [{ - token: '{' - }, { - listOfType: 'RootOperationTypeDefinition' - }, { - token: '}' - }] - }] - }], - Description: 'StringValue', - ScalarTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }], - ScalarTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword' - }, 'TypeName', 'Directives'], - ObjectTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword' - }, 'TypeName', { - ofType: 'ImplementsInterfaces', - optional: true - }, { - ofType: 'Directives', - optional: true - }, { - ofType: 'FieldsDefinition', - optional: true - }], - ImplementsInterfaces: [{ - token: 'Name', - ofValue: 'implements', - tokenName: 'ImplementsKeyword' - }, { - token: '&', - optional: true - }, 'TypeName', { - listOfType: 'ImplementsAdditionalInterfaceName', - optional: true - }], - ImplementsAdditionalInterfaceName: [{ - token: '&' - }, 'TypeName'], - FieldsDefinition: [{ - token: '{' - }, { - listOfType: 'FieldDefinition' - }, { - token: '}' - }], - FieldDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - tokenName: 'AliasName', - definitionName: true - }, { - ofType: 'ArgumentsDefinition', - optional: true - }, { - token: ':' - }, 'Type', { - ofType: 'Directives', - optional: true - }], - ArgumentsDefinition: [{ - token: '(' - }, { - listOfType: 'InputValueDefinition' - }, { - token: ')' - }], - InputValueDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - tokenName: 'ArgumentName' - }, { - token: ':' - }, 'Type', { - ofType: 'DefaultValue', - optional: true - }, { - ofType: 'Directives', - optional: true - }], - ObjectTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: 'Name', - ofValue: 'interface' - }, - expect: ['ImplementsInterfaces', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'FieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'FieldsDefinition' - }], - optional: true - }] - }, { - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'FieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'FieldsDefinition' - }] - }], - InterfaceTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'FieldsDefinition', - optional: true - }], - InterfaceTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'FieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'FieldsDefinition' - }] - }], - UnionTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'UnionMemberTypes', - optional: true - }], - UnionMemberTypes: [{ - token: '=' - }, { - token: '|', - optional: true - }, 'Name', { - listOfType: 'UnionMemberAdditionalTypeName', - optional: true - }], - UnionMemberAdditionalTypeName: [{ - token: '|' - }, 'TypeName'], - UnionTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'UnionMemberTypes', - optional: true - }] - }, { - ifCondition: { - token: '=' - }, - expect: 'UnionMemberTypes' - }] - }], - EnumTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'EnumValuesDefinition', - optional: true - }], - EnumValuesDefinition: [{ - token: '{' - }, { - listOfType: 'EnumValueDefinition' - }, { - token: '}' - }], - EnumValueDefinition: [{ - ofType: 'Description', - optional: true - }, 'EnumValue', { - ofType: 'Directives', - optional: true - }], - EnumTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'EnumValuesDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'EnumValuesDefinition' - }] - }], - InputObjectTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'InputFieldsDefinition', - optional: true - }], - InputFieldsDefinition: [{ - token: '{' - }, { - listOfType: 'InputValueDefinition' - }, { - token: '}' - }], - InputObjectTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'InputFieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'InputFieldsDefinition' - }] - }], - DirectiveDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'directive', - tokenName: 'DirectiveDefinitionKeyword' - }, { - token: '@', - tokenName: 'DirectiveName' - }, { - token: 'Name', - tokenName: 'DirectiveName' - }, { - ofType: 'ArgumentsDefinition', - optional: true - }, { - token: 'Name', - ofValue: 'on', - tokenName: 'OnKeyword' - }, 'DirectiveLocations'], - DirectiveLocations: [{ - token: '|', - optional: true - }, 'DirectiveLocation', { - listOfType: 'DirectiveLocationAdditionalName', - optional: true - }], - DirectiveLocationAdditionalName: [{ - token: '|' - }, 'DirectiveLocation'], - DirectiveLocation: { - peek: [{ - ifCondition: 'ExecutableDirectiveLocation', - expect: 'ExecutableDirectiveLocation' - }, { - ifCondition: 'TypeSystemDirectiveLocation', - expect: 'TypeSystemDirectiveLocation' - }] - }, - ExecutableDirectiveLocation: { - token: 'Name', - oneOf: ['QUERY', 'MUTATION', 'SUBSCRIPTION', 'FIELD', 'FRAGMENT_DEFINITION', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT'], - tokenName: 'EnumValue' - }, - TypeSystemDirectiveLocation: { - token: 'Name', - oneOf: ['SCHEMA', 'SCALAR', 'OBJECT', 'FIELD_DEFINITION', 'ARGUMENT_DEFINITION', 'INTERFACE', 'UNION', 'ENUM', 'ENUM_VALUE', 'INPUT_OBJECT', 'INPUT_FIELD_DEFINITION'], - tokenName: 'EnumValue' - } // FIXME: enforce proper typing - -}; -var _default = grammar; -exports.default = _default; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.js.flow b/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.js.flow deleted file mode 100644 index f1d2f10..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.js.flow +++ /dev/null @@ -1,1000 +0,0 @@ -// @flow strict -export type GraphQLGrammarType = {| - [name: string]: GraphQLGrammarRule, -|}; -export type GraphQLGrammarRuleName = string; -export type GraphQLGrammarRuleConstraint = - | GraphQLGrammarTokenConstraint - | GraphQLGrammarOfTypeConstraint - | GraphQLGrammarListOfTypeConstraint - | GraphQLGrammarPeekConstraint; -export type GraphQLGrammarConstraintsSet = Array< - GraphQLGrammarRuleName | GraphQLGrammarRuleConstraint, ->; -export type GraphQLGrammarRule = - | GraphQLGrammarRuleName - | GraphQLGrammarRuleConstraint - | GraphQLGrammarConstraintsSet; -export interface GraphQLGrammarBaseRuleConstraint { - butNot?: - | ?GraphQLGrammarTokenConstraint - | ?Array; - optional?: boolean; - eatNextOnFail?: boolean; -} -export interface GraphQLGrammarTokenConstraint - extends GraphQLGrammarBaseRuleConstraint { - token: - | '!' - | '$' - | '&' - | '(' - | ')' - | '...' - | ':' - | '=' - | '@' - | '[' - | ']' - | '{' - | '}' - | '|' - | 'Name' - | 'Int' - | 'Float' - | 'String' - | 'BlockString' - | 'Comment'; - ofValue?: ?string; - oneOf?: ?Array; - tokenName?: string; - definitionName?: boolean; - typeName?: boolean; -} -export interface GraphQLGrammarOfTypeConstraint - extends GraphQLGrammarBaseRuleConstraint { - ofType: GraphQLGrammarRule; - tokenName?: string; -} -export interface GraphQLGrammarListOfTypeConstraint - extends GraphQLGrammarBaseRuleConstraint { - listOfType: GraphQLGrammarRuleName; -} -export interface GraphQLGrammarPeekConstraint - extends GraphQLGrammarBaseRuleConstraint { - peek: Array; -} -export interface GraphQLGrammarPeekConstraintCondition { - ifCondition: GraphQLGrammarTokenConstraint; - expect: GraphQLGrammarRule; - end?: boolean; -} - -const grammar: GraphQLGrammarType = ({ - Name: { token: 'Name' }, - String: { token: 'String' }, - BlockString: { token: 'BlockString' }, - - Document: { listOfType: 'Definition' }, - Definition: { - peek: [ - { - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - }, - expect: 'OperationDefinition', - }, - { - ifCondition: { token: 'Name', ofValue: 'fragment' }, - expect: 'FragmentDefinition', - }, - { - ifCondition: { - token: 'Name', - oneOf: [ - 'schema', - 'scalar', - 'type', - 'interface', - 'union', - 'enum', - 'input', - 'directive', - ], - }, - expect: 'TypeSystemDefinition', - }, - { - ifCondition: { token: 'Name', ofValue: 'extend' }, - expect: 'TypeSystemExtension', - }, - { - ifCondition: { token: '{' }, - expect: 'OperationDefinition', - }, - { - ifCondition: 'String', - expect: 'TypeSystemDefinition', - }, - { - ifCondition: 'BlockString', - expect: 'TypeSystemDefinition', - }, - ], - }, - - OperationDefinition: { - peek: [ - { - ifCondition: { token: '{' }, - expect: 'SelectionSet', - }, - { - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - }, - expect: [ - 'OperationType', - { - token: 'Name', - optional: true, - tokenName: 'OperationName', - definitionName: true, - }, - { ofType: 'VariableDefinitions', optional: true }, - { ofType: 'Directives', optional: true }, - 'SelectionSet', - ], - }, - ], - }, - OperationType: { - ofType: 'OperationTypeName', - }, - OperationTypeName: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - definitionName: true, - }, - SelectionSet: [{ token: '{' }, { listOfType: 'Selection' }, { token: '}' }], - Selection: { - peek: [ - { - ifCondition: { token: '...' }, - expect: 'Fragment', - }, - { - ifCondition: { token: 'Name' }, - expect: 'Field', - }, - ], - }, - - Field: [ - { - ofType: 'Alias', - optional: true, - eatNextOnFail: true, - definitionName: true, - }, - { token: 'Name', tokenName: 'FieldName', definitionName: true }, - { ofType: 'Arguments', optional: true }, - { ofType: 'Directives', optional: true }, - { ofType: 'SelectionSet', optional: true }, - ], - - Arguments: [{ token: '(' }, { listOfType: 'Argument' }, { token: ')' }], - Argument: [ - { token: 'Name', tokenName: 'ArgumentName', definitionName: true }, - { token: ':' }, - 'Value', - ], - - Alias: [ - { token: 'Name', tokenName: 'AliasName', definitionName: true }, - { token: ':' }, - ], - - Fragment: [ - { token: '...' }, - { - peek: [ - { - ifCondition: 'FragmentName', - expect: 'FragmentSpread', - }, - { - ifCondition: { token: 'Name', ofValue: 'on' }, - expect: 'InlineFragment', - }, - { - ifCondition: { token: '@' }, - expect: 'InlineFragment', - }, - { - ifCondition: { token: '{' }, - expect: 'InlineFragment', - }, - ], - }, - ], - - FragmentSpread: ['FragmentName', { ofType: 'Directives', optional: true }], - FragmentDefinition: [ - { - token: 'Name', - ofValue: 'fragment', - tokenName: 'FragmentDefinitionKeyword', - }, - 'FragmentName', - 'TypeCondition', - { ofType: 'Directives', optional: true }, - 'SelectionSet', - ], - FragmentName: { - token: 'Name', - butNot: { token: 'Name', ofValue: 'on' }, - definitionName: true, - }, - - TypeCondition: [ - { token: 'Name', ofValue: 'on', tokenName: 'OnKeyword' }, - 'TypeName', - ], - - InlineFragment: [ - { ofType: 'TypeCondition', optional: true }, - { ofType: 'Directives', optional: true }, - 'SelectionSet', - ], - - Value: { - peek: [ - { - ifCondition: { token: '$' }, - expect: 'Variable', - }, - { - ifCondition: 'IntValue', - expect: { ofType: 'IntValue', tokenName: 'NumberValue' }, - }, - { - ifCondition: 'FloatValue', - expect: { ofType: 'FloatValue', tokenName: 'NumberValue' }, - }, - { - ifCondition: 'BooleanValue', - expect: { ofType: 'BooleanValue', tokenName: 'BooleanValue' }, - }, - { - ifCondition: 'EnumValue', - expect: { ofType: 'EnumValue', tokenName: 'EnumValue' }, - }, - { - ifCondition: 'String', - expect: { ofType: 'String', tokenName: 'StringValue' }, - }, - { - ifCondition: 'BlockString', - expect: { ofType: 'BlockString', tokenName: 'StringValue' }, - }, - { - ifCondition: 'NullValue', - expect: { ofType: 'NullValue', tokenName: 'NullValue' }, - }, - { - ifCondition: { token: '[' }, - expect: 'ListValue', - }, - { - ifCondition: { token: '{' }, - expect: 'ObjectValue', - }, - ], - }, - - ConstValue: { - peek: [ - { - ifCondition: 'IntValue', - expect: { ofType: 'IntValue' }, - }, - { - ifCondition: 'FloatValue', - expect: { ofType: 'FloatValue' }, - }, - { - ifCondition: 'BooleanValue', - expect: 'BooleanValue', - }, - { - ifCondition: 'EnumValue', - expect: 'EnumValue', - }, - { - ifCondition: 'String', - expect: { ofType: 'String', tokenName: 'StringValue' }, - }, - { - ifCondition: 'BlockString', - expect: { token: 'BlockString', tokenName: 'StringValue' }, - }, - { - ifCondition: 'NullValue', - expect: 'NullValue', - }, - { - ifCondition: { token: '[' }, - expect: 'ConstListValue', - }, - { - ifCondition: { token: '{' }, - expect: 'ObjectValue', - }, - ], - }, - - IntValue: { token: 'Int' }, - - FloatValue: { token: 'Float' }, - - StringValue: { - peek: [ - { - ifCondition: { token: 'String' }, - expect: { token: 'String', tokenName: 'StringValue' }, - }, - { - ifCondition: { token: 'BlockString' }, - expect: { token: 'BlockString', tokenName: 'StringValue' }, - }, - ], - }, - - BooleanValue: { - token: 'Name', - oneOf: ['true', 'false'], - tokenName: 'BooleanValue', - }, - - NullValue: { - token: 'Name', - ofValue: 'null', - tokenName: 'NullValue', - }, - - EnumValue: { - token: 'Name', - butNot: { token: 'Name', oneOf: ['null', 'true', 'false'] }, - tokenName: 'EnumValue', - }, - - ListValue: [ - { token: '[' }, - { listOfType: 'Value', optional: true }, - { token: ']' }, - ], - - ConstListValue: [ - { token: '[' }, - { listOfType: 'ConstValue', optional: true }, - { token: ']' }, - ], - - ObjectValue: [ - { token: '{' }, - { listOfType: 'ObjectField', optional: true }, - { token: '}' }, - ], - ObjectField: [ - { token: 'Name', tokenName: 'ObjectFieldName' }, - { token: ':' }, - { ofType: 'ConstValue' }, - ], - - Variable: [ - { token: '$', tokenName: 'VariableName' }, - { token: 'Name', tokenName: 'VariableName' }, - ], - VariableDefinitions: [ - { token: '(' }, - { listOfType: 'VariableDefinition' }, - { token: ')' }, - ], - VariableDefinition: [ - 'Variable', - { token: ':' }, - 'Type', - { ofType: 'DefaultValue', optional: true }, - ], - DefaultValue: [{ token: '=' }, 'ConstValue'], - - TypeName: { token: 'Name', tokenName: 'TypeName', typeName: true }, - - Type: { - peek: [ - { - ifCondition: { token: 'Name' }, - expect: ['TypeName', { token: '!', optional: true }], - }, - { - ifCondition: { token: '[' }, - expect: 'ListType', - }, - ], - }, - ListType: [ - { token: '[' }, - { listOfType: 'Type' }, - { token: ']' }, - { token: '!', optional: true }, - ], - - Directives: { listOfType: 'Directive' }, - Directive: [ - { token: '@', tokenName: 'DirectiveName' }, - { token: 'Name', tokenName: 'DirectiveName' }, - { ofType: 'Arguments', optional: true }, - ], - - TypeSystemDefinition: [ - { ofType: 'Description', optional: true }, - { - peek: [ - { - ifCondition: { - target: 'Name', - ofValue: 'schema', - }, - expect: 'SchemaDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'scalar', - }, - expect: 'ScalarTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'type', - }, - expect: 'ObjectTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'interface', - }, - expect: 'InterfaceTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'union', - }, - expect: 'UnionTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'enum', - }, - expect: 'EnumTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'input', - }, - expect: 'InputObjectTypeDefinition', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'directive', - }, - expect: 'DirectiveDefinition', - }, - ], - }, - ], - - TypeSystemExtension: { - peek: [ - { - ifCondition: { - target: 'Name', - ofValue: 'schema', - }, - expect: 'SchemaExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'scalar', - }, - expect: 'ScalarTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'type', - }, - expect: 'ObjectTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'interface', - }, - expect: 'InterfaceTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'union', - }, - expect: 'UnionTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'enum', - }, - expect: 'EnumTypeExtension', - }, - { - ifCondition: { - target: 'Name', - ofValue: 'input', - }, - expect: 'InputObjectTypeExtension', - }, - ], - }, - - SchemaDefinition: [ - { - token: 'Name', - ofValue: 'schema', - tokenName: 'SchemaDefinitionKeyword', - }, - { ofType: 'Directives', optional: true }, - { token: '{' }, - { listOfType: 'RootOperationTypeDefinition' }, - { token: '}' }, - ], - RootOperationTypeDefinition: [ - 'OperationType', - { token: ':' }, - { token: 'Name', tokenName: 'OperationTypeDefinitionName' }, - ], - - SchemaExtension: [ - { token: 'Name', ofValue: 'extend' }, - { token: 'Name', ofValue: 'schema' }, - 'Name', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { - ofType: [ - { token: '{' }, - { listOfType: 'RootOperationTypeDefinition' }, - { token: '}' }, - ], - optional: true, - }, - ], - }, - { - ifCondition: { token: '{' }, - expect: [ - { token: '{' }, - { listOfType: 'RootOperationTypeDefinition' }, - { token: '}' }, - ], - }, - ], - }, - ], - - Description: 'StringValue', - - ScalarTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - ], - - ScalarTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword', - }, - 'TypeName', - 'Directives', - ], - - ObjectTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword', - }, - 'TypeName', - { ofType: 'ImplementsInterfaces', optional: true }, - { ofType: 'Directives', optional: true }, - { ofType: 'FieldsDefinition', optional: true }, - ], - ImplementsInterfaces: [ - { - token: 'Name', - ofValue: 'implements', - tokenName: 'ImplementsKeyword', - }, - { token: '&', optional: true }, - 'TypeName', - { - listOfType: 'ImplementsAdditionalInterfaceName', - optional: true, - }, - ], - ImplementsAdditionalInterfaceName: [{ token: '&' }, 'TypeName'], - FieldsDefinition: [ - { token: '{' }, - { listOfType: 'FieldDefinition' }, - { token: '}' }, - ], - FieldDefinition: [ - { ofType: 'Description', optional: true }, - { token: 'Name', tokenName: 'AliasName', definitionName: true }, - { ofType: 'ArgumentsDefinition', optional: true }, - { token: ':' }, - 'Type', - { ofType: 'Directives', optional: true }, - ], - - ArgumentsDefinition: [ - { token: '(' }, - { listOfType: 'InputValueDefinition' }, - { token: ')' }, - ], - InputValueDefinition: [ - { ofType: 'Description', optional: true }, - { token: 'Name', tokenName: 'ArgumentName' }, - { token: ':' }, - 'Type', - { ofType: 'DefaultValue', optional: true }, - { ofType: 'Directives', optional: true }, - ], - - ObjectTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: 'Name', ofValue: 'interface' }, - expect: [ - 'ImplementsInterfaces', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'FieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'FieldsDefinition', - }, - ], - optional: true, - }, - ], - }, - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'FieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'FieldsDefinition', - }, - ], - }, - ], - - InterfaceTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'FieldsDefinition', optional: true }, - ], - - InterfaceTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'FieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'FieldsDefinition', - }, - ], - }, - ], - - UnionTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'UnionMemberTypes', optional: true }, - ], - - UnionMemberTypes: [ - { token: '=' }, - { token: '|', optional: true }, - 'Name', - { - listOfType: 'UnionMemberAdditionalTypeName', - optional: true, - }, - ], - - UnionMemberAdditionalTypeName: [{ token: '|' }, 'TypeName'], - - UnionTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'UnionMemberTypes', optional: true }, - ], - }, - { - ifCondition: { token: '=' }, - expect: 'UnionMemberTypes', - }, - ], - }, - ], - - EnumTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'EnumValuesDefinition', optional: true }, - ], - EnumValuesDefinition: [ - { token: '{' }, - { listOfType: 'EnumValueDefinition' }, - { token: '}' }, - ], - EnumValueDefinition: [ - { ofType: 'Description', optional: true }, - 'EnumValue', - { ofType: 'Directives', optional: true }, - ], - - EnumTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'EnumValuesDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'EnumValuesDefinition', - }, - ], - }, - ], - - InputObjectTypeDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword', - }, - 'TypeName', - { ofType: 'Directives', optional: true }, - { ofType: 'InputFieldsDefinition', optional: true }, - ], - InputFieldsDefinition: [ - { token: '{' }, - { listOfType: 'InputValueDefinition' }, - { token: '}' }, - ], - - InputObjectTypeExtension: [ - { - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword', - }, - { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword', - }, - 'TypeName', - { - peek: [ - { - ifCondition: { token: '@' }, - expect: [ - 'Directives', - { ofType: 'InputFieldsDefinition', optional: true }, - ], - }, - { - ifCondition: { token: '{' }, - expect: 'InputFieldsDefinition', - }, - ], - }, - ], - - DirectiveDefinition: [ - { ofType: 'Description', optional: true }, - { - token: 'Name', - ofValue: 'directive', - tokenName: 'DirectiveDefinitionKeyword', - }, - { token: '@', tokenName: 'DirectiveName' }, - { token: 'Name', tokenName: 'DirectiveName' }, - { ofType: 'ArgumentsDefinition', optional: true }, - { token: 'Name', ofValue: 'on', tokenName: 'OnKeyword' }, - 'DirectiveLocations', - ], - DirectiveLocations: [ - { token: '|', optional: true }, - 'DirectiveLocation', - { - listOfType: 'DirectiveLocationAdditionalName', - optional: true, - }, - ], - DirectiveLocationAdditionalName: [{ token: '|' }, 'DirectiveLocation'], - DirectiveLocation: { - peek: [ - { - ifCondition: 'ExecutableDirectiveLocation', - expect: 'ExecutableDirectiveLocation', - }, - { - ifCondition: 'TypeSystemDirectiveLocation', - expect: 'TypeSystemDirectiveLocation', - }, - ], - }, - ExecutableDirectiveLocation: { - token: 'Name', - oneOf: [ - 'QUERY', - 'MUTATION', - 'SUBSCRIPTION', - 'FIELD', - 'FRAGMENT_DEFINITION', - 'FRAGMENT_SPREAD', - 'INLINE_FRAGMENT', - ], - tokenName: 'EnumValue', - }, - TypeSystemDirectiveLocation: { - token: 'Name', - oneOf: [ - 'SCHEMA', - 'SCALAR', - 'OBJECT', - 'FIELD_DEFINITION', - 'ARGUMENT_DEFINITION', - 'INTERFACE', - 'UNION', - 'ENUM', - 'ENUM_VALUE', - 'INPUT_OBJECT', - 'INPUT_FIELD_DEFINITION', - ], - tokenName: 'EnumValue', - }, - // FIXME: enforce proper typing -}: any); - -export default grammar; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.mjs b/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.mjs deleted file mode 100644 index a31907e..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/grammar.mjs +++ /dev/null @@ -1,980 +0,0 @@ -var grammar = { - Name: { - token: 'Name' - }, - String: { - token: 'String' - }, - BlockString: { - token: 'BlockString' - }, - Document: { - listOfType: 'Definition' - }, - Definition: { - peek: [{ - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'] - }, - expect: 'OperationDefinition' - }, { - ifCondition: { - token: 'Name', - ofValue: 'fragment' - }, - expect: 'FragmentDefinition' - }, { - ifCondition: { - token: 'Name', - oneOf: ['schema', 'scalar', 'type', 'interface', 'union', 'enum', 'input', 'directive'] - }, - expect: 'TypeSystemDefinition' - }, { - ifCondition: { - token: 'Name', - ofValue: 'extend' - }, - expect: 'TypeSystemExtension' - }, { - ifCondition: { - token: '{' - }, - expect: 'OperationDefinition' - }, { - ifCondition: 'String', - expect: 'TypeSystemDefinition' - }, { - ifCondition: 'BlockString', - expect: 'TypeSystemDefinition' - }] - }, - OperationDefinition: { - peek: [{ - ifCondition: { - token: '{' - }, - expect: 'SelectionSet' - }, { - ifCondition: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'] - }, - expect: ['OperationType', { - token: 'Name', - optional: true, - tokenName: 'OperationName', - definitionName: true - }, { - ofType: 'VariableDefinitions', - optional: true - }, { - ofType: 'Directives', - optional: true - }, 'SelectionSet'] - }] - }, - OperationType: { - ofType: 'OperationTypeName' - }, - OperationTypeName: { - token: 'Name', - oneOf: ['query', 'mutation', 'subscription'], - definitionName: true - }, - SelectionSet: [{ - token: '{' - }, { - listOfType: 'Selection' - }, { - token: '}' - }], - Selection: { - peek: [{ - ifCondition: { - token: '...' - }, - expect: 'Fragment' - }, { - ifCondition: { - token: 'Name' - }, - expect: 'Field' - }] - }, - Field: [{ - ofType: 'Alias', - optional: true, - eatNextOnFail: true, - definitionName: true - }, { - token: 'Name', - tokenName: 'FieldName', - definitionName: true - }, { - ofType: 'Arguments', - optional: true - }, { - ofType: 'Directives', - optional: true - }, { - ofType: 'SelectionSet', - optional: true - }], - Arguments: [{ - token: '(' - }, { - listOfType: 'Argument' - }, { - token: ')' - }], - Argument: [{ - token: 'Name', - tokenName: 'ArgumentName', - definitionName: true - }, { - token: ':' - }, 'Value'], - Alias: [{ - token: 'Name', - tokenName: 'AliasName', - definitionName: true - }, { - token: ':' - }], - Fragment: [{ - token: '...' - }, { - peek: [{ - ifCondition: 'FragmentName', - expect: 'FragmentSpread' - }, { - ifCondition: { - token: 'Name', - ofValue: 'on' - }, - expect: 'InlineFragment' - }, { - ifCondition: { - token: '@' - }, - expect: 'InlineFragment' - }, { - ifCondition: { - token: '{' - }, - expect: 'InlineFragment' - }] - }], - FragmentSpread: ['FragmentName', { - ofType: 'Directives', - optional: true - }], - FragmentDefinition: [{ - token: 'Name', - ofValue: 'fragment', - tokenName: 'FragmentDefinitionKeyword' - }, 'FragmentName', 'TypeCondition', { - ofType: 'Directives', - optional: true - }, 'SelectionSet'], - FragmentName: { - token: 'Name', - butNot: { - token: 'Name', - ofValue: 'on' - }, - definitionName: true - }, - TypeCondition: [{ - token: 'Name', - ofValue: 'on', - tokenName: 'OnKeyword' - }, 'TypeName'], - InlineFragment: [{ - ofType: 'TypeCondition', - optional: true - }, { - ofType: 'Directives', - optional: true - }, 'SelectionSet'], - Value: { - peek: [{ - ifCondition: { - token: '$' - }, - expect: 'Variable' - }, { - ifCondition: 'IntValue', - expect: { - ofType: 'IntValue', - tokenName: 'NumberValue' - } - }, { - ifCondition: 'FloatValue', - expect: { - ofType: 'FloatValue', - tokenName: 'NumberValue' - } - }, { - ifCondition: 'BooleanValue', - expect: { - ofType: 'BooleanValue', - tokenName: 'BooleanValue' - } - }, { - ifCondition: 'EnumValue', - expect: { - ofType: 'EnumValue', - tokenName: 'EnumValue' - } - }, { - ifCondition: 'String', - expect: { - ofType: 'String', - tokenName: 'StringValue' - } - }, { - ifCondition: 'BlockString', - expect: { - ofType: 'BlockString', - tokenName: 'StringValue' - } - }, { - ifCondition: 'NullValue', - expect: { - ofType: 'NullValue', - tokenName: 'NullValue' - } - }, { - ifCondition: { - token: '[' - }, - expect: 'ListValue' - }, { - ifCondition: { - token: '{' - }, - expect: 'ObjectValue' - }] - }, - ConstValue: { - peek: [{ - ifCondition: 'IntValue', - expect: { - ofType: 'IntValue' - } - }, { - ifCondition: 'FloatValue', - expect: { - ofType: 'FloatValue' - } - }, { - ifCondition: 'BooleanValue', - expect: 'BooleanValue' - }, { - ifCondition: 'EnumValue', - expect: 'EnumValue' - }, { - ifCondition: 'String', - expect: { - ofType: 'String', - tokenName: 'StringValue' - } - }, { - ifCondition: 'BlockString', - expect: { - token: 'BlockString', - tokenName: 'StringValue' - } - }, { - ifCondition: 'NullValue', - expect: 'NullValue' - }, { - ifCondition: { - token: '[' - }, - expect: 'ConstListValue' - }, { - ifCondition: { - token: '{' - }, - expect: 'ObjectValue' - }] - }, - IntValue: { - token: 'Int' - }, - FloatValue: { - token: 'Float' - }, - StringValue: { - peek: [{ - ifCondition: { - token: 'String' - }, - expect: { - token: 'String', - tokenName: 'StringValue' - } - }, { - ifCondition: { - token: 'BlockString' - }, - expect: { - token: 'BlockString', - tokenName: 'StringValue' - } - }] - }, - BooleanValue: { - token: 'Name', - oneOf: ['true', 'false'], - tokenName: 'BooleanValue' - }, - NullValue: { - token: 'Name', - ofValue: 'null', - tokenName: 'NullValue' - }, - EnumValue: { - token: 'Name', - butNot: { - token: 'Name', - oneOf: ['null', 'true', 'false'] - }, - tokenName: 'EnumValue' - }, - ListValue: [{ - token: '[' - }, { - listOfType: 'Value', - optional: true - }, { - token: ']' - }], - ConstListValue: [{ - token: '[' - }, { - listOfType: 'ConstValue', - optional: true - }, { - token: ']' - }], - ObjectValue: [{ - token: '{' - }, { - listOfType: 'ObjectField', - optional: true - }, { - token: '}' - }], - ObjectField: [{ - token: 'Name', - tokenName: 'ObjectFieldName' - }, { - token: ':' - }, { - ofType: 'ConstValue' - }], - Variable: [{ - token: '$', - tokenName: 'VariableName' - }, { - token: 'Name', - tokenName: 'VariableName' - }], - VariableDefinitions: [{ - token: '(' - }, { - listOfType: 'VariableDefinition' - }, { - token: ')' - }], - VariableDefinition: ['Variable', { - token: ':' - }, 'Type', { - ofType: 'DefaultValue', - optional: true - }], - DefaultValue: [{ - token: '=' - }, 'ConstValue'], - TypeName: { - token: 'Name', - tokenName: 'TypeName', - typeName: true - }, - Type: { - peek: [{ - ifCondition: { - token: 'Name' - }, - expect: ['TypeName', { - token: '!', - optional: true - }] - }, { - ifCondition: { - token: '[' - }, - expect: 'ListType' - }] - }, - ListType: [{ - token: '[' - }, { - listOfType: 'Type' - }, { - token: ']' - }, { - token: '!', - optional: true - }], - Directives: { - listOfType: 'Directive' - }, - Directive: [{ - token: '@', - tokenName: 'DirectiveName' - }, { - token: 'Name', - tokenName: 'DirectiveName' - }, { - ofType: 'Arguments', - optional: true - }], - TypeSystemDefinition: [{ - ofType: 'Description', - optional: true - }, { - peek: [{ - ifCondition: { - target: 'Name', - ofValue: 'schema' - }, - expect: 'SchemaDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'scalar' - }, - expect: 'ScalarTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'type' - }, - expect: 'ObjectTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'interface' - }, - expect: 'InterfaceTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'union' - }, - expect: 'UnionTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'enum' - }, - expect: 'EnumTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'input' - }, - expect: 'InputObjectTypeDefinition' - }, { - ifCondition: { - target: 'Name', - ofValue: 'directive' - }, - expect: 'DirectiveDefinition' - }] - }], - TypeSystemExtension: { - peek: [{ - ifCondition: { - target: 'Name', - ofValue: 'schema' - }, - expect: 'SchemaExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'scalar' - }, - expect: 'ScalarTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'type' - }, - expect: 'ObjectTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'interface' - }, - expect: 'InterfaceTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'union' - }, - expect: 'UnionTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'enum' - }, - expect: 'EnumTypeExtension' - }, { - ifCondition: { - target: 'Name', - ofValue: 'input' - }, - expect: 'InputObjectTypeExtension' - }] - }, - SchemaDefinition: [{ - token: 'Name', - ofValue: 'schema', - tokenName: 'SchemaDefinitionKeyword' - }, { - ofType: 'Directives', - optional: true - }, { - token: '{' - }, { - listOfType: 'RootOperationTypeDefinition' - }, { - token: '}' - }], - RootOperationTypeDefinition: ['OperationType', { - token: ':' - }, { - token: 'Name', - tokenName: 'OperationTypeDefinitionName' - }], - SchemaExtension: [{ - token: 'Name', - ofValue: 'extend' - }, { - token: 'Name', - ofValue: 'schema' - }, 'Name', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: [{ - token: '{' - }, { - listOfType: 'RootOperationTypeDefinition' - }, { - token: '}' - }], - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: [{ - token: '{' - }, { - listOfType: 'RootOperationTypeDefinition' - }, { - token: '}' - }] - }] - }], - Description: 'StringValue', - ScalarTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }], - ScalarTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'scalar', - tokenName: 'ScalarDefinitionKeyword' - }, 'TypeName', 'Directives'], - ObjectTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword' - }, 'TypeName', { - ofType: 'ImplementsInterfaces', - optional: true - }, { - ofType: 'Directives', - optional: true - }, { - ofType: 'FieldsDefinition', - optional: true - }], - ImplementsInterfaces: [{ - token: 'Name', - ofValue: 'implements', - tokenName: 'ImplementsKeyword' - }, { - token: '&', - optional: true - }, 'TypeName', { - listOfType: 'ImplementsAdditionalInterfaceName', - optional: true - }], - ImplementsAdditionalInterfaceName: [{ - token: '&' - }, 'TypeName'], - FieldsDefinition: [{ - token: '{' - }, { - listOfType: 'FieldDefinition' - }, { - token: '}' - }], - FieldDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - tokenName: 'AliasName', - definitionName: true - }, { - ofType: 'ArgumentsDefinition', - optional: true - }, { - token: ':' - }, 'Type', { - ofType: 'Directives', - optional: true - }], - ArgumentsDefinition: [{ - token: '(' - }, { - listOfType: 'InputValueDefinition' - }, { - token: ')' - }], - InputValueDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - tokenName: 'ArgumentName' - }, { - token: ':' - }, 'Type', { - ofType: 'DefaultValue', - optional: true - }, { - ofType: 'Directives', - optional: true - }], - ObjectTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'type', - tokenName: 'TypeDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: 'Name', - ofValue: 'interface' - }, - expect: ['ImplementsInterfaces', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'FieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'FieldsDefinition' - }], - optional: true - }] - }, { - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'FieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'FieldsDefinition' - }] - }], - InterfaceTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'FieldsDefinition', - optional: true - }], - InterfaceTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'interface', - tokenName: 'InterfaceDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'FieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'FieldsDefinition' - }] - }], - UnionTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'UnionMemberTypes', - optional: true - }], - UnionMemberTypes: [{ - token: '=' - }, { - token: '|', - optional: true - }, 'Name', { - listOfType: 'UnionMemberAdditionalTypeName', - optional: true - }], - UnionMemberAdditionalTypeName: [{ - token: '|' - }, 'TypeName'], - UnionTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'union', - tokenName: 'UnionDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'UnionMemberTypes', - optional: true - }] - }, { - ifCondition: { - token: '=' - }, - expect: 'UnionMemberTypes' - }] - }], - EnumTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'EnumValuesDefinition', - optional: true - }], - EnumValuesDefinition: [{ - token: '{' - }, { - listOfType: 'EnumValueDefinition' - }, { - token: '}' - }], - EnumValueDefinition: [{ - ofType: 'Description', - optional: true - }, 'EnumValue', { - ofType: 'Directives', - optional: true - }], - EnumTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'enum', - tokenName: 'EnumDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'EnumValuesDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'EnumValuesDefinition' - }] - }], - InputObjectTypeDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword' - }, 'TypeName', { - ofType: 'Directives', - optional: true - }, { - ofType: 'InputFieldsDefinition', - optional: true - }], - InputFieldsDefinition: [{ - token: '{' - }, { - listOfType: 'InputValueDefinition' - }, { - token: '}' - }], - InputObjectTypeExtension: [{ - token: 'Name', - ofValue: 'extend', - tokenName: 'ExtendDefinitionKeyword' - }, { - token: 'Name', - ofValue: 'input', - tokenName: 'InputDefinitionKeyword' - }, 'TypeName', { - peek: [{ - ifCondition: { - token: '@' - }, - expect: ['Directives', { - ofType: 'InputFieldsDefinition', - optional: true - }] - }, { - ifCondition: { - token: '{' - }, - expect: 'InputFieldsDefinition' - }] - }], - DirectiveDefinition: [{ - ofType: 'Description', - optional: true - }, { - token: 'Name', - ofValue: 'directive', - tokenName: 'DirectiveDefinitionKeyword' - }, { - token: '@', - tokenName: 'DirectiveName' - }, { - token: 'Name', - tokenName: 'DirectiveName' - }, { - ofType: 'ArgumentsDefinition', - optional: true - }, { - token: 'Name', - ofValue: 'on', - tokenName: 'OnKeyword' - }, 'DirectiveLocations'], - DirectiveLocations: [{ - token: '|', - optional: true - }, 'DirectiveLocation', { - listOfType: 'DirectiveLocationAdditionalName', - optional: true - }], - DirectiveLocationAdditionalName: [{ - token: '|' - }, 'DirectiveLocation'], - DirectiveLocation: { - peek: [{ - ifCondition: 'ExecutableDirectiveLocation', - expect: 'ExecutableDirectiveLocation' - }, { - ifCondition: 'TypeSystemDirectiveLocation', - expect: 'TypeSystemDirectiveLocation' - }] - }, - ExecutableDirectiveLocation: { - token: 'Name', - oneOf: ['QUERY', 'MUTATION', 'SUBSCRIPTION', 'FIELD', 'FRAGMENT_DEFINITION', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT'], - tokenName: 'EnumValue' - }, - TypeSystemDirectiveLocation: { - token: 'Name', - oneOf: ['SCHEMA', 'SCALAR', 'OBJECT', 'FIELD_DEFINITION', 'ARGUMENT_DEFINITION', 'INTERFACE', 'UNION', 'ENUM', 'ENUM_VALUE', 'INPUT_OBJECT', 'INPUT_FIELD_DEFINITION'], - tokenName: 'EnumValue' - } // FIXME: enforce proper typing - -}; -export default grammar; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/index.d.ts b/JS/node_modules/graphql/language/experimentalOnlineParser/index.d.ts deleted file mode 100644 index 039446a..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { - OnlineParser, - RuleKind, - TokenKind, - OnlineParserState, -} from './onlineParser'; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/index.js b/JS/node_modules/graphql/language/experimentalOnlineParser/index.js deleted file mode 100644 index dd38694..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/index.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "OnlineParser", { - enumerable: true, - get: function get() { - return _onlineParser.OnlineParser; - } -}); -Object.defineProperty(exports, "RuleKind", { - enumerable: true, - get: function get() { - return _onlineParser.RuleKind; - } -}); -Object.defineProperty(exports, "TokenKind", { - enumerable: true, - get: function get() { - return _onlineParser.TokenKind; - } -}); -Object.defineProperty(exports, "OnlineParserState", { - enumerable: true, - get: function get() { - return _onlineParser.OnlineParserState; - } -}); - -var _onlineParser = require("./onlineParser.js"); diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/index.js.flow b/JS/node_modules/graphql/language/experimentalOnlineParser/index.js.flow deleted file mode 100644 index 90e34f2..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/index.js.flow +++ /dev/null @@ -1,7 +0,0 @@ -// @flow strict -export { - OnlineParser, - RuleKind, - TokenKind, - OnlineParserState, -} from './onlineParser'; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/index.mjs b/JS/node_modules/graphql/language/experimentalOnlineParser/index.mjs deleted file mode 100644 index a82cbe8..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/index.mjs +++ /dev/null @@ -1 +0,0 @@ -export { OnlineParser, RuleKind, TokenKind, OnlineParserState } from "./onlineParser.mjs"; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts b/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts deleted file mode 100644 index 9570b9e..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { Lexer } from '../lexer'; - -import { - GraphQLGrammarTokenConstraint, - GraphQLGrammarOfTypeConstraint, - GraphQLGrammarListOfTypeConstraint, - GraphQLGrammarPeekConstraint, - GraphQLGrammarConstraintsSet, -} from './grammar'; - -interface BaseOnlineParserRule { - kind: string; - name?: string; - depth: number; - step: number; - expanded: boolean; - state: string; - optional?: boolean; - eatNextOnFail?: boolean; -} -interface TokenOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarTokenConstraint {} -interface OfTypeOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarOfTypeConstraint {} -interface ListOfTypeOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarListOfTypeConstraint {} -interface PeekOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarPeekConstraint { - index: number; - matched: boolean; -} -interface ConstraintsSetOnlineParserRule extends BaseOnlineParserRule { - constraintsSet: boolean; - constraints: GraphQLGrammarConstraintsSet; -} - -type OnlineParserRule = - | TokenOnlineParserRule - | OfTypeOnlineParserRule - | ListOfTypeOnlineParserRule - | PeekOnlineParserRule - | ConstraintsSetOnlineParserRule; - -export interface OnlineParserState { - rules: Array; - kind: () => string; - step: () => number; - levels: Array; - indentLevel: number | undefined; - name: string | null; - type: string | null; -} - -interface Token { - kind: string; - value?: string; - tokenName?: string | undefined; - ruleName?: string | undefined; -} - -type OnlineParserConfig = { - tabSize: number; -}; - -type OnlineParserConfigOption = { - tabSize?: number; -}; - -export class OnlineParser { - state: OnlineParserState; - _lexer: Lexer; - _config: OnlineParserConfig; - constructor( - source: string, - state?: OnlineParserState, - config?: OnlineParserConfigOption, - ); - static startState(): OnlineParserState; - static copyState(state: OnlineParserState): OnlineParserState; - sol(): boolean; - parseToken(): Token; - indentation(): number; - private readonly _parseTokenConstraint; - private readonly _parseListOfTypeConstraint; - private readonly _parseOfTypeConstraint; - private readonly _parsePeekConstraint; - private readonly _parseConstraintsSetRule; - private readonly _matchToken; - private readonly _butNot; - private readonly _transformLexerToken; - private readonly _getNextRule; - private readonly _popMatchedRule; - private readonly _rollbackRule; - private readonly _pushRule; - private readonly _getRuleKind; - private readonly _advanceToken; - private readonly _lookAhead; -} - -export const TokenKind: { - NAME: string; - INT: string; - FLOAT: string; - STRING: string; - BLOCK_STRING: string; - COMMENT: string; - PUNCTUATION: string; - EOF: string; - INVALID: string; -}; - -export const RuleKind: { - TOKEN_CONSTRAINT: string; - OF_TYPE_CONSTRAINT: string; - LIST_OF_TYPE_CONSTRAINT: string; - PEEK_CONSTRAINT: string; - CONSTRAINTS_SET: string; - CONSTRAINTS_SET_ROOT: string; - RULE_NAME: string; - INVALID: string; -}; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.js b/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.js deleted file mode 100644 index 8fc0707..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.js +++ /dev/null @@ -1,604 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.OnlineParser = exports.RuleKind = exports.TokenKind = void 0; - -var _lexer = require("../lexer.js"); - -var _source = require("../source.js"); - -var _grammar = _interopRequireDefault(require("./grammar.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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; } - -var TokenKind = { - NAME: 'Name', - INT: 'Int', - FLOAT: 'Float', - STRING: 'String', - BLOCK_STRING: 'BlockString', - COMMENT: 'Comment', - PUNCTUATION: 'Punctuation', - EOF: '', - INVALID: 'Invalid' -}; -exports.TokenKind = TokenKind; -var RuleKind = { - TOKEN_CONSTRAINT: 'TokenConstraint', - OF_TYPE_CONSTRAINT: 'OfTypeConstraint', - LIST_OF_TYPE_CONSTRAINT: 'ListOfTypeConstraint', - PEEK_CONSTRAINT: 'PeekConstraint', - CONSTRAINTS_SET: 'ConstraintsSet', - CONSTRAINTS_SET_ROOT: 'ConstraintsSetRoot', - RULE_NAME: 'RuleName', - INVALID: 'Invalid' -}; -exports.RuleKind = RuleKind; - -var OnlineParser = /*#__PURE__*/function () { - function OnlineParser(source, state, config) { - var _config$tabSize; - - this.state = state || OnlineParser.startState(); - this._config = { - tabSize: (_config$tabSize = config === null || config === void 0 ? void 0 : config.tabSize) !== null && _config$tabSize !== void 0 ? _config$tabSize : 2 - }; - this._lexer = new _lexer.Lexer(new _source.Source(source)); - } - - OnlineParser.startState = function startState() { - return { - rules: [// $FlowFixMe[cannot-spread-interface] - _objectSpread(_objectSpread({ - name: 'Document', - state: 'Document', - kind: 'ListOfTypeConstraint' - }, _grammar.default.Document), {}, { - expanded: false, - depth: 1, - step: 1 - })], - name: null, - type: null, - levels: [], - indentLevel: 0, - kind: function kind() { - var _this$rules; - - return ((_this$rules = this.rules[this.rules.length - 1]) === null || _this$rules === void 0 ? void 0 : _this$rules.state) || ''; - }, - step: function step() { - var _this$rules2; - - return ((_this$rules2 = this.rules[this.rules.length - 1]) === null || _this$rules2 === void 0 ? void 0 : _this$rules2.step) || 0; - } - }; - }; - - OnlineParser.copyState = function copyState(state) { - return { - name: state.name, - type: state.type, - rules: JSON.parse(JSON.stringify(state.rules)), - levels: [].concat(state.levels), - indentLevel: state.indentLevel, - kind: function kind() { - var _this$rules3; - - return ((_this$rules3 = this.rules[this.rules.length - 1]) === null || _this$rules3 === void 0 ? void 0 : _this$rules3.state) || ''; - }, - step: function step() { - var _this$rules4; - - return ((_this$rules4 = this.rules[this.rules.length - 1]) === null || _this$rules4 === void 0 ? void 0 : _this$rules4.step) || 0; - } - }; - }; - - var _proto = OnlineParser.prototype; - - _proto.sol = function sol() { - return this._lexer.source.locationOffset.line === 1 && this._lexer.source.locationOffset.column === 1; - }; - - _proto.parseToken = function parseToken() { - var rule = this._getNextRule(); - - if (this.sol()) { - this.state.indentLevel = Math.floor(this.indentation() / this._config.tabSize); - } - - if (!rule) { - return { - kind: TokenKind.INVALID, - value: '' - }; - } - - var token; - - if (this._lookAhead().kind === '') { - return { - kind: TokenKind.EOF, - value: '', - ruleName: rule.name - }; - } - - switch (rule.kind) { - case RuleKind.TOKEN_CONSTRAINT: - token = this._parseTokenConstraint(rule); - break; - - case RuleKind.LIST_OF_TYPE_CONSTRAINT: - token = this._parseListOfTypeConstraint(rule); - break; - - case RuleKind.OF_TYPE_CONSTRAINT: - token = this._parseOfTypeConstraint(rule); - break; - - case RuleKind.PEEK_CONSTRAINT: - token = this._parsePeekConstraint(rule); - break; - - case RuleKind.CONSTRAINTS_SET_ROOT: - token = this._parseConstraintsSetRule(rule); - break; - - default: - return { - kind: TokenKind.INVALID, - value: '', - ruleName: rule.name - }; - } - - if (token && token.kind === TokenKind.INVALID) { - if (rule.optional === true) { - this.state.rules.pop(); - } else { - this._rollbackRule(); - } - - return this.parseToken() || token; - } - - return token; - }; - - _proto.indentation = function indentation() { - var match = this._lexer.source.body.match(/\s*/); - - var indent = 0; - - if (match && match.length === 0) { - var whiteSpaces = match[0]; - var pos = 0; - - while (whiteSpaces.length > pos) { - if (whiteSpaces.charCodeAt(pos) === 9) { - indent += 2; - } else { - indent++; - } - - pos++; - } - } - - return indent; - }; - - _proto._parseTokenConstraint = function _parseTokenConstraint(rule) { - rule.expanded = true; - - var token = this._lookAhead(); - - if (!this._matchToken(token, rule)) { - return { - kind: TokenKind.INVALID, - value: '', - tokenName: rule.tokenName, - ruleName: rule.name - }; - } - - this._advanceToken(); - - var parserToken = this._transformLexerToken(token, rule); - - this._popMatchedRule(parserToken); - - return parserToken; - }; - - _proto._parseListOfTypeConstraint = function _parseListOfTypeConstraint(rule) { - this._pushRule(_grammar.default[rule.listOfType], rule.depth + 1, rule.listOfType, 1, rule.state); - - rule.expanded = true; - var token = this.parseToken(); - return token; - }; - - _proto._parseOfTypeConstraint = function _parseOfTypeConstraint(rule) { - if (rule.expanded) { - this._popMatchedRule(); - - return this.parseToken(); - } - - this._pushRule(rule.ofType, rule.depth + 1, rule.tokenName, 1, rule.state); - - rule.expanded = true; - var token = this.parseToken(); - return token; - }; - - _proto._parsePeekConstraint = function _parsePeekConstraint(rule) { - if (rule.expanded) { - this._popMatchedRule(); - - return this.parseToken(); - } - - while (!rule.matched && rule.index < rule.peek.length - 1) { - rule.index++; - var constraint = rule.peek[rule.index]; - var ifCondition = constraint.ifCondition; - - if (typeof ifCondition === 'string') { - ifCondition = _grammar.default[ifCondition]; - } - - var token = this._lookAhead(); - - if (ifCondition && this._matchToken(token, ifCondition)) { - rule.matched = true; - rule.expanded = true; - - this._pushRule(constraint.expect, rule.depth + 1, '', 1, rule.state); - - token = this.parseToken(); - return token; - } - } - - return { - kind: TokenKind.INVALID, - value: '', - ruleName: rule.name - }; - }; - - _proto._parseConstraintsSetRule = function _parseConstraintsSetRule(rule) { - if (rule.expanded) { - this._popMatchedRule(); - - return this.parseToken(); - } - - for (var index = rule.constraints.length - 1; index >= 0; index--) { - this._pushRule(rule.constraints[index], rule.depth + 1, '', index, rule.state); - } - - rule.expanded = true; - return this.parseToken(); - }; - - _proto._matchToken = function _matchToken(token, rule) { - if (typeof token.value === 'string') { - if (typeof rule.ofValue === 'string' && token.value !== rule.ofValue || Array.isArray(rule.oneOf) && !rule.oneOf.includes(token.value) || typeof rule.ofValue !== 'string' && !Array.isArray(rule.oneOf) && token.kind !== rule.token) { - return false; - } - - return this._butNot(token, rule); - } - - if (token.kind !== rule.token) { - return false; - } - - return this._butNot(token, rule); - }; - - _proto._butNot = function _butNot(token, rule) { - var _this = this; - - if (rule.butNot) { - if (Array.isArray(rule.butNot)) { - if (rule.butNot.reduce(function (matched, constraint) { - return matched || _this._matchToken(token, constraint); - }, false)) { - return false; - } - - return true; - } - - return !this._matchToken(token, rule.butNot); - } - - return true; - }; - - _proto._transformLexerToken = function _transformLexerToken(lexerToken, rule) { - var token; - var ruleName = rule.name || ''; - var tokenName = rule.tokenName || ''; - - if (lexerToken.kind === '' || lexerToken.value !== undefined) { - token = { - kind: lexerToken.kind, - value: lexerToken.value || '', - tokenName: tokenName, - ruleName: ruleName - }; - - if (token.kind === TokenKind.STRING) { - token.value = "\"".concat(token.value, "\""); - } else if (token.kind === TokenKind.BLOCK_STRING) { - token.value = "\"\"\"".concat(token.value, "\"\"\""); - } - } else { - token = { - kind: TokenKind.PUNCTUATION, - value: lexerToken.kind, - tokenName: tokenName, - ruleName: ruleName - }; - - if (/^[{([]/.test(token.value)) { - if (this.state.indentLevel !== undefined) { - this.state.levels = this.state.levels.concat(this.state.indentLevel + 1); - } - } else if (/^[})\]]/.test(token.value)) { - this.state.levels.pop(); - } - } - - return token; - }; - - _proto._getNextRule = function _getNextRule() { - return this.state.rules[this.state.rules.length - 1] || null; - }; - - _proto._popMatchedRule = function _popMatchedRule(token) { - var rule = this.state.rules.pop(); - - if (!rule) { - return; - } - - if (token && rule.kind === RuleKind.TOKEN_CONSTRAINT) { - var constraint = rule; - - if (typeof constraint.definitionName === 'string') { - this.state.name = token.value || null; - } else if (typeof constraint.typeName === 'string') { - this.state.type = token.value || null; - } - } - - var nextRule = this._getNextRule(); - - if (!nextRule) { - return; - } - - if (nextRule.depth === rule.depth - 1 && nextRule.expanded && nextRule.kind === RuleKind.CONSTRAINTS_SET_ROOT) { - this.state.rules.pop(); - } - - if (nextRule.depth === rule.depth - 1 && nextRule.expanded && nextRule.kind === RuleKind.LIST_OF_TYPE_CONSTRAINT) { - nextRule.expanded = false; - nextRule.optional = true; - } - }; - - _proto._rollbackRule = function _rollbackRule() { - var _this2 = this; - - if (!this.state.rules.length) { - return; - } - - var popRule = function popRule() { - var lastPoppedRule = _this2.state.rules.pop(); - - if (lastPoppedRule.eatNextOnFail === true) { - _this2.state.rules.pop(); - } - }; - - var poppedRule = this.state.rules.pop(); - - if (!poppedRule) { - return; - } - - var popped = 0; - - var nextRule = this._getNextRule(); - - while (nextRule && (poppedRule.kind !== RuleKind.LIST_OF_TYPE_CONSTRAINT || nextRule.expanded) && nextRule.depth > poppedRule.depth - 1) { - this.state.rules.pop(); - popped++; - nextRule = this._getNextRule(); - } - - if (nextRule && nextRule.expanded) { - if (nextRule.optional === true) { - popRule(); - } else { - if (nextRule.kind === RuleKind.LIST_OF_TYPE_CONSTRAINT && popped === 1) { - this.state.rules.pop(); - return; - } - - this._rollbackRule(); - } - } - }; - - _proto._pushRule = function _pushRule(baseRule, depth, name, step, state) { - var _this$_getNextRule, _this$_getNextRule2, _this$_getNextRule3, _this$_getNextRule4, _this$_getNextRule5, _this$_getNextRule6, _this$_getNextRule7, _this$_getNextRule8, _this$_getNextRule9, _this$_getNextRule10; - - this.state.name = null; - this.state.type = null; - var rule = baseRule; - - switch (this._getRuleKind(rule)) { - case RuleKind.RULE_NAME: - rule = rule; - - this._pushRule(_grammar.default[rule], depth, (typeof name === 'string' ? name : undefined) || rule, step, state); - - break; - - case RuleKind.CONSTRAINTS_SET: - rule = rule; - this.state.rules.push({ - name: name || '', - depth: depth, - expanded: false, - constraints: rule, - constraintsSet: true, - kind: RuleKind.CONSTRAINTS_SET_ROOT, - state: (typeof name === 'string' ? name : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule = this._getNextRule()) === null || _this$_getNextRule === void 0 ? void 0 : _this$_getNextRule.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule2 = this._getNextRule()) === null || _this$_getNextRule2 === void 0 ? void 0 : _this$_getNextRule2.step) || 0) + 1 - }); - break; - - case RuleKind.OF_TYPE_CONSTRAINT: - rule = rule; - this.state.rules.push({ - name: name || '', - ofType: rule.ofType, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - depth: depth, - expanded: false, - kind: RuleKind.OF_TYPE_CONSTRAINT, - state: (typeof rule.tokenName === 'string' ? rule.tokenName : undefined) || (typeof name === 'string' ? name : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule3 = this._getNextRule()) === null || _this$_getNextRule3 === void 0 ? void 0 : _this$_getNextRule3.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule4 = this._getNextRule()) === null || _this$_getNextRule4 === void 0 ? void 0 : _this$_getNextRule4.step) || 0) + 1 - }); - break; - - case RuleKind.LIST_OF_TYPE_CONSTRAINT: - rule = rule; - this.state.rules.push({ - listOfType: rule.listOfType, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth: depth, - expanded: false, - kind: RuleKind.LIST_OF_TYPE_CONSTRAINT, - state: (typeof name === 'string' ? name : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule5 = this._getNextRule()) === null || _this$_getNextRule5 === void 0 ? void 0 : _this$_getNextRule5.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule6 = this._getNextRule()) === null || _this$_getNextRule6 === void 0 ? void 0 : _this$_getNextRule6.step) || 0) + 1 - }); - break; - - case RuleKind.TOKEN_CONSTRAINT: - rule = rule; - this.state.rules.push({ - token: rule.token, - ofValue: rule.ofValue, - oneOf: rule.oneOf, - definitionName: Boolean(rule.definitionName), - typeName: Boolean(rule.typeName), - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth: depth, - expanded: false, - kind: RuleKind.TOKEN_CONSTRAINT, - state: (typeof rule.tokenName === 'string' ? rule.tokenName : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule7 = this._getNextRule()) === null || _this$_getNextRule7 === void 0 ? void 0 : _this$_getNextRule7.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule8 = this._getNextRule()) === null || _this$_getNextRule8 === void 0 ? void 0 : _this$_getNextRule8.step) || 0) + 1 - }); - break; - - case RuleKind.PEEK_CONSTRAINT: - rule = rule; - this.state.rules.push({ - peek: rule.peek, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth: depth, - index: -1, - matched: false, - expanded: false, - kind: RuleKind.PEEK_CONSTRAINT, - state: (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule9 = this._getNextRule()) === null || _this$_getNextRule9 === void 0 ? void 0 : _this$_getNextRule9.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule10 = this._getNextRule()) === null || _this$_getNextRule10 === void 0 ? void 0 : _this$_getNextRule10.step) || 0) + 1 - }); - break; - } - }; - - _proto._getRuleKind = function _getRuleKind(rule) { - if (Array.isArray(rule)) { - return RuleKind.CONSTRAINTS_SET; - } - - if (rule.constraintsSet === true) { - return RuleKind.CONSTRAINTS_SET_ROOT; - } - - if (typeof rule === 'string') { - return RuleKind.RULE_NAME; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'ofType')) { - return RuleKind.OF_TYPE_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'listOfType')) { - return RuleKind.LIST_OF_TYPE_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'peek')) { - return RuleKind.PEEK_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'token')) { - return RuleKind.TOKEN_CONSTRAINT; - } - - return RuleKind.INVALID; - }; - - _proto._advanceToken = function _advanceToken() { - return this._lexer.advance(); - }; - - _proto._lookAhead = function _lookAhead() { - try { - return this._lexer.lookahead(); - } catch (err) { - return { - kind: TokenKind.INVALID, - value: '' - }; - } - }; - - return OnlineParser; -}(); - -exports.OnlineParser = OnlineParser; diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.js.flow b/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.js.flow deleted file mode 100644 index eae6e89..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.js.flow +++ /dev/null @@ -1,723 +0,0 @@ -// @flow strict -import { Lexer } from '../lexer'; -import { Source } from '../source'; - -import GraphQLGrammar from './grammar'; -import type { - GraphQLGrammarRule, - GraphQLGrammarRuleName, - GraphQLGrammarRuleConstraint, - GraphQLGrammarTokenConstraint, - GraphQLGrammarOfTypeConstraint, - GraphQLGrammarListOfTypeConstraint, - GraphQLGrammarPeekConstraint, - GraphQLGrammarConstraintsSet, -} from './grammar'; - -export const TokenKind = { - NAME: 'Name', - INT: 'Int', - FLOAT: 'Float', - STRING: 'String', - BLOCK_STRING: 'BlockString', - COMMENT: 'Comment', - PUNCTUATION: 'Punctuation', - EOF: '', - INVALID: 'Invalid', -}; - -export const RuleKind = { - TOKEN_CONSTRAINT: 'TokenConstraint', - OF_TYPE_CONSTRAINT: 'OfTypeConstraint', - LIST_OF_TYPE_CONSTRAINT: 'ListOfTypeConstraint', - PEEK_CONSTRAINT: 'PeekConstraint', - CONSTRAINTS_SET: 'ConstraintsSet', - CONSTRAINTS_SET_ROOT: 'ConstraintsSetRoot', - RULE_NAME: 'RuleName', - INVALID: 'Invalid', -}; - -interface BaseOnlineParserRule { - kind: string; - name?: string; - depth: number; - step: number; - expanded: boolean; - state: string; - optional?: boolean; - eatNextOnFail?: boolean; -} -interface TokenOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarTokenConstraint {} -interface OfTypeOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarOfTypeConstraint {} -interface ListOfTypeOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarListOfTypeConstraint {} -interface PeekOnlineParserRule - extends BaseOnlineParserRule, - GraphQLGrammarPeekConstraint { - index: number; - matched: boolean; -} -interface ConstraintsSetOnlineParserRule extends BaseOnlineParserRule { - constraintsSet: boolean; - constraints: GraphQLGrammarConstraintsSet; -} - -type OnlineParserRule = - | TokenOnlineParserRule - | OfTypeOnlineParserRule - | ListOfTypeOnlineParserRule - | PeekOnlineParserRule - | ConstraintsSetOnlineParserRule; - -export type OnlineParserState = {| - rules: Array, - kind: () => string, - step: () => number, - levels: Array, - indentLevel: number, - name: string | null, - type: string | null, -|}; - -type Token = {| - kind: string, - value: string, - tokenName?: ?string, - ruleName?: ?string, -|}; - -type LexerToken = {| - kind: string, - value: ?string, -|}; - -type OnlineParserConfig = {| - tabSize: number, -|}; - -type OnlineParserConfigOption = {| - tabSize: ?number, -|}; - -export class OnlineParser { - state: OnlineParserState; - _lexer: Lexer; - _config: OnlineParserConfig; - - constructor( - source: string, - state?: OnlineParserState, - config?: OnlineParserConfigOption, - ) { - this.state = state || OnlineParser.startState(); - this._config = { - tabSize: config?.tabSize ?? 2, - }; - this._lexer = new Lexer(new Source(source)); - } - - static startState(): OnlineParserState { - return { - rules: [ - // $FlowFixMe[cannot-spread-interface] - { - name: 'Document', - state: 'Document', - kind: 'ListOfTypeConstraint', - ...GraphQLGrammar.Document, - expanded: false, - depth: 1, - step: 1, - }, - ], - name: null, - type: null, - levels: [], - indentLevel: 0, - kind(): string { - return this.rules[this.rules.length - 1]?.state || ''; - }, - step(): number { - return this.rules[this.rules.length - 1]?.step || 0; - }, - }; - } - - static copyState(state: OnlineParserState): OnlineParserState { - return { - name: state.name, - type: state.type, - rules: JSON.parse(JSON.stringify(state.rules)), - levels: [...state.levels], - indentLevel: state.indentLevel, - kind(): string { - return this.rules[this.rules.length - 1]?.state || ''; - }, - step(): number { - return this.rules[this.rules.length - 1]?.step || 0; - }, - }; - } - - sol(): boolean { - return ( - this._lexer.source.locationOffset.line === 1 && - this._lexer.source.locationOffset.column === 1 - ); - } - - parseToken(): Token { - const rule = (this._getNextRule(): any); - - if (this.sol()) { - this.state.indentLevel = Math.floor( - this.indentation() / this._config.tabSize, - ); - } - - if (!rule) { - return { - kind: TokenKind.INVALID, - value: '', - }; - } - - let token; - - if (this._lookAhead().kind === '') { - return { - kind: TokenKind.EOF, - value: '', - ruleName: rule.name, - }; - } - - switch (rule.kind) { - case RuleKind.TOKEN_CONSTRAINT: - token = this._parseTokenConstraint(rule); - break; - case RuleKind.LIST_OF_TYPE_CONSTRAINT: - token = this._parseListOfTypeConstraint(rule); - break; - case RuleKind.OF_TYPE_CONSTRAINT: - token = this._parseOfTypeConstraint(rule); - break; - case RuleKind.PEEK_CONSTRAINT: - token = this._parsePeekConstraint(rule); - break; - case RuleKind.CONSTRAINTS_SET_ROOT: - token = this._parseConstraintsSetRule(rule); - break; - default: - return { - kind: TokenKind.INVALID, - value: '', - ruleName: rule.name, - }; - } - - if (token && token.kind === TokenKind.INVALID) { - if (rule.optional === true) { - this.state.rules.pop(); - } else { - this._rollbackRule(); - } - - return this.parseToken() || token; - } - - return token; - } - - indentation(): number { - const match = this._lexer.source.body.match(/\s*/); - let indent = 0; - - if (match && match.length === 0) { - const whiteSpaces = match[0]; - let pos = 0; - while (whiteSpaces.length > pos) { - if (whiteSpaces.charCodeAt(pos) === 9) { - indent += 2; - } else { - indent++; - } - pos++; - } - } - - return indent; - } - - _parseTokenConstraint(rule: TokenOnlineParserRule): Token { - rule.expanded = true; - - const token = this._lookAhead(); - - if (!this._matchToken(token, rule)) { - return { - kind: TokenKind.INVALID, - value: '', - tokenName: rule.tokenName, - ruleName: rule.name, - }; - } - - this._advanceToken(); - const parserToken = this._transformLexerToken(token, rule); - this._popMatchedRule(parserToken); - - return parserToken; - } - - _parseListOfTypeConstraint(rule: ListOfTypeOnlineParserRule): Token { - this._pushRule( - GraphQLGrammar[rule.listOfType], - rule.depth + 1, - rule.listOfType, - 1, - rule.state, - ); - - rule.expanded = true; - - const token = this.parseToken(); - - return token; - } - - _parseOfTypeConstraint(rule: OfTypeOnlineParserRule): Token { - if (rule.expanded) { - this._popMatchedRule(); - return this.parseToken(); - } - - this._pushRule(rule.ofType, rule.depth + 1, rule.tokenName, 1, rule.state); - rule.expanded = true; - - const token = this.parseToken(); - - return token; - } - - _parsePeekConstraint(rule: PeekOnlineParserRule): Token { - if (rule.expanded) { - this._popMatchedRule(); - return this.parseToken(); - } - - while (!rule.matched && rule.index < rule.peek.length - 1) { - rule.index++; - const constraint = rule.peek[rule.index]; - - let { ifCondition } = constraint; - if (typeof ifCondition === 'string') { - ifCondition = GraphQLGrammar[ifCondition]; - } - - let token = this._lookAhead(); - if (ifCondition && this._matchToken(token, ifCondition)) { - rule.matched = true; - rule.expanded = true; - this._pushRule(constraint.expect, rule.depth + 1, '', 1, rule.state); - - token = this.parseToken(); - - return token; - } - } - - return { - kind: TokenKind.INVALID, - value: '', - ruleName: rule.name, - }; - } - - _parseConstraintsSetRule(rule: ConstraintsSetOnlineParserRule): Token { - if (rule.expanded) { - this._popMatchedRule(); - return this.parseToken(); - } - - for (let index = rule.constraints.length - 1; index >= 0; index--) { - this._pushRule( - rule.constraints[index], - rule.depth + 1, - '', - index, - rule.state, - ); - } - rule.expanded = true; - - return this.parseToken(); - } - - _matchToken( - token: Token | LexerToken, - rule: GraphQLGrammarTokenConstraint, - ): boolean { - if (typeof token.value === 'string') { - if ( - (typeof rule.ofValue === 'string' && token.value !== rule.ofValue) || - (Array.isArray(rule.oneOf) && !rule.oneOf.includes(token.value)) || - (typeof rule.ofValue !== 'string' && - !Array.isArray(rule.oneOf) && - token.kind !== rule.token) - ) { - return false; - } - - return this._butNot(token, rule); - } - - if (token.kind !== rule.token) { - return false; - } - - return this._butNot(token, rule); - } - - _butNot( - token: Token | LexerToken, - rule: GraphQLGrammarRuleConstraint, - ): boolean { - if (rule.butNot) { - if (Array.isArray(rule.butNot)) { - if ( - rule.butNot.reduce( - (matched, constraint) => - matched || this._matchToken(token, constraint), - false, - ) - ) { - return false; - } - - return true; - } - - return !this._matchToken(token, rule.butNot); - } - - return true; - } - - _transformLexerToken(lexerToken: LexerToken, rule: any): Token { - let token; - const ruleName = rule.name || ''; - const tokenName = rule.tokenName || ''; - - if (lexerToken.kind === '' || lexerToken.value !== undefined) { - token = { - kind: lexerToken.kind, - value: lexerToken.value || '', - tokenName, - ruleName, - }; - - if (token.kind === TokenKind.STRING) { - token.value = `"${token.value}"`; - } else if (token.kind === TokenKind.BLOCK_STRING) { - token.value = `"""${token.value}"""`; - } - } else { - token = { - kind: TokenKind.PUNCTUATION, - value: lexerToken.kind, - tokenName, - ruleName, - }; - - if (/^[{([]/.test(token.value)) { - if (this.state.indentLevel !== undefined) { - this.state.levels = this.state.levels.concat( - this.state.indentLevel + 1, - ); - } - } else if (/^[})\]]/.test(token.value)) { - this.state.levels.pop(); - } - } - - return token; - } - - _getNextRule(): OnlineParserRule | null { - return this.state.rules[this.state.rules.length - 1] || null; - } - - _popMatchedRule(token: ?Token) { - const rule = this.state.rules.pop(); - if (!rule) { - return; - } - - if (token && rule.kind === RuleKind.TOKEN_CONSTRAINT) { - const constraint = rule; - if (typeof constraint.definitionName === 'string') { - this.state.name = token.value || null; - } else if (typeof constraint.typeName === 'string') { - this.state.type = token.value || null; - } - } - - const nextRule = this._getNextRule(); - if (!nextRule) { - return; - } - - if ( - nextRule.depth === rule.depth - 1 && - nextRule.expanded && - nextRule.kind === RuleKind.CONSTRAINTS_SET_ROOT - ) { - this.state.rules.pop(); - } - - if ( - nextRule.depth === rule.depth - 1 && - nextRule.expanded && - nextRule.kind === RuleKind.LIST_OF_TYPE_CONSTRAINT - ) { - nextRule.expanded = false; - nextRule.optional = true; - } - } - - _rollbackRule() { - if (!this.state.rules.length) { - return; - } - - const popRule = () => { - const lastPoppedRule = this.state.rules.pop(); - - if (lastPoppedRule.eatNextOnFail === true) { - this.state.rules.pop(); - } - }; - - const poppedRule = this.state.rules.pop(); - if (!poppedRule) { - return; - } - - let popped = 0; - let nextRule = this._getNextRule(); - while ( - nextRule && - (poppedRule.kind !== RuleKind.LIST_OF_TYPE_CONSTRAINT || - nextRule.expanded) && - nextRule.depth > poppedRule.depth - 1 - ) { - this.state.rules.pop(); - popped++; - nextRule = this._getNextRule(); - } - - if (nextRule && nextRule.expanded) { - if (nextRule.optional === true) { - popRule(); - } else { - if ( - nextRule.kind === RuleKind.LIST_OF_TYPE_CONSTRAINT && - popped === 1 - ) { - this.state.rules.pop(); - return; - } - this._rollbackRule(); - } - } - } - - _pushRule( - baseRule: any, - depth: number, - name?: string, - step?: number, - state?: string, - ) { - this.state.name = null; - this.state.type = null; - let rule = baseRule; - - switch (this._getRuleKind(rule)) { - case RuleKind.RULE_NAME: - rule = (rule: GraphQLGrammarRuleName); - this._pushRule( - GraphQLGrammar[rule], - depth, - (typeof name === 'string' ? name : undefined) || rule, - step, - state, - ); - break; - case RuleKind.CONSTRAINTS_SET: - rule = (rule: GraphQLGrammarConstraintsSet); - this.state.rules.push({ - name: name || '', - depth, - expanded: false, - constraints: rule, - constraintsSet: true, - kind: RuleKind.CONSTRAINTS_SET_ROOT, - state: - (typeof name === 'string' ? name : undefined) || - (typeof state === 'string' ? state : undefined) || - this._getNextRule()?.state || - '', - step: - typeof step === 'number' - ? step - : (this._getNextRule()?.step || 0) + 1, - }); - break; - case RuleKind.OF_TYPE_CONSTRAINT: - rule = (rule: GraphQLGrammarOfTypeConstraint); - this.state.rules.push({ - name: name || '', - ofType: rule.ofType, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - depth, - expanded: false, - kind: RuleKind.OF_TYPE_CONSTRAINT, - state: - (typeof rule.tokenName === 'string' ? rule.tokenName : undefined) || - (typeof name === 'string' ? name : undefined) || - (typeof state === 'string' ? state : undefined) || - this._getNextRule()?.state || - '', - step: - typeof step === 'number' - ? step - : (this._getNextRule()?.step || 0) + 1, - }); - break; - case RuleKind.LIST_OF_TYPE_CONSTRAINT: - rule = (rule: GraphQLGrammarListOfTypeConstraint); - this.state.rules.push({ - listOfType: rule.listOfType, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth, - expanded: false, - kind: RuleKind.LIST_OF_TYPE_CONSTRAINT, - state: - (typeof name === 'string' ? name : undefined) || - (typeof state === 'string' ? state : undefined) || - this._getNextRule()?.state || - '', - step: - typeof step === 'number' - ? step - : (this._getNextRule()?.step || 0) + 1, - }); - break; - case RuleKind.TOKEN_CONSTRAINT: - rule = (rule: GraphQLGrammarTokenConstraint); - this.state.rules.push({ - token: rule.token, - ofValue: rule.ofValue, - oneOf: rule.oneOf, - definitionName: Boolean(rule.definitionName), - typeName: Boolean(rule.typeName), - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth, - expanded: false, - kind: RuleKind.TOKEN_CONSTRAINT, - state: - (typeof rule.tokenName === 'string' ? rule.tokenName : undefined) || - (typeof state === 'string' ? state : undefined) || - this._getNextRule()?.state || - '', - step: - typeof step === 'number' - ? step - : (this._getNextRule()?.step || 0) + 1, - }); - break; - case RuleKind.PEEK_CONSTRAINT: - rule = (rule: GraphQLGrammarPeekConstraint); - this.state.rules.push({ - peek: rule.peek, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth, - index: -1, - matched: false, - expanded: false, - kind: RuleKind.PEEK_CONSTRAINT, - state: - (typeof state === 'string' ? state : undefined) || - this._getNextRule()?.state || - '', - step: - typeof step === 'number' - ? step - : (this._getNextRule()?.step || 0) + 1, - }); - break; - } - } - - _getRuleKind(rule: GraphQLGrammarRule | OnlineParserRule): string { - if (Array.isArray(rule)) { - return RuleKind.CONSTRAINTS_SET; - } - - if (rule.constraintsSet === true) { - return RuleKind.CONSTRAINTS_SET_ROOT; - } - - if (typeof rule === 'string') { - return RuleKind.RULE_NAME; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'ofType')) { - return RuleKind.OF_TYPE_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'listOfType')) { - return RuleKind.LIST_OF_TYPE_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'peek')) { - return RuleKind.PEEK_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'token')) { - return RuleKind.TOKEN_CONSTRAINT; - } - - return RuleKind.INVALID; - } - - _advanceToken(): LexerToken { - return (this._lexer.advance(): any); - } - - _lookAhead(): LexerToken { - try { - return (this._lexer.lookahead(): any); - } catch (err) { - return { kind: TokenKind.INVALID, value: '' }; - } - } -} diff --git a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.mjs b/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.mjs deleted file mode 100644 index bd5e2fd..0000000 --- a/JS/node_modules/graphql/language/experimentalOnlineParser/onlineParser.mjs +++ /dev/null @@ -1,587 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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 { Lexer } from "../lexer.mjs"; -import { Source } from "../source.mjs"; -import GraphQLGrammar from "./grammar.mjs"; -export var TokenKind = { - NAME: 'Name', - INT: 'Int', - FLOAT: 'Float', - STRING: 'String', - BLOCK_STRING: 'BlockString', - COMMENT: 'Comment', - PUNCTUATION: 'Punctuation', - EOF: '', - INVALID: 'Invalid' -}; -export var RuleKind = { - TOKEN_CONSTRAINT: 'TokenConstraint', - OF_TYPE_CONSTRAINT: 'OfTypeConstraint', - LIST_OF_TYPE_CONSTRAINT: 'ListOfTypeConstraint', - PEEK_CONSTRAINT: 'PeekConstraint', - CONSTRAINTS_SET: 'ConstraintsSet', - CONSTRAINTS_SET_ROOT: 'ConstraintsSetRoot', - RULE_NAME: 'RuleName', - INVALID: 'Invalid' -}; -export var OnlineParser = /*#__PURE__*/function () { - function OnlineParser(source, state, config) { - var _config$tabSize; - - this.state = state || OnlineParser.startState(); - this._config = { - tabSize: (_config$tabSize = config === null || config === void 0 ? void 0 : config.tabSize) !== null && _config$tabSize !== void 0 ? _config$tabSize : 2 - }; - this._lexer = new Lexer(new Source(source)); - } - - OnlineParser.startState = function startState() { - return { - rules: [// $FlowFixMe[cannot-spread-interface] - _objectSpread(_objectSpread({ - name: 'Document', - state: 'Document', - kind: 'ListOfTypeConstraint' - }, GraphQLGrammar.Document), {}, { - expanded: false, - depth: 1, - step: 1 - })], - name: null, - type: null, - levels: [], - indentLevel: 0, - kind: function kind() { - var _this$rules; - - return ((_this$rules = this.rules[this.rules.length - 1]) === null || _this$rules === void 0 ? void 0 : _this$rules.state) || ''; - }, - step: function step() { - var _this$rules2; - - return ((_this$rules2 = this.rules[this.rules.length - 1]) === null || _this$rules2 === void 0 ? void 0 : _this$rules2.step) || 0; - } - }; - }; - - OnlineParser.copyState = function copyState(state) { - return { - name: state.name, - type: state.type, - rules: JSON.parse(JSON.stringify(state.rules)), - levels: [].concat(state.levels), - indentLevel: state.indentLevel, - kind: function kind() { - var _this$rules3; - - return ((_this$rules3 = this.rules[this.rules.length - 1]) === null || _this$rules3 === void 0 ? void 0 : _this$rules3.state) || ''; - }, - step: function step() { - var _this$rules4; - - return ((_this$rules4 = this.rules[this.rules.length - 1]) === null || _this$rules4 === void 0 ? void 0 : _this$rules4.step) || 0; - } - }; - }; - - var _proto = OnlineParser.prototype; - - _proto.sol = function sol() { - return this._lexer.source.locationOffset.line === 1 && this._lexer.source.locationOffset.column === 1; - }; - - _proto.parseToken = function parseToken() { - var rule = this._getNextRule(); - - if (this.sol()) { - this.state.indentLevel = Math.floor(this.indentation() / this._config.tabSize); - } - - if (!rule) { - return { - kind: TokenKind.INVALID, - value: '' - }; - } - - var token; - - if (this._lookAhead().kind === '') { - return { - kind: TokenKind.EOF, - value: '', - ruleName: rule.name - }; - } - - switch (rule.kind) { - case RuleKind.TOKEN_CONSTRAINT: - token = this._parseTokenConstraint(rule); - break; - - case RuleKind.LIST_OF_TYPE_CONSTRAINT: - token = this._parseListOfTypeConstraint(rule); - break; - - case RuleKind.OF_TYPE_CONSTRAINT: - token = this._parseOfTypeConstraint(rule); - break; - - case RuleKind.PEEK_CONSTRAINT: - token = this._parsePeekConstraint(rule); - break; - - case RuleKind.CONSTRAINTS_SET_ROOT: - token = this._parseConstraintsSetRule(rule); - break; - - default: - return { - kind: TokenKind.INVALID, - value: '', - ruleName: rule.name - }; - } - - if (token && token.kind === TokenKind.INVALID) { - if (rule.optional === true) { - this.state.rules.pop(); - } else { - this._rollbackRule(); - } - - return this.parseToken() || token; - } - - return token; - }; - - _proto.indentation = function indentation() { - var match = this._lexer.source.body.match(/\s*/); - - var indent = 0; - - if (match && match.length === 0) { - var whiteSpaces = match[0]; - var pos = 0; - - while (whiteSpaces.length > pos) { - if (whiteSpaces.charCodeAt(pos) === 9) { - indent += 2; - } else { - indent++; - } - - pos++; - } - } - - return indent; - }; - - _proto._parseTokenConstraint = function _parseTokenConstraint(rule) { - rule.expanded = true; - - var token = this._lookAhead(); - - if (!this._matchToken(token, rule)) { - return { - kind: TokenKind.INVALID, - value: '', - tokenName: rule.tokenName, - ruleName: rule.name - }; - } - - this._advanceToken(); - - var parserToken = this._transformLexerToken(token, rule); - - this._popMatchedRule(parserToken); - - return parserToken; - }; - - _proto._parseListOfTypeConstraint = function _parseListOfTypeConstraint(rule) { - this._pushRule(GraphQLGrammar[rule.listOfType], rule.depth + 1, rule.listOfType, 1, rule.state); - - rule.expanded = true; - var token = this.parseToken(); - return token; - }; - - _proto._parseOfTypeConstraint = function _parseOfTypeConstraint(rule) { - if (rule.expanded) { - this._popMatchedRule(); - - return this.parseToken(); - } - - this._pushRule(rule.ofType, rule.depth + 1, rule.tokenName, 1, rule.state); - - rule.expanded = true; - var token = this.parseToken(); - return token; - }; - - _proto._parsePeekConstraint = function _parsePeekConstraint(rule) { - if (rule.expanded) { - this._popMatchedRule(); - - return this.parseToken(); - } - - while (!rule.matched && rule.index < rule.peek.length - 1) { - rule.index++; - var constraint = rule.peek[rule.index]; - var ifCondition = constraint.ifCondition; - - if (typeof ifCondition === 'string') { - ifCondition = GraphQLGrammar[ifCondition]; - } - - var token = this._lookAhead(); - - if (ifCondition && this._matchToken(token, ifCondition)) { - rule.matched = true; - rule.expanded = true; - - this._pushRule(constraint.expect, rule.depth + 1, '', 1, rule.state); - - token = this.parseToken(); - return token; - } - } - - return { - kind: TokenKind.INVALID, - value: '', - ruleName: rule.name - }; - }; - - _proto._parseConstraintsSetRule = function _parseConstraintsSetRule(rule) { - if (rule.expanded) { - this._popMatchedRule(); - - return this.parseToken(); - } - - for (var index = rule.constraints.length - 1; index >= 0; index--) { - this._pushRule(rule.constraints[index], rule.depth + 1, '', index, rule.state); - } - - rule.expanded = true; - return this.parseToken(); - }; - - _proto._matchToken = function _matchToken(token, rule) { - if (typeof token.value === 'string') { - if (typeof rule.ofValue === 'string' && token.value !== rule.ofValue || Array.isArray(rule.oneOf) && !rule.oneOf.includes(token.value) || typeof rule.ofValue !== 'string' && !Array.isArray(rule.oneOf) && token.kind !== rule.token) { - return false; - } - - return this._butNot(token, rule); - } - - if (token.kind !== rule.token) { - return false; - } - - return this._butNot(token, rule); - }; - - _proto._butNot = function _butNot(token, rule) { - var _this = this; - - if (rule.butNot) { - if (Array.isArray(rule.butNot)) { - if (rule.butNot.reduce(function (matched, constraint) { - return matched || _this._matchToken(token, constraint); - }, false)) { - return false; - } - - return true; - } - - return !this._matchToken(token, rule.butNot); - } - - return true; - }; - - _proto._transformLexerToken = function _transformLexerToken(lexerToken, rule) { - var token; - var ruleName = rule.name || ''; - var tokenName = rule.tokenName || ''; - - if (lexerToken.kind === '' || lexerToken.value !== undefined) { - token = { - kind: lexerToken.kind, - value: lexerToken.value || '', - tokenName: tokenName, - ruleName: ruleName - }; - - if (token.kind === TokenKind.STRING) { - token.value = "\"".concat(token.value, "\""); - } else if (token.kind === TokenKind.BLOCK_STRING) { - token.value = "\"\"\"".concat(token.value, "\"\"\""); - } - } else { - token = { - kind: TokenKind.PUNCTUATION, - value: lexerToken.kind, - tokenName: tokenName, - ruleName: ruleName - }; - - if (/^[{([]/.test(token.value)) { - if (this.state.indentLevel !== undefined) { - this.state.levels = this.state.levels.concat(this.state.indentLevel + 1); - } - } else if (/^[})\]]/.test(token.value)) { - this.state.levels.pop(); - } - } - - return token; - }; - - _proto._getNextRule = function _getNextRule() { - return this.state.rules[this.state.rules.length - 1] || null; - }; - - _proto._popMatchedRule = function _popMatchedRule(token) { - var rule = this.state.rules.pop(); - - if (!rule) { - return; - } - - if (token && rule.kind === RuleKind.TOKEN_CONSTRAINT) { - var constraint = rule; - - if (typeof constraint.definitionName === 'string') { - this.state.name = token.value || null; - } else if (typeof constraint.typeName === 'string') { - this.state.type = token.value || null; - } - } - - var nextRule = this._getNextRule(); - - if (!nextRule) { - return; - } - - if (nextRule.depth === rule.depth - 1 && nextRule.expanded && nextRule.kind === RuleKind.CONSTRAINTS_SET_ROOT) { - this.state.rules.pop(); - } - - if (nextRule.depth === rule.depth - 1 && nextRule.expanded && nextRule.kind === RuleKind.LIST_OF_TYPE_CONSTRAINT) { - nextRule.expanded = false; - nextRule.optional = true; - } - }; - - _proto._rollbackRule = function _rollbackRule() { - var _this2 = this; - - if (!this.state.rules.length) { - return; - } - - var popRule = function popRule() { - var lastPoppedRule = _this2.state.rules.pop(); - - if (lastPoppedRule.eatNextOnFail === true) { - _this2.state.rules.pop(); - } - }; - - var poppedRule = this.state.rules.pop(); - - if (!poppedRule) { - return; - } - - var popped = 0; - - var nextRule = this._getNextRule(); - - while (nextRule && (poppedRule.kind !== RuleKind.LIST_OF_TYPE_CONSTRAINT || nextRule.expanded) && nextRule.depth > poppedRule.depth - 1) { - this.state.rules.pop(); - popped++; - nextRule = this._getNextRule(); - } - - if (nextRule && nextRule.expanded) { - if (nextRule.optional === true) { - popRule(); - } else { - if (nextRule.kind === RuleKind.LIST_OF_TYPE_CONSTRAINT && popped === 1) { - this.state.rules.pop(); - return; - } - - this._rollbackRule(); - } - } - }; - - _proto._pushRule = function _pushRule(baseRule, depth, name, step, state) { - var _this$_getNextRule, _this$_getNextRule2, _this$_getNextRule3, _this$_getNextRule4, _this$_getNextRule5, _this$_getNextRule6, _this$_getNextRule7, _this$_getNextRule8, _this$_getNextRule9, _this$_getNextRule10; - - this.state.name = null; - this.state.type = null; - var rule = baseRule; - - switch (this._getRuleKind(rule)) { - case RuleKind.RULE_NAME: - rule = rule; - - this._pushRule(GraphQLGrammar[rule], depth, (typeof name === 'string' ? name : undefined) || rule, step, state); - - break; - - case RuleKind.CONSTRAINTS_SET: - rule = rule; - this.state.rules.push({ - name: name || '', - depth: depth, - expanded: false, - constraints: rule, - constraintsSet: true, - kind: RuleKind.CONSTRAINTS_SET_ROOT, - state: (typeof name === 'string' ? name : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule = this._getNextRule()) === null || _this$_getNextRule === void 0 ? void 0 : _this$_getNextRule.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule2 = this._getNextRule()) === null || _this$_getNextRule2 === void 0 ? void 0 : _this$_getNextRule2.step) || 0) + 1 - }); - break; - - case RuleKind.OF_TYPE_CONSTRAINT: - rule = rule; - this.state.rules.push({ - name: name || '', - ofType: rule.ofType, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - depth: depth, - expanded: false, - kind: RuleKind.OF_TYPE_CONSTRAINT, - state: (typeof rule.tokenName === 'string' ? rule.tokenName : undefined) || (typeof name === 'string' ? name : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule3 = this._getNextRule()) === null || _this$_getNextRule3 === void 0 ? void 0 : _this$_getNextRule3.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule4 = this._getNextRule()) === null || _this$_getNextRule4 === void 0 ? void 0 : _this$_getNextRule4.step) || 0) + 1 - }); - break; - - case RuleKind.LIST_OF_TYPE_CONSTRAINT: - rule = rule; - this.state.rules.push({ - listOfType: rule.listOfType, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth: depth, - expanded: false, - kind: RuleKind.LIST_OF_TYPE_CONSTRAINT, - state: (typeof name === 'string' ? name : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule5 = this._getNextRule()) === null || _this$_getNextRule5 === void 0 ? void 0 : _this$_getNextRule5.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule6 = this._getNextRule()) === null || _this$_getNextRule6 === void 0 ? void 0 : _this$_getNextRule6.step) || 0) + 1 - }); - break; - - case RuleKind.TOKEN_CONSTRAINT: - rule = rule; - this.state.rules.push({ - token: rule.token, - ofValue: rule.ofValue, - oneOf: rule.oneOf, - definitionName: Boolean(rule.definitionName), - typeName: Boolean(rule.typeName), - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth: depth, - expanded: false, - kind: RuleKind.TOKEN_CONSTRAINT, - state: (typeof rule.tokenName === 'string' ? rule.tokenName : undefined) || (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule7 = this._getNextRule()) === null || _this$_getNextRule7 === void 0 ? void 0 : _this$_getNextRule7.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule8 = this._getNextRule()) === null || _this$_getNextRule8 === void 0 ? void 0 : _this$_getNextRule8.step) || 0) + 1 - }); - break; - - case RuleKind.PEEK_CONSTRAINT: - rule = rule; - this.state.rules.push({ - peek: rule.peek, - optional: Boolean(rule.optional), - butNot: rule.butNot, - eatNextOnFail: Boolean(rule.eatNextOnFail), - name: name || '', - depth: depth, - index: -1, - matched: false, - expanded: false, - kind: RuleKind.PEEK_CONSTRAINT, - state: (typeof state === 'string' ? state : undefined) || ((_this$_getNextRule9 = this._getNextRule()) === null || _this$_getNextRule9 === void 0 ? void 0 : _this$_getNextRule9.state) || '', - step: typeof step === 'number' ? step : (((_this$_getNextRule10 = this._getNextRule()) === null || _this$_getNextRule10 === void 0 ? void 0 : _this$_getNextRule10.step) || 0) + 1 - }); - break; - } - }; - - _proto._getRuleKind = function _getRuleKind(rule) { - if (Array.isArray(rule)) { - return RuleKind.CONSTRAINTS_SET; - } - - if (rule.constraintsSet === true) { - return RuleKind.CONSTRAINTS_SET_ROOT; - } - - if (typeof rule === 'string') { - return RuleKind.RULE_NAME; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'ofType')) { - return RuleKind.OF_TYPE_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'listOfType')) { - return RuleKind.LIST_OF_TYPE_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'peek')) { - return RuleKind.PEEK_CONSTRAINT; - } - - if (Object.prototype.hasOwnProperty.call(rule, 'token')) { - return RuleKind.TOKEN_CONSTRAINT; - } - - return RuleKind.INVALID; - }; - - _proto._advanceToken = function _advanceToken() { - return this._lexer.advance(); - }; - - _proto._lookAhead = function _lookAhead() { - try { - return this._lexer.lookahead(); - } catch (err) { - return { - kind: TokenKind.INVALID, - value: '' - }; - } - }; - - return OnlineParser; -}(); diff --git a/JS/node_modules/graphql/language/index.d.ts b/JS/node_modules/graphql/language/index.d.ts deleted file mode 100644 index ce96538..0000000 --- a/JS/node_modules/graphql/language/index.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -export { Source } from './source'; -export { getLocation, SourceLocation } from './location'; - -export { printLocation, printSourceLocation } from './printLocation'; - -export { Kind, KindEnum } from './kinds'; -export { TokenKind, TokenKindEnum } from './tokenKind'; -export { Lexer } from './lexer'; -export { parse, parseValue, parseType, ParseOptions } from './parser'; -export { print } from './printer'; -export { - visit, - visitInParallel, - getVisitFn, - BREAK, - ASTVisitor, - Visitor, - VisitFn, - VisitorKeyMap, -} from './visitor'; - -export { - 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, DirectiveLocationEnum } from './directiveLocation'; diff --git a/JS/node_modules/graphql/language/index.js b/JS/node_modules/graphql/language/index.js deleted file mode 100644 index 63e564d..0000000 --- a/JS/node_modules/graphql/language/index.js +++ /dev/null @@ -1,191 +0,0 @@ -"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, "Lexer", { - enumerable: true, - get: function get() { - return _lexer.Lexer; - } -}); -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, "getVisitFn", { - enumerable: true, - get: function get() { - return _visitor.getVisitFn; - } -}); -Object.defineProperty(exports, "BREAK", { - enumerable: true, - get: function get() { - return _visitor.BREAK; - } -}); -Object.defineProperty(exports, "Location", { - enumerable: true, - get: function get() { - return _ast.Location; - } -}); -Object.defineProperty(exports, "Token", { - enumerable: true, - get: function get() { - return _ast.Token; - } -}); -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.js"); - -var _location = require("./location.js"); - -var _printLocation = require("./printLocation.js"); - -var _kinds = require("./kinds.js"); - -var _tokenKind = require("./tokenKind.js"); - -var _lexer = require("./lexer.js"); - -var _parser = require("./parser.js"); - -var _printer = require("./printer.js"); - -var _visitor = require("./visitor.js"); - -var _ast = require("./ast.js"); - -var _predicates = require("./predicates.js"); - -var _directiveLocation = require("./directiveLocation.js"); diff --git a/JS/node_modules/graphql/language/index.js.flow b/JS/node_modules/graphql/language/index.js.flow deleted file mode 100644 index c604e46..0000000 --- a/JS/node_modules/graphql/language/index.js.flow +++ /dev/null @@ -1,98 +0,0 @@ -// @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 { Lexer } from './lexer'; - -export { parse, parseValue, parseType } from './parser'; -export type { ParseOptions } from './parser'; - -export { print } from './printer'; - -export { visit, visitInParallel, getVisitFn, BREAK } from './visitor'; -export type { ASTVisitor, Visitor, VisitFn, VisitorKeyMap } from './visitor'; - -export { Location, Token } from './ast'; -export type { - 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/JS/node_modules/graphql/language/index.mjs b/JS/node_modules/graphql/language/index.mjs deleted file mode 100644 index 682e1a8..0000000 --- a/JS/node_modules/graphql/language/index.mjs +++ /dev/null @@ -1,12 +0,0 @@ -export { Source } from "./source.mjs"; -export { getLocation } from "./location.mjs"; -export { printLocation, printSourceLocation } from "./printLocation.mjs"; -export { Kind } from "./kinds.mjs"; -export { TokenKind } from "./tokenKind.mjs"; -export { Lexer } from "./lexer.mjs"; -export { parse, parseValue, parseType } from "./parser.mjs"; -export { print } from "./printer.mjs"; -export { visit, visitInParallel, getVisitFn, BREAK } from "./visitor.mjs"; -export { Location, Token } from "./ast.mjs"; -export { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from "./predicates.mjs"; -export { DirectiveLocation } from "./directiveLocation.mjs"; diff --git a/JS/node_modules/graphql/language/kinds.d.ts b/JS/node_modules/graphql/language/kinds.d.ts deleted file mode 100644 index 35a7239..0000000 --- a/JS/node_modules/graphql/language/kinds.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * The set of allowed kind values for AST nodes. - */ -export const Kind: { - // 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 = typeof Kind[keyof typeof Kind]; diff --git a/JS/node_modules/graphql/language/kinds.js b/JS/node_modules/graphql/language/kinds.js deleted file mode 100644 index 32b90c4..0000000 --- a/JS/node_modules/graphql/language/kinds.js +++ /dev/null @@ -1,71 +0,0 @@ -"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/JS/node_modules/graphql/language/kinds.js.flow b/JS/node_modules/graphql/language/kinds.js.flow deleted file mode 100644 index 8826fa1..0000000 --- a/JS/node_modules/graphql/language/kinds.js.flow +++ /dev/null @@ -1,75 +0,0 @@ -// @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/JS/node_modules/graphql/language/kinds.mjs b/JS/node_modules/graphql/language/kinds.mjs deleted file mode 100644 index b439c71..0000000 --- a/JS/node_modules/graphql/language/kinds.mjs +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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/JS/node_modules/graphql/language/lexer.d.ts b/JS/node_modules/graphql/language/lexer.d.ts deleted file mode 100644 index 40dbf9a..0000000 --- a/JS/node_modules/graphql/language/lexer.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { Token } from './ast'; -import { Source } from './source'; -import { TokenKindEnum } from './tokenKind'; - -/** - * 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 class Lexer { - source: Source; - - /** - * 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; - - constructor(source: Source); - - /** - * 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 state of Lexer. - */ - lookahead(): Token; -} - -/** - * @internal - */ -export function isPunctuatorToken(token: Token): boolean; - -/** - * @internal - */ -export function isPunctuatorTokenKind(kind: TokenKindEnum): boolean; diff --git a/JS/node_modules/graphql/language/lexer.js b/JS/node_modules/graphql/language/lexer.js deleted file mode 100644 index 7b2ee16..0000000 --- a/JS/node_modules/graphql/language/lexer.js +++ /dev/null @@ -1,690 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isPunctuatorTokenKind = isPunctuatorTokenKind; -exports.Lexer = void 0; - -var _syntaxError = require("../error/syntaxError.js"); - -var _ast = require("./ast.js"); - -var _tokenKind = require("./tokenKind.js"); - -var _blockString = require("./blockString.js"); - -/** - * Given a Source object, creates 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. - */ -var Lexer = /*#__PURE__*/function () { - /** - * The previously focused non-ignored token. - */ - - /** - * The currently focused non-ignored token. - */ - - /** - * The (1-indexed) line containing the current token. - */ - - /** - * The character offset at which the current line begins. - */ - function Lexer(source) { - var startOfFileToken = new _ast.Token(_tokenKind.TokenKind.SOF, 0, 0, 0, 0, null); - this.source = source; - this.lastToken = startOfFileToken; - this.token = startOfFileToken; - this.line = 1; - this.lineStart = 0; - } - /** - * Advances the token stream to the next non-ignored token. - */ - - - var _proto = Lexer.prototype; - - _proto.advance = function advance() { - this.lastToken = this.token; - var token = this.token = this.lookahead(); - return token; - } - /** - * Looks ahead and returns the next non-ignored token, but does not change - * the state of Lexer. - */ - ; - - _proto.lookahead = function lookahead() { - var token = this.token; - - if (token.kind !== _tokenKind.TokenKind.EOF) { - do { - var _token$next; - - // Note: next is only mutable during parsing, so we cast to allow this. - token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token); - } while (token.kind === _tokenKind.TokenKind.COMMENT); - } - - return token; - }; - - return Lexer; -}(); -/** - * @internal - */ - - -exports.Lexer = Lexer; - -function isPunctuatorTokenKind(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; -} - -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 = prev.end; - - while (pos < bodyLength) { - var code = body.charCodeAt(pos); - var _line = lexer.line; - - var _col = 1 + pos - lexer.lineStart; // SourceCharacter - - - switch (code) { - case 0xfeff: // - - case 9: // \t - - case 32: // - - case 44: - // , - ++pos; - continue; - - case 10: - // \n - ++pos; - ++lexer.line; - lexer.lineStart = pos; - continue; - - case 13: - // \r - if (body.charCodeAt(pos + 1) === 10) { - pos += 2; - } else { - ++pos; - } - - ++lexer.line; - lexer.lineStart = pos; - continue; - - case 33: - // ! - return new _ast.Token(_tokenKind.TokenKind.BANG, pos, pos + 1, _line, _col, prev); - - case 35: - // # - return readComment(source, pos, _line, _col, prev); - - case 36: - // $ - return new _ast.Token(_tokenKind.TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev); - - case 38: - // & - return new _ast.Token(_tokenKind.TokenKind.AMP, pos, pos + 1, _line, _col, prev); - - case 40: - // ( - return new _ast.Token(_tokenKind.TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev); - - case 41: - // ) - return new _ast.Token(_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 _ast.Token(_tokenKind.TokenKind.SPREAD, pos, pos + 3, _line, _col, prev); - } - - break; - - case 58: - // : - return new _ast.Token(_tokenKind.TokenKind.COLON, pos, pos + 1, _line, _col, prev); - - case 61: - // = - return new _ast.Token(_tokenKind.TokenKind.EQUALS, pos, pos + 1, _line, _col, prev); - - case 64: - // @ - return new _ast.Token(_tokenKind.TokenKind.AT, pos, pos + 1, _line, _col, prev); - - case 91: - // [ - return new _ast.Token(_tokenKind.TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev); - - case 93: - // ] - return new _ast.Token(_tokenKind.TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev); - - case 123: - // { - return new _ast.Token(_tokenKind.TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev); - - case 124: - // | - return new _ast.Token(_tokenKind.TokenKind.PIPE, pos, pos + 1, _line, _col, prev); - - case 125: - // } - return new _ast.Token(_tokenKind.TokenKind.BRACE_R, pos, pos + 1, _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); - - case 45: // - - - case 48: // 0 - - case 49: // 1 - - case 50: // 2 - - case 51: // 3 - - case 52: // 4 - - case 53: // 5 - - case 54: // 6 - - case 55: // 7 - - case 56: // 8 - - case 57: - // 9 - return readNumber(source, pos, code, _line, _col, prev); - - case 65: // A - - case 66: // B - - case 67: // C - - case 68: // D - - case 69: // E - - case 70: // F - - case 71: // G - - case 72: // H - - case 73: // I - - case 74: // J - - case 75: // K - - case 76: // L - - case 77: // M - - case 78: // N - - case 79: // O - - case 80: // P - - case 81: // Q - - case 82: // R - - case 83: // S - - case 84: // T - - case 85: // U - - case 86: // V - - case 87: // W - - case 88: // X - - case 89: // Y - - case 90: // Z - - case 95: // _ - - case 97: // a - - case 98: // b - - case 99: // c - - case 100: // d - - case 101: // e - - case 102: // f - - case 103: // g - - case 104: // h - - case 105: // i - - case 106: // j - - case 107: // k - - case 108: // l - - case 109: // m - - case 110: // n - - case 111: // o - - case 112: // p - - case 113: // q - - case 114: // r - - case 115: // s - - case 116: // t - - case 117: // u - - case 118: // v - - case 119: // w - - case 120: // x - - case 121: // y - - case 122: - // z - return readName(source, pos, _line, _col, prev); - } - - throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code)); - } - - var line = lexer.line; - var col = 1 + pos - lexer.lineStart; - return new _ast.Token(_tokenKind.TokenKind.EOF, bodyLength, bodyLength, line, col, prev); -} -/** - * 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 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 _ast.Token(_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); - code = body.charCodeAt(position); - } // Numbers cannot be followed by . or NameStart - - - if (code === 46 || isNameStart(code)) { - throw (0, _syntaxError.syntaxError)(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); - } - - return new _ast.Token(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 _ast.Token(_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 _ast.Token(_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 _ast.Token(_tokenKind.TokenKind.NAME, start, position, line, col, prev, body.slice(start, position)); -} // _ A-Z a-z - - -function isNameStart(code) { - return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122; -} diff --git a/JS/node_modules/graphql/language/lexer.js.flow b/JS/node_modules/graphql/language/lexer.js.flow deleted file mode 100644 index 32dba0c..0000000 --- a/JS/node_modules/graphql/language/lexer.js.flow +++ /dev/null @@ -1,701 +0,0 @@ -// @flow strict -import { syntaxError } from '../error/syntaxError'; - -import type { Source } from './source'; -import type { TokenKindEnum } from './tokenKind'; -import { Token } from './ast'; -import { TokenKind } from './tokenKind'; -import { dedentBlockStringValue } from './blockString'; - -/** - * Given a Source object, creates 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 class Lexer { - source: Source; - - /** - * 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; - - constructor(source: Source) { - const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null); - - this.source = source; - this.lastToken = startOfFileToken; - this.token = startOfFileToken; - this.line = 1; - this.lineStart = 0; - } - - /** - * Advances the token stream to the next non-ignored token. - */ - advance(): Token { - this.lastToken = this.token; - const token = (this.token = this.lookahead()); - return token; - } - - /** - * Looks ahead and returns the next non-ignored token, but does not change - * the state of Lexer. - */ - lookahead(): Token { - 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; - } -} - -/** - * @internal - */ -export function isPunctuatorTokenKind(kind: TokenKindEnum): boolean %checks { - 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 - ); -} - -function printCharCode(code: number): string { - 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; - - let pos = prev.end; - while (pos < bodyLength) { - const code = body.charCodeAt(pos); - - const line = lexer.line; - const col = 1 + pos - lexer.lineStart; - - // SourceCharacter - switch (code) { - case 0xfeff: // - case 9: // \t - case 32: // - case 44: // , - ++pos; - continue; - case 10: // \n - ++pos; - ++lexer.line; - lexer.lineStart = pos; - continue; - case 13: // \r - if (body.charCodeAt(pos + 1) === 10) { - pos += 2; - } else { - ++pos; - } - ++lexer.line; - lexer.lineStart = pos; - continue; - case 33: // ! - return new Token(TokenKind.BANG, pos, pos + 1, line, col, prev); - case 35: // # - return readComment(source, pos, line, col, prev); - case 36: // $ - return new Token(TokenKind.DOLLAR, pos, pos + 1, line, col, prev); - case 38: // & - return new Token(TokenKind.AMP, pos, pos + 1, line, col, prev); - case 40: // ( - return new Token(TokenKind.PAREN_L, pos, pos + 1, line, col, prev); - case 41: // ) - return new Token(TokenKind.PAREN_R, pos, pos + 1, line, col, prev); - case 46: // . - if ( - body.charCodeAt(pos + 1) === 46 && - body.charCodeAt(pos + 2) === 46 - ) { - return new Token(TokenKind.SPREAD, pos, pos + 3, line, col, prev); - } - break; - case 58: // : - return new Token(TokenKind.COLON, pos, pos + 1, line, col, prev); - case 61: // = - return new Token(TokenKind.EQUALS, pos, pos + 1, line, col, prev); - case 64: // @ - return new Token(TokenKind.AT, pos, pos + 1, line, col, prev); - case 91: // [ - return new Token(TokenKind.BRACKET_L, pos, pos + 1, line, col, prev); - case 93: // ] - return new Token(TokenKind.BRACKET_R, pos, pos + 1, line, col, prev); - case 123: // { - return new Token(TokenKind.BRACE_L, pos, pos + 1, line, col, prev); - case 124: // | - return new Token(TokenKind.PIPE, pos, pos + 1, line, col, prev); - case 125: // } - return new Token(TokenKind.BRACE_R, pos, pos + 1, 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); - case 45: // - - case 48: // 0 - case 49: // 1 - case 50: // 2 - case 51: // 3 - case 52: // 4 - case 53: // 5 - case 54: // 6 - case 55: // 7 - case 56: // 8 - case 57: // 9 - return readNumber(source, pos, code, line, col, prev); - case 65: // A - case 66: // B - case 67: // C - case 68: // D - case 69: // E - case 70: // F - case 71: // G - case 72: // H - case 73: // I - case 74: // J - case 75: // K - case 76: // L - case 77: // M - case 78: // N - case 79: // O - case 80: // P - case 81: // Q - case 82: // R - case 83: // S - case 84: // T - case 85: // U - case 86: // V - case 87: // W - case 88: // X - case 89: // Y - case 90: // Z - case 95: // _ - case 97: // a - case 98: // b - case 99: // c - case 100: // d - case 101: // e - case 102: // f - case 103: // g - case 104: // h - case 105: // i - case 106: // j - case 107: // k - case 108: // l - case 109: // m - case 110: // n - case 111: // o - case 112: // p - case 113: // q - case 114: // r - case 115: // s - case 116: // t - case 117: // u - case 118: // v - case 119: // w - case 120: // x - case 121: // y - case 122: // z - return readName(source, pos, line, col, prev); - } - - throw syntaxError(source, pos, unexpectedCharacterMessage(code)); - } - - const line = lexer.line; - const col = 1 + pos - lexer.lineStart; - return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev); -} - -/** - * Report a message that an unexpected character was encountered. - */ -function unexpectedCharacterMessage(code: number): string { - 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 a comment token from the source file. - * - * #[\u0009\u0020-\uFFFF]* - */ -function readComment( - source: Source, - start: number, - line: number, - col: number, - prev: Token | null, -): 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 Token( - 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: Source, - start: number, - firstCode: number, - line: number, - col: number, - prev: Token | null, -): 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); - code = body.charCodeAt(position); - } - - // Numbers cannot be followed by . or NameStart - if (code === 46 || isNameStart(code)) { - throw syntaxError( - source, - position, - `Invalid number, expected digit but got: ${printCharCode(code)}.`, - ); - } - - return new Token( - 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: Source, start: number, firstCode: number): number { - 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: Source, - start: number, - line: number, - col: number, - prev: Token | null, -): 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 Token( - 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: Source, - start: number, - line: number, - col: number, - prev: Token | null, - lexer: 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 Token( - 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: number, b: number, c: number, d: number): number { - 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: number): number { - 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: Source, - start: number, - line: number, - col: number, - prev: Token | null, -): 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 Token( - TokenKind.NAME, - start, - position, - line, - col, - prev, - body.slice(start, position), - ); -} - -// _ A-Z a-z -function isNameStart(code: number): boolean { - return ( - code === 95 || (code >= 65 && code <= 90) || (code >= 97 && code <= 122) - ); -} diff --git a/JS/node_modules/graphql/language/lexer.mjs b/JS/node_modules/graphql/language/lexer.mjs deleted file mode 100644 index a970631..0000000 --- a/JS/node_modules/graphql/language/lexer.mjs +++ /dev/null @@ -1,676 +0,0 @@ -import { syntaxError } from "../error/syntaxError.mjs"; -import { Token } from "./ast.mjs"; -import { TokenKind } from "./tokenKind.mjs"; -import { dedentBlockStringValue } from "./blockString.mjs"; -/** - * Given a Source object, creates 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 var Lexer = /*#__PURE__*/function () { - /** - * The previously focused non-ignored token. - */ - - /** - * The currently focused non-ignored token. - */ - - /** - * The (1-indexed) line containing the current token. - */ - - /** - * The character offset at which the current line begins. - */ - function Lexer(source) { - var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null); - this.source = source; - this.lastToken = startOfFileToken; - this.token = startOfFileToken; - this.line = 1; - this.lineStart = 0; - } - /** - * Advances the token stream to the next non-ignored token. - */ - - - var _proto = Lexer.prototype; - - _proto.advance = function advance() { - this.lastToken = this.token; - var token = this.token = this.lookahead(); - return token; - } - /** - * Looks ahead and returns the next non-ignored token, but does not change - * the state of Lexer. - */ - ; - - _proto.lookahead = function lookahead() { - var token = this.token; - - if (token.kind !== TokenKind.EOF) { - do { - var _token$next; - - // Note: next is only mutable during parsing, so we cast to allow this. - token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token); - } while (token.kind === TokenKind.COMMENT); - } - - return token; - }; - - return Lexer; -}(); -/** - * @internal - */ - -export function isPunctuatorTokenKind(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; -} - -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 = prev.end; - - while (pos < bodyLength) { - var code = body.charCodeAt(pos); - var _line = lexer.line; - - var _col = 1 + pos - lexer.lineStart; // SourceCharacter - - - switch (code) { - case 0xfeff: // - - case 9: // \t - - case 32: // - - case 44: - // , - ++pos; - continue; - - case 10: - // \n - ++pos; - ++lexer.line; - lexer.lineStart = pos; - continue; - - case 13: - // \r - if (body.charCodeAt(pos + 1) === 10) { - pos += 2; - } else { - ++pos; - } - - ++lexer.line; - lexer.lineStart = pos; - continue; - - case 33: - // ! - return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev); - - case 35: - // # - return readComment(source, pos, _line, _col, prev); - - case 36: - // $ - return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev); - - case 38: - // & - return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev); - - case 40: - // ( - return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev); - - case 41: - // ) - return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev); - - case 46: - // . - if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) { - return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev); - } - - break; - - case 58: - // : - return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev); - - case 61: - // = - return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev); - - case 64: - // @ - return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev); - - case 91: - // [ - return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev); - - case 93: - // ] - return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev); - - case 123: - // { - return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev); - - case 124: - // | - return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev); - - case 125: - // } - return new Token(TokenKind.BRACE_R, pos, pos + 1, _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); - - case 45: // - - - case 48: // 0 - - case 49: // 1 - - case 50: // 2 - - case 51: // 3 - - case 52: // 4 - - case 53: // 5 - - case 54: // 6 - - case 55: // 7 - - case 56: // 8 - - case 57: - // 9 - return readNumber(source, pos, code, _line, _col, prev); - - case 65: // A - - case 66: // B - - case 67: // C - - case 68: // D - - case 69: // E - - case 70: // F - - case 71: // G - - case 72: // H - - case 73: // I - - case 74: // J - - case 75: // K - - case 76: // L - - case 77: // M - - case 78: // N - - case 79: // O - - case 80: // P - - case 81: // Q - - case 82: // R - - case 83: // S - - case 84: // T - - case 85: // U - - case 86: // V - - case 87: // W - - case 88: // X - - case 89: // Y - - case 90: // Z - - case 95: // _ - - case 97: // a - - case 98: // b - - case 99: // c - - case 100: // d - - case 101: // e - - case 102: // f - - case 103: // g - - case 104: // h - - case 105: // i - - case 106: // j - - case 107: // k - - case 108: // l - - case 109: // m - - case 110: // n - - case 111: // o - - case 112: // p - - case 113: // q - - case 114: // r - - case 115: // s - - case 116: // t - - case 117: // u - - case 118: // v - - case 119: // w - - case 120: // x - - case 121: // y - - case 122: - // z - return readName(source, pos, _line, _col, prev); - } - - throw syntaxError(source, pos, unexpectedCharacterMessage(code)); - } - - var line = lexer.line; - var col = 1 + pos - lexer.lineStart; - return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev); -} -/** - * 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 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 Token(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); - code = body.charCodeAt(position); - } // Numbers cannot be followed by . or NameStart - - - if (code === 46 || isNameStart(code)) { - throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), ".")); - } - - return new Token(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 Token(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 Token(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 Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position)); -} // _ A-Z a-z - - -function isNameStart(code) { - return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122; -} diff --git a/JS/node_modules/graphql/language/location.d.ts b/JS/node_modules/graphql/language/location.d.ts deleted file mode 100644 index a41e82f..0000000 --- a/JS/node_modules/graphql/language/location.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Source } from './source'; - -/** - * Represents a location in a Source. - */ -export interface SourceLocation { - readonly line: number; - readonly 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; diff --git a/JS/node_modules/graphql/language/location.js b/JS/node_modules/graphql/language/location.js deleted file mode 100644 index 27d87c3..0000000 --- a/JS/node_modules/graphql/language/location.js +++ /dev/null @@ -1,31 +0,0 @@ -"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/JS/node_modules/graphql/language/location.js.flow b/JS/node_modules/graphql/language/location.js.flow deleted file mode 100644 index 94b77f1..0000000 --- a/JS/node_modules/graphql/language/location.js.flow +++ /dev/null @@ -1,26 +0,0 @@ -// @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/JS/node_modules/graphql/language/location.mjs b/JS/node_modules/graphql/language/location.mjs deleted file mode 100644 index e578ef0..0000000 --- a/JS/node_modules/graphql/language/location.mjs +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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/JS/node_modules/graphql/language/parser.d.ts b/JS/node_modules/graphql/language/parser.d.ts deleted file mode 100644 index 49db417..0000000 --- a/JS/node_modules/graphql/language/parser.d.ts +++ /dev/null @@ -1,543 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; -import { GraphQLError } from '..'; - -import { TokenKindEnum } from './tokenKind'; -import { Source } from './source'; -import { - TypeNode, - ValueNode, - DocumentNode, - Token, - Location, - NameNode, - DirectiveDefinitionNode, - InputObjectTypeExtensionNode, - EnumTypeExtensionNode, - UnionTypeExtensionNode, - InterfaceTypeExtensionNode, - ObjectTypeExtensionNode, - ScalarTypeExtensionNode, - SchemaExtensionNode, - TypeSystemExtensionNode, - InputValueDefinitionNode, - InputObjectTypeDefinitionNode, - EnumValueDefinitionNode, - EnumTypeDefinitionNode, - NamedTypeNode, - UnionTypeDefinitionNode, - InterfaceTypeDefinitionNode, - FieldDefinitionNode, - ObjectTypeDefinitionNode, - ScalarTypeDefinitionNode, - OperationTypeDefinitionNode, - SchemaDefinitionNode, - StringValueNode, - DirectiveNode, - ObjectFieldNode, - ObjectValueNode, - FragmentSpreadNode, - InlineFragmentNode, - ArgumentNode, - FieldNode, - SelectionNode, - SelectionSetNode, - VariableNode, - VariableDefinitionNode, - OperationTypeNode, - OperationDefinitionNode, - DefinitionNode, - FragmentDefinitionNode, - ListValueNode, -} from './ast'; -import { Lexer } from './lexer'; - -/** - * Configuration options to control parser behavior - */ -export interface 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; - -/** - * Given a string containing a GraphQL value, 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. - */ -export function parseValue( - source: string | Source, - options?: ParseOptions, -): ValueNode; - -/** - * 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; - -export class Parser { - protected _lexer: Lexer; - protected _options?: ParseOptions; - constructor(source: string | Source, options?: ParseOptions); - - /** - * Converts a name lex token into a name parse node. - */ - parseName(): NameNode; - /** - * Document : Definition+ - */ - parseDocument(): DocumentNode; - /** - * Definition : - * - ExecutableDefinition - * - TypeSystemDefinition - * - TypeSystemExtension - * - * ExecutableDefinition : - * - OperationDefinition - * - FragmentDefinition - * - * TypeSystemDefinition : - * - SchemaDefinition - * - TypeDefinition - * - DirectiveDefinition - * - * TypeDefinition : - * - ScalarTypeDefinition - * - ObjectTypeDefinition - * - InterfaceTypeDefinition - * - UnionTypeDefinition - * - EnumTypeDefinition - * - InputObjectTypeDefinition - */ - parseDefinition(): DefinitionNode; - /** - * OperationDefinition : - * - SelectionSet - * - OperationType Name? VariableDefinitions? Directives? SelectionSet - */ - parseOperationDefinition(): OperationDefinitionNode; - /** - * OperationType : one of query mutation subscription - */ - parseOperationType(): OperationTypeNode; - /** - * VariableDefinitions : ( VariableDefinition+ ) - */ - parseVariableDefinitions(): Array; - /** - * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? - */ - parseVariableDefinition(): VariableDefinitionNode; - /** - * Variable : $ Name - */ - parseVariable(): VariableNode; - /** - * ``` - * SelectionSet : { Selection+ } - * ``` - */ - parseSelectionSet(): SelectionSetNode; - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - parseSelection(): SelectionNode; - /** - * Field : Alias? Name Arguments? Directives? SelectionSet? - * - * Alias : Name : - */ - parseField(): FieldNode; - /** - * Arguments[Const] : ( Argument[?Const]+ ) - */ - parseArguments(): Array; - /** - * Argument[Const] : Name : Value[?Const] - */ - parseArgument(): ArgumentNode; - /** - * Corresponds to both FragmentSpread and InlineFragment in the spec. - * - * FragmentSpread : ... FragmentName Directives? - * - * InlineFragment : ... TypeCondition? Directives? SelectionSet - */ - parseFragment(): FragmentSpreadNode | InlineFragmentNode; - /** - * FragmentDefinition : - * - fragment FragmentName on TypeCondition Directives? SelectionSet - * - * TypeCondition : NamedType - */ - parseFragmentDefinition(): FragmentDefinitionNode; - /** - * FragmentName : Name but not `on` - */ - parseFragmentName(): NameNode; - /** - * 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` - */ - parseValueLiteral(): ValueNode; - parseStringLiteral(): StringValueNode; - /** - * ListValue[Const] : - * - [ ] - * - [ Value[?Const]+ ] - */ - parseList(): ListValueNode; - /** - * ``` - * ObjectValue[Const] : - * - { } - * - { ObjectField[?Const]+ } - * ``` - */ - parseObject(isConst: boolean): ObjectValueNode; - /** - * ObjectField[Const] : Name : Value[?Const] - */ - parseObjectField: ObjectFieldNode; - /** - * Directives[Const] : Directive[?Const]+ - */ - parseDirectives(): Array; - /** - * ``` - * Directive[Const] : @ Name Arguments[?Const]? - * ``` - */ - parseDirective(): DirectiveNode; - /** - * Type : - * - NamedType - * - ListType - * - NonNullType - */ - parseTypeReference(): TypeNode; - /** - * NamedType : Name - */ - parseNamedType(): NamedTypeNode; - peekDescription(): boolean; - /** - * Description : StringValue - */ - parseDescription(): undefined | StringValueNode; - /** - * ``` - * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } - * ``` - */ - parseSchemaDefinition(): SchemaDefinitionNode; - /** - * OperationTypeDefinition : OperationType : NamedType - */ - parseOperationTypeDefinition(): OperationTypeDefinitionNode; - /** - * ScalarTypeDefinition : Description? scalar Name Directives[Const]? - */ - parseScalarTypeDefinition(): ScalarTypeDefinitionNode; - /** - * ObjectTypeDefinition : - * Description? - * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? - */ - parseObjectTypeDefinition(): ObjectTypeDefinitionNode; - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - parseImplementsInterfaces(): Array; - /** - * ``` - * FieldsDefinition : { FieldDefinition+ } - * ``` - */ - parseFieldsDefinition(): Array; - /** - * FieldDefinition : - * - Description? Name ArgumentsDefinition? : Type Directives[Const]? - */ - parseFieldDefinition(): FieldDefinitionNode; - /** - * ArgumentsDefinition : ( InputValueDefinition+ ) - */ - parseArgumentDefs(): Array; - /** - * InputValueDefinition : - * - Description? Name : Type DefaultValue? Directives[Const]? - */ - parseInputValueDef(): InputValueDefinitionNode; - /** - * InterfaceTypeDefinition : - * - Description? interface Name Directives[Const]? FieldsDefinition? - */ - parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode; - /** - * UnionTypeDefinition : - * - Description? union Name Directives[Const]? UnionMemberTypes? - */ - parseUnionTypeDefinition(): UnionTypeDefinitionNode; - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - parseUnionMemberTypes(): Array; - /** - * EnumTypeDefinition : - * - Description? enum Name Directives[Const]? EnumValuesDefinition? - */ - parseEnumTypeDefinition(): EnumTypeDefinitionNode; - /** - * ``` - * EnumValuesDefinition : { EnumValueDefinition+ } - * ``` - */ - parseEnumValuesDefinition(): Array; - /** - * EnumValueDefinition : Description? EnumValue Directives[Const]? - */ - parseEnumValueDefinition(): EnumValueDefinitionNode; - /** - * EnumValue : Name but not `true`, `false` or `null` - */ - parseEnumValueName(): NameNode; - /** - * InputObjectTypeDefinition : - * - Description? input Name Directives[Const]? InputFieldsDefinition? - */ - parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode; - /** - * ``` - * InputFieldsDefinition : { InputValueDefinition+ } - * ``` - */ - parseInputFieldsDefinition(): Array; - /** - * TypeSystemExtension : - * - SchemaExtension - * - TypeExtension - * - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - */ - parseTypeSystemExtension(): TypeSystemExtensionNode; - /** - * ``` - * SchemaExtension : - * - extend schema Directives[Const]? { OperationTypeDefinition+ } - * - extend schema Directives[Const] - * ``` - */ - parseSchemaExtension(): SchemaExtensionNode; - /** - * ScalarTypeExtension : - * - extend scalar Name Directives[Const] - */ - parseScalarTypeExtension(): ScalarTypeExtensionNode; - /** - * ObjectTypeExtension : - * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend type Name ImplementsInterfaces? Directives[Const] - * - extend type Name ImplementsInterfaces - */ - parseObjectTypeExtension(): ObjectTypeExtensionNode; - /** - * InterfaceTypeExtension : - * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend interface Name ImplementsInterfaces? Directives[Const] - * - extend interface Name ImplementsInterfaces - */ - parseInterfaceTypeExtension(): InterfaceTypeExtensionNode; - /** - * UnionTypeExtension : - * - extend union Name Directives[Const]? UnionMemberTypes - * - extend union Name Directives[Const] - */ - parseUnionTypeExtension(): UnionTypeExtensionNode; - /** - * EnumTypeExtension : - * - extend enum Name Directives[Const]? EnumValuesDefinition - * - extend enum Name Directives[Const] - */ - parseEnumTypeExtension(): EnumTypeExtensionNode; - /** - * InputObjectTypeExtension : - * - extend input Name Directives[Const]? InputFieldsDefinition - * - extend input Name Directives[Const] - */ - parseInputObjectTypeExtension(): InputObjectTypeExtensionNode; - /** - * ``` - * DirectiveDefinition : - * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations - * ``` - */ - parseDirectiveDefinition(): DirectiveDefinitionNode; - /** - * DirectiveLocations : - * - `|`? DirectiveLocation - * - DirectiveLocations | DirectiveLocation - */ - parseDirectiveLocations(): Array; - parseDirectiveLocation(): NameNode; - /** - * Returns a location object, used to identify the place in the source that created a given parsed object. - */ - loc(startToken: Token): Location | undefined; - /** - * Determines if the next token is of a given kind - */ - peek(kind: TokenKindEnum): boolean; - /** - * 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. - */ - expectToken(kind: TokenKindEnum): Token; - /** - * If the next token is of the given kind, return "true" after advancing the lexer. - * Otherwise, do not change the parser state and return "false". - */ - expectOptionalToken(kind: TokenKindEnum): boolean; - /** - * If the next token is a given keyword, advance the lexer. - * Otherwise, do not change the parser state and throw an error. - */ - expectKeyword(value: string): void; - /** - * If the next token is a given keyword, return "true" after advancing the lexer. - * Otherwise, do not change the parser state and return "false". - */ - expectOptionalKeyword(value: string): boolean; - /** - * Helper function for creating an error when an unexpected lexed token is encountered. - */ - unexpected(atToken?: Maybe): GraphQLError; - /** - * 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. - */ - any( - openKind: TokenKindEnum, - parseFn: () => T, - closeKind: TokenKindEnum, - ): Array; - /** - * Returns a list of parse nodes, determined by the parseFn. - * It can be empty only if open token is missing otherwise it will always return non-empty list - * that 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. - */ - optionalMany( - openKind: TokenKindEnum, - parseFn: () => T, - closeKind: TokenKindEnum, - ): Array; - /** - * 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. - */ - many( - openKind: TokenKindEnum, - parseFn: () => T, - closeKind: TokenKindEnum, - ): Array; - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. - * Advances the parser to the next lex token after last item in the list. - */ - delimitedMany(delimiterKind: TokenKindEnum, parseFn: () => T): Array; -} diff --git a/JS/node_modules/graphql/language/parser.js b/JS/node_modules/graphql/language/parser.js deleted file mode 100644 index cef9a77..0000000 --- a/JS/node_modules/graphql/language/parser.js +++ /dev/null @@ -1,1566 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.parse = parse; -exports.parseValue = parseValue; -exports.parseType = parseType; -exports.Parser = void 0; - -var _syntaxError = require("../error/syntaxError.js"); - -var _kinds = require("./kinds.js"); - -var _ast = require("./ast.js"); - -var _tokenKind = require("./tokenKind.js"); - -var _source = require("./source.js"); - -var _directiveLocation = require("./directiveLocation.js"); - -var _lexer = require("./lexer.js"); - -/** - * Given a GraphQL source, parses it into a Document. - * Throws GraphQLError if a syntax error is encountered. - */ -function parse(source, options) { - var parser = new Parser(source, options); - return parser.parseDocument(); -} -/** - * 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 parser = new Parser(source, options); - parser.expectToken(_tokenKind.TokenKind.SOF); - var value = parser.parseValueLiteral(false); - parser.expectToken(_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 parser = new Parser(source, options); - parser.expectToken(_tokenKind.TokenKind.SOF); - var type = parser.parseTypeReference(); - parser.expectToken(_tokenKind.TokenKind.EOF); - return type; -} -/** - * This class is exported only to assist people in implementing their own parsers - * without duplicating too much code and should be used only as last resort for cases - * such as experimental syntax or if certain features could not be contributed upstream. - * - * It is still part of the internal API and is versioned, so any changes to it are never - * considered breaking changes. If you still need to support multiple versions of the - * library, please use the `versionInfo` variable for version detection. - * - * @internal - */ - - -var Parser = /*#__PURE__*/function () { - function Parser(source, options) { - var sourceObj = (0, _source.isSource)(source) ? source : new _source.Source(source); - this._lexer = new _lexer.Lexer(sourceObj); - this._options = options; - } - /** - * Converts a name lex token into a name parse node. - */ - - - var _proto = Parser.prototype; - - _proto.parseName = function parseName() { - var token = this.expectToken(_tokenKind.TokenKind.NAME); - return { - kind: _kinds.Kind.NAME, - value: token.value, - loc: this.loc(token) - }; - } // Implements the parsing rules in the Document section. - - /** - * Document : Definition+ - */ - ; - - _proto.parseDocument = function parseDocument() { - var start = this._lexer.token; - return { - kind: _kinds.Kind.DOCUMENT, - definitions: this.many(_tokenKind.TokenKind.SOF, this.parseDefinition, _tokenKind.TokenKind.EOF), - loc: this.loc(start) - }; - } - /** - * Definition : - * - ExecutableDefinition - * - TypeSystemDefinition - * - TypeSystemExtension - * - * ExecutableDefinition : - * - OperationDefinition - * - FragmentDefinition - */ - ; - - _proto.parseDefinition = function parseDefinition() { - if (this.peek(_tokenKind.TokenKind.NAME)) { - switch (this._lexer.token.value) { - case 'query': - case 'mutation': - case 'subscription': - return this.parseOperationDefinition(); - - case 'fragment': - return this.parseFragmentDefinition(); - - case 'schema': - case 'scalar': - case 'type': - case 'interface': - case 'union': - case 'enum': - case 'input': - case 'directive': - return this.parseTypeSystemDefinition(); - - case 'extend': - return this.parseTypeSystemExtension(); - } - } else if (this.peek(_tokenKind.TokenKind.BRACE_L)) { - return this.parseOperationDefinition(); - } else if (this.peekDescription()) { - return this.parseTypeSystemDefinition(); - } - - throw this.unexpected(); - } // Implements the parsing rules in the Operations section. - - /** - * OperationDefinition : - * - SelectionSet - * - OperationType Name? VariableDefinitions? Directives? SelectionSet - */ - ; - - _proto.parseOperationDefinition = function parseOperationDefinition() { - var start = this._lexer.token; - - if (this.peek(_tokenKind.TokenKind.BRACE_L)) { - return { - kind: _kinds.Kind.OPERATION_DEFINITION, - operation: 'query', - name: undefined, - variableDefinitions: [], - directives: [], - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - - var operation = this.parseOperationType(); - var name; - - if (this.peek(_tokenKind.TokenKind.NAME)) { - name = this.parseName(); - } - - return { - kind: _kinds.Kind.OPERATION_DEFINITION, - operation: operation, - name: name, - variableDefinitions: this.parseVariableDefinitions(), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - /** - * OperationType : one of query mutation subscription - */ - ; - - _proto.parseOperationType = function parseOperationType() { - var operationToken = this.expectToken(_tokenKind.TokenKind.NAME); - - switch (operationToken.value) { - case 'query': - return 'query'; - - case 'mutation': - return 'mutation'; - - case 'subscription': - return 'subscription'; - } - - throw this.unexpected(operationToken); - } - /** - * VariableDefinitions : ( VariableDefinition+ ) - */ - ; - - _proto.parseVariableDefinitions = function parseVariableDefinitions() { - return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseVariableDefinition, _tokenKind.TokenKind.PAREN_R); - } - /** - * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? - */ - ; - - _proto.parseVariableDefinition = function parseVariableDefinition() { - var start = this._lexer.token; - return { - kind: _kinds.Kind.VARIABLE_DEFINITION, - variable: this.parseVariable(), - type: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseTypeReference()), - defaultValue: this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined, - directives: this.parseDirectives(true), - loc: this.loc(start) - }; - } - /** - * Variable : $ Name - */ - ; - - _proto.parseVariable = function parseVariable() { - var start = this._lexer.token; - this.expectToken(_tokenKind.TokenKind.DOLLAR); - return { - kind: _kinds.Kind.VARIABLE, - name: this.parseName(), - loc: this.loc(start) - }; - } - /** - * SelectionSet : { Selection+ } - */ - ; - - _proto.parseSelectionSet = function parseSelectionSet() { - var start = this._lexer.token; - return { - kind: _kinds.Kind.SELECTION_SET, - selections: this.many(_tokenKind.TokenKind.BRACE_L, this.parseSelection, _tokenKind.TokenKind.BRACE_R), - loc: this.loc(start) - }; - } - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - ; - - _proto.parseSelection = function parseSelection() { - return this.peek(_tokenKind.TokenKind.SPREAD) ? this.parseFragment() : this.parseField(); - } - /** - * Field : Alias? Name Arguments? Directives? SelectionSet? - * - * Alias : Name : - */ - ; - - _proto.parseField = function parseField() { - var start = this._lexer.token; - var nameOrAlias = this.parseName(); - var alias; - var name; - - if (this.expectOptionalToken(_tokenKind.TokenKind.COLON)) { - alias = nameOrAlias; - name = this.parseName(); - } else { - name = nameOrAlias; - } - - return { - kind: _kinds.Kind.FIELD, - alias: alias, - name: name, - arguments: this.parseArguments(false), - directives: this.parseDirectives(false), - selectionSet: this.peek(_tokenKind.TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined, - loc: this.loc(start) - }; - } - /** - * Arguments[Const] : ( Argument[?Const]+ ) - */ - ; - - _proto.parseArguments = function parseArguments(isConst) { - var item = isConst ? this.parseConstArgument : this.parseArgument; - return this.optionalMany(_tokenKind.TokenKind.PAREN_L, item, _tokenKind.TokenKind.PAREN_R); - } - /** - * Argument[Const] : Name : Value[?Const] - */ - ; - - _proto.parseArgument = function parseArgument() { - var start = this._lexer.token; - var name = this.parseName(); - this.expectToken(_tokenKind.TokenKind.COLON); - return { - kind: _kinds.Kind.ARGUMENT, - name: name, - value: this.parseValueLiteral(false), - loc: this.loc(start) - }; - }; - - _proto.parseConstArgument = function parseConstArgument() { - var start = this._lexer.token; - return { - kind: _kinds.Kind.ARGUMENT, - name: this.parseName(), - value: (this.expectToken(_tokenKind.TokenKind.COLON), this.parseValueLiteral(true)), - loc: this.loc(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 - */ - ; - - _proto.parseFragment = function parseFragment() { - var start = this._lexer.token; - this.expectToken(_tokenKind.TokenKind.SPREAD); - var hasTypeCondition = this.expectOptionalKeyword('on'); - - if (!hasTypeCondition && this.peek(_tokenKind.TokenKind.NAME)) { - return { - kind: _kinds.Kind.FRAGMENT_SPREAD, - name: this.parseFragmentName(), - directives: this.parseDirectives(false), - loc: this.loc(start) - }; - } - - return { - kind: _kinds.Kind.INLINE_FRAGMENT, - typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - /** - * FragmentDefinition : - * - fragment FragmentName on TypeCondition Directives? SelectionSet - * - * TypeCondition : NamedType - */ - ; - - _proto.parseFragmentDefinition = function parseFragmentDefinition() { - var _this$_options; - - var start = this._lexer.token; - this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes - // the grammar of FragmentDefinition: - // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet - - if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) { - return { - kind: _kinds.Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - variableDefinitions: this.parseVariableDefinitions(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - - return { - kind: _kinds.Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - /** - * FragmentName : Name but not `on` - */ - ; - - _proto.parseFragmentName = function parseFragmentName() { - if (this._lexer.token.value === 'on') { - throw this.unexpected(); - } - - return this.parseName(); - } // 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` - */ - ; - - _proto.parseValueLiteral = function parseValueLiteral(isConst) { - var token = this._lexer.token; - - switch (token.kind) { - case _tokenKind.TokenKind.BRACKET_L: - return this.parseList(isConst); - - case _tokenKind.TokenKind.BRACE_L: - return this.parseObject(isConst); - - case _tokenKind.TokenKind.INT: - this._lexer.advance(); - - return { - kind: _kinds.Kind.INT, - value: token.value, - loc: this.loc(token) - }; - - case _tokenKind.TokenKind.FLOAT: - this._lexer.advance(); - - return { - kind: _kinds.Kind.FLOAT, - value: token.value, - loc: this.loc(token) - }; - - case _tokenKind.TokenKind.STRING: - case _tokenKind.TokenKind.BLOCK_STRING: - return this.parseStringLiteral(); - - case _tokenKind.TokenKind.NAME: - this._lexer.advance(); - - switch (token.value) { - case 'true': - return { - kind: _kinds.Kind.BOOLEAN, - value: true, - loc: this.loc(token) - }; - - case 'false': - return { - kind: _kinds.Kind.BOOLEAN, - value: false, - loc: this.loc(token) - }; - - case 'null': - return { - kind: _kinds.Kind.NULL, - loc: this.loc(token) - }; - - default: - return { - kind: _kinds.Kind.ENUM, - value: token.value, - loc: this.loc(token) - }; - } - - case _tokenKind.TokenKind.DOLLAR: - if (!isConst) { - return this.parseVariable(); - } - - break; - } - - throw this.unexpected(); - }; - - _proto.parseStringLiteral = function parseStringLiteral() { - var token = this._lexer.token; - - this._lexer.advance(); - - return { - kind: _kinds.Kind.STRING, - value: token.value, - block: token.kind === _tokenKind.TokenKind.BLOCK_STRING, - loc: this.loc(token) - }; - } - /** - * ListValue[Const] : - * - [ ] - * - [ Value[?Const]+ ] - */ - ; - - _proto.parseList = function parseList(isConst) { - var _this = this; - - var start = this._lexer.token; - - var item = function item() { - return _this.parseValueLiteral(isConst); - }; - - return { - kind: _kinds.Kind.LIST, - values: this.any(_tokenKind.TokenKind.BRACKET_L, item, _tokenKind.TokenKind.BRACKET_R), - loc: this.loc(start) - }; - } - /** - * ObjectValue[Const] : - * - { } - * - { ObjectField[?Const]+ } - */ - ; - - _proto.parseObject = function parseObject(isConst) { - var _this2 = this; - - var start = this._lexer.token; - - var item = function item() { - return _this2.parseObjectField(isConst); - }; - - return { - kind: _kinds.Kind.OBJECT, - fields: this.any(_tokenKind.TokenKind.BRACE_L, item, _tokenKind.TokenKind.BRACE_R), - loc: this.loc(start) - }; - } - /** - * ObjectField[Const] : Name : Value[?Const] - */ - ; - - _proto.parseObjectField = function parseObjectField(isConst) { - var start = this._lexer.token; - var name = this.parseName(); - this.expectToken(_tokenKind.TokenKind.COLON); - return { - kind: _kinds.Kind.OBJECT_FIELD, - name: name, - value: this.parseValueLiteral(isConst), - loc: this.loc(start) - }; - } // Implements the parsing rules in the Directives section. - - /** - * Directives[Const] : Directive[?Const]+ - */ - ; - - _proto.parseDirectives = function parseDirectives(isConst) { - var directives = []; - - while (this.peek(_tokenKind.TokenKind.AT)) { - directives.push(this.parseDirective(isConst)); - } - - return directives; - } - /** - * Directive[Const] : @ Name Arguments[?Const]? - */ - ; - - _proto.parseDirective = function parseDirective(isConst) { - var start = this._lexer.token; - this.expectToken(_tokenKind.TokenKind.AT); - return { - kind: _kinds.Kind.DIRECTIVE, - name: this.parseName(), - arguments: this.parseArguments(isConst), - loc: this.loc(start) - }; - } // Implements the parsing rules in the Types section. - - /** - * Type : - * - NamedType - * - ListType - * - NonNullType - */ - ; - - _proto.parseTypeReference = function parseTypeReference() { - var start = this._lexer.token; - var type; - - if (this.expectOptionalToken(_tokenKind.TokenKind.BRACKET_L)) { - type = this.parseTypeReference(); - this.expectToken(_tokenKind.TokenKind.BRACKET_R); - type = { - kind: _kinds.Kind.LIST_TYPE, - type: type, - loc: this.loc(start) - }; - } else { - type = this.parseNamedType(); - } - - if (this.expectOptionalToken(_tokenKind.TokenKind.BANG)) { - return { - kind: _kinds.Kind.NON_NULL_TYPE, - type: type, - loc: this.loc(start) - }; - } - - return type; - } - /** - * NamedType : Name - */ - ; - - _proto.parseNamedType = function parseNamedType() { - var start = this._lexer.token; - return { - kind: _kinds.Kind.NAMED_TYPE, - name: this.parseName(), - loc: this.loc(start) - }; - } // Implements the parsing rules in the Type Definition section. - - /** - * TypeSystemDefinition : - * - SchemaDefinition - * - TypeDefinition - * - DirectiveDefinition - * - * TypeDefinition : - * - ScalarTypeDefinition - * - ObjectTypeDefinition - * - InterfaceTypeDefinition - * - UnionTypeDefinition - * - EnumTypeDefinition - * - InputObjectTypeDefinition - */ - ; - - _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() { - // Many definitions begin with a description and require a lookahead. - var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token; - - if (keywordToken.kind === _tokenKind.TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaDefinition(); - - case 'scalar': - return this.parseScalarTypeDefinition(); - - case 'type': - return this.parseObjectTypeDefinition(); - - case 'interface': - return this.parseInterfaceTypeDefinition(); - - case 'union': - return this.parseUnionTypeDefinition(); - - case 'enum': - return this.parseEnumTypeDefinition(); - - case 'input': - return this.parseInputObjectTypeDefinition(); - - case 'directive': - return this.parseDirectiveDefinition(); - } - } - - throw this.unexpected(keywordToken); - }; - - _proto.peekDescription = function peekDescription() { - return this.peek(_tokenKind.TokenKind.STRING) || this.peek(_tokenKind.TokenKind.BLOCK_STRING); - } - /** - * Description : StringValue - */ - ; - - _proto.parseDescription = function parseDescription() { - if (this.peekDescription()) { - return this.parseStringLiteral(); - } - } - /** - * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } - */ - ; - - _proto.parseSchemaDefinition = function parseSchemaDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('schema'); - var directives = this.parseDirectives(true); - var operationTypes = this.many(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); - return { - kind: _kinds.Kind.SCHEMA_DEFINITION, - description: description, - directives: directives, - operationTypes: operationTypes, - loc: this.loc(start) - }; - } - /** - * OperationTypeDefinition : OperationType : NamedType - */ - ; - - _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() { - var start = this._lexer.token; - var operation = this.parseOperationType(); - this.expectToken(_tokenKind.TokenKind.COLON); - var type = this.parseNamedType(); - return { - kind: _kinds.Kind.OPERATION_TYPE_DEFINITION, - operation: operation, - type: type, - loc: this.loc(start) - }; - } - /** - * ScalarTypeDefinition : Description? scalar Name Directives[Const]? - */ - ; - - _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('scalar'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - return { - kind: _kinds.Kind.SCALAR_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - loc: this.loc(start) - }; - } - /** - * ObjectTypeDefinition : - * Description? - * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? - */ - ; - - _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('type'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - return { - kind: _kinds.Kind.OBJECT_TYPE_DEFINITION, - description: description, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - ; - - _proto.parseImplementsInterfaces = function parseImplementsInterfaces() { - var _this$_options2; - - if (!this.expectOptionalKeyword('implements')) { - return []; - } - - if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) { - var types = []; // Optional leading ampersand - - this.expectOptionalToken(_tokenKind.TokenKind.AMP); - - do { - types.push(this.parseNamedType()); - } while (this.expectOptionalToken(_tokenKind.TokenKind.AMP) || this.peek(_tokenKind.TokenKind.NAME)); - - return types; - } - - return this.delimitedMany(_tokenKind.TokenKind.AMP, this.parseNamedType); - } - /** - * FieldsDefinition : { FieldDefinition+ } - */ - ; - - _proto.parseFieldsDefinition = function parseFieldsDefinition() { - var _this$_options3; - - // Legacy support for the SDL? - if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(_tokenKind.TokenKind.BRACE_L) && this._lexer.lookahead().kind === _tokenKind.TokenKind.BRACE_R) { - this._lexer.advance(); - - this._lexer.advance(); - - return []; - } - - return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseFieldDefinition, _tokenKind.TokenKind.BRACE_R); - } - /** - * FieldDefinition : - * - Description? Name ArgumentsDefinition? : Type Directives[Const]? - */ - ; - - _proto.parseFieldDefinition = function parseFieldDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - var name = this.parseName(); - var args = this.parseArgumentDefs(); - this.expectToken(_tokenKind.TokenKind.COLON); - var type = this.parseTypeReference(); - var directives = this.parseDirectives(true); - return { - kind: _kinds.Kind.FIELD_DEFINITION, - description: description, - name: name, - arguments: args, - type: type, - directives: directives, - loc: this.loc(start) - }; - } - /** - * ArgumentsDefinition : ( InputValueDefinition+ ) - */ - ; - - _proto.parseArgumentDefs = function parseArgumentDefs() { - return this.optionalMany(_tokenKind.TokenKind.PAREN_L, this.parseInputValueDef, _tokenKind.TokenKind.PAREN_R); - } - /** - * InputValueDefinition : - * - Description? Name : Type DefaultValue? Directives[Const]? - */ - ; - - _proto.parseInputValueDef = function parseInputValueDef() { - var start = this._lexer.token; - var description = this.parseDescription(); - var name = this.parseName(); - this.expectToken(_tokenKind.TokenKind.COLON); - var type = this.parseTypeReference(); - var defaultValue; - - if (this.expectOptionalToken(_tokenKind.TokenKind.EQUALS)) { - defaultValue = this.parseValueLiteral(true); - } - - var directives = this.parseDirectives(true); - return { - kind: _kinds.Kind.INPUT_VALUE_DEFINITION, - description: description, - name: name, - type: type, - defaultValue: defaultValue, - directives: directives, - loc: this.loc(start) - }; - } - /** - * InterfaceTypeDefinition : - * - Description? interface Name Directives[Const]? FieldsDefinition? - */ - ; - - _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('interface'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - return { - kind: _kinds.Kind.INTERFACE_TYPE_DEFINITION, - description: description, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * UnionTypeDefinition : - * - Description? union Name Directives[Const]? UnionMemberTypes? - */ - ; - - _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('union'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var types = this.parseUnionMemberTypes(); - return { - kind: _kinds.Kind.UNION_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - types: types, - loc: this.loc(start) - }; - } - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - ; - - _proto.parseUnionMemberTypes = function parseUnionMemberTypes() { - return this.expectOptionalToken(_tokenKind.TokenKind.EQUALS) ? this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseNamedType) : []; - } - /** - * EnumTypeDefinition : - * - Description? enum Name Directives[Const]? EnumValuesDefinition? - */ - ; - - _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('enum'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var values = this.parseEnumValuesDefinition(); - return { - kind: _kinds.Kind.ENUM_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - values: values, - loc: this.loc(start) - }; - } - /** - * EnumValuesDefinition : { EnumValueDefinition+ } - */ - ; - - _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() { - return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseEnumValueDefinition, _tokenKind.TokenKind.BRACE_R); - } - /** - * EnumValueDefinition : Description? EnumValue Directives[Const]? - * - * EnumValue : Name - */ - ; - - _proto.parseEnumValueDefinition = function parseEnumValueDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - var name = this.parseName(); - var directives = this.parseDirectives(true); - return { - kind: _kinds.Kind.ENUM_VALUE_DEFINITION, - description: description, - name: name, - directives: directives, - loc: this.loc(start) - }; - } - /** - * InputObjectTypeDefinition : - * - Description? input Name Directives[Const]? InputFieldsDefinition? - */ - ; - - _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('input'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var fields = this.parseInputFieldsDefinition(); - return { - kind: _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * InputFieldsDefinition : { InputValueDefinition+ } - */ - ; - - _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() { - return this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseInputValueDef, _tokenKind.TokenKind.BRACE_R); - } - /** - * TypeSystemExtension : - * - SchemaExtension - * - TypeExtension - * - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - */ - ; - - _proto.parseTypeSystemExtension = function parseTypeSystemExtension() { - var keywordToken = this._lexer.lookahead(); - - if (keywordToken.kind === _tokenKind.TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaExtension(); - - case 'scalar': - return this.parseScalarTypeExtension(); - - case 'type': - return this.parseObjectTypeExtension(); - - case 'interface': - return this.parseInterfaceTypeExtension(); - - case 'union': - return this.parseUnionTypeExtension(); - - case 'enum': - return this.parseEnumTypeExtension(); - - case 'input': - return this.parseInputObjectTypeExtension(); - } - } - - throw this.unexpected(keywordToken); - } - /** - * SchemaExtension : - * - extend schema Directives[Const]? { OperationTypeDefinition+ } - * - extend schema Directives[Const] - */ - ; - - _proto.parseSchemaExtension = function parseSchemaExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('schema'); - var directives = this.parseDirectives(true); - var operationTypes = this.optionalMany(_tokenKind.TokenKind.BRACE_L, this.parseOperationTypeDefinition, _tokenKind.TokenKind.BRACE_R); - - if (directives.length === 0 && operationTypes.length === 0) { - throw this.unexpected(); - } - - return { - kind: _kinds.Kind.SCHEMA_EXTENSION, - directives: directives, - operationTypes: operationTypes, - loc: this.loc(start) - }; - } - /** - * ScalarTypeExtension : - * - extend scalar Name Directives[Const] - */ - ; - - _proto.parseScalarTypeExtension = function parseScalarTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('scalar'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - - if (directives.length === 0) { - throw this.unexpected(); - } - - return { - kind: _kinds.Kind.SCALAR_TYPE_EXTENSION, - name: name, - directives: directives, - loc: this.loc(start) - }; - } - /** - * ObjectTypeExtension : - * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend type Name ImplementsInterfaces? Directives[Const] - * - extend type Name ImplementsInterfaces - */ - ; - - _proto.parseObjectTypeExtension = function parseObjectTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('type'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - - if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - - return { - kind: _kinds.Kind.OBJECT_TYPE_EXTENSION, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * InterfaceTypeExtension : - * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend interface Name ImplementsInterfaces? Directives[Const] - * - extend interface Name ImplementsInterfaces - */ - ; - - _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('interface'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - - if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - - return { - kind: _kinds.Kind.INTERFACE_TYPE_EXTENSION, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * UnionTypeExtension : - * - extend union Name Directives[Const]? UnionMemberTypes - * - extend union Name Directives[Const] - */ - ; - - _proto.parseUnionTypeExtension = function parseUnionTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('union'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var types = this.parseUnionMemberTypes(); - - if (directives.length === 0 && types.length === 0) { - throw this.unexpected(); - } - - return { - kind: _kinds.Kind.UNION_TYPE_EXTENSION, - name: name, - directives: directives, - types: types, - loc: this.loc(start) - }; - } - /** - * EnumTypeExtension : - * - extend enum Name Directives[Const]? EnumValuesDefinition - * - extend enum Name Directives[Const] - */ - ; - - _proto.parseEnumTypeExtension = function parseEnumTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('enum'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var values = this.parseEnumValuesDefinition(); - - if (directives.length === 0 && values.length === 0) { - throw this.unexpected(); - } - - return { - kind: _kinds.Kind.ENUM_TYPE_EXTENSION, - name: name, - directives: directives, - values: values, - loc: this.loc(start) - }; - } - /** - * InputObjectTypeExtension : - * - extend input Name Directives[Const]? InputFieldsDefinition - * - extend input Name Directives[Const] - */ - ; - - _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('input'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var fields = this.parseInputFieldsDefinition(); - - if (directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - - return { - kind: _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION, - name: name, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * DirectiveDefinition : - * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations - */ - ; - - _proto.parseDirectiveDefinition = function parseDirectiveDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('directive'); - this.expectToken(_tokenKind.TokenKind.AT); - var name = this.parseName(); - var args = this.parseArgumentDefs(); - var repeatable = this.expectOptionalKeyword('repeatable'); - this.expectKeyword('on'); - var locations = this.parseDirectiveLocations(); - return { - kind: _kinds.Kind.DIRECTIVE_DEFINITION, - description: description, - name: name, - arguments: args, - repeatable: repeatable, - locations: locations, - loc: this.loc(start) - }; - } - /** - * DirectiveLocations : - * - `|`? DirectiveLocation - * - DirectiveLocations | DirectiveLocation - */ - ; - - _proto.parseDirectiveLocations = function parseDirectiveLocations() { - return this.delimitedMany(_tokenKind.TokenKind.PIPE, this.parseDirectiveLocation); - } - /* - * 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` - */ - ; - - _proto.parseDirectiveLocation = function parseDirectiveLocation() { - var start = this._lexer.token; - var name = this.parseName(); - - if (_directiveLocation.DirectiveLocation[name.value] !== undefined) { - return name; - } - - throw this.unexpected(start); - } // Core parsing utility functions - - /** - * Returns a location object, used to identify the place in the source that created a given parsed object. - */ - ; - - _proto.loc = function loc(startToken) { - var _this$_options4; - - if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) { - return new _ast.Location(startToken, this._lexer.lastToken, this._lexer.source); - } - } - /** - * Determines if the next token is of a given kind - */ - ; - - _proto.peek = function peek(kind) { - return this._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. - */ - ; - - _proto.expectToken = function expectToken(kind) { - var token = this._lexer.token; - - if (token.kind === kind) { - this._lexer.advance(); - - return token; - } - - throw (0, _syntaxError.syntaxError)(this._lexer.source, token.start, "Expected ".concat(getTokenKindDesc(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. - */ - ; - - _proto.expectOptionalToken = function expectOptionalToken(kind) { - var token = this._lexer.token; - - if (token.kind === kind) { - this._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. - */ - ; - - _proto.expectKeyword = function expectKeyword(value) { - var token = this._lexer.token; - - if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { - this._lexer.advance(); - } else { - throw (0, _syntaxError.syntaxError)(this._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". - */ - ; - - _proto.expectOptionalKeyword = function expectOptionalKeyword(value) { - var token = this._lexer.token; - - if (token.kind === _tokenKind.TokenKind.NAME && token.value === value) { - this._lexer.advance(); - - return true; - } - - return false; - } - /** - * Helper function for creating an error when an unexpected lexed token is encountered. - */ - ; - - _proto.unexpected = function unexpected(atToken) { - var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token; - return (0, _syntaxError.syntaxError)(this._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. - */ - ; - - _proto.any = function any(openKind, parseFn, closeKind) { - this.expectToken(openKind); - var nodes = []; - - while (!this.expectOptionalToken(closeKind)) { - nodes.push(parseFn.call(this)); - } - - return nodes; - } - /** - * Returns a list of parse nodes, determined by the parseFn. - * It can be empty only if open token is missing otherwise it will always return non-empty list - * that 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. - */ - ; - - _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) { - if (this.expectOptionalToken(openKind)) { - var nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - - return nodes; - } - - return []; - } - /** - * 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. - */ - ; - - _proto.many = function many(openKind, parseFn, closeKind) { - this.expectToken(openKind); - var nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - - return nodes; - } - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. - * Advances the parser to the next lex token after last item in the list. - */ - ; - - _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) { - this.expectOptionalToken(delimiterKind); - var nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (this.expectOptionalToken(delimiterKind)); - - return nodes; - }; - - return Parser; -}(); -/** - * A helper function to describe a token as a string for debugging. - */ - - -exports.Parser = Parser; - -function getTokenDesc(token) { - var value = token.value; - return getTokenKindDesc(token.kind) + (value != null ? " \"".concat(value, "\"") : ''); -} -/** - * A helper function to describe a token kind as a string for debugging. - */ - - -function getTokenKindDesc(kind) { - return (0, _lexer.isPunctuatorTokenKind)(kind) ? "\"".concat(kind, "\"") : kind; -} diff --git a/JS/node_modules/graphql/language/parser.js.flow b/JS/node_modules/graphql/language/parser.js.flow deleted file mode 100644 index ee8bd3e..0000000 --- a/JS/node_modules/graphql/language/parser.js.flow +++ /dev/null @@ -1,1568 +0,0 @@ -// @flow strict -import type { GraphQLError } from '../error/GraphQLError'; -import { syntaxError } from '../error/syntaxError'; - -import type { TokenKindEnum } from './tokenKind'; -import type { - Token, - NameNode, - VariableNode, - DocumentNode, - DefinitionNode, - OperationDefinitionNode, - OperationTypeNode, - VariableDefinitionNode, - SelectionSetNode, - SelectionNode, - FieldNode, - ArgumentNode, - FragmentSpreadNode, - InlineFragmentNode, - FragmentDefinitionNode, - ValueNode, - StringValueNode, - ListValueNode, - ObjectValueNode, - ObjectFieldNode, - DirectiveNode, - TypeNode, - NamedTypeNode, - TypeSystemDefinitionNode, - SchemaDefinitionNode, - OperationTypeDefinitionNode, - ScalarTypeDefinitionNode, - ObjectTypeDefinitionNode, - FieldDefinitionNode, - InputValueDefinitionNode, - InterfaceTypeDefinitionNode, - UnionTypeDefinitionNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - InputObjectTypeDefinitionNode, - DirectiveDefinitionNode, - TypeSystemExtensionNode, - SchemaExtensionNode, - ScalarTypeExtensionNode, - ObjectTypeExtensionNode, - InterfaceTypeExtensionNode, - UnionTypeExtensionNode, - EnumTypeExtensionNode, - InputObjectTypeExtensionNode, -} from './ast'; -import { Kind } from './kinds'; -import { Location } from './ast'; -import { TokenKind } from './tokenKind'; -import { Source, isSource } from './source'; -import { DirectiveLocation } from './directiveLocation'; -import { Lexer, isPunctuatorTokenKind } from './lexer'; - -/** - * 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 parser = new Parser(source, options); - return parser.parseDocument(); -} - -/** - * 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 parser = new Parser(source, options); - parser.expectToken(TokenKind.SOF); - const value = parser.parseValueLiteral(false); - parser.expectToken(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 parser = new Parser(source, options); - parser.expectToken(TokenKind.SOF); - const type = parser.parseTypeReference(); - parser.expectToken(TokenKind.EOF); - return type; -} - -/** - * This class is exported only to assist people in implementing their own parsers - * without duplicating too much code and should be used only as last resort for cases - * such as experimental syntax or if certain features could not be contributed upstream. - * - * It is still part of the internal API and is versioned, so any changes to it are never - * considered breaking changes. If you still need to support multiple versions of the - * library, please use the `versionInfo` variable for version detection. - * - * @internal - */ -export class Parser { - _options: ?ParseOptions; - _lexer: Lexer; - - constructor(source: string | Source, options?: ParseOptions) { - const sourceObj = isSource(source) ? source : new Source(source); - - this._lexer = new Lexer(sourceObj); - this._options = options; - } - - /** - * Converts a name lex token into a name parse node. - */ - parseName(): NameNode { - const token = this.expectToken(TokenKind.NAME); - return { - kind: Kind.NAME, - value: ((token.value: any): string), - loc: this.loc(token), - }; - } - - // Implements the parsing rules in the Document section. - - /** - * Document : Definition+ - */ - parseDocument(): DocumentNode { - const start = this._lexer.token; - return { - kind: Kind.DOCUMENT, - definitions: this.many( - TokenKind.SOF, - this.parseDefinition, - TokenKind.EOF, - ), - loc: this.loc(start), - }; - } - - /** - * Definition : - * - ExecutableDefinition - * - TypeSystemDefinition - * - TypeSystemExtension - * - * ExecutableDefinition : - * - OperationDefinition - * - FragmentDefinition - */ - parseDefinition(): DefinitionNode { - if (this.peek(TokenKind.NAME)) { - switch (this._lexer.token.value) { - case 'query': - case 'mutation': - case 'subscription': - return this.parseOperationDefinition(); - case 'fragment': - return this.parseFragmentDefinition(); - case 'schema': - case 'scalar': - case 'type': - case 'interface': - case 'union': - case 'enum': - case 'input': - case 'directive': - return this.parseTypeSystemDefinition(); - case 'extend': - return this.parseTypeSystemExtension(); - } - } else if (this.peek(TokenKind.BRACE_L)) { - return this.parseOperationDefinition(); - } else if (this.peekDescription()) { - return this.parseTypeSystemDefinition(); - } - - throw this.unexpected(); - } - - // Implements the parsing rules in the Operations section. - - /** - * OperationDefinition : - * - SelectionSet - * - OperationType Name? VariableDefinitions? Directives? SelectionSet - */ - parseOperationDefinition(): OperationDefinitionNode { - const start = this._lexer.token; - if (this.peek(TokenKind.BRACE_L)) { - return { - kind: Kind.OPERATION_DEFINITION, - operation: 'query', - name: undefined, - variableDefinitions: [], - directives: [], - selectionSet: this.parseSelectionSet(), - loc: this.loc(start), - }; - } - const operation = this.parseOperationType(); - let name; - if (this.peek(TokenKind.NAME)) { - name = this.parseName(); - } - return { - kind: Kind.OPERATION_DEFINITION, - operation, - name, - variableDefinitions: this.parseVariableDefinitions(), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start), - }; - } - - /** - * OperationType : one of query mutation subscription - */ - parseOperationType(): OperationTypeNode { - const operationToken = this.expectToken(TokenKind.NAME); - switch (operationToken.value) { - case 'query': - return 'query'; - case 'mutation': - return 'mutation'; - case 'subscription': - return 'subscription'; - } - - throw this.unexpected(operationToken); - } - - /** - * VariableDefinitions : ( VariableDefinition+ ) - */ - parseVariableDefinitions(): Array { - return this.optionalMany( - TokenKind.PAREN_L, - this.parseVariableDefinition, - TokenKind.PAREN_R, - ); - } - - /** - * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? - */ - parseVariableDefinition(): VariableDefinitionNode { - const start = this._lexer.token; - return { - kind: Kind.VARIABLE_DEFINITION, - variable: this.parseVariable(), - type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()), - defaultValue: this.expectOptionalToken(TokenKind.EQUALS) - ? this.parseValueLiteral(true) - : undefined, - directives: this.parseDirectives(true), - loc: this.loc(start), - }; - } - - /** - * Variable : $ Name - */ - parseVariable(): VariableNode { - const start = this._lexer.token; - this.expectToken(TokenKind.DOLLAR); - return { - kind: Kind.VARIABLE, - name: this.parseName(), - loc: this.loc(start), - }; - } - - /** - * SelectionSet : { Selection+ } - */ - parseSelectionSet(): SelectionSetNode { - const start = this._lexer.token; - return { - kind: Kind.SELECTION_SET, - selections: this.many( - TokenKind.BRACE_L, - this.parseSelection, - TokenKind.BRACE_R, - ), - loc: this.loc(start), - }; - } - - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - parseSelection(): SelectionNode { - return this.peek(TokenKind.SPREAD) - ? this.parseFragment() - : this.parseField(); - } - - /** - * Field : Alias? Name Arguments? Directives? SelectionSet? - * - * Alias : Name : - */ - parseField(): FieldNode { - const start = this._lexer.token; - - const nameOrAlias = this.parseName(); - let alias; - let name; - if (this.expectOptionalToken(TokenKind.COLON)) { - alias = nameOrAlias; - name = this.parseName(); - } else { - name = nameOrAlias; - } - - return { - kind: Kind.FIELD, - alias, - name, - arguments: this.parseArguments(false), - directives: this.parseDirectives(false), - selectionSet: this.peek(TokenKind.BRACE_L) - ? this.parseSelectionSet() - : undefined, - loc: this.loc(start), - }; - } - - /** - * Arguments[Const] : ( Argument[?Const]+ ) - */ - parseArguments(isConst: boolean): Array { - const item = isConst ? this.parseConstArgument : this.parseArgument; - return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R); - } - - /** - * Argument[Const] : Name : Value[?Const] - */ - parseArgument(): ArgumentNode { - const start = this._lexer.token; - const name = this.parseName(); - - this.expectToken(TokenKind.COLON); - return { - kind: Kind.ARGUMENT, - name, - value: this.parseValueLiteral(false), - loc: this.loc(start), - }; - } - - parseConstArgument(): ArgumentNode { - const start = this._lexer.token; - return { - kind: Kind.ARGUMENT, - name: this.parseName(), - value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)), - loc: this.loc(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 - */ - parseFragment(): FragmentSpreadNode | InlineFragmentNode { - const start = this._lexer.token; - this.expectToken(TokenKind.SPREAD); - - const hasTypeCondition = this.expectOptionalKeyword('on'); - if (!hasTypeCondition && this.peek(TokenKind.NAME)) { - return { - kind: Kind.FRAGMENT_SPREAD, - name: this.parseFragmentName(), - directives: this.parseDirectives(false), - loc: this.loc(start), - }; - } - return { - kind: Kind.INLINE_FRAGMENT, - typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start), - }; - } - - /** - * FragmentDefinition : - * - fragment FragmentName on TypeCondition Directives? SelectionSet - * - * TypeCondition : NamedType - */ - parseFragmentDefinition(): FragmentDefinitionNode { - const start = this._lexer.token; - this.expectKeyword('fragment'); - // Experimental support for defining variables within fragments changes - // the grammar of FragmentDefinition: - // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet - if (this._options?.experimentalFragmentVariables === true) { - return { - kind: Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - variableDefinitions: this.parseVariableDefinitions(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start), - }; - } - return { - kind: Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start), - }; - } - - /** - * FragmentName : Name but not `on` - */ - parseFragmentName(): NameNode { - if (this._lexer.token.value === 'on') { - throw this.unexpected(); - } - return this.parseName(); - } - - // 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` - */ - parseValueLiteral(isConst: boolean): ValueNode { - const token = this._lexer.token; - switch (token.kind) { - case TokenKind.BRACKET_L: - return this.parseList(isConst); - case TokenKind.BRACE_L: - return this.parseObject(isConst); - case TokenKind.INT: - this._lexer.advance(); - return { - kind: Kind.INT, - value: ((token.value: any): string), - loc: this.loc(token), - }; - case TokenKind.FLOAT: - this._lexer.advance(); - return { - kind: Kind.FLOAT, - value: ((token.value: any): string), - loc: this.loc(token), - }; - case TokenKind.STRING: - case TokenKind.BLOCK_STRING: - return this.parseStringLiteral(); - case TokenKind.NAME: - this._lexer.advance(); - switch (token.value) { - case 'true': - return { kind: Kind.BOOLEAN, value: true, loc: this.loc(token) }; - case 'false': - return { kind: Kind.BOOLEAN, value: false, loc: this.loc(token) }; - case 'null': - return { kind: Kind.NULL, loc: this.loc(token) }; - default: - return { - kind: Kind.ENUM, - value: ((token.value: any): string), - loc: this.loc(token), - }; - } - case TokenKind.DOLLAR: - if (!isConst) { - return this.parseVariable(); - } - break; - } - throw this.unexpected(); - } - - parseStringLiteral(): StringValueNode { - const token = this._lexer.token; - this._lexer.advance(); - return { - kind: Kind.STRING, - value: ((token.value: any): string), - block: token.kind === TokenKind.BLOCK_STRING, - loc: this.loc(token), - }; - } - - /** - * ListValue[Const] : - * - [ ] - * - [ Value[?Const]+ ] - */ - parseList(isConst: boolean): ListValueNode { - const start = this._lexer.token; - const item = () => this.parseValueLiteral(isConst); - return { - kind: Kind.LIST, - values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R), - loc: this.loc(start), - }; - } - - /** - * ObjectValue[Const] : - * - { } - * - { ObjectField[?Const]+ } - */ - parseObject(isConst: boolean): ObjectValueNode { - const start = this._lexer.token; - const item = () => this.parseObjectField(isConst); - return { - kind: Kind.OBJECT, - fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R), - loc: this.loc(start), - }; - } - - /** - * ObjectField[Const] : Name : Value[?Const] - */ - parseObjectField(isConst: boolean): ObjectFieldNode { - const start = this._lexer.token; - const name = this.parseName(); - this.expectToken(TokenKind.COLON); - - return { - kind: Kind.OBJECT_FIELD, - name, - value: this.parseValueLiteral(isConst), - loc: this.loc(start), - }; - } - - // Implements the parsing rules in the Directives section. - - /** - * Directives[Const] : Directive[?Const]+ - */ - parseDirectives(isConst: boolean): Array { - const directives = []; - while (this.peek(TokenKind.AT)) { - directives.push(this.parseDirective(isConst)); - } - return directives; - } - - /** - * Directive[Const] : @ Name Arguments[?Const]? - */ - parseDirective(isConst: boolean): DirectiveNode { - const start = this._lexer.token; - this.expectToken(TokenKind.AT); - return { - kind: Kind.DIRECTIVE, - name: this.parseName(), - arguments: this.parseArguments(isConst), - loc: this.loc(start), - }; - } - - // Implements the parsing rules in the Types section. - - /** - * Type : - * - NamedType - * - ListType - * - NonNullType - */ - parseTypeReference(): TypeNode { - const start = this._lexer.token; - let type; - if (this.expectOptionalToken(TokenKind.BRACKET_L)) { - type = this.parseTypeReference(); - this.expectToken(TokenKind.BRACKET_R); - type = { - kind: Kind.LIST_TYPE, - type, - loc: this.loc(start), - }; - } else { - type = this.parseNamedType(); - } - - if (this.expectOptionalToken(TokenKind.BANG)) { - return { - kind: Kind.NON_NULL_TYPE, - type, - loc: this.loc(start), - }; - } - return type; - } - - /** - * NamedType : Name - */ - parseNamedType(): NamedTypeNode { - const start = this._lexer.token; - return { - kind: Kind.NAMED_TYPE, - name: this.parseName(), - loc: this.loc(start), - }; - } - - // Implements the parsing rules in the Type Definition section. - - /** - * TypeSystemDefinition : - * - SchemaDefinition - * - TypeDefinition - * - DirectiveDefinition - * - * TypeDefinition : - * - ScalarTypeDefinition - * - ObjectTypeDefinition - * - InterfaceTypeDefinition - * - UnionTypeDefinition - * - EnumTypeDefinition - * - InputObjectTypeDefinition - */ - parseTypeSystemDefinition(): TypeSystemDefinitionNode { - // Many definitions begin with a description and require a lookahead. - const keywordToken = this.peekDescription() - ? this._lexer.lookahead() - : this._lexer.token; - - if (keywordToken.kind === TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaDefinition(); - case 'scalar': - return this.parseScalarTypeDefinition(); - case 'type': - return this.parseObjectTypeDefinition(); - case 'interface': - return this.parseInterfaceTypeDefinition(); - case 'union': - return this.parseUnionTypeDefinition(); - case 'enum': - return this.parseEnumTypeDefinition(); - case 'input': - return this.parseInputObjectTypeDefinition(); - case 'directive': - return this.parseDirectiveDefinition(); - } - } - - throw this.unexpected(keywordToken); - } - - peekDescription(): boolean { - return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING); - } - - /** - * Description : StringValue - */ - parseDescription(): void | StringValueNode { - if (this.peekDescription()) { - return this.parseStringLiteral(); - } - } - - /** - * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } - */ - parseSchemaDefinition(): SchemaDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('schema'); - const directives = this.parseDirectives(true); - const operationTypes = this.many( - TokenKind.BRACE_L, - this.parseOperationTypeDefinition, - TokenKind.BRACE_R, - ); - return { - kind: Kind.SCHEMA_DEFINITION, - description, - directives, - operationTypes, - loc: this.loc(start), - }; - } - - /** - * OperationTypeDefinition : OperationType : NamedType - */ - parseOperationTypeDefinition(): OperationTypeDefinitionNode { - const start = this._lexer.token; - const operation = this.parseOperationType(); - this.expectToken(TokenKind.COLON); - const type = this.parseNamedType(); - return { - kind: Kind.OPERATION_TYPE_DEFINITION, - operation, - type, - loc: this.loc(start), - }; - } - - /** - * ScalarTypeDefinition : Description? scalar Name Directives[Const]? - */ - parseScalarTypeDefinition(): ScalarTypeDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('scalar'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - return { - kind: Kind.SCALAR_TYPE_DEFINITION, - description, - name, - directives, - loc: this.loc(start), - }; - } - - /** - * ObjectTypeDefinition : - * Description? - * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? - */ - parseObjectTypeDefinition(): ObjectTypeDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('type'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseDirectives(true); - const fields = this.parseFieldsDefinition(); - return { - kind: Kind.OBJECT_TYPE_DEFINITION, - description, - name, - interfaces, - directives, - fields, - loc: this.loc(start), - }; - } - - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - parseImplementsInterfaces(): Array { - if (!this.expectOptionalKeyword('implements')) { - return []; - } - - if (this._options?.allowLegacySDLImplementsInterfaces === true) { - const types = []; - // Optional leading ampersand - this.expectOptionalToken(TokenKind.AMP); - do { - types.push(this.parseNamedType()); - } while ( - this.expectOptionalToken(TokenKind.AMP) || - this.peek(TokenKind.NAME) - ); - return types; - } - - return this.delimitedMany(TokenKind.AMP, this.parseNamedType); - } - - /** - * FieldsDefinition : { FieldDefinition+ } - */ - parseFieldsDefinition(): Array { - // Legacy support for the SDL? - if ( - this._options?.allowLegacySDLEmptyFields === true && - this.peek(TokenKind.BRACE_L) && - this._lexer.lookahead().kind === TokenKind.BRACE_R - ) { - this._lexer.advance(); - this._lexer.advance(); - return []; - } - return this.optionalMany( - TokenKind.BRACE_L, - this.parseFieldDefinition, - TokenKind.BRACE_R, - ); - } - - /** - * FieldDefinition : - * - Description? Name ArgumentsDefinition? : Type Directives[Const]? - */ - parseFieldDefinition(): FieldDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseName(); - const args = this.parseArgumentDefs(); - this.expectToken(TokenKind.COLON); - const type = this.parseTypeReference(); - const directives = this.parseDirectives(true); - return { - kind: Kind.FIELD_DEFINITION, - description, - name, - arguments: args, - type, - directives, - loc: this.loc(start), - }; - } - - /** - * ArgumentsDefinition : ( InputValueDefinition+ ) - */ - parseArgumentDefs(): Array { - return this.optionalMany( - TokenKind.PAREN_L, - this.parseInputValueDef, - TokenKind.PAREN_R, - ); - } - - /** - * InputValueDefinition : - * - Description? Name : Type DefaultValue? Directives[Const]? - */ - parseInputValueDef(): InputValueDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseName(); - this.expectToken(TokenKind.COLON); - const type = this.parseTypeReference(); - let defaultValue; - if (this.expectOptionalToken(TokenKind.EQUALS)) { - defaultValue = this.parseValueLiteral(true); - } - const directives = this.parseDirectives(true); - return { - kind: Kind.INPUT_VALUE_DEFINITION, - description, - name, - type, - defaultValue, - directives, - loc: this.loc(start), - }; - } - - /** - * InterfaceTypeDefinition : - * - Description? interface Name Directives[Const]? FieldsDefinition? - */ - parseInterfaceTypeDefinition(): InterfaceTypeDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('interface'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseDirectives(true); - const fields = this.parseFieldsDefinition(); - return { - kind: Kind.INTERFACE_TYPE_DEFINITION, - description, - name, - interfaces, - directives, - fields, - loc: this.loc(start), - }; - } - - /** - * UnionTypeDefinition : - * - Description? union Name Directives[Const]? UnionMemberTypes? - */ - parseUnionTypeDefinition(): UnionTypeDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('union'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - const types = this.parseUnionMemberTypes(); - return { - kind: Kind.UNION_TYPE_DEFINITION, - description, - name, - directives, - types, - loc: this.loc(start), - }; - } - - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - parseUnionMemberTypes(): Array { - return this.expectOptionalToken(TokenKind.EQUALS) - ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) - : []; - } - - /** - * EnumTypeDefinition : - * - Description? enum Name Directives[Const]? EnumValuesDefinition? - */ - parseEnumTypeDefinition(): EnumTypeDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('enum'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - const values = this.parseEnumValuesDefinition(); - return { - kind: Kind.ENUM_TYPE_DEFINITION, - description, - name, - directives, - values, - loc: this.loc(start), - }; - } - - /** - * EnumValuesDefinition : { EnumValueDefinition+ } - */ - parseEnumValuesDefinition(): Array { - return this.optionalMany( - TokenKind.BRACE_L, - this.parseEnumValueDefinition, - TokenKind.BRACE_R, - ); - } - - /** - * EnumValueDefinition : Description? EnumValue Directives[Const]? - * - * EnumValue : Name - */ - parseEnumValueDefinition(): EnumValueDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - const name = this.parseName(); - const directives = this.parseDirectives(true); - return { - kind: Kind.ENUM_VALUE_DEFINITION, - description, - name, - directives, - loc: this.loc(start), - }; - } - - /** - * InputObjectTypeDefinition : - * - Description? input Name Directives[Const]? InputFieldsDefinition? - */ - parseInputObjectTypeDefinition(): InputObjectTypeDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('input'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - const fields = this.parseInputFieldsDefinition(); - return { - kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, - description, - name, - directives, - fields, - loc: this.loc(start), - }; - } - - /** - * InputFieldsDefinition : { InputValueDefinition+ } - */ - parseInputFieldsDefinition(): Array { - return this.optionalMany( - TokenKind.BRACE_L, - this.parseInputValueDef, - TokenKind.BRACE_R, - ); - } - - /** - * TypeSystemExtension : - * - SchemaExtension - * - TypeExtension - * - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - */ - parseTypeSystemExtension(): TypeSystemExtensionNode { - const keywordToken = this._lexer.lookahead(); - - if (keywordToken.kind === TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaExtension(); - case 'scalar': - return this.parseScalarTypeExtension(); - case 'type': - return this.parseObjectTypeExtension(); - case 'interface': - return this.parseInterfaceTypeExtension(); - case 'union': - return this.parseUnionTypeExtension(); - case 'enum': - return this.parseEnumTypeExtension(); - case 'input': - return this.parseInputObjectTypeExtension(); - } - } - - throw this.unexpected(keywordToken); - } - - /** - * SchemaExtension : - * - extend schema Directives[Const]? { OperationTypeDefinition+ } - * - extend schema Directives[Const] - */ - parseSchemaExtension(): SchemaExtensionNode { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('schema'); - const directives = this.parseDirectives(true); - const operationTypes = this.optionalMany( - TokenKind.BRACE_L, - this.parseOperationTypeDefinition, - TokenKind.BRACE_R, - ); - if (directives.length === 0 && operationTypes.length === 0) { - throw this.unexpected(); - } - return { - kind: Kind.SCHEMA_EXTENSION, - directives, - operationTypes, - loc: this.loc(start), - }; - } - - /** - * ScalarTypeExtension : - * - extend scalar Name Directives[Const] - */ - parseScalarTypeExtension(): ScalarTypeExtensionNode { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('scalar'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - if (directives.length === 0) { - throw this.unexpected(); - } - return { - kind: Kind.SCALAR_TYPE_EXTENSION, - name, - directives, - loc: this.loc(start), - }; - } - - /** - * ObjectTypeExtension : - * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend type Name ImplementsInterfaces? Directives[Const] - * - extend type Name ImplementsInterfaces - */ - parseObjectTypeExtension(): ObjectTypeExtensionNode { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('type'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseDirectives(true); - const fields = this.parseFieldsDefinition(); - if ( - interfaces.length === 0 && - directives.length === 0 && - fields.length === 0 - ) { - throw this.unexpected(); - } - return { - kind: Kind.OBJECT_TYPE_EXTENSION, - name, - interfaces, - directives, - fields, - loc: this.loc(start), - }; - } - - /** - * InterfaceTypeExtension : - * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend interface Name ImplementsInterfaces? Directives[Const] - * - extend interface Name ImplementsInterfaces - */ - parseInterfaceTypeExtension(): InterfaceTypeExtensionNode { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('interface'); - const name = this.parseName(); - const interfaces = this.parseImplementsInterfaces(); - const directives = this.parseDirectives(true); - const fields = this.parseFieldsDefinition(); - if ( - interfaces.length === 0 && - directives.length === 0 && - fields.length === 0 - ) { - throw this.unexpected(); - } - return { - kind: Kind.INTERFACE_TYPE_EXTENSION, - name, - interfaces, - directives, - fields, - loc: this.loc(start), - }; - } - - /** - * UnionTypeExtension : - * - extend union Name Directives[Const]? UnionMemberTypes - * - extend union Name Directives[Const] - */ - parseUnionTypeExtension(): UnionTypeExtensionNode { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('union'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - const types = this.parseUnionMemberTypes(); - if (directives.length === 0 && types.length === 0) { - throw this.unexpected(); - } - return { - kind: Kind.UNION_TYPE_EXTENSION, - name, - directives, - types, - loc: this.loc(start), - }; - } - - /** - * EnumTypeExtension : - * - extend enum Name Directives[Const]? EnumValuesDefinition - * - extend enum Name Directives[Const] - */ - parseEnumTypeExtension(): EnumTypeExtensionNode { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('enum'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - const values = this.parseEnumValuesDefinition(); - if (directives.length === 0 && values.length === 0) { - throw this.unexpected(); - } - return { - kind: Kind.ENUM_TYPE_EXTENSION, - name, - directives, - values, - loc: this.loc(start), - }; - } - - /** - * InputObjectTypeExtension : - * - extend input Name Directives[Const]? InputFieldsDefinition - * - extend input Name Directives[Const] - */ - parseInputObjectTypeExtension(): InputObjectTypeExtensionNode { - const start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('input'); - const name = this.parseName(); - const directives = this.parseDirectives(true); - const fields = this.parseInputFieldsDefinition(); - if (directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - return { - kind: Kind.INPUT_OBJECT_TYPE_EXTENSION, - name, - directives, - fields, - loc: this.loc(start), - }; - } - - /** - * DirectiveDefinition : - * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations - */ - parseDirectiveDefinition(): DirectiveDefinitionNode { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword('directive'); - this.expectToken(TokenKind.AT); - const name = this.parseName(); - const args = this.parseArgumentDefs(); - const repeatable = this.expectOptionalKeyword('repeatable'); - this.expectKeyword('on'); - const locations = this.parseDirectiveLocations(); - return { - kind: Kind.DIRECTIVE_DEFINITION, - description, - name, - arguments: args, - repeatable, - locations, - loc: this.loc(start), - }; - } - - /** - * DirectiveLocations : - * - `|`? DirectiveLocation - * - DirectiveLocations | DirectiveLocation - */ - parseDirectiveLocations(): Array { - return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation); - } - - /* - * 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` - */ - parseDirectiveLocation(): NameNode { - const start = this._lexer.token; - const name = this.parseName(); - if (DirectiveLocation[name.value] !== undefined) { - return name; - } - throw this.unexpected(start); - } - - // Core parsing utility functions - - /** - * Returns a location object, used to identify the place in the source that created a given parsed object. - */ - loc(startToken: Token): Location | void { - if (this._options?.noLocation !== true) { - return new Location( - startToken, - this._lexer.lastToken, - this._lexer.source, - ); - } - } - - /** - * Determines if the next token is of a given kind - */ - peek(kind: TokenKindEnum): boolean { - return this._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. - */ - expectToken(kind: TokenKindEnum): Token { - const token = this._lexer.token; - if (token.kind === kind) { - this._lexer.advance(); - return token; - } - - throw syntaxError( - this._lexer.source, - token.start, - `Expected ${getTokenKindDesc(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. - */ - expectOptionalToken(kind: TokenKindEnum): ?Token { - const token = this._lexer.token; - if (token.kind === kind) { - this._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. - */ - expectKeyword(value: string) { - const token = this._lexer.token; - if (token.kind === TokenKind.NAME && token.value === value) { - this._lexer.advance(); - } else { - throw syntaxError( - this._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". - */ - expectOptionalKeyword(value: string): boolean { - const token = this._lexer.token; - if (token.kind === TokenKind.NAME && token.value === value) { - this._lexer.advance(); - return true; - } - return false; - } - - /** - * Helper function for creating an error when an unexpected lexed token is encountered. - */ - unexpected(atToken?: ?Token): GraphQLError { - const token = atToken ?? this._lexer.token; - return syntaxError( - this._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. - */ - any( - openKind: TokenKindEnum, - parseFn: () => T, - closeKind: TokenKindEnum, - ): Array { - this.expectToken(openKind); - const nodes = []; - while (!this.expectOptionalToken(closeKind)) { - nodes.push(parseFn.call(this)); - } - return nodes; - } - - /** - * Returns a list of parse nodes, determined by the parseFn. - * It can be empty only if open token is missing otherwise it will always return non-empty list - * that 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. - */ - optionalMany( - openKind: TokenKindEnum, - parseFn: () => T, - closeKind: TokenKindEnum, - ): Array { - if (this.expectOptionalToken(openKind)) { - const nodes = []; - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - return nodes; - } - return []; - } - - /** - * 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. - */ - many( - openKind: TokenKindEnum, - parseFn: () => T, - closeKind: TokenKindEnum, - ): Array { - this.expectToken(openKind); - const nodes = []; - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - return nodes; - } - - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. - * Advances the parser to the next lex token after last item in the list. - */ - delimitedMany(delimiterKind: TokenKindEnum, parseFn: () => T): Array { - this.expectOptionalToken(delimiterKind); - - const nodes = []; - do { - nodes.push(parseFn.call(this)); - } while (this.expectOptionalToken(delimiterKind)); - return nodes; - } -} - -/** - * A helper function to describe a token as a string for debugging. - */ -function getTokenDesc(token: Token): string { - const value = token.value; - return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ''); -} - -/** - * A helper function to describe a token kind as a string for debugging. - */ -function getTokenKindDesc(kind: TokenKindEnum): string { - return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind; -} diff --git a/JS/node_modules/graphql/language/parser.mjs b/JS/node_modules/graphql/language/parser.mjs deleted file mode 100644 index 3987f6c..0000000 --- a/JS/node_modules/graphql/language/parser.mjs +++ /dev/null @@ -1,1547 +0,0 @@ -import { syntaxError } from "../error/syntaxError.mjs"; -import { Kind } from "./kinds.mjs"; -import { Location } from "./ast.mjs"; -import { TokenKind } from "./tokenKind.mjs"; -import { Source, isSource } from "./source.mjs"; -import { DirectiveLocation } from "./directiveLocation.mjs"; -import { Lexer, isPunctuatorTokenKind } from "./lexer.mjs"; -/** - * 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 parser = new Parser(source, options); - return parser.parseDocument(); -} -/** - * 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 parser = new Parser(source, options); - parser.expectToken(TokenKind.SOF); - var value = parser.parseValueLiteral(false); - parser.expectToken(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 parser = new Parser(source, options); - parser.expectToken(TokenKind.SOF); - var type = parser.parseTypeReference(); - parser.expectToken(TokenKind.EOF); - return type; -} -/** - * This class is exported only to assist people in implementing their own parsers - * without duplicating too much code and should be used only as last resort for cases - * such as experimental syntax or if certain features could not be contributed upstream. - * - * It is still part of the internal API and is versioned, so any changes to it are never - * considered breaking changes. If you still need to support multiple versions of the - * library, please use the `versionInfo` variable for version detection. - * - * @internal - */ - -export var Parser = /*#__PURE__*/function () { - function Parser(source, options) { - var sourceObj = isSource(source) ? source : new Source(source); - this._lexer = new Lexer(sourceObj); - this._options = options; - } - /** - * Converts a name lex token into a name parse node. - */ - - - var _proto = Parser.prototype; - - _proto.parseName = function parseName() { - var token = this.expectToken(TokenKind.NAME); - return { - kind: Kind.NAME, - value: token.value, - loc: this.loc(token) - }; - } // Implements the parsing rules in the Document section. - - /** - * Document : Definition+ - */ - ; - - _proto.parseDocument = function parseDocument() { - var start = this._lexer.token; - return { - kind: Kind.DOCUMENT, - definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF), - loc: this.loc(start) - }; - } - /** - * Definition : - * - ExecutableDefinition - * - TypeSystemDefinition - * - TypeSystemExtension - * - * ExecutableDefinition : - * - OperationDefinition - * - FragmentDefinition - */ - ; - - _proto.parseDefinition = function parseDefinition() { - if (this.peek(TokenKind.NAME)) { - switch (this._lexer.token.value) { - case 'query': - case 'mutation': - case 'subscription': - return this.parseOperationDefinition(); - - case 'fragment': - return this.parseFragmentDefinition(); - - case 'schema': - case 'scalar': - case 'type': - case 'interface': - case 'union': - case 'enum': - case 'input': - case 'directive': - return this.parseTypeSystemDefinition(); - - case 'extend': - return this.parseTypeSystemExtension(); - } - } else if (this.peek(TokenKind.BRACE_L)) { - return this.parseOperationDefinition(); - } else if (this.peekDescription()) { - return this.parseTypeSystemDefinition(); - } - - throw this.unexpected(); - } // Implements the parsing rules in the Operations section. - - /** - * OperationDefinition : - * - SelectionSet - * - OperationType Name? VariableDefinitions? Directives? SelectionSet - */ - ; - - _proto.parseOperationDefinition = function parseOperationDefinition() { - var start = this._lexer.token; - - if (this.peek(TokenKind.BRACE_L)) { - return { - kind: Kind.OPERATION_DEFINITION, - operation: 'query', - name: undefined, - variableDefinitions: [], - directives: [], - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - - var operation = this.parseOperationType(); - var name; - - if (this.peek(TokenKind.NAME)) { - name = this.parseName(); - } - - return { - kind: Kind.OPERATION_DEFINITION, - operation: operation, - name: name, - variableDefinitions: this.parseVariableDefinitions(), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - /** - * OperationType : one of query mutation subscription - */ - ; - - _proto.parseOperationType = function parseOperationType() { - var operationToken = this.expectToken(TokenKind.NAME); - - switch (operationToken.value) { - case 'query': - return 'query'; - - case 'mutation': - return 'mutation'; - - case 'subscription': - return 'subscription'; - } - - throw this.unexpected(operationToken); - } - /** - * VariableDefinitions : ( VariableDefinition+ ) - */ - ; - - _proto.parseVariableDefinitions = function parseVariableDefinitions() { - return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R); - } - /** - * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? - */ - ; - - _proto.parseVariableDefinition = function parseVariableDefinition() { - var start = this._lexer.token; - return { - kind: Kind.VARIABLE_DEFINITION, - variable: this.parseVariable(), - type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()), - defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined, - directives: this.parseDirectives(true), - loc: this.loc(start) - }; - } - /** - * Variable : $ Name - */ - ; - - _proto.parseVariable = function parseVariable() { - var start = this._lexer.token; - this.expectToken(TokenKind.DOLLAR); - return { - kind: Kind.VARIABLE, - name: this.parseName(), - loc: this.loc(start) - }; - } - /** - * SelectionSet : { Selection+ } - */ - ; - - _proto.parseSelectionSet = function parseSelectionSet() { - var start = this._lexer.token; - return { - kind: Kind.SELECTION_SET, - selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R), - loc: this.loc(start) - }; - } - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - ; - - _proto.parseSelection = function parseSelection() { - return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField(); - } - /** - * Field : Alias? Name Arguments? Directives? SelectionSet? - * - * Alias : Name : - */ - ; - - _proto.parseField = function parseField() { - var start = this._lexer.token; - var nameOrAlias = this.parseName(); - var alias; - var name; - - if (this.expectOptionalToken(TokenKind.COLON)) { - alias = nameOrAlias; - name = this.parseName(); - } else { - name = nameOrAlias; - } - - return { - kind: Kind.FIELD, - alias: alias, - name: name, - arguments: this.parseArguments(false), - directives: this.parseDirectives(false), - selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined, - loc: this.loc(start) - }; - } - /** - * Arguments[Const] : ( Argument[?Const]+ ) - */ - ; - - _proto.parseArguments = function parseArguments(isConst) { - var item = isConst ? this.parseConstArgument : this.parseArgument; - return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R); - } - /** - * Argument[Const] : Name : Value[?Const] - */ - ; - - _proto.parseArgument = function parseArgument() { - var start = this._lexer.token; - var name = this.parseName(); - this.expectToken(TokenKind.COLON); - return { - kind: Kind.ARGUMENT, - name: name, - value: this.parseValueLiteral(false), - loc: this.loc(start) - }; - }; - - _proto.parseConstArgument = function parseConstArgument() { - var start = this._lexer.token; - return { - kind: Kind.ARGUMENT, - name: this.parseName(), - value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)), - loc: this.loc(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 - */ - ; - - _proto.parseFragment = function parseFragment() { - var start = this._lexer.token; - this.expectToken(TokenKind.SPREAD); - var hasTypeCondition = this.expectOptionalKeyword('on'); - - if (!hasTypeCondition && this.peek(TokenKind.NAME)) { - return { - kind: Kind.FRAGMENT_SPREAD, - name: this.parseFragmentName(), - directives: this.parseDirectives(false), - loc: this.loc(start) - }; - } - - return { - kind: Kind.INLINE_FRAGMENT, - typeCondition: hasTypeCondition ? this.parseNamedType() : undefined, - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - /** - * FragmentDefinition : - * - fragment FragmentName on TypeCondition Directives? SelectionSet - * - * TypeCondition : NamedType - */ - ; - - _proto.parseFragmentDefinition = function parseFragmentDefinition() { - var _this$_options; - - var start = this._lexer.token; - this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes - // the grammar of FragmentDefinition: - // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet - - if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) { - return { - kind: Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - variableDefinitions: this.parseVariableDefinitions(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - - return { - kind: Kind.FRAGMENT_DEFINITION, - name: this.parseFragmentName(), - typeCondition: (this.expectKeyword('on'), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet(), - loc: this.loc(start) - }; - } - /** - * FragmentName : Name but not `on` - */ - ; - - _proto.parseFragmentName = function parseFragmentName() { - if (this._lexer.token.value === 'on') { - throw this.unexpected(); - } - - return this.parseName(); - } // 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` - */ - ; - - _proto.parseValueLiteral = function parseValueLiteral(isConst) { - var token = this._lexer.token; - - switch (token.kind) { - case TokenKind.BRACKET_L: - return this.parseList(isConst); - - case TokenKind.BRACE_L: - return this.parseObject(isConst); - - case TokenKind.INT: - this._lexer.advance(); - - return { - kind: Kind.INT, - value: token.value, - loc: this.loc(token) - }; - - case TokenKind.FLOAT: - this._lexer.advance(); - - return { - kind: Kind.FLOAT, - value: token.value, - loc: this.loc(token) - }; - - case TokenKind.STRING: - case TokenKind.BLOCK_STRING: - return this.parseStringLiteral(); - - case TokenKind.NAME: - this._lexer.advance(); - - switch (token.value) { - case 'true': - return { - kind: Kind.BOOLEAN, - value: true, - loc: this.loc(token) - }; - - case 'false': - return { - kind: Kind.BOOLEAN, - value: false, - loc: this.loc(token) - }; - - case 'null': - return { - kind: Kind.NULL, - loc: this.loc(token) - }; - - default: - return { - kind: Kind.ENUM, - value: token.value, - loc: this.loc(token) - }; - } - - case TokenKind.DOLLAR: - if (!isConst) { - return this.parseVariable(); - } - - break; - } - - throw this.unexpected(); - }; - - _proto.parseStringLiteral = function parseStringLiteral() { - var token = this._lexer.token; - - this._lexer.advance(); - - return { - kind: Kind.STRING, - value: token.value, - block: token.kind === TokenKind.BLOCK_STRING, - loc: this.loc(token) - }; - } - /** - * ListValue[Const] : - * - [ ] - * - [ Value[?Const]+ ] - */ - ; - - _proto.parseList = function parseList(isConst) { - var _this = this; - - var start = this._lexer.token; - - var item = function item() { - return _this.parseValueLiteral(isConst); - }; - - return { - kind: Kind.LIST, - values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R), - loc: this.loc(start) - }; - } - /** - * ObjectValue[Const] : - * - { } - * - { ObjectField[?Const]+ } - */ - ; - - _proto.parseObject = function parseObject(isConst) { - var _this2 = this; - - var start = this._lexer.token; - - var item = function item() { - return _this2.parseObjectField(isConst); - }; - - return { - kind: Kind.OBJECT, - fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R), - loc: this.loc(start) - }; - } - /** - * ObjectField[Const] : Name : Value[?Const] - */ - ; - - _proto.parseObjectField = function parseObjectField(isConst) { - var start = this._lexer.token; - var name = this.parseName(); - this.expectToken(TokenKind.COLON); - return { - kind: Kind.OBJECT_FIELD, - name: name, - value: this.parseValueLiteral(isConst), - loc: this.loc(start) - }; - } // Implements the parsing rules in the Directives section. - - /** - * Directives[Const] : Directive[?Const]+ - */ - ; - - _proto.parseDirectives = function parseDirectives(isConst) { - var directives = []; - - while (this.peek(TokenKind.AT)) { - directives.push(this.parseDirective(isConst)); - } - - return directives; - } - /** - * Directive[Const] : @ Name Arguments[?Const]? - */ - ; - - _proto.parseDirective = function parseDirective(isConst) { - var start = this._lexer.token; - this.expectToken(TokenKind.AT); - return { - kind: Kind.DIRECTIVE, - name: this.parseName(), - arguments: this.parseArguments(isConst), - loc: this.loc(start) - }; - } // Implements the parsing rules in the Types section. - - /** - * Type : - * - NamedType - * - ListType - * - NonNullType - */ - ; - - _proto.parseTypeReference = function parseTypeReference() { - var start = this._lexer.token; - var type; - - if (this.expectOptionalToken(TokenKind.BRACKET_L)) { - type = this.parseTypeReference(); - this.expectToken(TokenKind.BRACKET_R); - type = { - kind: Kind.LIST_TYPE, - type: type, - loc: this.loc(start) - }; - } else { - type = this.parseNamedType(); - } - - if (this.expectOptionalToken(TokenKind.BANG)) { - return { - kind: Kind.NON_NULL_TYPE, - type: type, - loc: this.loc(start) - }; - } - - return type; - } - /** - * NamedType : Name - */ - ; - - _proto.parseNamedType = function parseNamedType() { - var start = this._lexer.token; - return { - kind: Kind.NAMED_TYPE, - name: this.parseName(), - loc: this.loc(start) - }; - } // Implements the parsing rules in the Type Definition section. - - /** - * TypeSystemDefinition : - * - SchemaDefinition - * - TypeDefinition - * - DirectiveDefinition - * - * TypeDefinition : - * - ScalarTypeDefinition - * - ObjectTypeDefinition - * - InterfaceTypeDefinition - * - UnionTypeDefinition - * - EnumTypeDefinition - * - InputObjectTypeDefinition - */ - ; - - _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() { - // Many definitions begin with a description and require a lookahead. - var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token; - - if (keywordToken.kind === TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaDefinition(); - - case 'scalar': - return this.parseScalarTypeDefinition(); - - case 'type': - return this.parseObjectTypeDefinition(); - - case 'interface': - return this.parseInterfaceTypeDefinition(); - - case 'union': - return this.parseUnionTypeDefinition(); - - case 'enum': - return this.parseEnumTypeDefinition(); - - case 'input': - return this.parseInputObjectTypeDefinition(); - - case 'directive': - return this.parseDirectiveDefinition(); - } - } - - throw this.unexpected(keywordToken); - }; - - _proto.peekDescription = function peekDescription() { - return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING); - } - /** - * Description : StringValue - */ - ; - - _proto.parseDescription = function parseDescription() { - if (this.peekDescription()) { - return this.parseStringLiteral(); - } - } - /** - * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ } - */ - ; - - _proto.parseSchemaDefinition = function parseSchemaDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('schema'); - var directives = this.parseDirectives(true); - var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R); - return { - kind: Kind.SCHEMA_DEFINITION, - description: description, - directives: directives, - operationTypes: operationTypes, - loc: this.loc(start) - }; - } - /** - * OperationTypeDefinition : OperationType : NamedType - */ - ; - - _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() { - var start = this._lexer.token; - var operation = this.parseOperationType(); - this.expectToken(TokenKind.COLON); - var type = this.parseNamedType(); - return { - kind: Kind.OPERATION_TYPE_DEFINITION, - operation: operation, - type: type, - loc: this.loc(start) - }; - } - /** - * ScalarTypeDefinition : Description? scalar Name Directives[Const]? - */ - ; - - _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('scalar'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - return { - kind: Kind.SCALAR_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - loc: this.loc(start) - }; - } - /** - * ObjectTypeDefinition : - * Description? - * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition? - */ - ; - - _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('type'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - return { - kind: Kind.OBJECT_TYPE_DEFINITION, - description: description, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - ; - - _proto.parseImplementsInterfaces = function parseImplementsInterfaces() { - var _this$_options2; - - if (!this.expectOptionalKeyword('implements')) { - return []; - } - - if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) { - var types = []; // Optional leading ampersand - - this.expectOptionalToken(TokenKind.AMP); - - do { - types.push(this.parseNamedType()); - } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME)); - - return types; - } - - return this.delimitedMany(TokenKind.AMP, this.parseNamedType); - } - /** - * FieldsDefinition : { FieldDefinition+ } - */ - ; - - _proto.parseFieldsDefinition = function parseFieldsDefinition() { - var _this$_options3; - - // Legacy support for the SDL? - if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) { - this._lexer.advance(); - - this._lexer.advance(); - - return []; - } - - return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R); - } - /** - * FieldDefinition : - * - Description? Name ArgumentsDefinition? : Type Directives[Const]? - */ - ; - - _proto.parseFieldDefinition = function parseFieldDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - var name = this.parseName(); - var args = this.parseArgumentDefs(); - this.expectToken(TokenKind.COLON); - var type = this.parseTypeReference(); - var directives = this.parseDirectives(true); - return { - kind: Kind.FIELD_DEFINITION, - description: description, - name: name, - arguments: args, - type: type, - directives: directives, - loc: this.loc(start) - }; - } - /** - * ArgumentsDefinition : ( InputValueDefinition+ ) - */ - ; - - _proto.parseArgumentDefs = function parseArgumentDefs() { - return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R); - } - /** - * InputValueDefinition : - * - Description? Name : Type DefaultValue? Directives[Const]? - */ - ; - - _proto.parseInputValueDef = function parseInputValueDef() { - var start = this._lexer.token; - var description = this.parseDescription(); - var name = this.parseName(); - this.expectToken(TokenKind.COLON); - var type = this.parseTypeReference(); - var defaultValue; - - if (this.expectOptionalToken(TokenKind.EQUALS)) { - defaultValue = this.parseValueLiteral(true); - } - - var directives = this.parseDirectives(true); - return { - kind: Kind.INPUT_VALUE_DEFINITION, - description: description, - name: name, - type: type, - defaultValue: defaultValue, - directives: directives, - loc: this.loc(start) - }; - } - /** - * InterfaceTypeDefinition : - * - Description? interface Name Directives[Const]? FieldsDefinition? - */ - ; - - _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('interface'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - return { - kind: Kind.INTERFACE_TYPE_DEFINITION, - description: description, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * UnionTypeDefinition : - * - Description? union Name Directives[Const]? UnionMemberTypes? - */ - ; - - _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('union'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var types = this.parseUnionMemberTypes(); - return { - kind: Kind.UNION_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - types: types, - loc: this.loc(start) - }; - } - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - ; - - _proto.parseUnionMemberTypes = function parseUnionMemberTypes() { - return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : []; - } - /** - * EnumTypeDefinition : - * - Description? enum Name Directives[Const]? EnumValuesDefinition? - */ - ; - - _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('enum'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var values = this.parseEnumValuesDefinition(); - return { - kind: Kind.ENUM_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - values: values, - loc: this.loc(start) - }; - } - /** - * EnumValuesDefinition : { EnumValueDefinition+ } - */ - ; - - _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() { - return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R); - } - /** - * EnumValueDefinition : Description? EnumValue Directives[Const]? - * - * EnumValue : Name - */ - ; - - _proto.parseEnumValueDefinition = function parseEnumValueDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - var name = this.parseName(); - var directives = this.parseDirectives(true); - return { - kind: Kind.ENUM_VALUE_DEFINITION, - description: description, - name: name, - directives: directives, - loc: this.loc(start) - }; - } - /** - * InputObjectTypeDefinition : - * - Description? input Name Directives[Const]? InputFieldsDefinition? - */ - ; - - _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('input'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var fields = this.parseInputFieldsDefinition(); - return { - kind: Kind.INPUT_OBJECT_TYPE_DEFINITION, - description: description, - name: name, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * InputFieldsDefinition : { InputValueDefinition+ } - */ - ; - - _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() { - return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R); - } - /** - * TypeSystemExtension : - * - SchemaExtension - * - TypeExtension - * - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - */ - ; - - _proto.parseTypeSystemExtension = function parseTypeSystemExtension() { - var keywordToken = this._lexer.lookahead(); - - if (keywordToken.kind === TokenKind.NAME) { - switch (keywordToken.value) { - case 'schema': - return this.parseSchemaExtension(); - - case 'scalar': - return this.parseScalarTypeExtension(); - - case 'type': - return this.parseObjectTypeExtension(); - - case 'interface': - return this.parseInterfaceTypeExtension(); - - case 'union': - return this.parseUnionTypeExtension(); - - case 'enum': - return this.parseEnumTypeExtension(); - - case 'input': - return this.parseInputObjectTypeExtension(); - } - } - - throw this.unexpected(keywordToken); - } - /** - * SchemaExtension : - * - extend schema Directives[Const]? { OperationTypeDefinition+ } - * - extend schema Directives[Const] - */ - ; - - _proto.parseSchemaExtension = function parseSchemaExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('schema'); - var directives = this.parseDirectives(true); - var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R); - - if (directives.length === 0 && operationTypes.length === 0) { - throw this.unexpected(); - } - - return { - kind: Kind.SCHEMA_EXTENSION, - directives: directives, - operationTypes: operationTypes, - loc: this.loc(start) - }; - } - /** - * ScalarTypeExtension : - * - extend scalar Name Directives[Const] - */ - ; - - _proto.parseScalarTypeExtension = function parseScalarTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('scalar'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - - if (directives.length === 0) { - throw this.unexpected(); - } - - return { - kind: Kind.SCALAR_TYPE_EXTENSION, - name: name, - directives: directives, - loc: this.loc(start) - }; - } - /** - * ObjectTypeExtension : - * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend type Name ImplementsInterfaces? Directives[Const] - * - extend type Name ImplementsInterfaces - */ - ; - - _proto.parseObjectTypeExtension = function parseObjectTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('type'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - - if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - - return { - kind: Kind.OBJECT_TYPE_EXTENSION, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * InterfaceTypeExtension : - * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition - * - extend interface Name ImplementsInterfaces? Directives[Const] - * - extend interface Name ImplementsInterfaces - */ - ; - - _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('interface'); - var name = this.parseName(); - var interfaces = this.parseImplementsInterfaces(); - var directives = this.parseDirectives(true); - var fields = this.parseFieldsDefinition(); - - if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - - return { - kind: Kind.INTERFACE_TYPE_EXTENSION, - name: name, - interfaces: interfaces, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * UnionTypeExtension : - * - extend union Name Directives[Const]? UnionMemberTypes - * - extend union Name Directives[Const] - */ - ; - - _proto.parseUnionTypeExtension = function parseUnionTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('union'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var types = this.parseUnionMemberTypes(); - - if (directives.length === 0 && types.length === 0) { - throw this.unexpected(); - } - - return { - kind: Kind.UNION_TYPE_EXTENSION, - name: name, - directives: directives, - types: types, - loc: this.loc(start) - }; - } - /** - * EnumTypeExtension : - * - extend enum Name Directives[Const]? EnumValuesDefinition - * - extend enum Name Directives[Const] - */ - ; - - _proto.parseEnumTypeExtension = function parseEnumTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('enum'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var values = this.parseEnumValuesDefinition(); - - if (directives.length === 0 && values.length === 0) { - throw this.unexpected(); - } - - return { - kind: Kind.ENUM_TYPE_EXTENSION, - name: name, - directives: directives, - values: values, - loc: this.loc(start) - }; - } - /** - * InputObjectTypeExtension : - * - extend input Name Directives[Const]? InputFieldsDefinition - * - extend input Name Directives[Const] - */ - ; - - _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() { - var start = this._lexer.token; - this.expectKeyword('extend'); - this.expectKeyword('input'); - var name = this.parseName(); - var directives = this.parseDirectives(true); - var fields = this.parseInputFieldsDefinition(); - - if (directives.length === 0 && fields.length === 0) { - throw this.unexpected(); - } - - return { - kind: Kind.INPUT_OBJECT_TYPE_EXTENSION, - name: name, - directives: directives, - fields: fields, - loc: this.loc(start) - }; - } - /** - * DirectiveDefinition : - * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations - */ - ; - - _proto.parseDirectiveDefinition = function parseDirectiveDefinition() { - var start = this._lexer.token; - var description = this.parseDescription(); - this.expectKeyword('directive'); - this.expectToken(TokenKind.AT); - var name = this.parseName(); - var args = this.parseArgumentDefs(); - var repeatable = this.expectOptionalKeyword('repeatable'); - this.expectKeyword('on'); - var locations = this.parseDirectiveLocations(); - return { - kind: Kind.DIRECTIVE_DEFINITION, - description: description, - name: name, - arguments: args, - repeatable: repeatable, - locations: locations, - loc: this.loc(start) - }; - } - /** - * DirectiveLocations : - * - `|`? DirectiveLocation - * - DirectiveLocations | DirectiveLocation - */ - ; - - _proto.parseDirectiveLocations = function parseDirectiveLocations() { - return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation); - } - /* - * 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` - */ - ; - - _proto.parseDirectiveLocation = function parseDirectiveLocation() { - var start = this._lexer.token; - var name = this.parseName(); - - if (DirectiveLocation[name.value] !== undefined) { - return name; - } - - throw this.unexpected(start); - } // Core parsing utility functions - - /** - * Returns a location object, used to identify the place in the source that created a given parsed object. - */ - ; - - _proto.loc = function loc(startToken) { - var _this$_options4; - - if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) { - return new Location(startToken, this._lexer.lastToken, this._lexer.source); - } - } - /** - * Determines if the next token is of a given kind - */ - ; - - _proto.peek = function peek(kind) { - return this._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. - */ - ; - - _proto.expectToken = function expectToken(kind) { - var token = this._lexer.token; - - if (token.kind === kind) { - this._lexer.advance(); - - return token; - } - - throw syntaxError(this._lexer.source, token.start, "Expected ".concat(getTokenKindDesc(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. - */ - ; - - _proto.expectOptionalToken = function expectOptionalToken(kind) { - var token = this._lexer.token; - - if (token.kind === kind) { - this._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. - */ - ; - - _proto.expectKeyword = function expectKeyword(value) { - var token = this._lexer.token; - - if (token.kind === TokenKind.NAME && token.value === value) { - this._lexer.advance(); - } else { - throw syntaxError(this._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". - */ - ; - - _proto.expectOptionalKeyword = function expectOptionalKeyword(value) { - var token = this._lexer.token; - - if (token.kind === TokenKind.NAME && token.value === value) { - this._lexer.advance(); - - return true; - } - - return false; - } - /** - * Helper function for creating an error when an unexpected lexed token is encountered. - */ - ; - - _proto.unexpected = function unexpected(atToken) { - var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token; - return syntaxError(this._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. - */ - ; - - _proto.any = function any(openKind, parseFn, closeKind) { - this.expectToken(openKind); - var nodes = []; - - while (!this.expectOptionalToken(closeKind)) { - nodes.push(parseFn.call(this)); - } - - return nodes; - } - /** - * Returns a list of parse nodes, determined by the parseFn. - * It can be empty only if open token is missing otherwise it will always return non-empty list - * that 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. - */ - ; - - _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) { - if (this.expectOptionalToken(openKind)) { - var nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - - return nodes; - } - - return []; - } - /** - * 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. - */ - ; - - _proto.many = function many(openKind, parseFn, closeKind) { - this.expectToken(openKind); - var nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (!this.expectOptionalToken(closeKind)); - - return nodes; - } - /** - * Returns a non-empty list of parse nodes, determined by the parseFn. - * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind. - * Advances the parser to the next lex token after last item in the list. - */ - ; - - _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) { - this.expectOptionalToken(delimiterKind); - var nodes = []; - - do { - nodes.push(parseFn.call(this)); - } while (this.expectOptionalToken(delimiterKind)); - - return nodes; - }; - - return Parser; -}(); -/** - * A helper function to describe a token as a string for debugging. - */ - -function getTokenDesc(token) { - var value = token.value; - return getTokenKindDesc(token.kind) + (value != null ? " \"".concat(value, "\"") : ''); -} -/** - * A helper function to describe a token kind as a string for debugging. - */ - - -function getTokenKindDesc(kind) { - return isPunctuatorTokenKind(kind) ? "\"".concat(kind, "\"") : kind; -} diff --git a/JS/node_modules/graphql/language/predicates.d.ts b/JS/node_modules/graphql/language/predicates.d.ts deleted file mode 100644 index cdbe1f9..0000000 --- a/JS/node_modules/graphql/language/predicates.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { - ASTNode, - DefinitionNode, - ExecutableDefinitionNode, - SelectionNode, - ValueNode, - TypeNode, - TypeSystemDefinitionNode, - TypeDefinitionNode, - TypeSystemExtensionNode, - TypeExtensionNode, -} from './ast'; - -export function isDefinitionNode(node: ASTNode): node is DefinitionNode; - -export function isExecutableDefinitionNode( - node: ASTNode, -): node is ExecutableDefinitionNode; - -export function isSelectionNode(node: ASTNode): node is SelectionNode; - -export function isValueNode(node: ASTNode): node is ValueNode; - -export function isTypeNode(node: ASTNode): node is TypeNode; - -export function isTypeSystemDefinitionNode( - node: ASTNode, -): node is TypeSystemDefinitionNode; - -export function isTypeDefinitionNode(node: ASTNode): node is TypeDefinitionNode; - -export function isTypeSystemExtensionNode( - node: ASTNode, -): node is TypeSystemExtensionNode; - -export function isTypeExtensionNode(node: ASTNode): node is TypeExtensionNode; diff --git a/JS/node_modules/graphql/language/predicates.js b/JS/node_modules/graphql/language/predicates.js deleted file mode 100644 index f75f9f4..0000000 --- a/JS/node_modules/graphql/language/predicates.js +++ /dev/null @@ -1,52 +0,0 @@ -"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.js"); - -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/JS/node_modules/graphql/language/predicates.js.flow b/JS/node_modules/graphql/language/predicates.js.flow deleted file mode 100644 index 5597dbb..0000000 --- a/JS/node_modules/graphql/language/predicates.js.flow +++ /dev/null @@ -1,82 +0,0 @@ -// @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/JS/node_modules/graphql/language/predicates.mjs b/JS/node_modules/graphql/language/predicates.mjs deleted file mode 100644 index 7a066f7..0000000 --- a/JS/node_modules/graphql/language/predicates.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { Kind } from "./kinds.mjs"; -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/JS/node_modules/graphql/language/printLocation.d.ts b/JS/node_modules/graphql/language/printLocation.d.ts deleted file mode 100644 index 7d0c347..0000000 --- a/JS/node_modules/graphql/language/printLocation.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Location } from './ast'; -import { Source } from './source'; -import { SourceLocation } from './location'; - -/** - * Render a helpful description of the location in the GraphQL Source document. - */ -export function printLocation(location: Location): string; - -/** - * Render a helpful description of the location in the GraphQL Source document. - */ -export function printSourceLocation( - source: Source, - sourceLocation: SourceLocation, -): string; diff --git a/JS/node_modules/graphql/language/printLocation.js b/JS/node_modules/graphql/language/printLocation.js deleted file mode 100644 index 86987ba..0000000 --- a/JS/node_modules/graphql/language/printLocation.js +++ /dev/null @@ -1,75 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.printLocation = printLocation; -exports.printSourceLocation = printSourceLocation; - -var _location = require("./location.js"); - -/** - * 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 leftPad(padLen, prefix) + (line ? ' | ' + line : ' |'); - }).join('\n'); -} - -function whitespace(len) { - return Array(len + 1).join(' '); -} - -function leftPad(len, str) { - return whitespace(len - str.length) + str; -} diff --git a/JS/node_modules/graphql/language/printLocation.js.flow b/JS/node_modules/graphql/language/printLocation.js.flow deleted file mode 100644 index db3bf91..0000000 --- a/JS/node_modules/graphql/language/printLocation.js.flow +++ /dev/null @@ -1,88 +0,0 @@ -// @flow strict -import type { Source } from './source'; -import type { Location } from './ast'; -import type { SourceLocation } from './location'; -import { getLocation } from './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]) => - leftPad(padLen, prefix) + (line ? ' | ' + line : ' |'), - ) - .join('\n'); -} - -function whitespace(len: number): string { - return Array(len + 1).join(' '); -} - -function leftPad(len: number, str: string): string { - return whitespace(len - str.length) + str; -} diff --git a/JS/node_modules/graphql/language/printLocation.mjs b/JS/node_modules/graphql/language/printLocation.mjs deleted file mode 100644 index c683f26..0000000 --- a/JS/node_modules/graphql/language/printLocation.mjs +++ /dev/null @@ -1,66 +0,0 @@ -import { getLocation } from "./location.mjs"; -/** - * 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 leftPad(padLen, prefix) + (line ? ' | ' + line : ' |'); - }).join('\n'); -} - -function whitespace(len) { - return Array(len + 1).join(' '); -} - -function leftPad(len, str) { - return whitespace(len - str.length) + str; -} diff --git a/JS/node_modules/graphql/language/printer.d.ts b/JS/node_modules/graphql/language/printer.d.ts deleted file mode 100644 index 9329b45..0000000 --- a/JS/node_modules/graphql/language/printer.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ASTNode } from './ast'; - -/** - * Converts an AST into a string, using one set of reasonable - * formatting rules. - */ -export function print(ast: ASTNode): string; diff --git a/JS/node_modules/graphql/language/printer.js b/JS/node_modules/graphql/language/printer.js deleted file mode 100644 index b76814b..0000000 --- a/JS/node_modules/graphql/language/printer.js +++ /dev/null @@ -1,322 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.print = print; - -var _visitor = require("./visitor.js"); - -var _blockString = require("./blockString.js"); - -/** - * Converts an AST into a string, using one set of reasonable - * formatting rules. - */ -function print(ast) { - return (0, _visitor.visit)(ast, { - leave: printDocASTReducer - }); -} - -var MAX_LINE_LENGTH = 80; // 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; - var prefix = wrap('', alias, ': ') + name; - var argsLine = prefix + wrap('(', join(args, ', '), ')'); - - if (argsLine.length > MAX_LINE_LENGTH) { - argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); - } - - return join([argsLine, 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: addDescription(function (_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, - interfaces = _ref26.interfaces, - directives = _ref26.directives, - fields = _ref26.fields; - return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), 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, - interfaces = _ref35.interfaces, - directives = _ref35.directives, - fields = _ref35.fields; - return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), 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) { - var _maybeArray$filter$jo; - - var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) { - return x; - }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : ''; -} -/** - * Given array, print each item on its own line, wrapped in an - * indented "{ }" block. - */ - - -function block(array) { - return wrap('{\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) { - var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - return maybeString != null && maybeString !== '' ? start + maybeString + end : ''; -} - -function indent(str) { - return wrap(' ', str.replace(/\n/g, '\n ')); -} - -function isMultiline(str) { - return str.indexOf('\n') !== -1; -} - -function hasMultilineItems(maybeArray) { - return maybeArray != null && maybeArray.some(isMultiline); -} diff --git a/JS/node_modules/graphql/language/printer.js.flow b/JS/node_modules/graphql/language/printer.js.flow deleted file mode 100644 index efaff6c..0000000 --- a/JS/node_modules/graphql/language/printer.js.flow +++ /dev/null @@ -1,292 +0,0 @@ -// @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 }); -} - -const MAX_LINE_LENGTH = 80; - -// 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 }) => { - const prefix = wrap('', alias, ': ') + name; - let argsLine = prefix + wrap('(', join(args, ', '), ')'); - - if (argsLine.length > MAX_LINE_LENGTH) { - argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); - } - - return join([argsLine, 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: addDescription(({ 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, interfaces, directives, fields }) => - join( - [ - 'interface', - name, - wrap('implements ', join(interfaces, ' & ')), - 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, interfaces, directives, fields }) => - join( - [ - 'extend interface', - name, - wrap('implements ', join(interfaces, ' & ')), - 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: ?Array, separator = ''): string { - return maybeArray?.filter((x) => x).join(separator) ?? ''; -} - -/** - * Given array, print each item on its own line, wrapped in an - * indented "{ }" block. - */ -function block(array: ?Array): string { - return wrap('{\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: string, maybeString: ?string, end: string = ''): string { - return maybeString != null && maybeString !== '' - ? start + maybeString + end - : ''; -} - -function indent(str: string): string { - return wrap(' ', str.replace(/\n/g, '\n ')); -} - -function isMultiline(str: string): boolean { - return str.indexOf('\n') !== -1; -} - -function hasMultilineItems(maybeArray: ?Array): boolean { - return maybeArray != null && maybeArray.some(isMultiline); -} diff --git a/JS/node_modules/graphql/language/printer.mjs b/JS/node_modules/graphql/language/printer.mjs deleted file mode 100644 index 2435311..0000000 --- a/JS/node_modules/graphql/language/printer.mjs +++ /dev/null @@ -1,313 +0,0 @@ -import { visit } from "./visitor.mjs"; -import { printBlockString } from "./blockString.mjs"; -/** - * Converts an AST into a string, using one set of reasonable - * formatting rules. - */ - -export function print(ast) { - return visit(ast, { - leave: printDocASTReducer - }); -} -var MAX_LINE_LENGTH = 80; // 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; - var prefix = wrap('', alias, ': ') + name; - var argsLine = prefix + wrap('(', join(args, ', '), ')'); - - if (argsLine.length > MAX_LINE_LENGTH) { - argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)'); - } - - return join([argsLine, 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: addDescription(function (_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, - interfaces = _ref26.interfaces, - directives = _ref26.directives, - fields = _ref26.fields; - return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), 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, - interfaces = _ref35.interfaces, - directives = _ref35.directives, - fields = _ref35.fields; - return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), 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) { - var _maybeArray$filter$jo; - - var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) { - return x; - }).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : ''; -} -/** - * Given array, print each item on its own line, wrapped in an - * indented "{ }" block. - */ - - -function block(array) { - return wrap('{\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) { - var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - return maybeString != null && maybeString !== '' ? start + maybeString + end : ''; -} - -function indent(str) { - return wrap(' ', str.replace(/\n/g, '\n ')); -} - -function isMultiline(str) { - return str.indexOf('\n') !== -1; -} - -function hasMultilineItems(maybeArray) { - return maybeArray != null && maybeArray.some(isMultiline); -} diff --git a/JS/node_modules/graphql/language/source.d.ts b/JS/node_modules/graphql/language/source.d.ts deleted file mode 100644 index a7df7cb..0000000 --- a/JS/node_modules/graphql/language/source.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -interface Location { - line: number; - column: number; -} - -/** - * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are - * optional, but 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: 1 }`. - * The `line` and `column` properties in `locationOffset` are 1-indexed. - */ -export class Source { - body: string; - name: string; - locationOffset: Location; - constructor(body: string, name?: string, locationOffset?: Location); -} - -/** - * Test if the given value is a Source object. - * - * @internal - */ -export function isSource(source: any): source is Source; diff --git a/JS/node_modules/graphql/language/source.js b/JS/node_modules/graphql/language/source.js deleted file mode 100644 index 7b19503..0000000 --- a/JS/node_modules/graphql/language/source.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isSource = isSource; -exports.Source = void 0; - -var _symbols = require("../polyfills/symbols.js"); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _instanceOf = _interopRequireDefault(require("../jsutils/instanceOf.js")); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -/** - * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are - * optional, but 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: 1 }`. - * The `line` and `column` properties in `locationOffset` are 1-indexed. - */ -var Source = /*#__PURE__*/function () { - function Source(body) { - var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request'; - var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - line: 1, - column: 1 - }; - typeof body === 'string' || (0, _devAssert.default)(0, "Body must be a string. Received: ".concat((0, _inspect.default)(body), ".")); - this.body = body; - this.name = name; - this.locationOffset = locationOffset; - this.locationOffset.line > 0 || (0, _devAssert.default)(0, 'line in locationOffset is 1-indexed and must be positive.'); - this.locationOffset.column > 0 || (0, _devAssert.default)(0, 'column in locationOffset is 1-indexed and must be positive.'); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - - - _createClass(Source, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'Source'; - } - }]); - - return Source; -}(); -/** - * Test if the given value is a Source object. - * - * @internal - */ - - -exports.Source = Source; - -// eslint-disable-next-line no-redeclare -function isSource(source) { - return (0, _instanceOf.default)(source, Source); -} diff --git a/JS/node_modules/graphql/language/source.js.flow b/JS/node_modules/graphql/language/source.js.flow deleted file mode 100644 index 270c85b..0000000 --- a/JS/node_modules/graphql/language/source.js.flow +++ /dev/null @@ -1,64 +0,0 @@ -// @flow strict -import { SYMBOL_TO_STRING_TAG } from '../polyfills/symbols'; - -import inspect from '../jsutils/inspect'; -import devAssert from '../jsutils/devAssert'; -import instanceOf from '../jsutils/instanceOf'; - -type Location = {| - line: number, - column: number, -|}; - -/** - * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are - * optional, but 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: 1 }`. - * The `line` and `column` properties in `locationOffset` are 1-indexed. - */ -export class Source { - body: string; - name: string; - locationOffset: Location; - - constructor( - body: string, - name: string = 'GraphQL request', - locationOffset: Location = { line: 1, column: 1 }, - ) { - devAssert( - typeof body === 'string', - `Body must be a string. Received: ${inspect(body)}.`, - ); - - this.body = body; - this.name = name; - this.locationOffset = locationOffset; - devAssert( - this.locationOffset.line > 0, - 'line in locationOffset is 1-indexed and must be positive.', - ); - devAssert( - this.locationOffset.column > 0, - 'column in locationOffset is 1-indexed and must be positive.', - ); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'Source'; - } -} - -/** - * Test if the given value is a Source object. - * - * @internal - */ -declare function isSource(source: mixed): boolean %checks(source instanceof - Source); -// eslint-disable-next-line no-redeclare -export function isSource(source) { - return instanceOf(source, Source); -} diff --git a/JS/node_modules/graphql/language/source.mjs b/JS/node_modules/graphql/language/source.mjs deleted file mode 100644 index e358f61..0000000 --- a/JS/node_modules/graphql/language/source.mjs +++ /dev/null @@ -1,51 +0,0 @@ -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import devAssert from "../jsutils/devAssert.mjs"; -import instanceOf from "../jsutils/instanceOf.mjs"; - -/** - * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are - * optional, but 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: 1 }`. - * The `line` and `column` properties in `locationOffset` are 1-indexed. - */ -export var Source = /*#__PURE__*/function () { - function Source(body) { - var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request'; - var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - line: 1, - column: 1 - }; - typeof body === 'string' || devAssert(0, "Body must be a string. Received: ".concat(inspect(body), ".")); - this.body = body; - this.name = name; - this.locationOffset = locationOffset; - this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.'); - this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.'); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - - - _createClass(Source, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'Source'; - } - }]); - - return Source; -}(); -/** - * Test if the given value is a Source object. - * - * @internal - */ - -// eslint-disable-next-line no-redeclare -export function isSource(source) { - return instanceOf(source, Source); -} diff --git a/JS/node_modules/graphql/language/tokenKind.d.ts b/JS/node_modules/graphql/language/tokenKind.d.ts deleted file mode 100644 index fa27e23..0000000 --- a/JS/node_modules/graphql/language/tokenKind.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * An exported enum describing the different kinds of tokens that the - * lexer emits. - */ -export const TokenKind: { - 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 = typeof TokenKind[keyof typeof TokenKind]; diff --git a/JS/node_modules/graphql/language/tokenKind.js b/JS/node_modules/graphql/language/tokenKind.js deleted file mode 100644 index 3d5532d..0000000 --- a/JS/node_modules/graphql/language/tokenKind.js +++ /dev/null @@ -1,40 +0,0 @@ -"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/JS/node_modules/graphql/language/tokenKind.js.flow b/JS/node_modules/graphql/language/tokenKind.js.flow deleted file mode 100644 index 70b3cfb..0000000 --- a/JS/node_modules/graphql/language/tokenKind.js.flow +++ /dev/null @@ -1,34 +0,0 @@ -// @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/JS/node_modules/graphql/language/tokenKind.mjs b/JS/node_modules/graphql/language/tokenKind.mjs deleted file mode 100644 index f100b99..0000000 --- a/JS/node_modules/graphql/language/tokenKind.mjs +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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/JS/node_modules/graphql/language/visitor.d.ts b/JS/node_modules/graphql/language/visitor.d.ts deleted file mode 100644 index 22e6346..0000000 --- a/JS/node_modules/graphql/language/visitor.d.ts +++ /dev/null @@ -1,263 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { ASTNode, ASTKindToNode } from './ast'; - -/** - * 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 = - | EnterLeaveVisitor - | ShapeMapVisitor; - -interface EnterLeave { - readonly enter?: T; - readonly leave?: T; -} - -type EnterLeaveVisitor = EnterLeave< - VisitFn | { [K in keyof KindToNode]?: VisitFn } ->; - -type ShapeMapVisitor = { - [K in keyof KindToNode]?: - | VisitFn - | EnterLeave>; -}; - -/** - * 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 | undefined, - /** The parent immediately above this node, which may be an Array. */ - parent: TAnyNode | ReadonlyArray | undefined, - /** 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 = { [P in keyof T]: ReadonlyArray }; - -// TODO: Should be `[]`, but that requires TypeScript@3 -type EmptyTuple = Array; - -export const QueryDocumentKeys: { - Name: EmptyTuple; - - Document: ['definitions']; - // Prettier forces trailing commas, but TS pre 3.2 doesn't allow them. - // prettier-ignore - 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']; - // prettier-ignore - FragmentDefinition: [ - 'name', - // Note: fragment variable definitions are experimental and may be changed - // or removed in the future. - 'variableDefinitions', - 'typeCondition', - 'directives', - 'selectionSet' - ]; - - IntValue: EmptyTuple; - FloatValue: EmptyTuple; - StringValue: EmptyTuple; - BooleanValue: EmptyTuple; - NullValue: EmptyTuple; - EnumValue: EmptyTuple; - ListValue: ['values']; - ObjectValue: ['fields']; - ObjectField: ['name', 'value']; - - Directive: ['name', 'arguments']; - - NamedType: ['name']; - ListType: ['type']; - NonNullType: ['type']; - - SchemaDefinition: ['description', 'directives', 'operationTypes']; - OperationTypeDefinition: ['type']; - - ScalarTypeDefinition: ['description', 'name', 'directives']; - // prettier-ignore - ObjectTypeDefinition: [ - 'description', - 'name', - 'interfaces', - 'directives', - 'fields' - ]; - FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives']; - // prettier-ignore - InputValueDefinition: [ - 'description', - 'name', - 'type', - 'defaultValue', - 'directives' - ]; - // prettier-ignore - InterfaceTypeDefinition: [ - 'description', - 'name', - 'interfaces', - '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', 'interfaces', 'directives', 'fields']; - UnionTypeExtension: ['name', 'directives', 'types']; - EnumTypeExtension: ['name', 'directives', 'values']; - InputObjectTypeExtension: ['name', 'directives', 'fields']; -}; - -export const BREAK: any; - -/** - * 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 the - * visitor API: - * - * 1) Named visitors triggered when entering a node of 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, // default: QueryDocumentKeys -): any; - -/** - * 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; - -/** - * 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, -): Maybe>; diff --git a/JS/node_modules/graphql/language/visitor.js b/JS/node_modules/graphql/language/visitor.js deleted file mode 100644 index af31e83..0000000 --- a/JS/node_modules/graphql/language/visitor.js +++ /dev/null @@ -1,397 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.visit = visit; -exports.visitInParallel = visitInParallel; -exports.getVisitFn = getVisitFn; -exports.BREAK = exports.QueryDocumentKeys = void 0; - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _ast = require("./ast.js"); - -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: ['description', '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', 'interfaces', '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', 'interfaces', '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 the - * visitor API: - * - * 1) Named visitors triggered when entering a node of 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 _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) { - var k = _Object$keys2[_i2]; - 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 (!(0, _ast.isNode)(node)) { - throw new Error("Invalid AST Node: ".concat((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 ((0, _ast.isNode)(result)) { - node = result; - } else { - path.pop(); - continue; - } - } - } - } - } - - if (result === undefined && isEdited) { - edits.push([key, node]); - } - - if (isLeaving) { - path.pop(); - } else { - var _visitorKeys$node$kin; - - stack = { - inArray: inArray, - index: index, - keys: keys, - edits: edits, - prev: stack - }; - inArray = Array.isArray(node); - keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : []; - 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; -} -/** - * 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] == null) { - 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] == null) { - 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; - } - } - } - }; -} -/** - * 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/JS/node_modules/graphql/language/visitor.js.flow b/JS/node_modules/graphql/language/visitor.js.flow deleted file mode 100644 index b53d476..0000000 --- a/JS/node_modules/graphql/language/visitor.js.flow +++ /dev/null @@ -1,437 +0,0 @@ -// @flow strict -import inspect from '../jsutils/inspect'; - -import type { ASTNode, ASTKindToNode } from './ast'; -import { isNode } from './ast'; - -/** - * 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: VisitorKeyMap = { - 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: ['description', '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', - 'interfaces', - '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', 'interfaces', '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 the - * visitor API: - * - * 1) Named visitors triggered when entering a node of 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; -} - -/** - * 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] == null) { - 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] == null) { - 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; - } - } - }, - }; -} - -/** - * 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/JS/node_modules/graphql/language/visitor.mjs b/JS/node_modules/graphql/language/visitor.mjs deleted file mode 100644 index 776e0cc..0000000 --- a/JS/node_modules/graphql/language/visitor.mjs +++ /dev/null @@ -1,383 +0,0 @@ -import inspect from "../jsutils/inspect.mjs"; -import { isNode } from "./ast.mjs"; -/** - * A visitor is provided to visit, it contains the collection of - * relevant functions to be called during the visitor's traversal. - */ - -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: ['description', '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', 'interfaces', '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', 'interfaces', '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 the - * visitor API: - * - * 1) Named visitors triggered when entering a node of 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 _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) { - var k = _Object$keys2[_i2]; - 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: ".concat(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 { - var _visitorKeys$node$kin; - - stack = { - inArray: inArray, - index: index, - keys: keys, - edits: edits, - prev: stack - }; - inArray = Array.isArray(node); - keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : []; - 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; -} -/** - * 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] == null) { - 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] == null) { - 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; - } - } - } - }; -} -/** - * 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/JS/node_modules/graphql/package.json b/JS/node_modules/graphql/package.json deleted file mode 100644 index 794792b..0000000 --- a/JS/node_modules/graphql/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "graphql", - "version": "15.5.3", - "description": "A Query Language and Runtime which can target any service.", - "license": "MIT", - "main": "index", - "module": "index.mjs", - "types": "index.d.ts", - "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": ">= 10.x" - } -} \ No newline at end of file diff --git a/JS/node_modules/graphql/polyfills/arrayFrom.js b/JS/node_modules/graphql/polyfills/arrayFrom.js deleted file mode 100644 index 0f2eab2..0000000 --- a/JS/node_modules/graphql/polyfills/arrayFrom.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _symbols = require("./symbols.js"); - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] -var arrayFrom = Array.from || function (obj, mapFn, thisArg) { - if (obj == null) { - throw new TypeError('Array.from requires an array-like object - not null or undefined'); - } // Is Iterable? - - - var iteratorMethod = obj[_symbols.SYMBOL_ITERATOR]; - - if (typeof iteratorMethod === 'function') { - var iterator = iteratorMethod.call(obj); - var result = []; - var step; - - for (var i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever. - // After a very large number of iterations, produce an error. - // istanbul ignore if (Too big to actually test) - - if (i > 9999999) { - throw new TypeError('Near-infinite iteration.'); - } - } - - return result; - } // Is Array like? - - - var length = obj.length; - - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - var _result = []; - - for (var _i = 0; _i < length; ++_i) { - if (Object.prototype.hasOwnProperty.call(obj, _i)) { - _result.push(mapFn.call(thisArg, obj[_i], _i)); - } - } - - return _result; - } - - return []; -}; - -var _default = arrayFrom; -exports.default = _default; diff --git a/JS/node_modules/graphql/polyfills/arrayFrom.js.flow b/JS/node_modules/graphql/polyfills/arrayFrom.js.flow deleted file mode 100644 index 73093b7..0000000 --- a/JS/node_modules/graphql/polyfills/arrayFrom.js.flow +++ /dev/null @@ -1,58 +0,0 @@ -// @flow strict -import { SYMBOL_ITERATOR } from './symbols'; - -declare function arrayFrom(arrayLike: Iterable): Array; -// eslint-disable-next-line no-redeclare -declare function arrayFrom( - arrayLike: mixed, - mapFn?: (elem: mixed, index: number) => T, - thisArg?: mixed, -): Array; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] -const arrayFrom = - Array.from || - function (obj, mapFn, thisArg) { - if (obj == null) { - throw new TypeError( - 'Array.from requires an array-like object - not null or undefined', - ); - } - - // Is Iterable? - const iteratorMethod = obj[SYMBOL_ITERATOR]; - if (typeof iteratorMethod === 'function') { - const iterator = iteratorMethod.call(obj); - const result = []; - let step; - - for (let i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn.call(thisArg, step.value, i)); - // Infinite Iterators could cause forEach to run forever. - // After a very large number of iterations, produce an error. - // istanbul ignore if (Too big to actually test) - if (i > 9999999) { - throw new TypeError('Near-infinite iteration.'); - } - } - return result; - } - - // Is Array like? - const length = obj.length; - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - const result = []; - - for (let i = 0; i < length; ++i) { - if (Object.prototype.hasOwnProperty.call(obj, i)) { - result.push(mapFn.call(thisArg, obj[i], i)); - } - } - return result; - } - - return []; - }; - -export default arrayFrom; diff --git a/JS/node_modules/graphql/polyfills/arrayFrom.mjs b/JS/node_modules/graphql/polyfills/arrayFrom.mjs deleted file mode 100644 index 1ea59f0..0000000 --- a/JS/node_modules/graphql/polyfills/arrayFrom.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import { SYMBOL_ITERATOR } from "./symbols.mjs"; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] -var arrayFrom = Array.from || function (obj, mapFn, thisArg) { - if (obj == null) { - throw new TypeError('Array.from requires an array-like object - not null or undefined'); - } // Is Iterable? - - - var iteratorMethod = obj[SYMBOL_ITERATOR]; - - if (typeof iteratorMethod === 'function') { - var iterator = iteratorMethod.call(obj); - var result = []; - var step; - - for (var i = 0; !(step = iterator.next()).done; ++i) { - result.push(mapFn.call(thisArg, step.value, i)); // Infinite Iterators could cause forEach to run forever. - // After a very large number of iterations, produce an error. - // istanbul ignore if (Too big to actually test) - - if (i > 9999999) { - throw new TypeError('Near-infinite iteration.'); - } - } - - return result; - } // Is Array like? - - - var length = obj.length; - - if (typeof length === 'number' && length >= 0 && length % 1 === 0) { - var _result = []; - - for (var _i = 0; _i < length; ++_i) { - if (Object.prototype.hasOwnProperty.call(obj, _i)) { - _result.push(mapFn.call(thisArg, obj[_i], _i)); - } - } - - return _result; - } - - return []; -}; - -export default arrayFrom; diff --git a/JS/node_modules/graphql/polyfills/find.js b/JS/node_modules/graphql/polyfills/find.js deleted file mode 100644 index fb14137..0000000 --- a/JS/node_modules/graphql/polyfills/find.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] -var find = Array.prototype.find ? function (list, predicate) { - return Array.prototype.find.call(list, predicate); -} : function (list, predicate) { - for (var _i2 = 0; _i2 < list.length; _i2++) { - var value = list[_i2]; - - if (predicate(value)) { - return value; - } - } -}; -var _default = find; -exports.default = _default; diff --git a/JS/node_modules/graphql/polyfills/find.js.flow b/JS/node_modules/graphql/polyfills/find.js.flow deleted file mode 100644 index 4ed151c..0000000 --- a/JS/node_modules/graphql/polyfills/find.js.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow strict -declare function find( - list: $ReadOnlyArray, - predicate: (item: T) => boolean, -): T | void; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] -const find = Array.prototype.find - ? function (list, predicate) { - return Array.prototype.find.call(list, predicate); - } - : function (list, predicate) { - for (const value of list) { - if (predicate(value)) { - return value; - } - } - }; -export default find; diff --git a/JS/node_modules/graphql/polyfills/find.mjs b/JS/node_modules/graphql/polyfills/find.mjs deleted file mode 100644 index ed3e6f3..0000000 --- a/JS/node_modules/graphql/polyfills/find.mjs +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] -var find = Array.prototype.find ? function (list, predicate) { - return Array.prototype.find.call(list, predicate); -} : function (list, predicate) { - for (var _i2 = 0; _i2 < list.length; _i2++) { - var value = list[_i2]; - - if (predicate(value)) { - return value; - } - } -}; -export default find; diff --git a/JS/node_modules/graphql/polyfills/isFinite.js b/JS/node_modules/graphql/polyfills/isFinite.js deleted file mode 100644 index 9c0e559..0000000 --- a/JS/node_modules/graphql/polyfills/isFinite.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -var isFinitePolyfill = Number.isFinite || function (value) { - return typeof value === 'number' && isFinite(value); -}; - -var _default = isFinitePolyfill; -exports.default = _default; diff --git a/JS/node_modules/graphql/polyfills/isFinite.js.flow b/JS/node_modules/graphql/polyfills/isFinite.js.flow deleted file mode 100644 index 5dd0229..0000000 --- a/JS/node_modules/graphql/polyfills/isFinite.js.flow +++ /dev/null @@ -1,13 +0,0 @@ -// @flow strict -declare function isFinitePolyfill( - value: mixed, -): boolean %checks(typeof value === 'number'); - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -const isFinitePolyfill = - Number.isFinite || - function (value) { - return typeof value === 'number' && isFinite(value); - }; -export default isFinitePolyfill; diff --git a/JS/node_modules/graphql/polyfills/isFinite.mjs b/JS/node_modules/graphql/polyfills/isFinite.mjs deleted file mode 100644 index 7c1aea6..0000000 --- a/JS/node_modules/graphql/polyfills/isFinite.mjs +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -var isFinitePolyfill = Number.isFinite || function (value) { - return typeof value === 'number' && isFinite(value); -}; - -export default isFinitePolyfill; diff --git a/JS/node_modules/graphql/polyfills/isInteger.js b/JS/node_modules/graphql/polyfills/isInteger.js deleted file mode 100644 index 9b25361..0000000 --- a/JS/node_modules/graphql/polyfills/isInteger.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] 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/JS/node_modules/graphql/polyfills/isInteger.js.flow b/JS/node_modules/graphql/polyfills/isInteger.js.flow deleted file mode 100644 index 757da92..0000000 --- a/JS/node_modules/graphql/polyfills/isInteger.js.flow +++ /dev/null @@ -1,16 +0,0 @@ -// @flow strict -declare function isInteger(value: mixed): boolean %checks(typeof value === - 'number'); - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] 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/JS/node_modules/graphql/polyfills/isInteger.mjs b/JS/node_modules/graphql/polyfills/isInteger.mjs deleted file mode 100644 index 3396f16..0000000 --- a/JS/node_modules/graphql/polyfills/isInteger.mjs +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] 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/JS/node_modules/graphql/polyfills/objectEntries.js b/JS/node_modules/graphql/polyfills/objectEntries.js deleted file mode 100644 index 749d4ef..0000000 --- a/JS/node_modules/graphql/polyfills/objectEntries.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -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/JS/node_modules/graphql/polyfills/objectEntries.js.flow b/JS/node_modules/graphql/polyfills/objectEntries.js.flow deleted file mode 100644 index d30e3c1..0000000 --- a/JS/node_modules/graphql/polyfills/objectEntries.js.flow +++ /dev/null @@ -1,11 +0,0 @@ -// @flow strict -import type { ObjMap } from '../jsutils/ObjMap'; - -declare function objectEntries(obj: ObjMap): Array<[string, T]>; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -const objectEntries = - Object.entries || ((obj) => Object.keys(obj).map((key) => [key, obj[key]])); - -export default objectEntries; diff --git a/JS/node_modules/graphql/polyfills/objectEntries.mjs b/JS/node_modules/graphql/polyfills/objectEntries.mjs deleted file mode 100644 index 72d0c60..0000000 --- a/JS/node_modules/graphql/polyfills/objectEntries.mjs +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -var objectEntries = Object.entries || function (obj) { - return Object.keys(obj).map(function (key) { - return [key, obj[key]]; - }); -}; - -export default objectEntries; diff --git a/JS/node_modules/graphql/polyfills/objectValues.js b/JS/node_modules/graphql/polyfills/objectValues.js deleted file mode 100644 index ab14e65..0000000 --- a/JS/node_modules/graphql/polyfills/objectValues.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -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/JS/node_modules/graphql/polyfills/objectValues.js.flow b/JS/node_modules/graphql/polyfills/objectValues.js.flow deleted file mode 100644 index 343419a..0000000 --- a/JS/node_modules/graphql/polyfills/objectValues.js.flow +++ /dev/null @@ -1,10 +0,0 @@ -// @flow strict -import type { ObjMap } from '../jsutils/ObjMap'; - -declare function objectValues(obj: ObjMap): Array; - -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -const objectValues = - Object.values || ((obj) => Object.keys(obj).map((key) => obj[key])); -export default objectValues; diff --git a/JS/node_modules/graphql/polyfills/objectValues.mjs b/JS/node_modules/graphql/polyfills/objectValues.mjs deleted file mode 100644 index afbde06..0000000 --- a/JS/node_modules/graphql/polyfills/objectValues.mjs +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable no-redeclare */ -// $FlowFixMe[name-already-bound] workaround for: https://github.com/facebook/flow/issues/4441 -var objectValues = Object.values || function (obj) { - return Object.keys(obj).map(function (key) { - return obj[key]; - }); -}; - -export default objectValues; diff --git a/JS/node_modules/graphql/polyfills/symbols.js b/JS/node_modules/graphql/polyfills/symbols.js deleted file mode 100644 index 3d4ba2e..0000000 --- a/JS/node_modules/graphql/polyfills/symbols.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SYMBOL_TO_STRING_TAG = exports.SYMBOL_ASYNC_ITERATOR = exports.SYMBOL_ITERATOR = void 0; -// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - -exports.SYMBOL_ITERATOR = SYMBOL_ITERATOR; -var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - -exports.SYMBOL_ASYNC_ITERATOR = SYMBOL_ASYNC_ITERATOR; -var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag'; -exports.SYMBOL_TO_STRING_TAG = SYMBOL_TO_STRING_TAG; diff --git a/JS/node_modules/graphql/polyfills/symbols.js.flow b/JS/node_modules/graphql/polyfills/symbols.js.flow deleted file mode 100644 index 66a1b2c..0000000 --- a/JS/node_modules/graphql/polyfills/symbols.js.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow strict -// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -export const SYMBOL_ITERATOR: string = - typeof Symbol === 'function' && Symbol.iterator != null - ? Symbol.iterator - : '@@iterator'; - -// In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -export const SYMBOL_ASYNC_ITERATOR: string = - typeof Symbol === 'function' && Symbol.asyncIterator != null - ? Symbol.asyncIterator - : '@@asyncIterator'; - -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -export const SYMBOL_TO_STRING_TAG: string = - typeof Symbol === 'function' && Symbol.toStringTag != null - ? Symbol.toStringTag - : '@@toStringTag'; diff --git a/JS/node_modules/graphql/polyfills/symbols.mjs b/JS/node_modules/graphql/polyfills/symbols.mjs deleted file mode 100644 index b338851..0000000 --- a/JS/node_modules/graphql/polyfills/symbols.mjs +++ /dev/null @@ -1,8 +0,0 @@ -// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') -export var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator -// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - -export var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317') - -export var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag'; diff --git a/JS/node_modules/graphql/subscription/index.d.ts b/JS/node_modules/graphql/subscription/index.d.ts deleted file mode 100644 index ba8835f..0000000 --- a/JS/node_modules/graphql/subscription/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { - subscribe, - createSourceEventStream, - SubscriptionArgs, -} from './subscribe'; diff --git a/JS/node_modules/graphql/subscription/index.js b/JS/node_modules/graphql/subscription/index.js deleted file mode 100644 index 845d944..0000000 --- a/JS/node_modules/graphql/subscription/index.js +++ /dev/null @@ -1,19 +0,0 @@ -"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.js"); diff --git a/JS/node_modules/graphql/subscription/index.js.flow b/JS/node_modules/graphql/subscription/index.js.flow deleted file mode 100644 index 9f37bfd..0000000 --- a/JS/node_modules/graphql/subscription/index.js.flow +++ /dev/null @@ -1,3 +0,0 @@ -// @flow strict -export { subscribe, createSourceEventStream } from './subscribe'; -export type { SubscriptionArgs } from './subscribe'; diff --git a/JS/node_modules/graphql/subscription/index.mjs b/JS/node_modules/graphql/subscription/index.mjs deleted file mode 100644 index 8983f84..0000000 --- a/JS/node_modules/graphql/subscription/index.mjs +++ /dev/null @@ -1 +0,0 @@ -export { subscribe, createSourceEventStream } from "./subscribe.mjs"; diff --git a/JS/node_modules/graphql/subscription/mapAsyncIterator.d.ts b/JS/node_modules/graphql/subscription/mapAsyncIterator.d.ts deleted file mode 100644 index 22e8a34..0000000 --- a/JS/node_modules/graphql/subscription/mapAsyncIterator.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { 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: (arg: T) => PromiseOrValue, - rejectCallback?: (arg: any) => PromiseOrValue, -): any; // TS_SPECIFIC: AsyncGenerator requires typescript@3.6 diff --git a/JS/node_modules/graphql/subscription/mapAsyncIterator.js b/JS/node_modules/graphql/subscription/mapAsyncIterator.js deleted file mode 100644 index 4fd37cd..0000000 --- a/JS/node_modules/graphql/subscription/mapAsyncIterator.js +++ /dev/null @@ -1,86 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = mapAsyncIterator; - -var _symbols = require("../polyfills/symbols.js"); - -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) { - // $FlowFixMe[prop-missing] - var iteratorMethod = iterable[_symbols.SYMBOL_ASYNC_ITERATOR]; - var iterator = iteratorMethod.call(iterable); - var $return; - var abruptClose; - - 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) { - if (typeof iterator.throw === 'function') { - return iterator.throw(error).then(mapResult, mapReject); - } - - return Promise.reject(error).catch(abruptClose); - } - }, _symbols.SYMBOL_ASYNC_ITERATOR, 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/JS/node_modules/graphql/subscription/mapAsyncIterator.js.flow b/JS/node_modules/graphql/subscription/mapAsyncIterator.js.flow deleted file mode 100644 index 8b1d1d8..0000000 --- a/JS/node_modules/graphql/subscription/mapAsyncIterator.js.flow +++ /dev/null @@ -1,74 +0,0 @@ -// @flow strict -import { SYMBOL_ASYNC_ITERATOR } from '../polyfills/symbols'; - -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 | AsyncGenerator, - callback: (T) => PromiseOrValue, - rejectCallback?: (any) => PromiseOrValue, -): AsyncGenerator { - // $FlowFixMe[prop-missing] - const iteratorMethod = iterable[SYMBOL_ASYNC_ITERATOR]; - const iterator: any = iteratorMethod.call(iterable); - let $return: any; - let abruptClose; - if (typeof iterator.return === 'function') { - $return = iterator.return; - abruptClose = (error: mixed) => { - const rethrow = () => Promise.reject(error); - return $return.call(iterator).then(rethrow, rethrow); - }; - } - - function mapResult(result: IteratorResult) { - 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: mixed) => - asyncMapValue(error, reject).then(iteratorResult, abruptClose); - } - - /* TODO: Flow doesn't support symbols as keys: - https://github.com/facebook/flow/issues/3258 */ - return ({ - next(): Promise> { - return iterator.next().then(mapResult, mapReject); - }, - return() { - return $return - ? $return.call(iterator).then(mapResult, mapReject) - : Promise.resolve({ value: undefined, done: true }); - }, - throw(error?: mixed): Promise> { - if (typeof iterator.throw === 'function') { - return iterator.throw(error).then(mapResult, mapReject); - } - return Promise.reject(error).catch(abruptClose); - }, - [SYMBOL_ASYNC_ITERATOR]() { - return this; - }, - }: $FlowFixMe); -} - -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/JS/node_modules/graphql/subscription/mapAsyncIterator.mjs b/JS/node_modules/graphql/subscription/mapAsyncIterator.mjs deleted file mode 100644 index ffe23e0..0000000 --- a/JS/node_modules/graphql/subscription/mapAsyncIterator.mjs +++ /dev/null @@ -1,79 +0,0 @@ -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 { SYMBOL_ASYNC_ITERATOR } from "../polyfills/symbols.mjs"; - -/** - * 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) { - // $FlowFixMe[prop-missing] - var iteratorMethod = iterable[SYMBOL_ASYNC_ITERATOR]; - var iterator = iteratorMethod.call(iterable); - var $return; - var abruptClose; - - 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) { - if (typeof iterator.throw === 'function') { - return iterator.throw(error).then(mapResult, mapReject); - } - - return Promise.reject(error).catch(abruptClose); - } - }, SYMBOL_ASYNC_ITERATOR, 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/JS/node_modules/graphql/subscription/subscribe.d.ts b/JS/node_modules/graphql/subscription/subscribe.d.ts deleted file mode 100644 index 3ed750a..0000000 --- a/JS/node_modules/graphql/subscription/subscribe.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { DocumentNode } from '../language/ast'; -import { ExecutionResult } from '../execution/execute'; -import { GraphQLSchema } from '../type/schema'; -import { GraphQLFieldResolver } from '../type/definition'; - -export interface SubscriptionArgs { - schema: GraphQLSchema; - document: DocumentNode; - rootValue?: any; - contextValue?: any; - variableValues?: Maybe>; - operationName?: Maybe; - fieldResolver?: Maybe>; - subscribeFieldResolver?: Maybe>; -} - -/** - * 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 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. - */ -export function subscribe( - args: SubscriptionArgs, -): Promise | ExecutionResult>; - -export function subscribe( - schema: GraphQLSchema, - document: DocumentNode, - rootValue?: any, - contextValue?: any, - variableValues?: Maybe<{ [key: string]: any }>, - operationName?: Maybe, - fieldResolver?: Maybe>, - subscribeFieldResolver?: Maybe>, -): Promise | ExecutionResult>; - -/** - * 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?: any, - contextValue?: any, - variableValues?: { [key: string]: any }, - operationName?: Maybe, - fieldResolver?: Maybe>, -): Promise | ExecutionResult>; diff --git a/JS/node_modules/graphql/subscription/subscribe.js b/JS/node_modules/graphql/subscription/subscribe.js deleted file mode 100644 index 9f8225d..0000000 --- a/JS/node_modules/graphql/subscription/subscribe.js +++ /dev/null @@ -1,192 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.subscribe = subscribe; -exports.createSourceEventStream = createSourceEventStream; - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _isAsyncIterable = _interopRequireDefault(require("../jsutils/isAsyncIterable.js")); - -var _Path = require("../jsutils/Path.js"); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _locatedError = require("../error/locatedError.js"); - -var _values = require("../execution/values.js"); - -var _execute = require("../execution/execute.js"); - -var _getOperationRootType = require("../utilities/getOperationRootType.js"); - -var _mapAsyncIterator = _interopRequireDefault(require("./mapAsyncIterator.js")); - -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: schema, - document: document, - rootValue: payload, - contextValue: contextValue, - variableValues: variableValues, - operationName: operationName, - fieldResolver: 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, _isAsyncIterable.default)(resultOrStream) ? (0, _mapAsyncIterator.default)(resultOrStream, mapSourceToResponse, reportGraphQLError) : resultOrStream - ); - }); -} -/** - * Implements the "CreateSourceEventStream" algorithm described in the - * GraphQL specification, resolving the subscription source event stream. - * - * Returns a Promise which resolves to either an AsyncIterable (if successful) - * or an ExecutionResult (error). The promise will be rejected if the schema or - * other arguments to this function are invalid, or if the resolved event stream - * is not an async iterable. - * - * 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 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 the AsyncIterable for the - * event stream returned by the resolver. - * - * 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); - return new Promise(function (resolve) { - // 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); - resolve( // Return early errors if execution context failed. - Array.isArray(exeContext) ? { - errors: exeContext - } : executeSubscription(exeContext)); - }).catch(reportGraphQLError); -} - -function executeSubscription(exeContext) { - var schema = exeContext.schema, - operation = exeContext.operation, - variableValues = exeContext.variableValues, - rootValue = exeContext.rootValue; - var type = (0, _getOperationRootType.getOperationRootType)(schema, operation); - var fields = (0, _execute.collectFields)(exeContext, type, 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); - } - - var path = (0, _Path.addPath)(undefined, responseName, type.name); - var info = (0, _execute.buildResolveInfo)(exeContext, fieldDef, fieldNodes, type, path); // Coerce to Promise for easier error handling and consistent return type. - - return new Promise(function (resolveResult) { - var _fieldDef$subscribe; - - // Implements the "ResolveFieldEventStream" algorithm from GraphQL specification. - // It differs from "ResolveFieldValue" due to providing a different `resolveFn`. - // Build a JS object of arguments from the field.arguments AST, using the - // variables scope to fulfill any variable references. - var args = (0, _values.getArgumentValues)(fieldDef, fieldNodes[0], 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; // Call the `subscribe()` resolver or the default resolver to produce an - // AsyncIterable yielding raw payloads. - - var resolveFn = (_fieldDef$subscribe = fieldDef.subscribe) !== null && _fieldDef$subscribe !== void 0 ? _fieldDef$subscribe : exeContext.fieldResolver; - resolveResult(resolveFn(rootValue, args, contextValue, info)); - }).then(function (eventStream) { - if (eventStream instanceof Error) { - throw (0, _locatedError.locatedError)(eventStream, fieldNodes, (0, _Path.pathToArray)(path)); - } // Assert field returned an event stream, otherwise yield an error. - - - if (!(0, _isAsyncIterable.default)(eventStream)) { - throw new Error('Subscription field must return Async Iterable. ' + "Received: ".concat((0, _inspect.default)(eventStream), ".")); - } - - return eventStream; - }, function (error) { - throw (0, _locatedError.locatedError)(error, fieldNodes, (0, _Path.pathToArray)(path)); - }); -} diff --git a/JS/node_modules/graphql/subscription/subscribe.js.flow b/JS/node_modules/graphql/subscription/subscribe.js.flow deleted file mode 100644 index 7d21367..0000000 --- a/JS/node_modules/graphql/subscription/subscribe.js.flow +++ /dev/null @@ -1,298 +0,0 @@ -// @flow strict -import inspect from '../jsutils/inspect'; -import isAsyncIterable from '../jsutils/isAsyncIterable'; -import { addPath, pathToArray } from '../jsutils/Path'; - -import { GraphQLError } from '../error/GraphQLError'; -import { locatedError } from '../error/locatedError'; - -import type { DocumentNode } from '../language/ast'; - -import type { ExecutionResult, ExecutionContext } from '../execution/execute'; -import { getArgumentValues } from '../execution/values'; -import { - assertValidExecutionArguments, - buildExecutionContext, - buildResolveInfo, - collectFields, - execute, - getFieldDef, -} from '../execution/execute'; - -import type { GraphQLSchema } from '../type/schema'; -import type { GraphQLFieldResolver } from '../type/definition'; - -import { getOperationRootType } from '../utilities/getOperationRootType'; - -import mapAsyncIterator from './mapAsyncIterator'; - -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 (error). The promise will be rejected if the schema or - * other arguments to this function are invalid, or if the resolved event stream - * is not an async iterable. - * - * 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: mixed): ExecutionResult { - 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, - rootValue: 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, - mapSourceToResponse, - reportGraphQLError, - ) - : ((resultOrStream: any): ExecutionResult), - ); -} - -/** - * Implements the "CreateSourceEventStream" algorithm described in the - * GraphQL specification, resolving the subscription source event stream. - * - * Returns a Promise which resolves to either an AsyncIterable (if successful) - * or an ExecutionResult (error). The promise will be rejected if the schema or - * other arguments to this function are invalid, or if the resolved event stream - * is not an async iterable. - * - * 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 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 the AsyncIterable for the - * event stream returned by the resolver. - * - * 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); - - return new Promise((resolve) => { - // 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, - ); - - resolve( - // Return early errors if execution context failed. - Array.isArray(exeContext) - ? { errors: exeContext } - : executeSubscription(exeContext), - ); - }).catch(reportGraphQLError); -} - -function executeSubscription( - exeContext: ExecutionContext, -): Promise> { - const { schema, operation, variableValues, rootValue } = exeContext; - const type = getOperationRootType(schema, operation); - const fields = collectFields( - exeContext, - type, - 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, - ); - } - - const path = addPath(undefined, responseName, type.name); - const info = buildResolveInfo(exeContext, fieldDef, fieldNodes, type, path); - - // Coerce to Promise for easier error handling and consistent return type. - return new Promise((resolveResult) => { - // Implements the "ResolveFieldEventStream" algorithm from GraphQL specification. - // It differs from "ResolveFieldValue" due to providing a different `resolveFn`. - - // Build a JS object of arguments from the field.arguments AST, using the - // variables scope to fulfill any variable references. - const args = getArgumentValues(fieldDef, fieldNodes[0], 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; - - // Call the `subscribe()` resolver or the default resolver to produce an - // AsyncIterable yielding raw payloads. - const resolveFn = fieldDef.subscribe ?? exeContext.fieldResolver; - resolveResult(resolveFn(rootValue, args, contextValue, info)); - }).then( - (eventStream) => { - if (eventStream instanceof Error) { - throw locatedError(eventStream, fieldNodes, pathToArray(path)); - } - - // Assert field returned an event stream, otherwise yield an error. - if (!isAsyncIterable(eventStream)) { - throw new Error( - 'Subscription field must return Async Iterable. ' + - `Received: ${inspect(eventStream)}.`, - ); - } - return eventStream; - }, - (error) => { - throw locatedError(error, fieldNodes, pathToArray(path)); - }, - ); -} diff --git a/JS/node_modules/graphql/subscription/subscribe.mjs b/JS/node_modules/graphql/subscription/subscribe.mjs deleted file mode 100644 index a35acf9..0000000 --- a/JS/node_modules/graphql/subscription/subscribe.mjs +++ /dev/null @@ -1,172 +0,0 @@ -import inspect from "../jsutils/inspect.mjs"; -import isAsyncIterable from "../jsutils/isAsyncIterable.mjs"; -import { addPath, pathToArray } from "../jsutils/Path.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { locatedError } from "../error/locatedError.mjs"; -import { getArgumentValues } from "../execution/values.mjs"; -import { assertValidExecutionArguments, buildExecutionContext, buildResolveInfo, collectFields, execute, getFieldDef } from "../execution/execute.mjs"; -import { getOperationRootType } from "../utilities/getOperationRootType.mjs"; -import mapAsyncIterator from "./mapAsyncIterator.mjs"; -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: schema, - document: document, - rootValue: payload, - contextValue: contextValue, - variableValues: variableValues, - operationName: operationName, - fieldResolver: 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 - ); - }); -} -/** - * Implements the "CreateSourceEventStream" algorithm described in the - * GraphQL specification, resolving the subscription source event stream. - * - * Returns a Promise which resolves to either an AsyncIterable (if successful) - * or an ExecutionResult (error). The promise will be rejected if the schema or - * other arguments to this function are invalid, or if the resolved event stream - * is not an async iterable. - * - * 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 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 the AsyncIterable for the - * event stream returned by the resolver. - * - * 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); - return new Promise(function (resolve) { - // 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); - resolve( // Return early errors if execution context failed. - Array.isArray(exeContext) ? { - errors: exeContext - } : executeSubscription(exeContext)); - }).catch(reportGraphQLError); -} - -function executeSubscription(exeContext) { - var schema = exeContext.schema, - operation = exeContext.operation, - variableValues = exeContext.variableValues, - rootValue = exeContext.rootValue; - var type = getOperationRootType(schema, operation); - var fields = collectFields(exeContext, type, 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); - } - - var path = addPath(undefined, responseName, type.name); - var info = buildResolveInfo(exeContext, fieldDef, fieldNodes, type, path); // Coerce to Promise for easier error handling and consistent return type. - - return new Promise(function (resolveResult) { - var _fieldDef$subscribe; - - // Implements the "ResolveFieldEventStream" algorithm from GraphQL specification. - // It differs from "ResolveFieldValue" due to providing a different `resolveFn`. - // Build a JS object of arguments from the field.arguments AST, using the - // variables scope to fulfill any variable references. - var args = getArgumentValues(fieldDef, fieldNodes[0], 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; // Call the `subscribe()` resolver or the default resolver to produce an - // AsyncIterable yielding raw payloads. - - var resolveFn = (_fieldDef$subscribe = fieldDef.subscribe) !== null && _fieldDef$subscribe !== void 0 ? _fieldDef$subscribe : exeContext.fieldResolver; - resolveResult(resolveFn(rootValue, args, contextValue, info)); - }).then(function (eventStream) { - if (eventStream instanceof Error) { - throw locatedError(eventStream, fieldNodes, pathToArray(path)); - } // Assert field returned an event stream, otherwise yield an error. - - - if (!isAsyncIterable(eventStream)) { - throw new Error('Subscription field must return Async Iterable. ' + "Received: ".concat(inspect(eventStream), ".")); - } - - return eventStream; - }, function (error) { - throw locatedError(error, fieldNodes, pathToArray(path)); - }); -} diff --git a/JS/node_modules/graphql/type/definition.d.ts b/JS/node_modules/graphql/type/definition.d.ts deleted file mode 100644 index 0679998..0000000 --- a/JS/node_modules/graphql/type/definition.d.ts +++ /dev/null @@ -1,947 +0,0 @@ -// FIXME -/* eslint-disable import/no-cycle */ - -import { Maybe } from '../jsutils/Maybe'; - -import { PromiseOrValue } from '../jsutils/PromiseOrValue'; -import { Path } from '../jsutils/Path'; - -import { - ScalarTypeDefinitionNode, - ObjectTypeDefinitionNode, - FieldDefinitionNode, - InputValueDefinitionNode, - InterfaceTypeDefinitionNode, - UnionTypeDefinitionNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - InputObjectTypeDefinitionNode, - ObjectTypeExtensionNode, - InterfaceTypeExtensionNode, - OperationDefinitionNode, - FieldNode, - FragmentDefinitionNode, - ValueNode, - ScalarTypeExtensionNode, - UnionTypeExtensionNode, - EnumTypeExtensionNode, - InputObjectTypeExtensionNode, -} from '../language/ast'; - -import { GraphQLSchema } from './schema'; - -/** - * These are all of the possible kinds of types. - */ -export type GraphQLType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull; - -export function isType(type: any): type is GraphQLType; - -export function assertType(type: any): GraphQLType; - -export function isScalarType(type: any): type is GraphQLScalarType; - -export function assertScalarType(type: any): GraphQLScalarType; - -export function isObjectType(type: any): type is GraphQLObjectType; - -export function assertObjectType(type: any): GraphQLObjectType; - -export function isInterfaceType(type: any): type is GraphQLInterfaceType; - -export function assertInterfaceType(type: any): GraphQLInterfaceType; - -export function isUnionType(type: any): type is GraphQLUnionType; - -export function assertUnionType(type: any): GraphQLUnionType; - -export function isEnumType(type: any): type is GraphQLEnumType; - -export function assertEnumType(type: any): GraphQLEnumType; - -export function isInputObjectType(type: any): type is GraphQLInputObjectType; - -export function assertInputObjectType(type: any): GraphQLInputObjectType; - -export function isListType(type: any): type is GraphQLList; - -export function assertListType(type: any): GraphQLList; - -export function isNonNullType(type: any): type is GraphQLNonNull; - -export function assertNonNullType(type: any): GraphQLNonNull; - -/** - * These types may be used as input types for arguments and directives. - */ -// TS_SPECIFIC: TS does not allow recursive type definitions, hence the `any`s -export type GraphQLInputType = - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList - >; - -export function isInputType(type: any): type is GraphQLInputType; - -export function assertInputType(type: any): GraphQLInputType; - -/** - * These types may be used as output types as the result of fields. - */ -// TS_SPECIFIC: TS does not allow recursive type definitions, hence the `any`s -export type GraphQLOutputType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - | GraphQLNonNull< - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLList - >; - -export function isOutputType(type: any): type is GraphQLOutputType; - -export function assertOutputType(type: any): GraphQLOutputType; - -/** - * These types may describe types which may be leaf values. - */ -export type GraphQLLeafType = GraphQLScalarType | GraphQLEnumType; - -export function isLeafType(type: any): type is GraphQLLeafType; - -export function assertLeafType(type: any): GraphQLLeafType; - -/** - * These types may describe the parent context of a selection set. - */ -export type GraphQLCompositeType = - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType; - -export function isCompositeType(type: any): type is GraphQLCompositeType; - -export function assertCompositeType(type: any): GraphQLCompositeType; - -/** - * These types may describe the parent context of a selection set. - */ -export type GraphQLAbstractType = GraphQLInterfaceType | GraphQLUnionType; - -export function isAbstractType(type: any): type is GraphQLAbstractType; - -export function assertAbstractType(type: any): GraphQLAbstractType; - -/** - * List Modifier - * - * A list is a kind of type marker, 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: new GraphQLList(Person) }, - * children: { type: new GraphQLList(Person) }, - * }) - * }) - * - */ -interface GraphQLList { - readonly ofType: T; - toString: () => string; - toJSON: () => string; - inspect: () => string; -} - -interface _GraphQLList { - (type: T): GraphQLList; - new (type: T): GraphQLList; -} - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const GraphQLList: _GraphQLList; - -/** - * Non-Null Modifier - * - * A non-null is a kind of type marker, 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: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * - * Note: the enforcement of non-nullability occurs within the executor. - */ -interface GraphQLNonNull { - readonly ofType: T; - toString: () => string; - toJSON: () => string; - inspect: () => string; -} - -interface _GraphQLNonNull { - (type: T): GraphQLNonNull; - new (type: T): GraphQLNonNull; -} - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const GraphQLNonNull: _GraphQLNonNull; - -export type GraphQLWrappingType = GraphQLList | GraphQLNonNull; - -export function isWrappingType(type: any): type is GraphQLWrappingType; - -export function assertWrappingType(type: any): GraphQLWrappingType; - -/** - * These types can all accept null as a value. - */ -export type GraphQLNullableType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType - | GraphQLList; - -export function isNullableType(type: any): type is GraphQLNullableType; - -export function assertNullableType(type: any): GraphQLNullableType; - -export function getNullableType(type: undefined): undefined; -export function getNullableType(type: T): T; -export function getNullableType( - // FIXME Disabled because of https://github.com/yaacovCR/graphql-tools-fork/issues/40#issuecomment-586671219 - // eslint-disable-next-line @typescript-eslint/unified-signatures - type: GraphQLNonNull, -): T; - -/** - * These named types do not include modifiers like List or NonNull. - */ -export type GraphQLNamedType = - | GraphQLScalarType - | GraphQLObjectType - | GraphQLInterfaceType - | GraphQLUnionType - | GraphQLEnumType - | GraphQLInputObjectType; - -export function isNamedType(type: any): type is GraphQLNamedType; - -export function assertNamedType(type: any): GraphQLNamedType; - -export function getNamedType(type: undefined): undefined; -export function getNamedType(type: GraphQLType): GraphQLNamedType; - -/** - * Used while defining GraphQL types to allow for circular references in - * otherwise immutable type definitions. - */ -export type Thunk = (() => T) | T; - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLScalarTypeExtensions { - [attributeName: string]: any; -} - -/** - * 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. - * - * Example: - * - * const OddType = new GraphQLScalarType({ - * name: 'Odd', - * serialize(value) { - * return value % 2 === 1 ? value : null; - * } - * }); - * - */ -export class GraphQLScalarType { - name: string; - description: Maybe; - specifiedByUrl: Maybe; - serialize: GraphQLScalarSerializer; - parseValue: GraphQLScalarValueParser; - parseLiteral: GraphQLScalarLiteralParser; - extensions: Maybe>; - astNode: Maybe; - extensionASTNodes: Maybe>; - - constructor(config: Readonly>); - - toConfig(): GraphQLScalarTypeConfig & { - specifiedByUrl: Maybe; - serialize: GraphQLScalarSerializer; - parseValue: GraphQLScalarValueParser; - parseLiteral: GraphQLScalarLiteralParser; - extensions: Maybe>; - extensionASTNodes: ReadonlyArray; - }; - - toString(): string; - toJSON(): string; - inspect(): string; -} - -export type GraphQLScalarSerializer = ( - value: any, -) => Maybe; -export type GraphQLScalarValueParser = ( - value: any, -) => Maybe; -export type GraphQLScalarLiteralParser = ( - valueNode: ValueNode, - variables: Maybe<{ [key: string]: any }>, -) => Maybe; - -export interface GraphQLScalarTypeConfig { - name: string; - description?: Maybe; - specifiedByUrl?: Maybe; - // 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; - extensions?: Maybe>; - astNode?: Maybe; - extensionASTNodes?: Maybe>; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - * - * We've provided these template arguments because this is an open type and - * you may find them useful. - */ -export interface GraphQLObjectTypeExtensions<_TSource = any, _TContext = any> { - [attributeName: string]: any; -} - -/** - * 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: Maybe; - isTypeOf: Maybe>; - extensions: Maybe>>; - astNode: Maybe; - extensionASTNodes: Maybe>; - - constructor(config: Readonly>); - - getFields(): GraphQLFieldMap; - getInterfaces(): Array; - - toConfig(): GraphQLObjectTypeConfig & { - interfaces: Array; - fields: GraphQLFieldConfigMap; - extensions: Maybe>>; - extensionASTNodes: ReadonlyArray; - }; - - toString(): string; - toJSON(): string; - inspect(): string; -} - -export function argsToArgsConfig( - args: ReadonlyArray, -): GraphQLFieldConfigArgumentMap; - -export interface GraphQLObjectTypeConfig { - name: string; - description?: Maybe; - interfaces?: Thunk>>; - fields: Thunk>; - isTypeOf?: Maybe>; - extensions?: Maybe>>; - astNode?: Maybe; - extensionASTNodes?: Maybe>; -} - -export type GraphQLTypeResolver = ( - value: TSource, - context: TContext, - info: GraphQLResolveInfo, - abstractType: GraphQLAbstractType, -) => PromiseOrValue | string>>; - -export type GraphQLIsTypeOfFn = ( - source: TSource, - context: TContext, - info: GraphQLResolveInfo, -) => PromiseOrValue; - -export type GraphQLFieldResolver< - TSource, - TContext, - TArgs = { [argName: string]: any } -> = ( - source: TSource, - args: TArgs, - context: TContext, - info: GraphQLResolveInfo, -) => any; - -export interface GraphQLResolveInfo { - readonly fieldName: string; - readonly fieldNodes: ReadonlyArray; - readonly returnType: GraphQLOutputType; - readonly parentType: GraphQLObjectType; - readonly path: Path; - readonly schema: GraphQLSchema; - readonly fragments: { [key: string]: FragmentDefinitionNode }; - readonly rootValue: any; - readonly operation: OperationDefinitionNode; - readonly variableValues: { [variableName: string]: any }; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - * - * We've provided these template arguments because this is an open type and - * you may find them useful. - */ -export interface GraphQLFieldExtensions< - _TSource, - _TContext, - _TArgs = { [argName: string]: any } -> { - [attributeName: string]: any; -} - -export interface GraphQLFieldConfig< - TSource, - TContext, - TArgs = { [argName: string]: any } -> { - description?: Maybe; - type: GraphQLOutputType; - args?: GraphQLFieldConfigArgumentMap; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - deprecationReason?: Maybe; - extensions?: Maybe< - Readonly> - >; - astNode?: Maybe; -} - -export interface GraphQLFieldConfigArgumentMap { - [key: string]: GraphQLArgumentConfig; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLArgumentExtensions { - [attributeName: string]: any; -} - -export interface GraphQLArgumentConfig { - description?: Maybe; - type: GraphQLInputType; - defaultValue?: any; - deprecationReason?: Maybe; - extensions?: Maybe>; - astNode?: Maybe; -} - -export interface GraphQLFieldConfigMap { - [key: string]: GraphQLFieldConfig; -} - -export interface GraphQLField< - TSource, - TContext, - TArgs = { [key: string]: any } -> { - name: string; - description: Maybe; - type: GraphQLOutputType; - args: Array; - resolve?: GraphQLFieldResolver; - subscribe?: GraphQLFieldResolver; - deprecationReason: Maybe; - extensions: Maybe>>; - astNode?: Maybe; - - // @deprecated and will be removed in v16 - isDeprecated: boolean; -} - -export interface GraphQLArgument { - name: string; - description: Maybe; - type: GraphQLInputType; - defaultValue: any; - deprecationReason: Maybe; - extensions: Maybe>; - astNode: Maybe; -} - -export function isRequiredArgument(arg: GraphQLArgument): boolean; - -export interface GraphQLFieldMap { - [key: string]: GraphQLField; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLInterfaceTypeExtensions { - [attributeName: string]: any; -} - -/** - * 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: Maybe; - resolveType: Maybe>; - extensions: Maybe>; - astNode?: Maybe; - extensionASTNodes: Maybe>; - - constructor(config: Readonly>); - getFields(): GraphQLFieldMap; - getInterfaces(): Array; - - toConfig(): GraphQLInterfaceTypeConfig & { - interfaces: Array; - fields: GraphQLFieldConfigMap; - extensions: Maybe>; - extensionASTNodes: ReadonlyArray; - }; - - toString(): string; - toJSON(): string; - inspect(): string; -} - -export interface GraphQLInterfaceTypeConfig { - name: string; - description?: Maybe; - interfaces?: Thunk>>; - 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?: Maybe>; - extensions?: Maybe>; - astNode?: Maybe; - extensionASTNodes?: Maybe>; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLUnionTypeExtensions { - [attributeName: string]: any; -} - -/** - * 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: Maybe; - resolveType: Maybe>; - extensions: Maybe>; - astNode: Maybe; - extensionASTNodes: Maybe>; - - constructor(config: Readonly>); - getTypes(): Array; - - toConfig(): GraphQLUnionTypeConfig & { - types: Array; - extensions: Maybe>; - extensionASTNodes: ReadonlyArray; - }; - - toString(): string; - toJSON(): string; - inspect(): string; -} - -export interface GraphQLUnionTypeConfig { - name: string; - description?: Maybe; - 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?: Maybe>; - extensions?: Maybe>; - astNode?: Maybe; - extensionASTNodes?: Maybe>; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLEnumTypeExtensions { - [attributeName: string]: any; -} - -/** - * 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: Maybe; - extensions: Maybe>; - astNode: Maybe; - extensionASTNodes: Maybe>; - - constructor(config: Readonly); - getValues(): Array; - getValue(name: string): Maybe; - serialize(value: any): Maybe; - parseValue(value: any): Maybe; - parseLiteral( - valueNode: ValueNode, - _variables: Maybe<{ [key: string]: any }>, - ): Maybe; - - toConfig(): GraphQLEnumTypeConfig & { - extensions: Maybe>; - extensionASTNodes: ReadonlyArray; - }; - - toString(): string; - toJSON(): string; - inspect(): string; -} - -export interface GraphQLEnumTypeConfig { - name: string; - description?: Maybe; - values: GraphQLEnumValueConfigMap; - extensions?: Maybe>; - astNode?: Maybe; - extensionASTNodes?: Maybe>; -} - -export interface GraphQLEnumValueConfigMap { - [key: string]: GraphQLEnumValueConfig; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLEnumValueExtensions { - [attributeName: string]: any; -} - -export interface GraphQLEnumValueConfig { - description?: Maybe; - value?: any; - deprecationReason?: Maybe; - extensions?: Maybe>; - astNode?: Maybe; -} - -export interface GraphQLEnumValue { - name: string; - description: Maybe; - value: any; - deprecationReason: Maybe; - extensions: Maybe>; - astNode?: Maybe; - - // @deprecated and will be removed in v16 - isDeprecated: boolean; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLInputObjectTypeExtensions { - [attributeName: string]: any; -} - -/** - * 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: new GraphQLNonNull(GraphQLFloat) }, - * lon: { type: new GraphQLNonNull(GraphQLFloat) }, - * alt: { type: GraphQLFloat, defaultValue: 0 }, - * } - * }); - * - */ -export class GraphQLInputObjectType { - name: string; - description: Maybe; - extensions: Maybe>; - astNode: Maybe; - extensionASTNodes: Maybe>; - - constructor(config: Readonly); - getFields(): GraphQLInputFieldMap; - - toConfig(): GraphQLInputObjectTypeConfig & { - fields: GraphQLInputFieldConfigMap; - extensions: Maybe>; - extensionASTNodes: ReadonlyArray; - }; - - toString(): string; - toJSON(): string; - inspect(): string; -} - -export interface GraphQLInputObjectTypeConfig { - name: string; - description?: Maybe; - fields: Thunk; - extensions?: Maybe>; - astNode?: Maybe; - extensionASTNodes?: Maybe>; -} - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLInputFieldExtensions { - [attributeName: string]: any; -} - -export interface GraphQLInputFieldConfig { - description?: Maybe; - type: GraphQLInputType; - defaultValue?: any; - deprecationReason?: Maybe; - extensions?: Maybe>; - astNode?: Maybe; -} - -export interface GraphQLInputFieldConfigMap { - [key: string]: GraphQLInputFieldConfig; -} - -export interface GraphQLInputField { - name: string; - description?: Maybe; - type: GraphQLInputType; - defaultValue?: any; - deprecationReason: Maybe; - extensions: Maybe>; - astNode?: Maybe; -} - -export function isRequiredInputField(field: GraphQLInputField): boolean; - -export interface GraphQLInputFieldMap { - [key: string]: GraphQLInputField; -} diff --git a/JS/node_modules/graphql/type/definition.js b/JS/node_modules/graphql/type/definition.js deleted file mode 100644 index 6d53cb7..0000000 --- a/JS/node_modules/graphql/type/definition.js +++ /dev/null @@ -1,1226 +0,0 @@ -"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.js")); - -var _symbols = require("../polyfills/symbols.js"); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _keyMap = _interopRequireDefault(require("../jsutils/keyMap.js")); - -var _mapValue = _interopRequireDefault(require("../jsutils/mapValue.js")); - -var _toObjMap = _interopRequireDefault(require("../jsutils/toObjMap.js")); - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap.js")); - -var _instanceOf = _interopRequireDefault(require("../jsutils/instanceOf.js")); - -var _didYouMean = _interopRequireDefault(require("../jsutils/didYouMean.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _identityFunc = _interopRequireDefault(require("../jsutils/identityFunc.js")); - -var _defineInspect = _interopRequireDefault(require("../jsutils/defineInspect.js")); - -var _suggestionList = _interopRequireDefault(require("../jsutils/suggestionList.js")); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _kinds = require("../language/kinds.js"); - -var _printer = require("../language/printer.js"); - -var _valueFromASTUntyped = require("../utilities/valueFromASTUntyped.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -function isType(type) { - return isScalarType(type) || isObjectType(type) || isInterfaceType(type) || isUnionType(type) || isEnumType(type) || isInputObjectType(type) || isListType(type) || isNonNullType(type); -} - -function assertType(type) { - if (!isType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL type.")); - } - - 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) { - if (!isScalarType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Scalar type.")); - } - - return type; -} - -// eslint-disable-next-line no-redeclare -function isObjectType(type) { - return (0, _instanceOf.default)(type, GraphQLObjectType); -} - -function assertObjectType(type) { - if (!isObjectType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Object type.")); - } - - return type; -} - -// eslint-disable-next-line no-redeclare -function isInterfaceType(type) { - return (0, _instanceOf.default)(type, GraphQLInterfaceType); -} - -function assertInterfaceType(type) { - if (!isInterfaceType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Interface type.")); - } - - return type; -} - -// eslint-disable-next-line no-redeclare -function isUnionType(type) { - return (0, _instanceOf.default)(type, GraphQLUnionType); -} - -function assertUnionType(type) { - if (!isUnionType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Union type.")); - } - - return type; -} - -// eslint-disable-next-line no-redeclare -function isEnumType(type) { - return (0, _instanceOf.default)(type, GraphQLEnumType); -} - -function assertEnumType(type) { - if (!isEnumType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Enum type.")); - } - - return type; -} - -// eslint-disable-next-line no-redeclare -function isInputObjectType(type) { - return (0, _instanceOf.default)(type, GraphQLInputObjectType); -} - -function assertInputObjectType(type) { - if (!isInputObjectType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Input Object type.")); - } - - return type; -} - -// eslint-disable-next-line no-redeclare -function isListType(type) { - return (0, _instanceOf.default)(type, GraphQLList); -} - -function assertListType(type) { - if (!isListType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL List type.")); - } - - return type; -} - -// eslint-disable-next-line no-redeclare -function isNonNullType(type) { - return (0, _instanceOf.default)(type, GraphQLNonNull); -} - -function assertNonNullType(type) { - if (!isNonNullType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL Non-Null type.")); - } - - 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) { - if (!isInputType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL input type.")); - } - - 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) { - if (!isOutputType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL output type.")); - } - - return type; -} -/** - * These types may describe types which may be leaf values. - */ - - -function isLeafType(type) { - return isScalarType(type) || isEnumType(type); -} - -function assertLeafType(type) { - if (!isLeafType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL leaf type.")); - } - - 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) { - if (!isCompositeType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL composite type.")); - } - - return type; -} -/** - * These types may describe the parent context of a selection set. - */ - - -function isAbstractType(type) { - return isInterfaceType(type) || isUnionType(type); -} - -function assertAbstractType(type) { - if (!isAbstractType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(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: new GraphQLList(PersonType) }, - * children: { type: new GraphQLList(PersonType) }, - * }) - * }) - * - */ -// FIXME: workaround to fix issue with Babel parser - -/* :: -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; -} -*/ - - -function GraphQLList(ofType) { - // istanbul ignore else (to be removed in v16.0.0) - 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) + ']'; -}; - -GraphQLList.prototype.toJSON = function toJSON() { - return this.toString(); -}; - -Object.defineProperty(GraphQLList.prototype, _symbols.SYMBOL_TO_STRING_TAG, { - get: function get() { - return 'GraphQLList'; - } -}); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -(0, _defineInspect.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: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * - * Note: the enforcement of non-nullability occurs within the executor. - */ -// FIXME: workaround to fix issue with Babel parser - -/* :: -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; -} -*/ - -function GraphQLNonNull(ofType) { - // istanbul ignore else (to be removed in v16.0.0) - 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) + '!'; -}; - -GraphQLNonNull.prototype.toJSON = function toJSON() { - return this.toString(); -}; - -Object.defineProperty(GraphQLNonNull.prototype, _symbols.SYMBOL_TO_STRING_TAG, { - get: function get() { - return 'GraphQLNonNull'; - } -}); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -(0, _defineInspect.default)(GraphQLNonNull); -/** - * These types wrap and modify other types - */ - -function isWrappingType(type) { - return isListType(type) || isNonNullType(type); -} - -function assertWrappingType(type) { - if (!isWrappingType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL wrapping type.")); - } - - return type; -} -/** - * These types can all accept null as a value. - */ - - -function isNullableType(type) { - return isType(type) && !isNonNullType(type); -} - -function assertNullableType(type) { - if (!isNullableType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL nullable type.")); - } - - 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) { - if (!isNamedType(type)) { - throw new Error("Expected ".concat((0, _inspect.default)(type), " to be a GraphQL named type.")); - } - - 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[incompatible-use] - 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 _config$parseValue, _config$serialize, _config$parseLiteral; - - var parseValue = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : _identityFunc.default; - this.name = config.name; - this.description = config.description; - this.specifiedByUrl = config.specifiedByUrl; - this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : _identityFunc.default; - this.parseValue = parseValue; - this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function (node, variables) { - return parseValue((0, _valueFromASTUntyped.valueFromASTUntyped)(node, variables)); - }; - this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); - config.specifiedByUrl == null || typeof config.specifiedByUrl === 'string' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"specifiedByUrl\" as a string, ") + "but got: ".concat((0, _inspect.default)(config.specifiedByUrl), ".")); - config.serialize == null || typeof config.serialize === 'function' || (0, _devAssert.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.")); - - if (config.parseLiteral) { - typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide both \"parseValue\" and \"parseLiteral\" functions.")); - } - } - - var _proto = GraphQLScalarType.prototype; - - _proto.toConfig = function toConfig() { - var _this$extensionASTNod; - - return { - name: this.name, - description: this.description, - specifiedByUrl: this.specifiedByUrl, - serialize: this.serialize, - parseValue: this.parseValue, - parseLiteral: this.parseLiteral, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : [] - }; - }; - - _proto.toString = function toString() { - return this.name; - }; - - _proto.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLScalarType, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLScalarType'; - } - }]); - - return GraphQLScalarType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.GraphQLScalarType = GraphQLScalarType; -(0, _defineInspect.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.isTypeOf = config.isTypeOf; - this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); - config.isTypeOf == null || typeof config.isTypeOf === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"isTypeOf\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.isTypeOf), ".")); - } - - 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, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - isTypeOf: this.isTypeOf, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes || [] - }; - }; - - _proto2.toString = function toString() { - return this.name; - }; - - _proto2.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLObjectType, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLObjectType'; - } - }]); - - return GraphQLObjectType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.GraphQLObjectType = GraphQLObjectType; -(0, _defineInspect.default)(GraphQLObjectType); - -function defineInterfaces(config) { - var _resolveThunk; - - var interfaces = (_resolveThunk = resolveThunk(config.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : []; - Array.isArray(interfaces) || (0, _devAssert.default)(0, "".concat(config.name, " interfaces must be an Array or a function which returns an Array.")); - return interfaces; -} - -function defineFieldMap(config) { - var fieldMap = resolveThunk(config.fields); - isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")); - return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) { - var _fieldConfig$args; - - isPlainObj(fieldConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " field config must be an object.")); - !('isDeprecated' in fieldConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")); - fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), ".")); - var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {}; - isPlainObj(argsConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " args must be an object with argument names as keys.")); - var args = (0, _objectEntries.default)(argsConfig).map(function (_ref) { - var argName = _ref[0], - argConfig = _ref[1]; - return { - name: argName, - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: argConfig.extensions && (0, _toObjMap.default)(argConfig.extensions), - astNode: argConfig.astNode - }; - }); - return { - name: fieldName, - description: fieldConfig.description, - type: fieldConfig.type, - args: args, - resolve: fieldConfig.resolve, - subscribe: fieldConfig.subscribe, - isDeprecated: fieldConfig.deprecationReason != null, - deprecationReason: fieldConfig.deprecationReason, - extensions: fieldConfig.extensions && (0, _toObjMap.default)(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); -} - -function isPlainObj(obj) { - return (0, _isObjectLike.default)(obj) && !Array.isArray(obj); -} - -function fieldsToFieldsConfig(fields) { - return (0, _mapValue.default)(fields, function (field) { - return { - description: field.description, - type: field.type, - args: argsToArgsConfig(field.args), - resolve: field.resolve, - subscribe: field.subscribe, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - }; - }); -} -/** - * @internal - */ - - -function argsToArgsConfig(args) { - return (0, _keyValMap.default)(args, function (arg) { - return arg.name; - }, function (arg) { - return { - description: arg.description, - type: arg.type, - defaultValue: arg.defaultValue, - deprecationReason: arg.deprecationReason, - extensions: arg.extensions, - 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.resolveType = config.resolveType; - this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); - config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.resolveType), ".")); - } - - var _proto3 = GraphQLInterfaceType.prototype; - - _proto3.getFields = function getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - - return this._fields; - }; - - _proto3.getInterfaces = function getInterfaces() { - if (typeof this._interfaces === 'function') { - this._interfaces = this._interfaces(); - } - - return this._interfaces; - }; - - _proto3.toConfig = function toConfig() { - var _this$extensionASTNod2; - - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod2 = this.extensionASTNodes) !== null && _this$extensionASTNod2 !== void 0 ? _this$extensionASTNod2 : [] - }; - }; - - _proto3.toString = function toString() { - return this.name; - }; - - _proto3.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLInterfaceType, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLInterfaceType'; - } - }]); - - return GraphQLInterfaceType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.GraphQLInterfaceType = GraphQLInterfaceType; -(0, _defineInspect.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.resolveType = config.resolveType; - this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._types = defineTypes.bind(undefined, config); - typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); - config.resolveType == null || typeof config.resolveType === 'function' || (0, _devAssert.default)(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat((0, _inspect.default)(config.resolveType), ".")); - } - - var _proto4 = GraphQLUnionType.prototype; - - _proto4.getTypes = function getTypes() { - if (typeof this._types === 'function') { - this._types = this._types(); - } - - return this._types; - }; - - _proto4.toConfig = function toConfig() { - var _this$extensionASTNod3; - - return { - name: this.name, - description: this.description, - types: this.getTypes(), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod3 = this.extensionASTNodes) !== null && _this$extensionASTNod3 !== void 0 ? _this$extensionASTNod3 : [] - }; - }; - - _proto4.toString = function toString() { - return this.name; - }; - - _proto4.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLUnionType, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLUnionType'; - } - }]); - - return GraphQLUnionType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.GraphQLUnionType = GraphQLUnionType; -(0, _defineInspect.default)(GraphQLUnionType); - -function defineTypes(config) { - var types = resolveThunk(config.types); - Array.isArray(types) || (0, _devAssert.default)(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config.name, ".")); - 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.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._values = defineEnumValues(this.name, 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, _devAssert.default)(0, 'Must provide name.'); - } - - var _proto5 = GraphQLEnumType.prototype; - - _proto5.getValues = function getValues() { - return this._values; - }; - - _proto5.getValue = function getValue(name) { - return this._nameLookup[name]; - }; - - _proto5.serialize = function serialize(outputValue) { - var enumValue = this._valueLookup.get(outputValue); - - if (enumValue === undefined) { - throw new _GraphQLError.GraphQLError("Enum \"".concat(this.name, "\" cannot represent value: ").concat((0, _inspect.default)(outputValue))); - } - - return enumValue.name; - }; - - _proto5.parseValue = function parseValue(inputValue) - /* T */ - { - if (typeof inputValue !== 'string') { - var valueStr = (0, _inspect.default)(inputValue); - throw new _GraphQLError.GraphQLError("Enum \"".concat(this.name, "\" cannot represent non-string value: ").concat(valueStr, ".") + didYouMeanEnumValue(this, valueStr)); - } - - var enumValue = this.getValue(inputValue); - - if (enumValue == null) { - throw new _GraphQLError.GraphQLError("Value \"".concat(inputValue, "\" does not exist in \"").concat(this.name, "\" enum.") + didYouMeanEnumValue(this, inputValue)); - } - - 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 valueStr = (0, _printer.print)(valueNode); - throw new _GraphQLError.GraphQLError("Enum \"".concat(this.name, "\" cannot represent non-enum value: ").concat(valueStr, ".") + didYouMeanEnumValue(this, valueStr), valueNode); - } - - var enumValue = this.getValue(valueNode.value); - - if (enumValue == null) { - var _valueStr = (0, _printer.print)(valueNode); - - throw new _GraphQLError.GraphQLError("Value \"".concat(_valueStr, "\" does not exist in \"").concat(this.name, "\" enum.") + didYouMeanEnumValue(this, _valueStr), valueNode); - } - - return enumValue.value; - }; - - _proto5.toConfig = function toConfig() { - var _this$extensionASTNod4; - - var values = (0, _keyValMap.default)(this.getValues(), function (value) { - return value.name; - }, function (value) { - return { - description: value.description, - value: value.value, - deprecationReason: value.deprecationReason, - extensions: value.extensions, - astNode: value.astNode - }; - }); - return { - name: this.name, - description: this.description, - values: values, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod4 = this.extensionASTNodes) !== null && _this$extensionASTNod4 !== void 0 ? _this$extensionASTNod4 : [] - }; - }; - - _proto5.toString = function toString() { - return this.name; - }; - - _proto5.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLEnumType, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLEnumType'; - } - }]); - - return GraphQLEnumType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.GraphQLEnumType = GraphQLEnumType; -(0, _defineInspect.default)(GraphQLEnumType); - -function didYouMeanEnumValue(enumType, unknownValueStr) { - var allNames = enumType.getValues().map(function (value) { - return value.name; - }); - var suggestedValues = (0, _suggestionList.default)(unknownValueStr, allNames); - return (0, _didYouMean.default)('the enum value', suggestedValues); -} - -function defineEnumValues(typeName, valueMap) { - isPlainObj(valueMap) || (0, _devAssert.default)(0, "".concat(typeName, " values must be an object with value names as keys.")); - return (0, _objectEntries.default)(valueMap).map(function (_ref2) { - var valueName = _ref2[0], - valueConfig = _ref2[1]; - isPlainObj(valueConfig) || (0, _devAssert.default)(0, "".concat(typeName, ".").concat(valueName, " must refer to an object with a \"value\" key ") + "representing an internal value but got: ".concat((0, _inspect.default)(valueConfig), ".")); - !('isDeprecated' in valueConfig) || (0, _devAssert.default)(0, "".concat(typeName, ".").concat(valueName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")); - return { - name: valueName, - description: valueConfig.description, - value: valueConfig.value !== undefined ? valueConfig.value : valueName, - isDeprecated: valueConfig.deprecationReason != null, - deprecationReason: valueConfig.deprecationReason, - extensions: valueConfig.extensions && (0, _toObjMap.default)(valueConfig.extensions), - astNode: valueConfig.astNode - }; - }); -} - -/** - * 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: new GraphQLNonNull(GraphQLFloat) }, - * lon: { type: new GraphQLNonNull(GraphQLFloat) }, - * alt: { type: GraphQLFloat, defaultValue: 0 }, - * } - * }); - * - */ -var GraphQLInputObjectType = /*#__PURE__*/function () { - function GraphQLInputObjectType(config) { - this.name = config.name; - this.description = config.description; - this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._fields = defineInputFieldMap.bind(undefined, config); - typeof config.name === 'string' || (0, _devAssert.default)(0, 'Must provide name.'); - } - - 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 _this$extensionASTNod5; - - var fields = (0, _mapValue.default)(this.getFields(), function (field) { - return { - description: field.description, - type: field.type, - defaultValue: field.defaultValue, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - }; - }); - return { - name: this.name, - description: this.description, - fields: fields, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod5 = this.extensionASTNodes) !== null && _this$extensionASTNod5 !== void 0 ? _this$extensionASTNod5 : [] - }; - }; - - _proto6.toString = function toString() { - return this.name; - }; - - _proto6.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLInputObjectType, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLInputObjectType'; - } - }]); - - return GraphQLInputObjectType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.GraphQLInputObjectType = GraphQLInputObjectType; -(0, _defineInspect.default)(GraphQLInputObjectType); - -function defineInputFieldMap(config) { - var fieldMap = resolveThunk(config.fields); - isPlainObj(fieldMap) || (0, _devAssert.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")); - return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) { - !('resolve' in fieldConfig) || (0, _devAssert.default)(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers.")); - return { - name: fieldName, - description: fieldConfig.description, - type: fieldConfig.type, - defaultValue: fieldConfig.defaultValue, - deprecationReason: fieldConfig.deprecationReason, - extensions: fieldConfig.extensions && (0, _toObjMap.default)(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); -} - -function isRequiredInputField(field) { - return isNonNullType(field.type) && field.defaultValue === undefined; -} diff --git a/JS/node_modules/graphql/type/definition.js.flow b/JS/node_modules/graphql/type/definition.js.flow deleted file mode 100644 index 89701d5..0000000 --- a/JS/node_modules/graphql/type/definition.js.flow +++ /dev/null @@ -1,1651 +0,0 @@ -// @flow strict -import objectEntries from '../polyfills/objectEntries'; -import { SYMBOL_TO_STRING_TAG } from '../polyfills/symbols'; - -import type { Path } from '../jsutils/Path'; -import type { PromiseOrValue } from '../jsutils/PromiseOrValue'; -import type { - ObjMap, - ReadOnlyObjMap, - ReadOnlyObjMapLike, -} from '../jsutils/ObjMap'; -import inspect from '../jsutils/inspect'; -import keyMap from '../jsutils/keyMap'; -import mapValue from '../jsutils/mapValue'; -import toObjMap from '../jsutils/toObjMap'; -import devAssert from '../jsutils/devAssert'; -import keyValMap from '../jsutils/keyValMap'; -import instanceOf from '../jsutils/instanceOf'; -import didYouMean from '../jsutils/didYouMean'; -import isObjectLike from '../jsutils/isObjectLike'; -import identityFunc from '../jsutils/identityFunc'; -import defineInspect from '../jsutils/defineInspect'; -import suggestionList from '../jsutils/suggestionList'; - -import { GraphQLError } from '../error/GraphQLError'; - -import { Kind } from '../language/kinds'; -import { print } from '../language/printer'; -import type { - ScalarTypeDefinitionNode, - ObjectTypeDefinitionNode, - FieldDefinitionNode, - InputValueDefinitionNode, - InterfaceTypeDefinitionNode, - UnionTypeDefinitionNode, - EnumTypeDefinitionNode, - EnumValueDefinitionNode, - InputObjectTypeDefinitionNode, - ScalarTypeExtensionNode, - ObjectTypeExtensionNode, - InterfaceTypeExtensionNode, - UnionTypeExtensionNode, - EnumTypeExtensionNode, - InputObjectTypeExtensionNode, - OperationDefinitionNode, - FieldNode, - FragmentDefinitionNode, - ValueNode, -} from '../language/ast'; - -import { valueFromASTUntyped } from '../utilities/valueFromASTUntyped'; - -import type { GraphQLSchema } from './schema'; - -// 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 { - if (!isType(type)) { - throw new Error(`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 { - if (!isScalarType(type)) { - throw new Error(`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 { - if (!isObjectType(type)) { - throw new Error(`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 { - if (!isInterfaceType(type)) { - throw new Error( - `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 { - if (!isUnionType(type)) { - throw new Error(`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 { - if (!isEnumType(type)) { - throw new Error(`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 { - if (!isInputObjectType(type)) { - throw new Error( - `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 { - if (!isListType(type)) { - throw new Error(`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 { - if (!isNonNullType(type)) { - throw new Error(`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 { - if (!isInputType(type)) { - throw new Error(`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 { - if (!isOutputType(type)) { - throw new Error(`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 { - if (!isLeafType(type)) { - throw new Error(`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 { - if (!isCompositeType(type)) { - throw new Error( - `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 { - if (!isAbstractType(type)) { - throw new Error(`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: new GraphQLList(PersonType) }, - * children: { type: new GraphQLList(PersonType) }, - * }) - * }) - * - */ -// FIXME: workaround to fix issue with Babel parser -/* :: -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; -} -*/ - -export function GraphQLList(ofType) { - // istanbul ignore else (to be removed in v16.0.0) - 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) + ']'; -}; - -(GraphQLList.prototype: any).toJSON = function toJSON() { - return this.toString(); -}; - -Object.defineProperty(GraphQLList.prototype, SYMBOL_TO_STRING_TAG, { - get() { - return 'GraphQLList'; - }, -}); - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(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: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * - * Note: the enforcement of non-nullability occurs within the executor. - */ -// FIXME: workaround to fix issue with Babel parser -/* :: -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; -} -*/ - -export function GraphQLNonNull(ofType) { - // istanbul ignore else (to be removed in v16.0.0) - 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) + '!'; -}; - -(GraphQLNonNull.prototype: any).toJSON = function toJSON() { - return this.toString(); -}; - -Object.defineProperty(GraphQLNonNull.prototype, SYMBOL_TO_STRING_TAG, { - get() { - return 'GraphQLNonNull'; - }, -}); - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(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 { - if (!isWrappingType(type)) { - throw new Error(`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 { - if (!isNullableType(type)) { - throw new Error(`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 { - if (!isNamedType(type)) { - throw new Error(`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[incompatible-use] - 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; - specifiedByUrl: ?string; - serialize: GraphQLScalarSerializer; - parseValue: GraphQLScalarValueParser; - parseLiteral: GraphQLScalarLiteralParser; - extensions: ?ReadOnlyObjMap; - astNode: ?ScalarTypeDefinitionNode; - extensionASTNodes: ?$ReadOnlyArray; - - constructor(config: $ReadOnly>) { - const parseValue = config.parseValue ?? identityFunc; - this.name = config.name; - this.description = config.description; - this.specifiedByUrl = config.specifiedByUrl; - this.serialize = config.serialize ?? identityFunc; - this.parseValue = parseValue; - this.parseLiteral = - config.parseLiteral ?? - ((node, variables) => parseValue(valueFromASTUntyped(node, variables))); - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - - devAssert(typeof config.name === 'string', 'Must provide name.'); - - devAssert( - config.specifiedByUrl == null || - typeof config.specifiedByUrl === 'string', - `${this.name} must provide "specifiedByUrl" as a string, ` + - `but got: ${inspect(config.specifiedByUrl)}.`, - ); - - devAssert( - 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) { - devAssert( - typeof config.parseValue === 'function' && - typeof config.parseLiteral === 'function', - `${this.name} must provide both "parseValue" and "parseLiteral" functions.`, - ); - } - } - - toConfig(): GraphQLScalarTypeNormalizedConfig { - return { - name: this.name, - description: this.description, - specifiedByUrl: this.specifiedByUrl, - serialize: this.serialize, - parseValue: this.parseValue, - parseLiteral: this.parseLiteral, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes ?? [], - }; - } - - toString(): string { - return this.name; - } - - toJSON(): string { - return this.toString(); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'GraphQLScalarType'; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(GraphQLScalarType); - -export type GraphQLScalarSerializer = ( - outputValue: mixed, -) => ?TExternal; - -export type GraphQLScalarValueParser = ( - inputValue: mixed, -) => ?TInternal; - -export type GraphQLScalarLiteralParser = ( - valueNode: ValueNode, - variables: ?ObjMap, -) => ?TInternal; - -export type GraphQLScalarTypeConfig = {| - name: string, - description?: ?string, - specifiedByUrl?: ?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, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?ScalarTypeDefinitionNode, - extensionASTNodes?: ?$ReadOnlyArray, -|}; - -type GraphQLScalarTypeNormalizedConfig = {| - ...GraphQLScalarTypeConfig, - serialize: GraphQLScalarSerializer, - parseValue: GraphQLScalarValueParser, - parseLiteral: GraphQLScalarLiteralParser, - extensions: ?ReadOnlyObjMap, - 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; - isTypeOf: ?GraphQLIsTypeOfFn; - extensions: ?ReadOnlyObjMap; - astNode: ?ObjectTypeDefinitionNode; - extensionASTNodes: ?$ReadOnlyArray; - - _fields: Thunk>; - _interfaces: Thunk>; - - constructor(config: $ReadOnly>) { - this.name = config.name; - this.description = config.description; - this.isTypeOf = config.isTypeOf; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - devAssert(typeof config.name === 'string', 'Must provide name.'); - devAssert( - 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(): GraphQLObjectTypeNormalizedConfig { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - isTypeOf: this.isTypeOf, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes || [], - }; - } - - toString(): string { - return this.name; - } - - toJSON(): string { - return this.toString(); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'GraphQLObjectType'; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(GraphQLObjectType); - -function defineInterfaces( - config: $ReadOnly< - | GraphQLObjectTypeConfig - | GraphQLInterfaceTypeConfig, - >, -): Array { - const interfaces = resolveThunk(config.interfaces) ?? []; - devAssert( - Array.isArray(interfaces), - `${config.name} interfaces must be an Array or a function which returns an Array.`, - ); - return interfaces; -} - -function defineFieldMap( - config: $ReadOnly< - | GraphQLObjectTypeConfig - | GraphQLInterfaceTypeConfig, - >, -): GraphQLFieldMap { - const fieldMap = resolveThunk(config.fields); - devAssert( - 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) => { - devAssert( - isPlainObj(fieldConfig), - `${config.name}.${fieldName} field config must be an object.`, - ); - devAssert( - !('isDeprecated' in fieldConfig), - `${config.name}.${fieldName} should provide "deprecationReason" instead of "isDeprecated".`, - ); - devAssert( - 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 ?? {}; - devAssert( - isPlainObj(argsConfig), - `${config.name}.${fieldName} args must be an object with argument names as keys.`, - ); - - const args = objectEntries(argsConfig).map(([argName, argConfig]) => ({ - name: argName, - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: argConfig.extensions && toObjMap(argConfig.extensions), - astNode: argConfig.astNode, - })); - - return { - name: fieldName, - description: fieldConfig.description, - type: fieldConfig.type, - args, - resolve: fieldConfig.resolve, - subscribe: fieldConfig.subscribe, - isDeprecated: fieldConfig.deprecationReason != null, - deprecationReason: fieldConfig.deprecationReason, - extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions), - astNode: fieldConfig.astNode, - }; - }); -} - -function isPlainObj(obj: mixed): boolean { - return isObjectLike(obj) && !Array.isArray(obj); -} - -function fieldsToFieldsConfig( - fields: GraphQLFieldMap, -): GraphQLFieldConfigMap { - return mapValue(fields, (field) => ({ - description: field.description, - type: field.type, - args: argsToArgsConfig(field.args), - resolve: field.resolve, - subscribe: field.subscribe, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode, - })); -} - -/** - * @internal - */ -export function argsToArgsConfig( - args: $ReadOnlyArray, -): GraphQLFieldConfigArgumentMap { - return keyValMap( - args, - (arg) => arg.name, - (arg) => ({ - description: arg.description, - type: arg.type, - defaultValue: arg.defaultValue, - deprecationReason: arg.deprecationReason, - extensions: arg.extensions, - astNode: arg.astNode, - }), - ); -} - -export type GraphQLObjectTypeConfig = {| - name: string, - description?: ?string, - interfaces?: Thunk>, - fields: Thunk>, - isTypeOf?: ?GraphQLIsTypeOfFn, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?ObjectTypeDefinitionNode, - extensionASTNodes?: ?$ReadOnlyArray, -|}; - -type GraphQLObjectTypeNormalizedConfig = {| - ...GraphQLObjectTypeConfig, - interfaces: Array, - fields: GraphQLFieldConfigMap, - extensions: ?ReadOnlyObjMap, - extensionASTNodes: $ReadOnlyArray, -|}; - -/** - * Note: returning GraphQLObjectType is deprecated and will be removed in v16.0.0 - */ -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: Path, - +schema: GraphQLSchema, - +fragments: ObjMap, - +rootValue: mixed, - +operation: OperationDefinitionNode, - +variableValues: { [variable: string]: mixed, ... }, -|}; - -export type GraphQLFieldConfig< - TSource, - TContext, - TArgs = { [argument: string]: any, ... }, -> = {| - description?: ?string, - type: GraphQLOutputType, - args?: GraphQLFieldConfigArgumentMap, - resolve?: GraphQLFieldResolver, - subscribe?: GraphQLFieldResolver, - deprecationReason?: ?string, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?FieldDefinitionNode, -|}; - -export type GraphQLFieldConfigArgumentMap = ObjMap; - -export type GraphQLArgumentConfig = {| - description?: ?string, - type: GraphQLInputType, - defaultValue?: mixed, - extensions?: ?ReadOnlyObjMapLike, - deprecationReason?: ?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, - deprecationReason: ?string, - extensions: ?ReadOnlyObjMap, - astNode: ?FieldDefinitionNode, - - // @deprecated and will be removed in v16 - isDeprecated: boolean, -|}; - -export type GraphQLArgument = {| - name: string, - description: ?string, - type: GraphQLInputType, - defaultValue: mixed, - deprecationReason: ?string, - extensions: ?ReadOnlyObjMap, - 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; - resolveType: ?GraphQLTypeResolver; - extensions: ?ReadOnlyObjMap; - astNode: ?InterfaceTypeDefinitionNode; - extensionASTNodes: ?$ReadOnlyArray; - - _fields: Thunk>; - _interfaces: Thunk>; - - constructor(config: $ReadOnly>) { - this.name = config.name; - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - devAssert(typeof config.name === 'string', 'Must provide name.'); - devAssert( - 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; - } - - getInterfaces(): Array { - if (typeof this._interfaces === 'function') { - this._interfaces = this._interfaces(); - } - return this._interfaces; - } - - toConfig(): GraphQLInterfaceTypeNormalizedConfig { - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes ?? [], - }; - } - - toString(): string { - return this.name; - } - - toJSON(): string { - return this.toString(); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'GraphQLInterfaceType'; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(GraphQLInterfaceType); - -export type GraphQLInterfaceTypeConfig = {| - name: string, - description?: ?string, - interfaces?: Thunk>, - 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, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?InterfaceTypeDefinitionNode, - extensionASTNodes?: ?$ReadOnlyArray, -|}; - -export type GraphQLInterfaceTypeNormalizedConfig = {| - ...GraphQLInterfaceTypeConfig, - interfaces: Array, - fields: GraphQLFieldConfigMap, - extensions: ?ReadOnlyObjMap, - 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; - resolveType: ?GraphQLTypeResolver; - extensions: ?ReadOnlyObjMap; - astNode: ?UnionTypeDefinitionNode; - extensionASTNodes: ?$ReadOnlyArray; - - _types: Thunk>; - - constructor(config: $ReadOnly>) { - this.name = config.name; - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - - this._types = defineTypes.bind(undefined, config); - devAssert(typeof config.name === 'string', 'Must provide name.'); - devAssert( - 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(): GraphQLUnionTypeNormalizedConfig { - return { - name: this.name, - description: this.description, - types: this.getTypes(), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes ?? [], - }; - } - - toString(): string { - return this.name; - } - - toJSON(): string { - return this.toString(); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'GraphQLUnionType'; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(GraphQLUnionType); - -function defineTypes( - config: $ReadOnly>, -): Array { - const types = resolveThunk(config.types); - devAssert( - 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, - description?: ?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, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?UnionTypeDefinitionNode, - extensionASTNodes?: ?$ReadOnlyArray, -|}; - -type GraphQLUnionTypeNormalizedConfig = {| - ...GraphQLUnionTypeConfig, - types: Array, - extensions: ?ReadOnlyObjMap, - 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; - extensions: ?ReadOnlyObjMap; - astNode: ?EnumTypeDefinitionNode; - extensionASTNodes: ?$ReadOnlyArray; - - _values: Array */>; - _valueLookup: Map; - _nameLookup: ObjMap; - - constructor(config: $ReadOnly */>) { - this.name = config.name; - this.description = config.description; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - - this._values = defineEnumValues(this.name, config.values); - this._valueLookup = new Map( - this._values.map((enumValue) => [enumValue.value, enumValue]), - ); - this._nameLookup = keyMap(this._values, (value) => value.name); - - devAssert(typeof config.name === 'string', 'Must provide name.'); - } - - getValues(): Array */> { - return this._values; - } - - getValue(name: string): ?GraphQLEnumValue { - return this._nameLookup[name]; - } - - serialize(outputValue: mixed /* T */): ?string { - const enumValue = this._valueLookup.get(outputValue); - if (enumValue === undefined) { - throw new GraphQLError( - `Enum "${this.name}" cannot represent value: ${inspect(outputValue)}`, - ); - } - return enumValue.name; - } - - parseValue(inputValue: mixed): ?any /* T */ { - if (typeof inputValue !== 'string') { - const valueStr = inspect(inputValue); - throw new GraphQLError( - `Enum "${this.name}" cannot represent non-string value: ${valueStr}.` + - didYouMeanEnumValue(this, valueStr), - ); - } - - const enumValue = this.getValue(inputValue); - if (enumValue == null) { - throw new GraphQLError( - `Value "${inputValue}" does not exist in "${this.name}" enum.` + - didYouMeanEnumValue(this, inputValue), - ); - } - 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 valueStr = print(valueNode); - throw new GraphQLError( - `Enum "${this.name}" cannot represent non-enum value: ${valueStr}.` + - didYouMeanEnumValue(this, valueStr), - valueNode, - ); - } - - const enumValue = this.getValue(valueNode.value); - if (enumValue == null) { - const valueStr = print(valueNode); - throw new GraphQLError( - `Value "${valueStr}" does not exist in "${this.name}" enum.` + - didYouMeanEnumValue(this, valueStr), - valueNode, - ); - } - return enumValue.value; - } - - toConfig(): GraphQLEnumTypeNormalizedConfig { - const values = keyValMap( - this.getValues(), - (value) => value.name, - (value) => ({ - description: value.description, - value: value.value, - deprecationReason: value.deprecationReason, - extensions: value.extensions, - astNode: value.astNode, - }), - ); - - return { - name: this.name, - description: this.description, - values, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes ?? [], - }; - } - - toString(): string { - return this.name; - } - - toJSON(): string { - return this.toString(); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'GraphQLEnumType'; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(GraphQLEnumType); - -function didYouMeanEnumValue( - enumType: GraphQLEnumType, - unknownValueStr: string, -): string { - const allNames = enumType.getValues().map((value) => value.name); - const suggestedValues = suggestionList(unknownValueStr, allNames); - - return didYouMean('the enum value', suggestedValues); -} - -function defineEnumValues( - typeName: string, - valueMap: GraphQLEnumValueConfigMap /* */, -): Array */> { - devAssert( - isPlainObj(valueMap), - `${typeName} values must be an object with value names as keys.`, - ); - return objectEntries(valueMap).map(([valueName, valueConfig]) => { - devAssert( - isPlainObj(valueConfig), - `${typeName}.${valueName} must refer to an object with a "value" key ` + - `representing an internal value but got: ${inspect(valueConfig)}.`, - ); - devAssert( - !('isDeprecated' in valueConfig), - `${typeName}.${valueName} should provide "deprecationReason" instead of "isDeprecated".`, - ); - return { - name: valueName, - description: valueConfig.description, - value: valueConfig.value !== undefined ? valueConfig.value : valueName, - isDeprecated: valueConfig.deprecationReason != null, - deprecationReason: valueConfig.deprecationReason, - extensions: valueConfig.extensions && toObjMap(valueConfig.extensions), - astNode: valueConfig.astNode, - }; - }); -} - -export type GraphQLEnumTypeConfig /* */ = {| - name: string, - description?: ?string, - values: GraphQLEnumValueConfigMap /* */, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?EnumTypeDefinitionNode, - extensionASTNodes?: ?$ReadOnlyArray, -|}; - -type GraphQLEnumTypeNormalizedConfig = {| - ...GraphQLEnumTypeConfig, - extensions: ?ReadOnlyObjMap, - extensionASTNodes: $ReadOnlyArray, -|}; - -export type GraphQLEnumValueConfigMap /* */ = ObjMap */>; - -export type GraphQLEnumValueConfig /* */ = {| - description?: ?string, - value?: any /* T */, - deprecationReason?: ?string, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?EnumValueDefinitionNode, -|}; - -export type GraphQLEnumValue /* */ = {| - name: string, - description: ?string, - value: any /* T */, - deprecationReason: ?string, - extensions: ?ReadOnlyObjMap, - astNode: ?EnumValueDefinitionNode, - - // @deprecated and will be removed in v16 - isDeprecated: boolean, -|}; - -/** - * 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: new GraphQLNonNull(GraphQLFloat) }, - * lon: { type: new GraphQLNonNull(GraphQLFloat) }, - * alt: { type: GraphQLFloat, defaultValue: 0 }, - * } - * }); - * - */ -export class GraphQLInputObjectType { - name: string; - description: ?string; - extensions: ?ReadOnlyObjMap; - astNode: ?InputObjectTypeDefinitionNode; - extensionASTNodes: ?$ReadOnlyArray; - - _fields: Thunk; - - constructor(config: $ReadOnly) { - this.name = config.name; - this.description = config.description; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - - this._fields = defineInputFieldMap.bind(undefined, config); - devAssert(typeof config.name === 'string', 'Must provide name.'); - } - - getFields(): GraphQLInputFieldMap { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - return this._fields; - } - - toConfig(): GraphQLInputObjectTypeNormalizedConfig { - const fields = mapValue(this.getFields(), (field) => ({ - description: field.description, - type: field.type, - defaultValue: field.defaultValue, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode, - })); - - return { - name: this.name, - description: this.description, - fields, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes ?? [], - }; - } - - toString(): string { - return this.name; - } - - toJSON(): string { - return this.toString(); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'GraphQLInputObjectType'; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(GraphQLInputObjectType); - -function defineInputFieldMap( - config: $ReadOnly, -): GraphQLInputFieldMap { - const fieldMap = resolveThunk(config.fields); - devAssert( - 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) => { - devAssert( - !('resolve' in fieldConfig), - `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`, - ); - - return { - name: fieldName, - description: fieldConfig.description, - type: fieldConfig.type, - defaultValue: fieldConfig.defaultValue, - deprecationReason: fieldConfig.deprecationReason, - extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions), - astNode: fieldConfig.astNode, - }; - }); -} - -export type GraphQLInputObjectTypeConfig = {| - name: string, - description?: ?string, - fields: Thunk, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?InputObjectTypeDefinitionNode, - extensionASTNodes?: ?$ReadOnlyArray, -|}; - -type GraphQLInputObjectTypeNormalizedConfig = {| - ...GraphQLInputObjectTypeConfig, - fields: GraphQLInputFieldConfigMap, - extensions: ?ReadOnlyObjMap, - extensionASTNodes: $ReadOnlyArray, -|}; - -export type GraphQLInputFieldConfig = {| - description?: ?string, - type: GraphQLInputType, - defaultValue?: mixed, - deprecationReason?: ?string, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?InputValueDefinitionNode, -|}; - -export type GraphQLInputFieldConfigMap = ObjMap; - -export type GraphQLInputField = {| - name: string, - description: ?string, - type: GraphQLInputType, - defaultValue: mixed, - deprecationReason: ?string, - extensions: ?ReadOnlyObjMap, - astNode: ?InputValueDefinitionNode, -|}; - -export function isRequiredInputField( - field: GraphQLInputField, -): boolean %checks { - return isNonNullType(field.type) && field.defaultValue === undefined; -} - -export type GraphQLInputFieldMap = ObjMap; diff --git a/JS/node_modules/graphql/type/definition.mjs b/JS/node_modules/graphql/type/definition.mjs deleted file mode 100644 index 70c27be..0000000 --- a/JS/node_modules/graphql/type/definition.mjs +++ /dev/null @@ -1,1107 +0,0 @@ -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -import objectEntries from "../polyfills/objectEntries.mjs"; -import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import keyMap from "../jsutils/keyMap.mjs"; -import mapValue from "../jsutils/mapValue.mjs"; -import toObjMap from "../jsutils/toObjMap.mjs"; -import devAssert from "../jsutils/devAssert.mjs"; -import keyValMap from "../jsutils/keyValMap.mjs"; -import instanceOf from "../jsutils/instanceOf.mjs"; -import didYouMean from "../jsutils/didYouMean.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import identityFunc from "../jsutils/identityFunc.mjs"; -import defineInspect from "../jsutils/defineInspect.mjs"; -import suggestionList from "../jsutils/suggestionList.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { print } from "../language/printer.mjs"; -import { valueFromASTUntyped } from "../utilities/valueFromASTUntyped.mjs"; -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) { - if (!isType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL type.")); - } - - 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) { - if (!isScalarType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL Scalar type.")); - } - - return type; -} -// eslint-disable-next-line no-redeclare -export function isObjectType(type) { - return instanceOf(type, GraphQLObjectType); -} -export function assertObjectType(type) { - if (!isObjectType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL Object type.")); - } - - return type; -} -// eslint-disable-next-line no-redeclare -export function isInterfaceType(type) { - return instanceOf(type, GraphQLInterfaceType); -} -export function assertInterfaceType(type) { - if (!isInterfaceType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL Interface type.")); - } - - return type; -} -// eslint-disable-next-line no-redeclare -export function isUnionType(type) { - return instanceOf(type, GraphQLUnionType); -} -export function assertUnionType(type) { - if (!isUnionType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL Union type.")); - } - - return type; -} -// eslint-disable-next-line no-redeclare -export function isEnumType(type) { - return instanceOf(type, GraphQLEnumType); -} -export function assertEnumType(type) { - if (!isEnumType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL Enum type.")); - } - - return type; -} -// eslint-disable-next-line no-redeclare -export function isInputObjectType(type) { - return instanceOf(type, GraphQLInputObjectType); -} -export function assertInputObjectType(type) { - if (!isInputObjectType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL Input Object type.")); - } - - return type; -} -// eslint-disable-next-line no-redeclare -export function isListType(type) { - return instanceOf(type, GraphQLList); -} -export function assertListType(type) { - if (!isListType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL List type.")); - } - - return type; -} -// eslint-disable-next-line no-redeclare -export function isNonNullType(type) { - return instanceOf(type, GraphQLNonNull); -} -export function assertNonNullType(type) { - if (!isNonNullType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL Non-Null type.")); - } - - 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) { - if (!isInputType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL input type.")); - } - - 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) { - if (!isOutputType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL output type.")); - } - - 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) { - if (!isLeafType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL leaf type.")); - } - - 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) { - if (!isCompositeType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL composite type.")); - } - - 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) { - if (!isAbstractType(type)) { - throw new Error("Expected ".concat(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: new GraphQLList(PersonType) }, - * children: { type: new GraphQLList(PersonType) }, - * }) - * }) - * - */ -// FIXME: workaround to fix issue with Babel parser - -/* :: -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; -} -*/ - -export function GraphQLList(ofType) { - // istanbul ignore else (to be removed in v16.0.0) - 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) + ']'; -}; - -GraphQLList.prototype.toJSON = function toJSON() { - return this.toString(); -}; - -Object.defineProperty(GraphQLList.prototype, SYMBOL_TO_STRING_TAG, { - get: function get() { - return 'GraphQLList'; - } -}); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(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: new GraphQLNonNull(GraphQLString) }, - * }) - * }) - * - * Note: the enforcement of non-nullability occurs within the executor. - */ -// FIXME: workaround to fix issue with Babel parser - -/* :: -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; -} -*/ - -export function GraphQLNonNull(ofType) { - // istanbul ignore else (to be removed in v16.0.0) - 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) + '!'; -}; - -GraphQLNonNull.prototype.toJSON = function toJSON() { - return this.toString(); -}; - -Object.defineProperty(GraphQLNonNull.prototype, SYMBOL_TO_STRING_TAG, { - get: function get() { - return 'GraphQLNonNull'; - } -}); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(GraphQLNonNull); -/** - * These types wrap and modify other types - */ - -export function isWrappingType(type) { - return isListType(type) || isNonNullType(type); -} -export function assertWrappingType(type) { - if (!isWrappingType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL wrapping type.")); - } - - return type; -} -/** - * These types can all accept null as a value. - */ - -export function isNullableType(type) { - return isType(type) && !isNonNullType(type); -} -export function assertNullableType(type) { - if (!isNullableType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL nullable type.")); - } - - 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) { - if (!isNamedType(type)) { - throw new Error("Expected ".concat(inspect(type), " to be a GraphQL named type.")); - } - - 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[incompatible-use] - 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 _config$parseValue, _config$serialize, _config$parseLiteral; - - var parseValue = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : identityFunc; - this.name = config.name; - this.description = config.description; - this.specifiedByUrl = config.specifiedByUrl; - this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : identityFunc; - this.parseValue = parseValue; - this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : function (node, variables) { - return parseValue(valueFromASTUntyped(node, variables)); - }; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - typeof config.name === 'string' || devAssert(0, 'Must provide name.'); - config.specifiedByUrl == null || typeof config.specifiedByUrl === 'string' || devAssert(0, "".concat(this.name, " must provide \"specifiedByUrl\" as a string, ") + "but got: ".concat(inspect(config.specifiedByUrl), ".")); - config.serialize == null || typeof config.serialize === 'function' || devAssert(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.")); - - if (config.parseLiteral) { - typeof config.parseValue === 'function' && typeof config.parseLiteral === 'function' || devAssert(0, "".concat(this.name, " must provide both \"parseValue\" and \"parseLiteral\" functions.")); - } - } - - var _proto = GraphQLScalarType.prototype; - - _proto.toConfig = function toConfig() { - var _this$extensionASTNod; - - return { - name: this.name, - description: this.description, - specifiedByUrl: this.specifiedByUrl, - serialize: this.serialize, - parseValue: this.parseValue, - parseLiteral: this.parseLiteral, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : [] - }; - }; - - _proto.toString = function toString() { - return this.name; - }; - - _proto.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLScalarType, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLScalarType'; - } - }]); - - return GraphQLScalarType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(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.isTypeOf = config.isTypeOf; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - typeof config.name === 'string' || devAssert(0, 'Must provide name.'); - config.isTypeOf == null || typeof config.isTypeOf === 'function' || devAssert(0, "".concat(this.name, " must provide \"isTypeOf\" as a function, ") + "but got: ".concat(inspect(config.isTypeOf), ".")); - } - - 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, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - isTypeOf: this.isTypeOf, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes || [] - }; - }; - - _proto2.toString = function toString() { - return this.name; - }; - - _proto2.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLObjectType, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLObjectType'; - } - }]); - - return GraphQLObjectType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(GraphQLObjectType); - -function defineInterfaces(config) { - var _resolveThunk; - - var interfaces = (_resolveThunk = resolveThunk(config.interfaces)) !== null && _resolveThunk !== void 0 ? _resolveThunk : []; - Array.isArray(interfaces) || devAssert(0, "".concat(config.name, " interfaces must be an Array or a function which returns an Array.")); - return interfaces; -} - -function defineFieldMap(config) { - var fieldMap = resolveThunk(config.fields); - isPlainObj(fieldMap) || devAssert(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")); - return mapValue(fieldMap, function (fieldConfig, fieldName) { - var _fieldConfig$args; - - isPlainObj(fieldConfig) || devAssert(0, "".concat(config.name, ".").concat(fieldName, " field config must be an object.")); - !('isDeprecated' in fieldConfig) || devAssert(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")); - fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function' || devAssert(0, "".concat(config.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat(inspect(fieldConfig.resolve), ".")); - var argsConfig = (_fieldConfig$args = fieldConfig.args) !== null && _fieldConfig$args !== void 0 ? _fieldConfig$args : {}; - isPlainObj(argsConfig) || devAssert(0, "".concat(config.name, ".").concat(fieldName, " args must be an object with argument names as keys.")); - var args = objectEntries(argsConfig).map(function (_ref) { - var argName = _ref[0], - argConfig = _ref[1]; - return { - name: argName, - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: argConfig.extensions && toObjMap(argConfig.extensions), - astNode: argConfig.astNode - }; - }); - return { - name: fieldName, - description: fieldConfig.description, - type: fieldConfig.type, - args: args, - resolve: fieldConfig.resolve, - subscribe: fieldConfig.subscribe, - isDeprecated: fieldConfig.deprecationReason != null, - deprecationReason: fieldConfig.deprecationReason, - extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); -} - -function isPlainObj(obj) { - return isObjectLike(obj) && !Array.isArray(obj); -} - -function fieldsToFieldsConfig(fields) { - return mapValue(fields, function (field) { - return { - description: field.description, - type: field.type, - args: argsToArgsConfig(field.args), - resolve: field.resolve, - subscribe: field.subscribe, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - }; - }); -} -/** - * @internal - */ - - -export function argsToArgsConfig(args) { - return keyValMap(args, function (arg) { - return arg.name; - }, function (arg) { - return { - description: arg.description, - type: arg.type, - defaultValue: arg.defaultValue, - deprecationReason: arg.deprecationReason, - extensions: arg.extensions, - 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.resolveType = config.resolveType; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._fields = defineFieldMap.bind(undefined, config); - this._interfaces = defineInterfaces.bind(undefined, config); - typeof config.name === 'string' || devAssert(0, 'Must provide name.'); - config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat(inspect(config.resolveType), ".")); - } - - var _proto3 = GraphQLInterfaceType.prototype; - - _proto3.getFields = function getFields() { - if (typeof this._fields === 'function') { - this._fields = this._fields(); - } - - return this._fields; - }; - - _proto3.getInterfaces = function getInterfaces() { - if (typeof this._interfaces === 'function') { - this._interfaces = this._interfaces(); - } - - return this._interfaces; - }; - - _proto3.toConfig = function toConfig() { - var _this$extensionASTNod2; - - return { - name: this.name, - description: this.description, - interfaces: this.getInterfaces(), - fields: fieldsToFieldsConfig(this.getFields()), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod2 = this.extensionASTNodes) !== null && _this$extensionASTNod2 !== void 0 ? _this$extensionASTNod2 : [] - }; - }; - - _proto3.toString = function toString() { - return this.name; - }; - - _proto3.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLInterfaceType, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLInterfaceType'; - } - }]); - - return GraphQLInterfaceType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(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.resolveType = config.resolveType; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._types = defineTypes.bind(undefined, config); - typeof config.name === 'string' || devAssert(0, 'Must provide name.'); - config.resolveType == null || typeof config.resolveType === 'function' || devAssert(0, "".concat(this.name, " must provide \"resolveType\" as a function, ") + "but got: ".concat(inspect(config.resolveType), ".")); - } - - var _proto4 = GraphQLUnionType.prototype; - - _proto4.getTypes = function getTypes() { - if (typeof this._types === 'function') { - this._types = this._types(); - } - - return this._types; - }; - - _proto4.toConfig = function toConfig() { - var _this$extensionASTNod3; - - return { - name: this.name, - description: this.description, - types: this.getTypes(), - resolveType: this.resolveType, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod3 = this.extensionASTNodes) !== null && _this$extensionASTNod3 !== void 0 ? _this$extensionASTNod3 : [] - }; - }; - - _proto4.toString = function toString() { - return this.name; - }; - - _proto4.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLUnionType, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLUnionType'; - } - }]); - - return GraphQLUnionType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(GraphQLUnionType); - -function defineTypes(config) { - var types = resolveThunk(config.types); - Array.isArray(types) || devAssert(0, "Must provide Array of types or a function which returns such an array for Union ".concat(config.name, ".")); - 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.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._values = defineEnumValues(this.name, 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' || devAssert(0, 'Must provide name.'); - } - - var _proto5 = GraphQLEnumType.prototype; - - _proto5.getValues = function getValues() { - return this._values; - }; - - _proto5.getValue = function getValue(name) { - return this._nameLookup[name]; - }; - - _proto5.serialize = function serialize(outputValue) { - var enumValue = this._valueLookup.get(outputValue); - - if (enumValue === undefined) { - throw new GraphQLError("Enum \"".concat(this.name, "\" cannot represent value: ").concat(inspect(outputValue))); - } - - return enumValue.name; - }; - - _proto5.parseValue = function parseValue(inputValue) - /* T */ - { - if (typeof inputValue !== 'string') { - var valueStr = inspect(inputValue); - throw new GraphQLError("Enum \"".concat(this.name, "\" cannot represent non-string value: ").concat(valueStr, ".") + didYouMeanEnumValue(this, valueStr)); - } - - var enumValue = this.getValue(inputValue); - - if (enumValue == null) { - throw new GraphQLError("Value \"".concat(inputValue, "\" does not exist in \"").concat(this.name, "\" enum.") + didYouMeanEnumValue(this, inputValue)); - } - - 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 valueStr = print(valueNode); - throw new GraphQLError("Enum \"".concat(this.name, "\" cannot represent non-enum value: ").concat(valueStr, ".") + didYouMeanEnumValue(this, valueStr), valueNode); - } - - var enumValue = this.getValue(valueNode.value); - - if (enumValue == null) { - var _valueStr = print(valueNode); - - throw new GraphQLError("Value \"".concat(_valueStr, "\" does not exist in \"").concat(this.name, "\" enum.") + didYouMeanEnumValue(this, _valueStr), valueNode); - } - - return enumValue.value; - }; - - _proto5.toConfig = function toConfig() { - var _this$extensionASTNod4; - - var values = keyValMap(this.getValues(), function (value) { - return value.name; - }, function (value) { - return { - description: value.description, - value: value.value, - deprecationReason: value.deprecationReason, - extensions: value.extensions, - astNode: value.astNode - }; - }); - return { - name: this.name, - description: this.description, - values: values, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod4 = this.extensionASTNodes) !== null && _this$extensionASTNod4 !== void 0 ? _this$extensionASTNod4 : [] - }; - }; - - _proto5.toString = function toString() { - return this.name; - }; - - _proto5.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLEnumType, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLEnumType'; - } - }]); - - return GraphQLEnumType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(GraphQLEnumType); - -function didYouMeanEnumValue(enumType, unknownValueStr) { - var allNames = enumType.getValues().map(function (value) { - return value.name; - }); - var suggestedValues = suggestionList(unknownValueStr, allNames); - return didYouMean('the enum value', suggestedValues); -} - -function defineEnumValues(typeName, valueMap) { - isPlainObj(valueMap) || devAssert(0, "".concat(typeName, " values must be an object with value names as keys.")); - return objectEntries(valueMap).map(function (_ref2) { - var valueName = _ref2[0], - valueConfig = _ref2[1]; - isPlainObj(valueConfig) || devAssert(0, "".concat(typeName, ".").concat(valueName, " must refer to an object with a \"value\" key ") + "representing an internal value but got: ".concat(inspect(valueConfig), ".")); - !('isDeprecated' in valueConfig) || devAssert(0, "".concat(typeName, ".").concat(valueName, " should provide \"deprecationReason\" instead of \"isDeprecated\".")); - return { - name: valueName, - description: valueConfig.description, - value: valueConfig.value !== undefined ? valueConfig.value : valueName, - isDeprecated: valueConfig.deprecationReason != null, - deprecationReason: valueConfig.deprecationReason, - extensions: valueConfig.extensions && toObjMap(valueConfig.extensions), - astNode: valueConfig.astNode - }; - }); -} - -/** - * 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: new GraphQLNonNull(GraphQLFloat) }, - * lon: { type: new GraphQLNonNull(GraphQLFloat) }, - * alt: { type: GraphQLFloat, defaultValue: 0 }, - * } - * }); - * - */ -export var GraphQLInputObjectType = /*#__PURE__*/function () { - function GraphQLInputObjectType(config) { - this.name = config.name; - this.description = config.description; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = undefineIfEmpty(config.extensionASTNodes); - this._fields = defineInputFieldMap.bind(undefined, config); - typeof config.name === 'string' || devAssert(0, 'Must provide name.'); - } - - 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 _this$extensionASTNod5; - - var fields = mapValue(this.getFields(), function (field) { - return { - description: field.description, - type: field.type, - defaultValue: field.defaultValue, - deprecationReason: field.deprecationReason, - extensions: field.extensions, - astNode: field.astNode - }; - }); - return { - name: this.name, - description: this.description, - fields: fields, - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod5 = this.extensionASTNodes) !== null && _this$extensionASTNod5 !== void 0 ? _this$extensionASTNod5 : [] - }; - }; - - _proto6.toString = function toString() { - return this.name; - }; - - _proto6.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLInputObjectType, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLInputObjectType'; - } - }]); - - return GraphQLInputObjectType; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(GraphQLInputObjectType); - -function defineInputFieldMap(config) { - var fieldMap = resolveThunk(config.fields); - isPlainObj(fieldMap) || devAssert(0, "".concat(config.name, " fields must be an object with field names as keys or a function which returns such an object.")); - return mapValue(fieldMap, function (fieldConfig, fieldName) { - !('resolve' in fieldConfig) || devAssert(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but Input Types cannot define resolvers.")); - return { - name: fieldName, - description: fieldConfig.description, - type: fieldConfig.type, - defaultValue: fieldConfig.defaultValue, - deprecationReason: fieldConfig.deprecationReason, - extensions: fieldConfig.extensions && toObjMap(fieldConfig.extensions), - astNode: fieldConfig.astNode - }; - }); -} - -export function isRequiredInputField(field) { - return isNonNullType(field.type) && field.defaultValue === undefined; -} diff --git a/JS/node_modules/graphql/type/directives.d.ts b/JS/node_modules/graphql/type/directives.d.ts deleted file mode 100644 index 2c6de77..0000000 --- a/JS/node_modules/graphql/type/directives.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -// FIXME -/* eslint-disable import/no-cycle */ - -import { Maybe } from '../jsutils/Maybe'; - -import { DirectiveDefinitionNode } from '../language/ast'; -import { DirectiveLocationEnum } from '../language/directiveLocation'; - -import { GraphQLFieldConfigArgumentMap, GraphQLArgument } from './definition'; - -/** - * Test if the given value is a GraphQL directive. - */ -export function isDirective(directive: any): directive is GraphQLDirective; -export function assertDirective(directive: any): GraphQLDirective; - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLDirectiveExtensions { - [attributeName: string]: any; -} - -/** - * 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: Maybe; - locations: Array; - isRepeatable: boolean; - args: Array; - extensions: Maybe>; - astNode: Maybe; - - constructor(config: Readonly); - - toConfig(): GraphQLDirectiveConfig & { - args: GraphQLFieldConfigArgumentMap; - isRepeatable: boolean; - extensions: Maybe>; - }; - - toString(): string; - toJSON(): string; - inspect(): string; -} - -export interface GraphQLDirectiveConfig { - name: string; - description?: Maybe; - locations: Array; - args?: Maybe; - isRepeatable?: Maybe; - extensions?: Maybe>; - astNode?: Maybe; -} - -/** - * Used to conditionally include fields or fragments. - */ -export const GraphQLIncludeDirective: GraphQLDirective; - -/** - * Used to conditionally skip (exclude) fields or fragments. - */ -export const GraphQLSkipDirective: GraphQLDirective; - -/** - * Used to provide a URL for specifying the behavior of custom scalar definitions. - */ -export const GraphQLSpecifiedByDirective: GraphQLDirective; - -/** - * 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: GraphQLDirective; - -/** - * The full list of specified directives. - */ -export const specifiedDirectives: ReadonlyArray; - -export function isSpecifiedDirective(directive: GraphQLDirective): boolean; diff --git a/JS/node_modules/graphql/type/directives.js b/JS/node_modules/graphql/type/directives.js deleted file mode 100644 index 58ee0ab..0000000 --- a/JS/node_modules/graphql/type/directives.js +++ /dev/null @@ -1,205 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isDirective = isDirective; -exports.assertDirective = assertDirective; -exports.isSpecifiedDirective = isSpecifiedDirective; -exports.specifiedDirectives = exports.GraphQLSpecifiedByDirective = exports.GraphQLDeprecatedDirective = exports.DEFAULT_DEPRECATION_REASON = exports.GraphQLSkipDirective = exports.GraphQLIncludeDirective = exports.GraphQLDirective = void 0; - -var _objectEntries = _interopRequireDefault(require("../polyfills/objectEntries.js")); - -var _symbols = require("../polyfills/symbols.js"); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _toObjMap = _interopRequireDefault(require("../jsutils/toObjMap.js")); - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _instanceOf = _interopRequireDefault(require("../jsutils/instanceOf.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _defineInspect = _interopRequireDefault(require("../jsutils/defineInspect.js")); - -var _directiveLocation = require("../language/directiveLocation.js"); - -var _scalars = require("./scalars.js"); - -var _definition = require("./definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -// eslint-disable-next-line no-redeclare -function isDirective(directive) { - return (0, _instanceOf.default)(directive, GraphQLDirective); -} - -function assertDirective(directive) { - if (!isDirective(directive)) { - throw new Error("Expected ".concat((0, _inspect.default)(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. - */ - - -var GraphQLDirective = /*#__PURE__*/function () { - function GraphQLDirective(config) { - var _config$isRepeatable, _config$args; - - this.name = config.name; - this.description = config.description; - this.locations = config.locations; - this.isRepeatable = (_config$isRepeatable = config.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false; - this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - config.name || (0, _devAssert.default)(0, 'Directive must be named.'); - Array.isArray(config.locations) || (0, _devAssert.default)(0, "@".concat(config.name, " locations must be an Array.")); - var args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {}; - (0, _isObjectLike.default)(args) && !Array.isArray(args) || (0, _devAssert.default)(0, "@".concat(config.name, " args must be an object with argument names as keys.")); - this.args = (0, _objectEntries.default)(args).map(function (_ref) { - var argName = _ref[0], - argConfig = _ref[1]; - return { - name: argName, - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: argConfig.extensions && (0, _toObjMap.default)(argConfig.extensions), - astNode: argConfig.astNode - }; - }); - } - - var _proto = GraphQLDirective.prototype; - - _proto.toConfig = function toConfig() { - return { - name: this.name, - description: this.description, - locations: this.locations, - args: (0, _definition.argsToArgsConfig)(this.args), - isRepeatable: this.isRepeatable, - extensions: this.extensions, - astNode: this.astNode - }; - }; - - _proto.toString = function toString() { - return '@' + this.name; - }; - - _proto.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLDirective, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLDirective'; - } - }]); - - return GraphQLDirective; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - - -exports.GraphQLDirective = GraphQLDirective; -(0, _defineInspect.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: new _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: new _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.ARGUMENT_DEFINITION, _directiveLocation.DirectiveLocation.INPUT_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 - } - } -}); -/** - * Used to provide a URL for specifying the behaviour of custom scalar definitions. - */ - -exports.GraphQLDeprecatedDirective = GraphQLDeprecatedDirective; -var GraphQLSpecifiedByDirective = new GraphQLDirective({ - name: 'specifiedBy', - description: 'Exposes a URL that specifies the behaviour of this scalar.', - locations: [_directiveLocation.DirectiveLocation.SCALAR], - args: { - url: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - description: 'The URL that specifies the behaviour of this scalar.' - } - } -}); -/** - * The full list of specified directives. - */ - -exports.GraphQLSpecifiedByDirective = GraphQLSpecifiedByDirective; -var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective]); -exports.specifiedDirectives = specifiedDirectives; - -function isSpecifiedDirective(directive) { - return specifiedDirectives.some(function (_ref2) { - var name = _ref2.name; - return name === directive.name; - }); -} diff --git a/JS/node_modules/graphql/type/directives.js.flow b/JS/node_modules/graphql/type/directives.js.flow deleted file mode 100644 index 5eed2b9..0000000 --- a/JS/node_modules/graphql/type/directives.js.flow +++ /dev/null @@ -1,230 +0,0 @@ -// @flow strict -import objectEntries from '../polyfills/objectEntries'; -import { SYMBOL_TO_STRING_TAG } from '../polyfills/symbols'; - -import type { ReadOnlyObjMap, ReadOnlyObjMapLike } from '../jsutils/ObjMap'; -import inspect from '../jsutils/inspect'; -import toObjMap from '../jsutils/toObjMap'; -import devAssert from '../jsutils/devAssert'; -import instanceOf from '../jsutils/instanceOf'; -import isObjectLike from '../jsutils/isObjectLike'; -import defineInspect from '../jsutils/defineInspect'; - -import type { DirectiveDefinitionNode } from '../language/ast'; -import type { DirectiveLocationEnum } from '../language/directiveLocation'; -import { DirectiveLocation } from '../language/directiveLocation'; - -import type { - GraphQLArgument, - GraphQLFieldConfigArgumentMap, -} from './definition'; -import { GraphQLString, GraphQLBoolean } from './scalars'; -import { argsToArgsConfig, GraphQLNonNull } from './definition'; - -/** - * 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 { - if (!isDirective(directive)) { - throw new Error( - `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; - args: Array; - isRepeatable: boolean; - extensions: ?ReadOnlyObjMap; - astNode: ?DirectiveDefinitionNode; - - constructor(config: $ReadOnly) { - this.name = config.name; - this.description = config.description; - this.locations = config.locations; - this.isRepeatable = config.isRepeatable ?? false; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - - devAssert(config.name, 'Directive must be named.'); - devAssert( - Array.isArray(config.locations), - `@${config.name} locations must be an Array.`, - ); - - const args = config.args ?? {}; - devAssert( - isObjectLike(args) && !Array.isArray(args), - `@${config.name} args must be an object with argument names as keys.`, - ); - - this.args = objectEntries(args).map(([argName, argConfig]) => ({ - name: argName, - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: argConfig.extensions && toObjMap(argConfig.extensions), - astNode: argConfig.astNode, - })); - } - - toConfig(): GraphQLDirectiveNormalizedConfig { - return { - name: this.name, - description: this.description, - locations: this.locations, - args: argsToArgsConfig(this.args), - isRepeatable: this.isRepeatable, - extensions: this.extensions, - astNode: this.astNode, - }; - } - - toString(): string { - return '@' + this.name; - } - - toJSON(): string { - return this.toString(); - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return 'GraphQLDirective'; - } -} - -// Print a simplified form when appearing in `inspect` and `util.inspect`. -defineInspect(GraphQLDirective); - -export type GraphQLDirectiveConfig = {| - name: string, - description?: ?string, - locations: Array, - args?: ?GraphQLFieldConfigArgumentMap, - isRepeatable?: ?boolean, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?DirectiveDefinitionNode, -|}; - -type GraphQLDirectiveNormalizedConfig = {| - ...GraphQLDirectiveConfig, - args: GraphQLFieldConfigArgumentMap, - isRepeatable: boolean, - extensions: ?ReadOnlyObjMap, -|}; - -/** - * 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: new 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: new 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.ARGUMENT_DEFINITION, - DirectiveLocation.INPUT_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, - }, - }, -}); - -/** - * Used to provide a URL for specifying the behaviour of custom scalar definitions. - */ -export const GraphQLSpecifiedByDirective = new GraphQLDirective({ - name: 'specifiedBy', - description: 'Exposes a URL that specifies the behaviour of this scalar.', - locations: [DirectiveLocation.SCALAR], - args: { - url: { - type: new GraphQLNonNull(GraphQLString), - description: 'The URL that specifies the behaviour of this scalar.', - }, - }, -}); - -/** - * The full list of specified directives. - */ -export const specifiedDirectives = Object.freeze([ - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - GraphQLSpecifiedByDirective, -]); - -export function isSpecifiedDirective( - directive: GraphQLDirective, -): boolean %checks { - return specifiedDirectives.some(({ name }) => name === directive.name); -} diff --git a/JS/node_modules/graphql/type/directives.mjs b/JS/node_modules/graphql/type/directives.mjs deleted file mode 100644 index 6b17658..0000000 --- a/JS/node_modules/graphql/type/directives.mjs +++ /dev/null @@ -1,175 +0,0 @@ -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -import objectEntries from "../polyfills/objectEntries.mjs"; -import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import toObjMap from "../jsutils/toObjMap.mjs"; -import devAssert from "../jsutils/devAssert.mjs"; -import instanceOf from "../jsutils/instanceOf.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import defineInspect from "../jsutils/defineInspect.mjs"; -import { DirectiveLocation } from "../language/directiveLocation.mjs"; -import { GraphQLString, GraphQLBoolean } from "./scalars.mjs"; -import { argsToArgsConfig, GraphQLNonNull } from "./definition.mjs"; -/** - * 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) { - if (!isDirective(directive)) { - throw new Error("Expected ".concat(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 var GraphQLDirective = /*#__PURE__*/function () { - function GraphQLDirective(config) { - var _config$isRepeatable, _config$args; - - this.name = config.name; - this.description = config.description; - this.locations = config.locations; - this.isRepeatable = (_config$isRepeatable = config.isRepeatable) !== null && _config$isRepeatable !== void 0 ? _config$isRepeatable : false; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - config.name || devAssert(0, 'Directive must be named.'); - Array.isArray(config.locations) || devAssert(0, "@".concat(config.name, " locations must be an Array.")); - var args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {}; - isObjectLike(args) && !Array.isArray(args) || devAssert(0, "@".concat(config.name, " args must be an object with argument names as keys.")); - this.args = objectEntries(args).map(function (_ref) { - var argName = _ref[0], - argConfig = _ref[1]; - return { - name: argName, - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: argConfig.extensions && toObjMap(argConfig.extensions), - astNode: argConfig.astNode - }; - }); - } - - var _proto = GraphQLDirective.prototype; - - _proto.toConfig = function toConfig() { - return { - name: this.name, - description: this.description, - locations: this.locations, - args: argsToArgsConfig(this.args), - isRepeatable: this.isRepeatable, - extensions: this.extensions, - astNode: this.astNode - }; - }; - - _proto.toString = function toString() { - return '@' + this.name; - }; - - _proto.toJSON = function toJSON() { - return this.toString(); - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLDirective, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLDirective'; - } - }]); - - return GraphQLDirective; -}(); // Print a simplified form when appearing in `inspect` and `util.inspect`. - -defineInspect(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: new 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: new 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.ARGUMENT_DEFINITION, DirectiveLocation.INPUT_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 - } - } -}); -/** - * Used to provide a URL for specifying the behaviour of custom scalar definitions. - */ - -export var GraphQLSpecifiedByDirective = new GraphQLDirective({ - name: 'specifiedBy', - description: 'Exposes a URL that specifies the behaviour of this scalar.', - locations: [DirectiveLocation.SCALAR], - args: { - url: { - type: new GraphQLNonNull(GraphQLString), - description: 'The URL that specifies the behaviour of this scalar.' - } - } -}); -/** - * The full list of specified directives. - */ - -export var specifiedDirectives = Object.freeze([GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective]); -export function isSpecifiedDirective(directive) { - return specifiedDirectives.some(function (_ref2) { - var name = _ref2.name; - return name === directive.name; - }); -} diff --git a/JS/node_modules/graphql/type/index.d.ts b/JS/node_modules/graphql/type/index.d.ts deleted file mode 100644 index 9686f41..0000000 --- a/JS/node_modules/graphql/type/index.d.ts +++ /dev/null @@ -1,168 +0,0 @@ -export { Path as ResponsePath } from '../jsutils/Path'; - -export { - // Predicate - isSchema, - // Assertion - assertSchema, - // GraphQL Schema definition - GraphQLSchema, - GraphQLSchemaConfig, - GraphQLSchemaExtensions, -} 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, - // type - GraphQLType, - GraphQLInputType, - GraphQLOutputType, - GraphQLLeafType, - GraphQLCompositeType, - GraphQLAbstractType, - GraphQLWrappingType, - GraphQLNullableType, - GraphQLNamedType, - Thunk, - GraphQLArgument, - GraphQLArgumentConfig, - GraphQLArgumentExtensions, - GraphQLEnumTypeConfig, - GraphQLEnumTypeExtensions, - GraphQLEnumValue, - GraphQLEnumValueConfig, - GraphQLEnumValueConfigMap, - GraphQLEnumValueExtensions, - GraphQLField, - GraphQLFieldConfig, - GraphQLFieldConfigArgumentMap, - GraphQLFieldConfigMap, - GraphQLFieldExtensions, - GraphQLFieldMap, - GraphQLFieldResolver, - GraphQLInputField, - GraphQLInputFieldConfig, - GraphQLInputFieldConfigMap, - GraphQLInputFieldExtensions, - GraphQLInputFieldMap, - GraphQLInputObjectTypeConfig, - GraphQLInputObjectTypeExtensions, - GraphQLInterfaceTypeConfig, - GraphQLInterfaceTypeExtensions, - GraphQLIsTypeOfFn, - GraphQLObjectTypeConfig, - GraphQLObjectTypeExtensions, - GraphQLResolveInfo, - GraphQLScalarTypeConfig, - GraphQLScalarTypeExtensions, - GraphQLTypeResolver, - GraphQLUnionTypeConfig, - GraphQLUnionTypeExtensions, - GraphQLScalarSerializer, - GraphQLScalarValueParser, - GraphQLScalarLiteralParser, -} from './definition'; - -export { - // Predicate - isDirective, - // Assertion - assertDirective, - // Directives Definition - GraphQLDirective, - // Built-in Directives defined by the Spec - isSpecifiedDirective, - specifiedDirectives, - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - GraphQLSpecifiedByDirective, - // Constant Deprecation Reason - DEFAULT_DEPRECATION_REASON, - // type - GraphQLDirectiveConfig, - GraphQLDirectiveExtensions, -} from './directives'; - -// Common built-in scalar instances. -export { - isSpecifiedScalarType, - specifiedScalarTypes, - GraphQLInt, - GraphQLFloat, - GraphQLString, - GraphQLBoolean, - GraphQLID, -} from './scalars'; - -export { - // "Enum" of Type Kinds - TypeKind, - // GraphQL Types for introspection. - isIntrospectionType, - introspectionTypes, - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind, - // Meta-field definitions. - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, -} from './introspection'; - -export { validateSchema, assertValidSchema } from './validate'; diff --git a/JS/node_modules/graphql/type/index.js b/JS/node_modules/graphql/type/index.js deleted file mode 100644 index e245def..0000000 --- a/JS/node_modules/graphql/type/index.js +++ /dev/null @@ -1,509 +0,0 @@ -"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, "GraphQLSpecifiedByDirective", { - enumerable: true, - get: function get() { - return _directives.GraphQLSpecifiedByDirective; - } -}); -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.js"); - -var _definition = require("./definition.js"); - -var _directives = require("./directives.js"); - -var _scalars = require("./scalars.js"); - -var _introspection = require("./introspection.js"); - -var _validate = require("./validate.js"); diff --git a/JS/node_modules/graphql/type/index.js.flow b/JS/node_modules/graphql/type/index.js.flow deleted file mode 100644 index 85603d0..0000000 --- a/JS/node_modules/graphql/type/index.js.flow +++ /dev/null @@ -1,163 +0,0 @@ -// @flow strict -export type { Path as ResponsePath } from '../jsutils/Path'; - -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, - GraphQLSpecifiedByDirective, - // 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, - GraphQLScalarTypeConfig, - GraphQLTypeResolver, - GraphQLUnionTypeConfig, - GraphQLScalarSerializer, - GraphQLScalarValueParser, - GraphQLScalarLiteralParser, -} from './definition'; - -// Validate GraphQL schema. -export { validateSchema, assertValidSchema } from './validate'; diff --git a/JS/node_modules/graphql/type/index.mjs b/JS/node_modules/graphql/type/index.mjs deleted file mode 100644 index 48e61ba..0000000 --- a/JS/node_modules/graphql/type/index.mjs +++ /dev/null @@ -1,27 +0,0 @@ -export { // Predicate -isSchema // Assertion -, assertSchema // GraphQL Schema definition -, GraphQLSchema } from "./schema.mjs"; -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.mjs"; -export { // Predicate -isDirective // Assertion -, assertDirective // Directives Definition -, GraphQLDirective // Built-in Directives defined by the Spec -, isSpecifiedDirective, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective // Constant Deprecation Reason -, DEFAULT_DEPRECATION_REASON } from "./directives.mjs"; -// Common built-in scalar instances. -export { // Predicate -isSpecifiedScalarType // Standard GraphQL Scalars -, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID } from "./scalars.mjs"; -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.mjs"; -// Validate GraphQL schema. -export { validateSchema, assertValidSchema } from "./validate.mjs"; diff --git a/JS/node_modules/graphql/type/introspection.d.ts b/JS/node_modules/graphql/type/introspection.d.ts deleted file mode 100644 index 34cefa7..0000000 --- a/JS/node_modules/graphql/type/introspection.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { - GraphQLObjectType, - GraphQLField, - GraphQLEnumType, - GraphQLNamedType, -} from './definition'; - -export const __Schema: GraphQLObjectType; -export const __Directive: GraphQLObjectType; -export const __DirectiveLocation: GraphQLEnumType; -export const __Type: GraphQLObjectType; -export const __Field: GraphQLObjectType; -export const __InputValue: GraphQLObjectType; -export const __EnumValue: GraphQLObjectType; - -export const TypeKind: { - SCALAR: 'SCALAR'; - OBJECT: 'OBJECT'; - INTERFACE: 'INTERFACE'; - UNION: 'UNION'; - ENUM: 'ENUM'; - INPUT_OBJECT: 'INPUT_OBJECT'; - LIST: 'LIST'; - NON_NULL: 'NON_NULL'; -}; - -export const __TypeKind: GraphQLEnumType; - -/** - * Note that these are GraphQLField and not GraphQLFieldConfig, - * so the format for args is different. - */ - -export const SchemaMetaFieldDef: GraphQLField; -export const TypeMetaFieldDef: GraphQLField; -export const TypeNameMetaFieldDef: GraphQLField; - -export const introspectionTypes: ReadonlyArray; - -export function isIntrospectionType(type: GraphQLNamedType): boolean; diff --git a/JS/node_modules/graphql/type/introspection.js b/JS/node_modules/graphql/type/introspection.js deleted file mode 100644 index 4bf155d..0000000 --- a/JS/node_modules/graphql/type/introspection.js +++ /dev/null @@ -1,615 +0,0 @@ -"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.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _printer = require("../language/printer.js"); - -var _directiveLocation = require("../language/directiveLocation.js"); - -var _astFromValue = require("../utilities/astFromValue.js"); - -var _scalars = require("./scalars.js"); - -var _definition = require("./definition.js"); - -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 { - description: { - type: _scalars.GraphQLString, - resolve: function resolve(schema) { - return schema.description; - } - }, - types: { - description: 'A list of all types supported by this server.', - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _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: new _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: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _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: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: function resolve(directive) { - return directive.name; - } - }, - description: { - type: _scalars.GraphQLString, - resolve: function resolve(directive) { - return directive.description; - } - }, - isRepeatable: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: function resolve(directive) { - return directive.isRepeatable; - } - }, - locations: { - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__DirectiveLocation))), - resolve: function resolve(directive) { - return directive.locations; - } - }, - args: { - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _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, description and optional `specifiedByUrl`, 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: new _definition.GraphQLNonNull(__TypeKind), - resolve: function resolve(type) { - if ((0, _definition.isScalarType)(type)) { - return TypeKind.SCALAR; - } - - if ((0, _definition.isObjectType)(type)) { - return TypeKind.OBJECT; - } - - if ((0, _definition.isInterfaceType)(type)) { - return TypeKind.INTERFACE; - } - - if ((0, _definition.isUnionType)(type)) { - return TypeKind.UNION; - } - - if ((0, _definition.isEnumType)(type)) { - return TypeKind.ENUM; - } - - if ((0, _definition.isInputObjectType)(type)) { - return TypeKind.INPUT_OBJECT; - } - - if ((0, _definition.isListType)(type)) { - return TypeKind.LIST; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isNonNullType)(type)) { - return TypeKind.NON_NULL; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || (0, _invariant.default)(0, "Unexpected type: \"".concat((0, _inspect.default)(type), "\".")); - } - }, - name: { - type: _scalars.GraphQLString, - resolve: function resolve(type) { - return type.name !== undefined ? type.name : undefined; - } - }, - description: { - type: _scalars.GraphQLString, - resolve: function resolve(type) { - return type.description !== undefined ? type.description : undefined; - } - }, - specifiedByUrl: { - type: _scalars.GraphQLString, - resolve: function resolve(obj) { - return obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined; - } - }, - fields: { - type: new _definition.GraphQLList(new _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()); - return includeDeprecated ? fields : fields.filter(function (field) { - return field.deprecationReason == null; - }); - } - } - }, - interfaces: { - type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__Type)), - resolve: function resolve(type) { - if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type)) { - return type.getInterfaces(); - } - } - }, - possibleTypes: { - type: new _definition.GraphQLList(new _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: new _definition.GraphQLList(new _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(); - return includeDeprecated ? values : values.filter(function (field) { - return field.deprecationReason == null; - }); - } - } - }, - inputFields: { - type: new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue)), - args: { - includeDeprecated: { - type: _scalars.GraphQLBoolean, - defaultValue: false - } - }, - resolve: function resolve(type, _ref4) { - var includeDeprecated = _ref4.includeDeprecated; - - if ((0, _definition.isInputObjectType)(type)) { - var values = (0, _objectValues.default)(type.getFields()); - return includeDeprecated ? values : values.filter(function (field) { - return field.deprecationReason == null; - }); - } - } - }, - ofType: { - type: __Type, - resolve: function resolve(type) { - return type.ofType !== undefined ? type.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: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: function resolve(field) { - return field.name; - } - }, - description: { - type: _scalars.GraphQLString, - resolve: function resolve(field) { - return field.description; - } - }, - args: { - type: new _definition.GraphQLNonNull(new _definition.GraphQLList(new _definition.GraphQLNonNull(__InputValue))), - args: { - includeDeprecated: { - type: _scalars.GraphQLBoolean, - defaultValue: false - } - }, - resolve: function resolve(field, _ref5) { - var includeDeprecated = _ref5.includeDeprecated; - return includeDeprecated ? field.args : field.args.filter(function (arg) { - return arg.deprecationReason == null; - }); - } - }, - type: { - type: new _definition.GraphQLNonNull(__Type), - resolve: function resolve(field) { - return field.type; - } - }, - isDeprecated: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: function resolve(field) { - return field.deprecationReason != null; - } - }, - deprecationReason: { - type: _scalars.GraphQLString, - resolve: function resolve(field) { - return field.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: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: function resolve(inputValue) { - return inputValue.name; - } - }, - description: { - type: _scalars.GraphQLString, - resolve: function resolve(inputValue) { - return inputValue.description; - } - }, - type: { - type: new _definition.GraphQLNonNull(__Type), - resolve: function resolve(inputValue) { - return inputValue.type; - } - }, - defaultValue: { - type: _scalars.GraphQLString, - description: 'A GraphQL-formatted string representing the default value for this input value.', - resolve: function resolve(inputValue) { - var type = inputValue.type, - defaultValue = inputValue.defaultValue; - var valueAST = (0, _astFromValue.astFromValue)(defaultValue, type); - return valueAST ? (0, _printer.print)(valueAST) : null; - } - }, - isDeprecated: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: function resolve(field) { - return field.deprecationReason != null; - } - }, - deprecationReason: { - type: _scalars.GraphQLString, - resolve: function resolve(obj) { - return obj.deprecationReason; - } - } - }; - } -}); - -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: new _definition.GraphQLNonNull(_scalars.GraphQLString), - resolve: function resolve(enumValue) { - return enumValue.name; - } - }, - description: { - type: _scalars.GraphQLString, - resolve: function resolve(enumValue) { - return enumValue.description; - } - }, - isDeprecated: { - type: new _definition.GraphQLNonNull(_scalars.GraphQLBoolean), - resolve: function resolve(enumValue) { - return enumValue.deprecationReason != null; - } - }, - deprecationReason: { - type: _scalars.GraphQLString, - resolve: function resolve(enumValue) { - return enumValue.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`, `interfaces`, 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: new _definition.GraphQLNonNull(__Schema), - description: 'Access the current type schema of this server.', - args: [], - resolve: function resolve(_source, _args, _context, _ref6) { - var schema = _ref6.schema; - return schema; - }, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined -}; -exports.SchemaMetaFieldDef = SchemaMetaFieldDef; -var TypeMetaFieldDef = { - name: '__type', - type: __Type, - description: 'Request the type information of a single type.', - args: [{ - name: 'name', - description: undefined, - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - defaultValue: undefined, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined - }], - resolve: function resolve(_source, _ref7, _context, _ref8) { - var name = _ref7.name; - var schema = _ref8.schema; - return schema.getType(name); - }, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined -}; -exports.TypeMetaFieldDef = TypeMetaFieldDef; -var TypeNameMetaFieldDef = { - name: '__typename', - type: new _definition.GraphQLNonNull(_scalars.GraphQLString), - description: 'The name of the current Object type at runtime.', - args: [], - resolve: function resolve(_source, _args, _context, _ref9) { - var parentType = _ref9.parentType; - return parentType.name; - }, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined -}; -exports.TypeNameMetaFieldDef = TypeNameMetaFieldDef; -var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); -exports.introspectionTypes = introspectionTypes; - -function isIntrospectionType(type) { - return introspectionTypes.some(function (_ref10) { - var name = _ref10.name; - return type.name === name; - }); -} diff --git a/JS/node_modules/graphql/type/introspection.js.flow b/JS/node_modules/graphql/type/introspection.js.flow deleted file mode 100644 index 5077e8b..0000000 --- a/JS/node_modules/graphql/type/introspection.js.flow +++ /dev/null @@ -1,550 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; - -import { print } from '../language/printer'; -import { DirectiveLocation } from '../language/directiveLocation'; -import { astFromValue } from '../utilities/astFromValue'; - -import type { GraphQLSchema } from './schema'; -import type { GraphQLDirective } from './directives'; -import type { - GraphQLType, - GraphQLNamedType, - GraphQLInputField, - GraphQLEnumValue, - GraphQLField, - GraphQLFieldConfigMap, -} from './definition'; -import { GraphQLString, GraphQLBoolean } from './scalars'; -import { - GraphQLList, - GraphQLNonNull, - GraphQLObjectType, - GraphQLEnumType, - isScalarType, - isObjectType, - isInterfaceType, - isUnionType, - isEnumType, - isInputObjectType, - isListType, - isNonNullType, - isAbstractType, -} from './definition'; - -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: () => - ({ - description: { - type: GraphQLString, - resolve: (schema) => schema.description, - }, - types: { - description: 'A list of all types supported by this server.', - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))), - resolve(schema) { - return objectValues(schema.getTypeMap()); - }, - }, - queryType: { - description: 'The type that query operations will be rooted at.', - type: new 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: new GraphQLNonNull( - new GraphQLList(new 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: new GraphQLNonNull(GraphQLString), - resolve: (directive) => directive.name, - }, - description: { - type: GraphQLString, - resolve: (directive) => directive.description, - }, - isRepeatable: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: (directive) => directive.isRepeatable, - }, - locations: { - type: new GraphQLNonNull( - new GraphQLList(new GraphQLNonNull(__DirectiveLocation)), - ), - resolve: (directive) => directive.locations, - }, - args: { - type: new GraphQLNonNull( - new GraphQLList(new 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, description and optional `specifiedByUrl`, 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: new GraphQLNonNull(__TypeKind), - resolve(type) { - if (isScalarType(type)) { - return TypeKind.SCALAR; - } - if (isObjectType(type)) { - return TypeKind.OBJECT; - } - if (isInterfaceType(type)) { - return TypeKind.INTERFACE; - } - if (isUnionType(type)) { - return TypeKind.UNION; - } - if (isEnumType(type)) { - return TypeKind.ENUM; - } - if (isInputObjectType(type)) { - return TypeKind.INPUT_OBJECT; - } - if (isListType(type)) { - return TypeKind.LIST; - } - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isNonNullType(type)) { - return TypeKind.NON_NULL; - } - - // istanbul ignore next (Not reachable. All possible types have been considered) - invariant(false, `Unexpected type: "${inspect((type: empty))}".`); - }, - }, - name: { - type: GraphQLString, - resolve: (type) => (type.name !== undefined ? type.name : undefined), - }, - description: { - type: GraphQLString, - resolve: (type) => - type.description !== undefined ? type.description : undefined, - }, - specifiedByUrl: { - type: GraphQLString, - resolve: (obj) => - obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined, - }, - fields: { - type: new GraphQLList(new GraphQLNonNull(__Field)), - args: { - includeDeprecated: { type: GraphQLBoolean, defaultValue: false }, - }, - resolve(type, { includeDeprecated }) { - if (isObjectType(type) || isInterfaceType(type)) { - const fields = objectValues(type.getFields()); - return includeDeprecated - ? fields - : fields.filter((field) => field.deprecationReason == null); - } - }, - }, - interfaces: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve(type) { - if (isObjectType(type) || isInterfaceType(type)) { - return type.getInterfaces(); - } - }, - }, - possibleTypes: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve(type, _args, _context, { schema }) { - if (isAbstractType(type)) { - return schema.getPossibleTypes(type); - } - }, - }, - enumValues: { - type: new GraphQLList(new GraphQLNonNull(__EnumValue)), - args: { - includeDeprecated: { type: GraphQLBoolean, defaultValue: false }, - }, - resolve(type, { includeDeprecated }) { - if (isEnumType(type)) { - const values = type.getValues(); - return includeDeprecated - ? values - : values.filter((field) => field.deprecationReason == null); - } - }, - }, - inputFields: { - type: new GraphQLList(new GraphQLNonNull(__InputValue)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false, - }, - }, - resolve(type, { includeDeprecated }) { - if (isInputObjectType(type)) { - const values = objectValues(type.getFields()); - return includeDeprecated - ? values - : values.filter((field) => field.deprecationReason == null); - } - }, - }, - ofType: { - type: __Type, - resolve: (type) => - type.ofType !== undefined ? type.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: new GraphQLNonNull(GraphQLString), - resolve: (field) => field.name, - }, - description: { - type: GraphQLString, - resolve: (field) => field.description, - }, - args: { - type: new GraphQLNonNull( - new GraphQLList(new GraphQLNonNull(__InputValue)), - ), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false, - }, - }, - resolve(field, { includeDeprecated }) { - return includeDeprecated - ? field.args - : field.args.filter((arg) => arg.deprecationReason == null); - }, - }, - type: { - type: new GraphQLNonNull(__Type), - resolve: (field) => field.type, - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: (field) => field.deprecationReason != null, - }, - deprecationReason: { - type: GraphQLString, - resolve: (field) => field.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: new GraphQLNonNull(GraphQLString), - resolve: (inputValue) => inputValue.name, - }, - description: { - type: GraphQLString, - resolve: (inputValue) => inputValue.description, - }, - type: { - type: new GraphQLNonNull(__Type), - resolve: (inputValue) => inputValue.type, - }, - defaultValue: { - type: GraphQLString, - description: - 'A GraphQL-formatted string representing the default value for this input value.', - resolve(inputValue) { - const { type, defaultValue } = inputValue; - const valueAST = astFromValue(defaultValue, type); - return valueAST ? print(valueAST) : null; - }, - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: (field) => field.deprecationReason != null, - }, - deprecationReason: { - type: GraphQLString, - resolve: (obj) => obj.deprecationReason, - }, - }: 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: new GraphQLNonNull(GraphQLString), - resolve: (enumValue) => enumValue.name, - }, - description: { - type: GraphQLString, - resolve: (enumValue) => enumValue.description, - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: (enumValue) => enumValue.deprecationReason != null, - }, - deprecationReason: { - type: GraphQLString, - resolve: (enumValue) => enumValue.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`, `interfaces`, 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: new GraphQLNonNull(__Schema), - description: 'Access the current type schema of this server.', - args: [], - resolve: (_source, _args, _context, { schema }) => schema, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined, -}; - -export const TypeMetaFieldDef: GraphQLField = { - name: '__type', - type: __Type, - description: 'Request the type information of a single type.', - args: [ - { - name: 'name', - description: undefined, - type: new GraphQLNonNull(GraphQLString), - defaultValue: undefined, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined, - }, - ], - resolve: (_source, { name }, _context, { schema }) => schema.getType(name), - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined, -}; - -export const TypeNameMetaFieldDef: GraphQLField = { - name: '__typename', - type: new GraphQLNonNull(GraphQLString), - description: 'The name of the current Object type at runtime.', - args: [], - resolve: (_source, _args, _context, { parentType }) => parentType.name, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined, -}; - -export const introspectionTypes = Object.freeze([ - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind, -]); - -export function isIntrospectionType(type: GraphQLNamedType): boolean %checks { - return introspectionTypes.some(({ name }) => type.name === name); -} diff --git a/JS/node_modules/graphql/type/introspection.mjs b/JS/node_modules/graphql/type/introspection.mjs deleted file mode 100644 index 772ce86..0000000 --- a/JS/node_modules/graphql/type/introspection.mjs +++ /dev/null @@ -1,568 +0,0 @@ -import objectValues from "../polyfills/objectValues.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import { print } from "../language/printer.mjs"; -import { DirectiveLocation } from "../language/directiveLocation.mjs"; -import { astFromValue } from "../utilities/astFromValue.mjs"; -import { GraphQLString, GraphQLBoolean } from "./scalars.mjs"; -import { GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLEnumType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isAbstractType } from "./definition.mjs"; -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 { - description: { - type: GraphQLString, - resolve: function resolve(schema) { - return schema.description; - } - }, - types: { - description: 'A list of all types supported by this server.', - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))), - resolve: function resolve(schema) { - return objectValues(schema.getTypeMap()); - } - }, - queryType: { - description: 'The type that query operations will be rooted at.', - type: new 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: new GraphQLNonNull(new GraphQLList(new 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: new GraphQLNonNull(GraphQLString), - resolve: function resolve(directive) { - return directive.name; - } - }, - description: { - type: GraphQLString, - resolve: function resolve(directive) { - return directive.description; - } - }, - isRepeatable: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: function resolve(directive) { - return directive.isRepeatable; - } - }, - locations: { - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__DirectiveLocation))), - resolve: function resolve(directive) { - return directive.locations; - } - }, - args: { - type: new GraphQLNonNull(new GraphQLList(new 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, description and optional `specifiedByUrl`, 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: new GraphQLNonNull(__TypeKind), - resolve: function resolve(type) { - if (isScalarType(type)) { - return TypeKind.SCALAR; - } - - if (isObjectType(type)) { - return TypeKind.OBJECT; - } - - if (isInterfaceType(type)) { - return TypeKind.INTERFACE; - } - - if (isUnionType(type)) { - return TypeKind.UNION; - } - - if (isEnumType(type)) { - return TypeKind.ENUM; - } - - if (isInputObjectType(type)) { - return TypeKind.INPUT_OBJECT; - } - - if (isListType(type)) { - return TypeKind.LIST; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isNonNullType(type)) { - return TypeKind.NON_NULL; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || invariant(0, "Unexpected type: \"".concat(inspect(type), "\".")); - } - }, - name: { - type: GraphQLString, - resolve: function resolve(type) { - return type.name !== undefined ? type.name : undefined; - } - }, - description: { - type: GraphQLString, - resolve: function resolve(type) { - return type.description !== undefined ? type.description : undefined; - } - }, - specifiedByUrl: { - type: GraphQLString, - resolve: function resolve(obj) { - return obj.specifiedByUrl !== undefined ? obj.specifiedByUrl : undefined; - } - }, - fields: { - type: new GraphQLList(new 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()); - return includeDeprecated ? fields : fields.filter(function (field) { - return field.deprecationReason == null; - }); - } - } - }, - interfaces: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve: function resolve(type) { - if (isObjectType(type) || isInterfaceType(type)) { - return type.getInterfaces(); - } - } - }, - possibleTypes: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve: function resolve(type, _args, _context, _ref2) { - var schema = _ref2.schema; - - if (isAbstractType(type)) { - return schema.getPossibleTypes(type); - } - } - }, - enumValues: { - type: new GraphQLList(new GraphQLNonNull(__EnumValue)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve: function resolve(type, _ref3) { - var includeDeprecated = _ref3.includeDeprecated; - - if (isEnumType(type)) { - var values = type.getValues(); - return includeDeprecated ? values : values.filter(function (field) { - return field.deprecationReason == null; - }); - } - } - }, - inputFields: { - type: new GraphQLList(new GraphQLNonNull(__InputValue)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve: function resolve(type, _ref4) { - var includeDeprecated = _ref4.includeDeprecated; - - if (isInputObjectType(type)) { - var values = objectValues(type.getFields()); - return includeDeprecated ? values : values.filter(function (field) { - return field.deprecationReason == null; - }); - } - } - }, - ofType: { - type: __Type, - resolve: function resolve(type) { - return type.ofType !== undefined ? type.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: new GraphQLNonNull(GraphQLString), - resolve: function resolve(field) { - return field.name; - } - }, - description: { - type: GraphQLString, - resolve: function resolve(field) { - return field.description; - } - }, - args: { - type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__InputValue))), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve: function resolve(field, _ref5) { - var includeDeprecated = _ref5.includeDeprecated; - return includeDeprecated ? field.args : field.args.filter(function (arg) { - return arg.deprecationReason == null; - }); - } - }, - type: { - type: new GraphQLNonNull(__Type), - resolve: function resolve(field) { - return field.type; - } - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: function resolve(field) { - return field.deprecationReason != null; - } - }, - deprecationReason: { - type: GraphQLString, - resolve: function resolve(field) { - return field.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: new GraphQLNonNull(GraphQLString), - resolve: function resolve(inputValue) { - return inputValue.name; - } - }, - description: { - type: GraphQLString, - resolve: function resolve(inputValue) { - return inputValue.description; - } - }, - type: { - type: new GraphQLNonNull(__Type), - resolve: function resolve(inputValue) { - return inputValue.type; - } - }, - defaultValue: { - type: GraphQLString, - description: 'A GraphQL-formatted string representing the default value for this input value.', - resolve: function resolve(inputValue) { - var type = inputValue.type, - defaultValue = inputValue.defaultValue; - var valueAST = astFromValue(defaultValue, type); - return valueAST ? print(valueAST) : null; - } - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: function resolve(field) { - return field.deprecationReason != null; - } - }, - deprecationReason: { - type: GraphQLString, - resolve: function resolve(obj) { - return obj.deprecationReason; - } - } - }; - } -}); -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: new GraphQLNonNull(GraphQLString), - resolve: function resolve(enumValue) { - return enumValue.name; - } - }, - description: { - type: GraphQLString, - resolve: function resolve(enumValue) { - return enumValue.description; - } - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: function resolve(enumValue) { - return enumValue.deprecationReason != null; - } - }, - deprecationReason: { - type: GraphQLString, - resolve: function resolve(enumValue) { - return enumValue.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`, `interfaces`, 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: new GraphQLNonNull(__Schema), - description: 'Access the current type schema of this server.', - args: [], - resolve: function resolve(_source, _args, _context, _ref6) { - var schema = _ref6.schema; - return schema; - }, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined -}; -export var TypeMetaFieldDef = { - name: '__type', - type: __Type, - description: 'Request the type information of a single type.', - args: [{ - name: 'name', - description: undefined, - type: new GraphQLNonNull(GraphQLString), - defaultValue: undefined, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined - }], - resolve: function resolve(_source, _ref7, _context, _ref8) { - var name = _ref7.name; - var schema = _ref8.schema; - return schema.getType(name); - }, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined -}; -export var TypeNameMetaFieldDef = { - name: '__typename', - type: new GraphQLNonNull(GraphQLString), - description: 'The name of the current Object type at runtime.', - args: [], - resolve: function resolve(_source, _args, _context, _ref9) { - var parentType = _ref9.parentType; - return parentType.name; - }, - isDeprecated: false, - deprecationReason: undefined, - extensions: undefined, - astNode: undefined -}; -export var introspectionTypes = Object.freeze([__Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind]); -export function isIntrospectionType(type) { - return introspectionTypes.some(function (_ref10) { - var name = _ref10.name; - return type.name === name; - }); -} diff --git a/JS/node_modules/graphql/type/scalars.d.ts b/JS/node_modules/graphql/type/scalars.d.ts deleted file mode 100644 index 71593d1..0000000 --- a/JS/node_modules/graphql/type/scalars.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { GraphQLScalarType, GraphQLNamedType } from './definition'; - -export const GraphQLInt: GraphQLScalarType; -export const GraphQLFloat: GraphQLScalarType; -export const GraphQLString: GraphQLScalarType; -export const GraphQLBoolean: GraphQLScalarType; -export const GraphQLID: GraphQLScalarType; - -export const specifiedScalarTypes: ReadonlyArray; - -export function isSpecifiedScalarType(type: GraphQLNamedType): boolean; diff --git a/JS/node_modules/graphql/type/scalars.js b/JS/node_modules/graphql/type/scalars.js deleted file mode 100644 index ca1f35b..0000000 --- a/JS/node_modules/graphql/type/scalars.js +++ /dev/null @@ -1,284 +0,0 @@ -"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.js")); - -var _isInteger = _interopRequireDefault(require("../polyfills/isInteger.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _kinds = require("../language/kinds.js"); - -var _printer = require("../language/printer.js"); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _definition = require("./definition.js"); - -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(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - var num = coercedValue; - - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (!(0, _isInteger.default)(num)) { - throw new _GraphQLError.GraphQLError("Int cannot represent non-integer value: ".concat((0, _inspect.default)(coercedValue))); - } - - if (num > MAX_INT || num < MIN_INT) { - throw new _GraphQLError.GraphQLError('Int cannot represent non 32-bit signed integer value: ' + (0, _inspect.default)(coercedValue)); - } - - return num; -} - -function coerceInt(inputValue) { - if (!(0, _isInteger.default)(inputValue)) { - throw new _GraphQLError.GraphQLError("Int cannot represent non-integer value: ".concat((0, _inspect.default)(inputValue))); - } - - if (inputValue > MAX_INT || inputValue < MIN_INT) { - throw new _GraphQLError.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(inputValue)); - } - - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== _kinds.Kind.INT) { - throw new _GraphQLError.GraphQLError("Int cannot represent non-integer value: ".concat((0, _printer.print)(valueNode)), valueNode); - } - - var num = parseInt(valueNode.value, 10); - - if (num > MAX_INT || num < MIN_INT) { - throw new _GraphQLError.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(valueNode.value), valueNode); - } - - return num; - } -}); -exports.GraphQLInt = GraphQLInt; - -function serializeFloat(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - var num = coercedValue; - - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (!(0, _isFinite.default)(num)) { - throw new _GraphQLError.GraphQLError("Float cannot represent non numeric value: ".concat((0, _inspect.default)(coercedValue))); - } - - return num; -} - -function coerceFloat(inputValue) { - if (!(0, _isFinite.default)(inputValue)) { - throw new _GraphQLError.GraphQLError("Float cannot represent non numeric value: ".concat((0, _inspect.default)(inputValue))); - } - - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== _kinds.Kind.FLOAT && valueNode.kind !== _kinds.Kind.INT) { - throw new _GraphQLError.GraphQLError("Float cannot represent non numeric value: ".concat((0, _printer.print)(valueNode)), valueNode); - } - - return parseFloat(valueNode.value); - } -}); // 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(outputValue) { - if ((0, _isObjectLike.default)(outputValue)) { - if (typeof outputValue.valueOf === 'function') { - var valueOfResult = outputValue.valueOf(); - - if (!(0, _isObjectLike.default)(valueOfResult)) { - return valueOfResult; - } - } - - if (typeof outputValue.toJSON === 'function') { - // $FlowFixMe[incompatible-use] - return outputValue.toJSON(); - } - } - - return outputValue; -} - -function serializeString(outputValue) { - var coercedValue = serializeObject(outputValue); // 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 coercedValue === 'string') { - return coercedValue; - } - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 'true' : 'false'; - } - - if ((0, _isFinite.default)(coercedValue)) { - return coercedValue.toString(); - } - - throw new _GraphQLError.GraphQLError("String cannot represent value: ".concat((0, _inspect.default)(outputValue))); -} - -function coerceString(inputValue) { - if (typeof inputValue !== 'string') { - throw new _GraphQLError.GraphQLError("String cannot represent a non string value: ".concat((0, _inspect.default)(inputValue))); - } - - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== _kinds.Kind.STRING) { - throw new _GraphQLError.GraphQLError("String cannot represent a non string value: ".concat((0, _printer.print)(valueNode)), valueNode); - } - - return valueNode.value; - } -}); -exports.GraphQLString = GraphQLString; - -function serializeBoolean(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue; - } - - if ((0, _isFinite.default)(coercedValue)) { - return coercedValue !== 0; - } - - throw new _GraphQLError.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0, _inspect.default)(coercedValue))); -} - -function coerceBoolean(inputValue) { - if (typeof inputValue !== 'boolean') { - throw new _GraphQLError.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0, _inspect.default)(inputValue))); - } - - return inputValue; -} - -var GraphQLBoolean = new _definition.GraphQLScalarType({ - name: 'Boolean', - description: 'The `Boolean` scalar type represents `true` or `false`.', - serialize: serializeBoolean, - parseValue: coerceBoolean, - parseLiteral: function parseLiteral(valueNode) { - if (valueNode.kind !== _kinds.Kind.BOOLEAN) { - throw new _GraphQLError.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0, _printer.print)(valueNode)), valueNode); - } - - return valueNode.value; - } -}); -exports.GraphQLBoolean = GraphQLBoolean; - -function serializeID(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'string') { - return coercedValue; - } - - if ((0, _isInteger.default)(coercedValue)) { - return String(coercedValue); - } - - throw new _GraphQLError.GraphQLError("ID cannot represent value: ".concat((0, _inspect.default)(outputValue))); -} - -function coerceID(inputValue) { - if (typeof inputValue === 'string') { - return inputValue; - } - - if ((0, _isInteger.default)(inputValue)) { - return inputValue.toString(); - } - - throw new _GraphQLError.GraphQLError("ID cannot represent value: ".concat((0, _inspect.default)(inputValue))); -} - -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(valueNode) { - if (valueNode.kind !== _kinds.Kind.STRING && valueNode.kind !== _kinds.Kind.INT) { - throw new _GraphQLError.GraphQLError('ID cannot represent a non-string and non-integer value: ' + (0, _printer.print)(valueNode), valueNode); - } - - return valueNode.value; - } -}); -exports.GraphQLID = GraphQLID; -var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); -exports.specifiedScalarTypes = specifiedScalarTypes; - -function isSpecifiedScalarType(type) { - return specifiedScalarTypes.some(function (_ref) { - var name = _ref.name; - return type.name === name; - }); -} diff --git a/JS/node_modules/graphql/type/scalars.js.flow b/JS/node_modules/graphql/type/scalars.js.flow deleted file mode 100644 index b72b579..0000000 --- a/JS/node_modules/graphql/type/scalars.js.flow +++ /dev/null @@ -1,287 +0,0 @@ -// @flow strict -import isFinite from '../polyfills/isFinite'; -import isInteger from '../polyfills/isInteger'; - -import inspect from '../jsutils/inspect'; -import isObjectLike from '../jsutils/isObjectLike'; - -import { Kind } from '../language/kinds'; -import { print } from '../language/printer'; - -import { GraphQLError } from '../error/GraphQLError'; - -import type { GraphQLNamedType } from './definition'; -import { GraphQLScalarType } from './definition'; - -// 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(outputValue: mixed): number { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - let num = coercedValue; - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (!isInteger(num)) { - throw new GraphQLError( - `Int cannot represent non-integer value: ${inspect(coercedValue)}`, - ); - } - if (num > MAX_INT || num < MIN_INT) { - throw new GraphQLError( - 'Int cannot represent non 32-bit signed integer value: ' + - inspect(coercedValue), - ); - } - return num; -} - -function coerceInt(inputValue: mixed): number { - if (!isInteger(inputValue)) { - throw new GraphQLError( - `Int cannot represent non-integer value: ${inspect(inputValue)}`, - ); - } - if (inputValue > MAX_INT || inputValue < MIN_INT) { - throw new GraphQLError( - `Int cannot represent non 32-bit signed integer value: ${inputValue}`, - ); - } - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== Kind.INT) { - throw new GraphQLError( - `Int cannot represent non-integer value: ${print(valueNode)}`, - valueNode, - ); - } - const num = parseInt(valueNode.value, 10); - if (num > MAX_INT || num < MIN_INT) { - throw new GraphQLError( - `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, - valueNode, - ); - } - return num; - }, -}); - -function serializeFloat(outputValue: mixed): number { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - let num = coercedValue; - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (!isFinite(num)) { - throw new GraphQLError( - `Float cannot represent non numeric value: ${inspect(coercedValue)}`, - ); - } - return num; -} - -function coerceFloat(inputValue: mixed): number { - if (!isFinite(inputValue)) { - throw new GraphQLError( - `Float cannot represent non numeric value: ${inspect(inputValue)}`, - ); - } - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) { - throw new GraphQLError( - `Float cannot represent non numeric value: ${print(valueNode)}`, - valueNode, - ); - } - return parseFloat(valueNode.value); - }, -}); - -// 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(outputValue: mixed): mixed { - if (isObjectLike(outputValue)) { - if (typeof outputValue.valueOf === 'function') { - const valueOfResult = outputValue.valueOf(); - if (!isObjectLike(valueOfResult)) { - return valueOfResult; - } - } - if (typeof outputValue.toJSON === 'function') { - // $FlowFixMe[incompatible-use] - return outputValue.toJSON(); - } - } - return outputValue; -} - -function serializeString(outputValue: mixed): string { - const coercedValue = serializeObject(outputValue); - - // 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 coercedValue === 'string') { - return coercedValue; - } - if (typeof coercedValue === 'boolean') { - return coercedValue ? 'true' : 'false'; - } - if (isFinite(coercedValue)) { - return coercedValue.toString(); - } - throw new GraphQLError( - `String cannot represent value: ${inspect(outputValue)}`, - ); -} - -function coerceString(inputValue: mixed): string { - if (typeof inputValue !== 'string') { - throw new GraphQLError( - `String cannot represent a non string value: ${inspect(inputValue)}`, - ); - } - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== Kind.STRING) { - throw new GraphQLError( - `String cannot represent a non string value: ${print(valueNode)}`, - valueNode, - ); - } - return valueNode.value; - }, -}); - -function serializeBoolean(outputValue: mixed): boolean { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue; - } - if (isFinite(coercedValue)) { - return coercedValue !== 0; - } - throw new GraphQLError( - `Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`, - ); -} - -function coerceBoolean(inputValue: mixed): boolean { - if (typeof inputValue !== 'boolean') { - throw new GraphQLError( - `Boolean cannot represent a non boolean value: ${inspect(inputValue)}`, - ); - } - return inputValue; -} - -export const GraphQLBoolean = new GraphQLScalarType({ - name: 'Boolean', - description: 'The `Boolean` scalar type represents `true` or `false`.', - serialize: serializeBoolean, - parseValue: coerceBoolean, - parseLiteral(valueNode) { - if (valueNode.kind !== Kind.BOOLEAN) { - throw new GraphQLError( - `Boolean cannot represent a non boolean value: ${print(valueNode)}`, - valueNode, - ); - } - return valueNode.value; - }, -}); - -function serializeID(outputValue: mixed): string { - const coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'string') { - return coercedValue; - } - if (isInteger(coercedValue)) { - return String(coercedValue); - } - throw new GraphQLError(`ID cannot represent value: ${inspect(outputValue)}`); -} - -function coerceID(inputValue: mixed): string { - if (typeof inputValue === 'string') { - return inputValue; - } - if (isInteger(inputValue)) { - return inputValue.toString(); - } - throw new GraphQLError(`ID cannot represent value: ${inspect(inputValue)}`); -} - -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(valueNode) { - if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) { - throw new GraphQLError( - 'ID cannot represent a non-string and non-integer value: ' + - print(valueNode), - valueNode, - ); - } - return valueNode.value; - }, -}); - -export const specifiedScalarTypes = Object.freeze([ - GraphQLString, - GraphQLInt, - GraphQLFloat, - GraphQLBoolean, - GraphQLID, -]); - -export function isSpecifiedScalarType(type: GraphQLNamedType): boolean %checks { - return specifiedScalarTypes.some(({ name }) => type.name === name); -} diff --git a/JS/node_modules/graphql/type/scalars.mjs b/JS/node_modules/graphql/type/scalars.mjs deleted file mode 100644 index e6f76a0..0000000 --- a/JS/node_modules/graphql/type/scalars.mjs +++ /dev/null @@ -1,258 +0,0 @@ -import isFinite from "../polyfills/isFinite.mjs"; -import isInteger from "../polyfills/isInteger.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { print } from "../language/printer.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { GraphQLScalarType } from "./definition.mjs"; // 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(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - var num = coercedValue; - - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (!isInteger(num)) { - throw new GraphQLError("Int cannot represent non-integer value: ".concat(inspect(coercedValue))); - } - - if (num > MAX_INT || num < MIN_INT) { - throw new GraphQLError('Int cannot represent non 32-bit signed integer value: ' + inspect(coercedValue)); - } - - return num; -} - -function coerceInt(inputValue) { - if (!isInteger(inputValue)) { - throw new GraphQLError("Int cannot represent non-integer value: ".concat(inspect(inputValue))); - } - - if (inputValue > MAX_INT || inputValue < MIN_INT) { - throw new GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(inputValue)); - } - - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== Kind.INT) { - throw new GraphQLError("Int cannot represent non-integer value: ".concat(print(valueNode)), valueNode); - } - - var num = parseInt(valueNode.value, 10); - - if (num > MAX_INT || num < MIN_INT) { - throw new GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(valueNode.value), valueNode); - } - - return num; - } -}); - -function serializeFloat(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 1 : 0; - } - - var num = coercedValue; - - if (typeof coercedValue === 'string' && coercedValue !== '') { - num = Number(coercedValue); - } - - if (!isFinite(num)) { - throw new GraphQLError("Float cannot represent non numeric value: ".concat(inspect(coercedValue))); - } - - return num; -} - -function coerceFloat(inputValue) { - if (!isFinite(inputValue)) { - throw new GraphQLError("Float cannot represent non numeric value: ".concat(inspect(inputValue))); - } - - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) { - throw new GraphQLError("Float cannot represent non numeric value: ".concat(print(valueNode)), valueNode); - } - - return parseFloat(valueNode.value); - } -}); // 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(outputValue) { - if (isObjectLike(outputValue)) { - if (typeof outputValue.valueOf === 'function') { - var valueOfResult = outputValue.valueOf(); - - if (!isObjectLike(valueOfResult)) { - return valueOfResult; - } - } - - if (typeof outputValue.toJSON === 'function') { - // $FlowFixMe[incompatible-use] - return outputValue.toJSON(); - } - } - - return outputValue; -} - -function serializeString(outputValue) { - var coercedValue = serializeObject(outputValue); // 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 coercedValue === 'string') { - return coercedValue; - } - - if (typeof coercedValue === 'boolean') { - return coercedValue ? 'true' : 'false'; - } - - if (isFinite(coercedValue)) { - return coercedValue.toString(); - } - - throw new GraphQLError("String cannot represent value: ".concat(inspect(outputValue))); -} - -function coerceString(inputValue) { - if (typeof inputValue !== 'string') { - throw new GraphQLError("String cannot represent a non string value: ".concat(inspect(inputValue))); - } - - return inputValue; -} - -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(valueNode) { - if (valueNode.kind !== Kind.STRING) { - throw new GraphQLError("String cannot represent a non string value: ".concat(print(valueNode)), valueNode); - } - - return valueNode.value; - } -}); - -function serializeBoolean(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'boolean') { - return coercedValue; - } - - if (isFinite(coercedValue)) { - return coercedValue !== 0; - } - - throw new GraphQLError("Boolean cannot represent a non boolean value: ".concat(inspect(coercedValue))); -} - -function coerceBoolean(inputValue) { - if (typeof inputValue !== 'boolean') { - throw new GraphQLError("Boolean cannot represent a non boolean value: ".concat(inspect(inputValue))); - } - - return inputValue; -} - -export var GraphQLBoolean = new GraphQLScalarType({ - name: 'Boolean', - description: 'The `Boolean` scalar type represents `true` or `false`.', - serialize: serializeBoolean, - parseValue: coerceBoolean, - parseLiteral: function parseLiteral(valueNode) { - if (valueNode.kind !== Kind.BOOLEAN) { - throw new GraphQLError("Boolean cannot represent a non boolean value: ".concat(print(valueNode)), valueNode); - } - - return valueNode.value; - } -}); - -function serializeID(outputValue) { - var coercedValue = serializeObject(outputValue); - - if (typeof coercedValue === 'string') { - return coercedValue; - } - - if (isInteger(coercedValue)) { - return String(coercedValue); - } - - throw new GraphQLError("ID cannot represent value: ".concat(inspect(outputValue))); -} - -function coerceID(inputValue) { - if (typeof inputValue === 'string') { - return inputValue; - } - - if (isInteger(inputValue)) { - return inputValue.toString(); - } - - throw new GraphQLError("ID cannot represent value: ".concat(inspect(inputValue))); -} - -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(valueNode) { - if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) { - throw new GraphQLError('ID cannot represent a non-string and non-integer value: ' + print(valueNode), valueNode); - } - - return valueNode.value; - } -}); -export var specifiedScalarTypes = Object.freeze([GraphQLString, GraphQLInt, GraphQLFloat, GraphQLBoolean, GraphQLID]); -export function isSpecifiedScalarType(type) { - return specifiedScalarTypes.some(function (_ref) { - var name = _ref.name; - return type.name === name; - }); -} diff --git a/JS/node_modules/graphql/type/schema.d.ts b/JS/node_modules/graphql/type/schema.d.ts deleted file mode 100644 index 4f759f9..0000000 --- a/JS/node_modules/graphql/type/schema.d.ts +++ /dev/null @@ -1,147 +0,0 @@ -// FIXME -/* eslint-disable import/no-cycle */ - -import { Maybe } from '../jsutils/Maybe'; - -import { SchemaDefinitionNode, SchemaExtensionNode } from '../language/ast'; - -import { GraphQLDirective } from './directives'; -import { - GraphQLNamedType, - GraphQLAbstractType, - GraphQLObjectType, - GraphQLInterfaceType, -} from './definition'; - -/** - * Test if the given value is a GraphQL schema. - */ -export function isSchema(schema: any): schema is GraphQLSchema; -export function assertSchema(schema: any): GraphQLSchema; - -/** - * Custom extensions - * - * @remarks - * Use a unique identifier name for your extension, for example the name of - * your library or project. Do not use a shortened identifier as this increases - * the risk of conflicts. We recommend you add at most one extension field, - * an object which can contain all the values you need. - */ -export interface GraphQLSchemaExtensions { - [attributeName: string]: any; -} - -/** - * 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: 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 { - description: Maybe; - extensions: Maybe>; - astNode: Maybe; - extensionASTNodes: Maybe>; - - constructor(config: Readonly); - getQueryType(): Maybe; - getMutationType(): Maybe; - getSubscriptionType(): Maybe; - getTypeMap(): TypeMap; - getType(name: string): Maybe; - - getPossibleTypes( - abstractType: GraphQLAbstractType, - ): ReadonlyArray; - - getImplementations( - interfaceType: GraphQLInterfaceType, - ): InterfaceImplementations; - - // @deprecated: use isSubType instead - will be removed in v16. - isPossibleType( - abstractType: GraphQLAbstractType, - possibleType: GraphQLObjectType, - ): boolean; - - isSubType( - abstractType: GraphQLAbstractType, - maybeSubType: GraphQLNamedType, - ): boolean; - - getDirectives(): ReadonlyArray; - getDirective(name: string): Maybe; - - toConfig(): GraphQLSchemaConfig & { - types: Array; - directives: Array; - extensions: Maybe>; - extensionASTNodes: ReadonlyArray; - assumeValid: boolean; - }; -} - -interface TypeMap { - [key: string]: GraphQLNamedType; -} - -interface InterfaceImplementations { - objects: ReadonlyArray; - interfaces: ReadonlyArray; -} - -export interface 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; -} - -export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions { - description?: Maybe; - query?: Maybe; - mutation?: Maybe; - subscription?: Maybe; - types?: Maybe>; - directives?: Maybe>; - extensions?: Maybe>; - astNode?: Maybe; - extensionASTNodes?: Maybe>; -} - -/** - * @internal - */ -export interface GraphQLSchemaNormalizedConfig extends GraphQLSchemaConfig { - description: Maybe; - types: Array; - directives: Array; - extensions: Maybe>; - extensionASTNodes: Maybe>; - assumeValid: boolean; -} diff --git a/JS/node_modules/graphql/type/schema.js b/JS/node_modules/graphql/type/schema.js deleted file mode 100644 index 9eef4d0..0000000 --- a/JS/node_modules/graphql/type/schema.js +++ /dev/null @@ -1,384 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isSchema = isSchema; -exports.assertSchema = assertSchema; -exports.GraphQLSchema = void 0; - -var _find = _interopRequireDefault(require("../polyfills/find.js")); - -var _arrayFrom3 = _interopRequireDefault(require("../polyfills/arrayFrom.js")); - -var _objectValues5 = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _symbols = require("../polyfills/symbols.js"); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _toObjMap = _interopRequireDefault(require("../jsutils/toObjMap.js")); - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _instanceOf = _interopRequireDefault(require("../jsutils/instanceOf.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _introspection = require("./introspection.js"); - -var _directives = require("./directives.js"); - -var _definition = require("./definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -// eslint-disable-next-line no-redeclare -function isSchema(schema) { - return (0, _instanceOf.default)(schema, GraphQLSchema); -} - -function assertSchema(schema) { - if (!isSchema(schema)) { - throw new Error("Expected ".concat((0, _inspect.default)(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 ]), - * }) - * - */ - - -var GraphQLSchema = /*#__PURE__*/function () { - // Used as a cache for validateSchema(). - function GraphQLSchema(config) { - var _config$directives; - - // 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. - this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors. - - (0, _isObjectLike.default)(config) || (0, _devAssert.default)(0, 'Must provide configuration object.'); - !config.types || Array.isArray(config.types) || (0, _devAssert.default)(0, "\"types\" must be Array if provided but got: ".concat((0, _inspect.default)(config.types), ".")); - !config.directives || Array.isArray(config.directives) || (0, _devAssert.default)(0, '"directives" must be Array if provided but got: ' + "".concat((0, _inspect.default)(config.directives), ".")); - this.description = config.description; - this.extensions = config.extensions && (0, _toObjMap.default)(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = config.extensionASTNodes; - 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 = config.directives) !== null && _config$directives !== void 0 ? _config$directives : _directives.specifiedDirectives; // To preserve order of user-provided types, we add first to add them to - // the set of "collected" types, so `collectReferencedTypes` ignore them. - - var allReferencedTypes = new Set(config.types); - - if (config.types != null) { - for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) { - var type = _config$types2[_i2]; - // When we ready to process this type, we remove it from "collected" types - // and then add it together with all dependent types in the correct position. - allReferencedTypes.delete(type); - collectReferencedTypes(type, allReferencedTypes); - } - } - - if (this._queryType != null) { - collectReferencedTypes(this._queryType, allReferencedTypes); - } - - if (this._mutationType != null) { - collectReferencedTypes(this._mutationType, allReferencedTypes); - } - - if (this._subscriptionType != null) { - collectReferencedTypes(this._subscriptionType, allReferencedTypes); - } - - for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) { - var directive = _this$_directives2[_i4]; - - // Directives are not validated until validateSchema() is called. - if ((0, _directives.isDirective)(directive)) { - for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) { - var arg = _directive$args2[_i6]; - collectReferencedTypes(arg.type, allReferencedTypes); - } - } - } - - collectReferencedTypes(_introspection.__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema. - - this._typeMap = Object.create(null); - this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name. - - this._implementationsMap = Object.create(null); - - for (var _i8 = 0, _arrayFrom2 = (0, _arrayFrom3.default)(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) { - var namedType = _arrayFrom2[_i8]; - - if (namedType == null) { - continue; - } - - var typeName = namedType.name; - typeName || (0, _devAssert.default)(0, 'One of the provided types for building the Schema is missing a name.'); - - if (this._typeMap[typeName] !== undefined) { - throw new Error("Schema must contain uniquely named types but contains multiple types named \"".concat(typeName, "\".")); - } - - this._typeMap[typeName] = namedType; - - if ((0, _definition.isInterfaceType)(namedType)) { - // Store implementations by interface. - for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) { - var iface = _namedType$getInterfa2[_i10]; - - if ((0, _definition.isInterfaceType)(iface)) { - var implementations = this._implementationsMap[iface.name]; - - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [] - }; - } - - implementations.interfaces.push(namedType); - } - } - } else if ((0, _definition.isObjectType)(namedType)) { - // Store implementations by objects. - for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) { - var _iface = _namedType$getInterfa4[_i12]; - - if ((0, _definition.isInterfaceType)(_iface)) { - var _implementations = this._implementationsMap[_iface.name]; - - if (_implementations === undefined) { - _implementations = this._implementationsMap[_iface.name] = { - objects: [], - interfaces: [] - }; - } - - _implementations.objects.push(namedType); - } - } - } - } - } - - 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) { - return (0, _definition.isUnionType)(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects; - }; - - _proto.getImplementations = function getImplementations(interfaceType) { - var implementations = this._implementationsMap[interfaceType.name]; - return implementations !== null && implementations !== void 0 ? implementations : { - objects: [], - interfaces: [] - }; - } // @deprecated: use isSubType instead - will be removed in v16. - ; - - _proto.isPossibleType = function isPossibleType(abstractType, possibleType) { - return this.isSubType(abstractType, possibleType); - }; - - _proto.isSubType = function isSubType(abstractType, maybeSubType) { - var map = this._subTypeMap[abstractType.name]; - - if (map === undefined) { - map = Object.create(null); - - if ((0, _definition.isUnionType)(abstractType)) { - for (var _i14 = 0, _abstractType$getType2 = abstractType.getTypes(); _i14 < _abstractType$getType2.length; _i14++) { - var type = _abstractType$getType2[_i14]; - map[type.name] = true; - } - } else { - var implementations = this.getImplementations(abstractType); - - for (var _i16 = 0, _implementations$obje2 = implementations.objects; _i16 < _implementations$obje2.length; _i16++) { - var _type = _implementations$obje2[_i16]; - map[_type.name] = true; - } - - for (var _i18 = 0, _implementations$inte2 = implementations.interfaces; _i18 < _implementations$inte2.length; _i18++) { - var _type2 = _implementations$inte2[_i18]; - map[_type2.name] = true; - } - } - - this._subTypeMap[abstractType.name] = map; - } - - return map[maybeSubType.name] !== undefined; - }; - - _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() { - var _this$extensionASTNod; - - return { - description: this.description, - query: this.getQueryType(), - mutation: this.getMutationType(), - subscription: this.getSubscriptionType(), - types: (0, _objectValues5.default)(this.getTypeMap()), - directives: this.getDirectives().slice(), - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : [], - assumeValid: this.__validationErrors !== undefined - }; - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLSchema, [{ - key: _symbols.SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLSchema'; - } - }]); - - return GraphQLSchema; -}(); - -exports.GraphQLSchema = GraphQLSchema; - -function collectReferencedTypes(type, typeSet) { - var namedType = (0, _definition.getNamedType)(type); - - if (!typeSet.has(namedType)) { - typeSet.add(namedType); - - if ((0, _definition.isUnionType)(namedType)) { - for (var _i20 = 0, _namedType$getTypes2 = namedType.getTypes(); _i20 < _namedType$getTypes2.length; _i20++) { - var memberType = _namedType$getTypes2[_i20]; - collectReferencedTypes(memberType, typeSet); - } - } else if ((0, _definition.isObjectType)(namedType) || (0, _definition.isInterfaceType)(namedType)) { - for (var _i22 = 0, _namedType$getInterfa6 = namedType.getInterfaces(); _i22 < _namedType$getInterfa6.length; _i22++) { - var interfaceType = _namedType$getInterfa6[_i22]; - collectReferencedTypes(interfaceType, typeSet); - } - - for (var _i24 = 0, _objectValues2 = (0, _objectValues5.default)(namedType.getFields()); _i24 < _objectValues2.length; _i24++) { - var field = _objectValues2[_i24]; - collectReferencedTypes(field.type, typeSet); - - for (var _i26 = 0, _field$args2 = field.args; _i26 < _field$args2.length; _i26++) { - var arg = _field$args2[_i26]; - collectReferencedTypes(arg.type, typeSet); - } - } - } else if ((0, _definition.isInputObjectType)(namedType)) { - for (var _i28 = 0, _objectValues4 = (0, _objectValues5.default)(namedType.getFields()); _i28 < _objectValues4.length; _i28++) { - var _field = _objectValues4[_i28]; - collectReferencedTypes(_field.type, typeSet); - } - } - } - - return typeSet; -} diff --git a/JS/node_modules/graphql/type/schema.js.flow b/JS/node_modules/graphql/type/schema.js.flow deleted file mode 100644 index bc51b70..0000000 --- a/JS/node_modules/graphql/type/schema.js.flow +++ /dev/null @@ -1,435 +0,0 @@ -// @flow strict -import find from '../polyfills/find'; -import arrayFrom from '../polyfills/arrayFrom'; -import objectValues from '../polyfills/objectValues'; -import { SYMBOL_TO_STRING_TAG } from '../polyfills/symbols'; - -import type { - ObjMap, - ReadOnlyObjMap, - ReadOnlyObjMapLike, -} from '../jsutils/ObjMap'; -import inspect from '../jsutils/inspect'; -import toObjMap from '../jsutils/toObjMap'; -import devAssert from '../jsutils/devAssert'; -import instanceOf from '../jsutils/instanceOf'; -import isObjectLike from '../jsutils/isObjectLike'; - -import type { GraphQLError } from '../error/GraphQLError'; - -import type { - SchemaDefinitionNode, - SchemaExtensionNode, -} from '../language/ast'; - -import type { - GraphQLType, - GraphQLNamedType, - GraphQLAbstractType, - GraphQLObjectType, - GraphQLInterfaceType, -} from './definition'; -import { __Schema } from './introspection'; -import { - GraphQLDirective, - isDirective, - specifiedDirectives, -} from './directives'; -import { - isObjectType, - isInterfaceType, - isUnionType, - isInputObjectType, - getNamedType, -} from './definition'; - -/** - * 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 { - if (!isSchema(schema)) { - throw new Error(`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 { - description: ?string; - extensions: ?ReadOnlyObjMap; - astNode: ?SchemaDefinitionNode; - extensionASTNodes: ?$ReadOnlyArray; - - _queryType: ?GraphQLObjectType; - _mutationType: ?GraphQLObjectType; - _subscriptionType: ?GraphQLObjectType; - _directives: $ReadOnlyArray; - _typeMap: TypeMap; - _subTypeMap: ObjMap>; - _implementationsMap: ObjMap<{| - objects: Array, - interfaces: Array, - |}>; - - // Used as a cache for validateSchema(). - __validationErrors: ?$ReadOnlyArray; - - constructor(config: $ReadOnly) { - // 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. - this.__validationErrors = config.assumeValid === true ? [] : undefined; - - // Check for common mistakes during construction to produce early errors. - devAssert(isObjectLike(config), 'Must provide configuration object.'); - devAssert( - !config.types || Array.isArray(config.types), - `"types" must be Array if provided but got: ${inspect(config.types)}.`, - ); - devAssert( - !config.directives || Array.isArray(config.directives), - '"directives" must be Array if provided but got: ' + - `${inspect(config.directives)}.`, - ); - - this.description = config.description; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = config.extensionASTNodes; - - 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; - - // To preserve order of user-provided types, we add first to add them to - // the set of "collected" types, so `collectReferencedTypes` ignore them. - const allReferencedTypes: Set = new Set(config.types); - if (config.types != null) { - for (const type of config.types) { - // When we ready to process this type, we remove it from "collected" types - // and then add it together with all dependent types in the correct position. - allReferencedTypes.delete(type); - collectReferencedTypes(type, allReferencedTypes); - } - } - - if (this._queryType != null) { - collectReferencedTypes(this._queryType, allReferencedTypes); - } - if (this._mutationType != null) { - collectReferencedTypes(this._mutationType, allReferencedTypes); - } - if (this._subscriptionType != null) { - collectReferencedTypes(this._subscriptionType, allReferencedTypes); - } - - for (const directive of this._directives) { - // Directives are not validated until validateSchema() is called. - if (isDirective(directive)) { - for (const arg of directive.args) { - collectReferencedTypes(arg.type, allReferencedTypes); - } - } - } - collectReferencedTypes(__Schema, allReferencedTypes); - - // Storing the resulting map for reference by the schema. - this._typeMap = Object.create(null); - this._subTypeMap = Object.create(null); - // Keep track of all implementations by interface name. - this._implementationsMap = Object.create(null); - - for (const namedType of arrayFrom(allReferencedTypes)) { - if (namedType == null) { - continue; - } - - const typeName = namedType.name; - devAssert( - typeName, - 'One of the provided types for building the Schema is missing a name.', - ); - if (this._typeMap[typeName] !== undefined) { - throw new Error( - `Schema must contain uniquely named types but contains multiple types named "${typeName}".`, - ); - } - this._typeMap[typeName] = namedType; - - if (isInterfaceType(namedType)) { - // Store implementations by interface. - for (const iface of namedType.getInterfaces()) { - if (isInterfaceType(iface)) { - let implementations = this._implementationsMap[iface.name]; - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [], - }; - } - - implementations.interfaces.push(namedType); - } - } - } else if (isObjectType(namedType)) { - // Store implementations by objects. - for (const iface of namedType.getInterfaces()) { - if (isInterfaceType(iface)) { - let implementations = this._implementationsMap[iface.name]; - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [], - }; - } - - implementations.objects.push(namedType); - } - } - } - } - } - - 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 { - return isUnionType(abstractType) - ? abstractType.getTypes() - : this.getImplementations(abstractType).objects; - } - - getImplementations( - interfaceType: GraphQLInterfaceType, - ): {| - objects: /* $ReadOnly */ Array, - interfaces: /* $ReadOnly */ Array, - |} { - const implementations = this._implementationsMap[interfaceType.name]; - return implementations ?? { objects: [], interfaces: [] }; - } - - // @deprecated: use isSubType instead - will be removed in v16. - isPossibleType( - abstractType: GraphQLAbstractType, - possibleType: GraphQLObjectType, - ): boolean { - return this.isSubType(abstractType, possibleType); - } - - isSubType( - abstractType: GraphQLAbstractType, - maybeSubType: GraphQLObjectType | GraphQLInterfaceType, - ): boolean { - let map = this._subTypeMap[abstractType.name]; - if (map === undefined) { - map = Object.create(null); - - if (isUnionType(abstractType)) { - for (const type of abstractType.getTypes()) { - map[type.name] = true; - } - } else { - const implementations = this.getImplementations(abstractType); - for (const type of implementations.objects) { - map[type.name] = true; - } - for (const type of implementations.interfaces) { - map[type.name] = true; - } - } - - this._subTypeMap[abstractType.name] = map; - } - return map[maybeSubType.name] !== undefined; - } - - getDirectives(): $ReadOnlyArray { - return this._directives; - } - - getDirective(name: string): ?GraphQLDirective { - return find(this.getDirectives(), (directive) => directive.name === name); - } - - toConfig(): GraphQLSchemaNormalizedConfig { - return { - description: this.description, - query: this.getQueryType(), - mutation: this.getMutationType(), - subscription: this.getSubscriptionType(), - types: objectValues(this.getTypeMap()), - directives: this.getDirectives().slice(), - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: this.extensionASTNodes ?? [], - assumeValid: this.__validationErrors !== undefined, - }; - } - - // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - get [SYMBOL_TO_STRING_TAG]() { - return '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, -|}; - -export type GraphQLSchemaConfig = {| - description?: ?string, - query?: ?GraphQLObjectType, - mutation?: ?GraphQLObjectType, - subscription?: ?GraphQLObjectType, - types?: ?Array, - directives?: ?Array, - extensions?: ?ReadOnlyObjMapLike, - astNode?: ?SchemaDefinitionNode, - extensionASTNodes?: ?$ReadOnlyArray, - ...GraphQLSchemaValidationOptions, -|}; - -/** - * @internal - */ -export type GraphQLSchemaNormalizedConfig = {| - ...GraphQLSchemaConfig, - description: ?string, - types: Array, - directives: Array, - extensions: ?ReadOnlyObjMap, - extensionASTNodes: $ReadOnlyArray, - assumeValid: boolean, -|}; - -function collectReferencedTypes( - type: GraphQLType, - typeSet: Set, -): Set { - const namedType = getNamedType(type); - - if (!typeSet.has(namedType)) { - typeSet.add(namedType); - if (isUnionType(namedType)) { - for (const memberType of namedType.getTypes()) { - collectReferencedTypes(memberType, typeSet); - } - } else if (isObjectType(namedType) || isInterfaceType(namedType)) { - for (const interfaceType of namedType.getInterfaces()) { - collectReferencedTypes(interfaceType, typeSet); - } - - for (const field of objectValues(namedType.getFields())) { - collectReferencedTypes(field.type, typeSet); - for (const arg of field.args) { - collectReferencedTypes(arg.type, typeSet); - } - } - } else if (isInputObjectType(namedType)) { - for (const field of objectValues(namedType.getFields())) { - collectReferencedTypes(field.type, typeSet); - } - } - } - - return typeSet; -} diff --git a/JS/node_modules/graphql/type/schema.mjs b/JS/node_modules/graphql/type/schema.mjs deleted file mode 100644 index 0163455..0000000 --- a/JS/node_modules/graphql/type/schema.mjs +++ /dev/null @@ -1,361 +0,0 @@ -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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -import find from "../polyfills/find.mjs"; -import arrayFrom from "../polyfills/arrayFrom.mjs"; -import objectValues from "../polyfills/objectValues.mjs"; -import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import toObjMap from "../jsutils/toObjMap.mjs"; -import devAssert from "../jsutils/devAssert.mjs"; -import instanceOf from "../jsutils/instanceOf.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import { __Schema } from "./introspection.mjs"; -import { GraphQLDirective, isDirective, specifiedDirectives } from "./directives.mjs"; -import { isObjectType, isInterfaceType, isUnionType, isInputObjectType, getNamedType } from "./definition.mjs"; -/** - * Test if the given value is a GraphQL schema. - */ - -// eslint-disable-next-line no-redeclare -export function isSchema(schema) { - return instanceOf(schema, GraphQLSchema); -} -export function assertSchema(schema) { - if (!isSchema(schema)) { - throw new Error("Expected ".concat(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 var GraphQLSchema = /*#__PURE__*/function () { - // Used as a cache for validateSchema(). - function GraphQLSchema(config) { - var _config$directives; - - // 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. - this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors. - - isObjectLike(config) || devAssert(0, 'Must provide configuration object.'); - !config.types || Array.isArray(config.types) || devAssert(0, "\"types\" must be Array if provided but got: ".concat(inspect(config.types), ".")); - !config.directives || Array.isArray(config.directives) || devAssert(0, '"directives" must be Array if provided but got: ' + "".concat(inspect(config.directives), ".")); - this.description = config.description; - this.extensions = config.extensions && toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = config.extensionASTNodes; - 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 = config.directives) !== null && _config$directives !== void 0 ? _config$directives : specifiedDirectives; // To preserve order of user-provided types, we add first to add them to - // the set of "collected" types, so `collectReferencedTypes` ignore them. - - var allReferencedTypes = new Set(config.types); - - if (config.types != null) { - for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) { - var type = _config$types2[_i2]; - // When we ready to process this type, we remove it from "collected" types - // and then add it together with all dependent types in the correct position. - allReferencedTypes.delete(type); - collectReferencedTypes(type, allReferencedTypes); - } - } - - if (this._queryType != null) { - collectReferencedTypes(this._queryType, allReferencedTypes); - } - - if (this._mutationType != null) { - collectReferencedTypes(this._mutationType, allReferencedTypes); - } - - if (this._subscriptionType != null) { - collectReferencedTypes(this._subscriptionType, allReferencedTypes); - } - - for (var _i4 = 0, _this$_directives2 = this._directives; _i4 < _this$_directives2.length; _i4++) { - var directive = _this$_directives2[_i4]; - - // Directives are not validated until validateSchema() is called. - if (isDirective(directive)) { - for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) { - var arg = _directive$args2[_i6]; - collectReferencedTypes(arg.type, allReferencedTypes); - } - } - } - - collectReferencedTypes(__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema. - - this._typeMap = Object.create(null); - this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name. - - this._implementationsMap = Object.create(null); - - for (var _i8 = 0, _arrayFrom2 = arrayFrom(allReferencedTypes); _i8 < _arrayFrom2.length; _i8++) { - var namedType = _arrayFrom2[_i8]; - - if (namedType == null) { - continue; - } - - var typeName = namedType.name; - typeName || devAssert(0, 'One of the provided types for building the Schema is missing a name.'); - - if (this._typeMap[typeName] !== undefined) { - throw new Error("Schema must contain uniquely named types but contains multiple types named \"".concat(typeName, "\".")); - } - - this._typeMap[typeName] = namedType; - - if (isInterfaceType(namedType)) { - // Store implementations by interface. - for (var _i10 = 0, _namedType$getInterfa2 = namedType.getInterfaces(); _i10 < _namedType$getInterfa2.length; _i10++) { - var iface = _namedType$getInterfa2[_i10]; - - if (isInterfaceType(iface)) { - var implementations = this._implementationsMap[iface.name]; - - if (implementations === undefined) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [] - }; - } - - implementations.interfaces.push(namedType); - } - } - } else if (isObjectType(namedType)) { - // Store implementations by objects. - for (var _i12 = 0, _namedType$getInterfa4 = namedType.getInterfaces(); _i12 < _namedType$getInterfa4.length; _i12++) { - var _iface = _namedType$getInterfa4[_i12]; - - if (isInterfaceType(_iface)) { - var _implementations = this._implementationsMap[_iface.name]; - - if (_implementations === undefined) { - _implementations = this._implementationsMap[_iface.name] = { - objects: [], - interfaces: [] - }; - } - - _implementations.objects.push(namedType); - } - } - } - } - } - - 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) { - return isUnionType(abstractType) ? abstractType.getTypes() : this.getImplementations(abstractType).objects; - }; - - _proto.getImplementations = function getImplementations(interfaceType) { - var implementations = this._implementationsMap[interfaceType.name]; - return implementations !== null && implementations !== void 0 ? implementations : { - objects: [], - interfaces: [] - }; - } // @deprecated: use isSubType instead - will be removed in v16. - ; - - _proto.isPossibleType = function isPossibleType(abstractType, possibleType) { - return this.isSubType(abstractType, possibleType); - }; - - _proto.isSubType = function isSubType(abstractType, maybeSubType) { - var map = this._subTypeMap[abstractType.name]; - - if (map === undefined) { - map = Object.create(null); - - if (isUnionType(abstractType)) { - for (var _i14 = 0, _abstractType$getType2 = abstractType.getTypes(); _i14 < _abstractType$getType2.length; _i14++) { - var type = _abstractType$getType2[_i14]; - map[type.name] = true; - } - } else { - var implementations = this.getImplementations(abstractType); - - for (var _i16 = 0, _implementations$obje2 = implementations.objects; _i16 < _implementations$obje2.length; _i16++) { - var _type = _implementations$obje2[_i16]; - map[_type.name] = true; - } - - for (var _i18 = 0, _implementations$inte2 = implementations.interfaces; _i18 < _implementations$inte2.length; _i18++) { - var _type2 = _implementations$inte2[_i18]; - map[_type2.name] = true; - } - } - - this._subTypeMap[abstractType.name] = map; - } - - return map[maybeSubType.name] !== undefined; - }; - - _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() { - var _this$extensionASTNod; - - return { - description: this.description, - query: this.getQueryType(), - mutation: this.getMutationType(), - subscription: this.getSubscriptionType(), - types: objectValues(this.getTypeMap()), - directives: this.getDirectives().slice(), - extensions: this.extensions, - astNode: this.astNode, - extensionASTNodes: (_this$extensionASTNod = this.extensionASTNodes) !== null && _this$extensionASTNod !== void 0 ? _this$extensionASTNod : [], - assumeValid: this.__validationErrors !== undefined - }; - } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet - ; - - _createClass(GraphQLSchema, [{ - key: SYMBOL_TO_STRING_TAG, - get: function get() { - return 'GraphQLSchema'; - } - }]); - - return GraphQLSchema; -}(); - -function collectReferencedTypes(type, typeSet) { - var namedType = getNamedType(type); - - if (!typeSet.has(namedType)) { - typeSet.add(namedType); - - if (isUnionType(namedType)) { - for (var _i20 = 0, _namedType$getTypes2 = namedType.getTypes(); _i20 < _namedType$getTypes2.length; _i20++) { - var memberType = _namedType$getTypes2[_i20]; - collectReferencedTypes(memberType, typeSet); - } - } else if (isObjectType(namedType) || isInterfaceType(namedType)) { - for (var _i22 = 0, _namedType$getInterfa6 = namedType.getInterfaces(); _i22 < _namedType$getInterfa6.length; _i22++) { - var interfaceType = _namedType$getInterfa6[_i22]; - collectReferencedTypes(interfaceType, typeSet); - } - - for (var _i24 = 0, _objectValues2 = objectValues(namedType.getFields()); _i24 < _objectValues2.length; _i24++) { - var field = _objectValues2[_i24]; - collectReferencedTypes(field.type, typeSet); - - for (var _i26 = 0, _field$args2 = field.args; _i26 < _field$args2.length; _i26++) { - var arg = _field$args2[_i26]; - collectReferencedTypes(arg.type, typeSet); - } - } - } else if (isInputObjectType(namedType)) { - for (var _i28 = 0, _objectValues4 = objectValues(namedType.getFields()); _i28 < _objectValues4.length; _i28++) { - var _field = _objectValues4[_i28]; - collectReferencedTypes(_field.type, typeSet); - } - } - } - - return typeSet; -} diff --git a/JS/node_modules/graphql/type/validate.d.ts b/JS/node_modules/graphql/type/validate.d.ts deleted file mode 100644 index 98400a2..0000000 --- a/JS/node_modules/graphql/type/validate.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { GraphQLError } from '../error/GraphQLError'; - -import { GraphQLSchema } from './schema'; - -/** - * 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; - -/** - * Utility function which asserts a schema is valid by throwing an error if - * it is invalid. - */ -export function assertValidSchema(schema: GraphQLSchema): void; diff --git a/JS/node_modules/graphql/type/validate.js b/JS/node_modules/graphql/type/validate.js deleted file mode 100644 index a233668..0000000 --- a/JS/node_modules/graphql/type/validate.js +++ /dev/null @@ -1,549 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.validateSchema = validateSchema; -exports.assertValidSchema = assertValidSchema; - -var _find = _interopRequireDefault(require("../polyfills/find.js")); - -var _objectValues5 = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _locatedError = require("../error/locatedError.js"); - -var _assertValidName = require("../utilities/assertValidName.js"); - -var _typeComparators = require("../utilities/typeComparators.js"); - -var _schema = require("./schema.js"); - -var _introspection = require("./introspection.js"); - -var _directives = require("./directives.js"); - -var _definition = require("./definition.js"); - -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)) { - var _getOperationTypeNode; - - context.reportError("Query root type must be Object type, it cannot be ".concat((0, _inspect.default)(queryType), "."), (_getOperationTypeNode = getOperationTypeNode(schema, 'query')) !== null && _getOperationTypeNode !== void 0 ? _getOperationTypeNode : queryType.astNode); - } - - var mutationType = schema.getMutationType(); - - if (mutationType && !(0, _definition.isObjectType)(mutationType)) { - var _getOperationTypeNode2; - - context.reportError('Mutation root type must be Object type if provided, it cannot be ' + "".concat((0, _inspect.default)(mutationType), "."), (_getOperationTypeNode2 = getOperationTypeNode(schema, 'mutation')) !== null && _getOperationTypeNode2 !== void 0 ? _getOperationTypeNode2 : mutationType.astNode); - } - - var subscriptionType = schema.getSubscriptionType(); - - if (subscriptionType && !(0, _definition.isObjectType)(subscriptionType)) { - var _getOperationTypeNode3; - - context.reportError('Subscription root type must be Object type if provided, it cannot be ' + "".concat((0, _inspect.default)(subscriptionType), "."), (_getOperationTypeNode3 = getOperationTypeNode(schema, 'subscription')) !== null && _getOperationTypeNode3 !== void 0 ? _getOperationTypeNode3 : subscriptionType.astNode); - } -} - -function getOperationTypeNode(schema, operation) { - var operationNodes = getAllSubNodes(schema, function (node) { - return node.operationTypes; - }); - - for (var _i2 = 0; _i2 < operationNodes.length; _i2++) { - var node = operationNodes[_i2]; - - if (node.operation === operation) { - return node.type; - } - } - - return undefined; -} - -function validateDirectives(context) { - for (var _i4 = 0, _context$schema$getDi2 = context.schema.getDirectives(); _i4 < _context$schema$getDi2.length; _i4++) { - var directive = _context$schema$getDi2[_i4]; - - // 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 === null || directive === void 0 ? void 0 : directive.astNode); - continue; - } // Ensure they are named correctly. - - - validateName(context, directive); // TODO: Ensure proper locations. - // Ensure the arguments are valid. - - for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) { - var arg = _directive$args2[_i6]; - // Ensure they are named correctly. - validateName(context, arg); // Ensure the type is an input type. - - if (!(0, _definition.isInputType)(arg.type)) { - context.reportError("The type of @".concat(directive.name, "(").concat(arg.name, ":) must be Input Type ") + "but got: ".concat((0, _inspect.default)(arg.type), "."), arg.astNode); - } - - if ((0, _definition.isRequiredArgument)(arg) && arg.deprecationReason != null) { - var _arg$astNode; - - context.reportError("Required argument @".concat(directive.name, "(").concat(arg.name, ":) cannot be deprecated."), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests) - (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0 ? void 0 : _arg$astNode.type]); - } - } - } -} - -function validateName(context, node) { - // Ensure names are valid, however introspection types opt out. - var error = (0, _assertValidName.isValidNameError)(node.name); - - if (error) { - context.addError((0, _locatedError.locatedError)(error, node.astNode)); - } -} - -function validateTypes(context) { - var validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context); - var typeMap = context.schema.getTypeMap(); - - for (var _i8 = 0, _objectValues2 = (0, _objectValues5.default)(typeMap); _i8 < _objectValues2.length; _i8++) { - var type = _objectValues2[_i8]; - - // 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.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. - - validateInterfaces(context, type); - } else if ((0, _definition.isInterfaceType)(type)) { - // Ensure fields are valid. - validateFields(context, type); // Ensure interfaces implement the interfaces they claim to. - - validateInterfaces(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); - } - } -} - -function validateFields(context, type) { - var fields = (0, _objectValues5.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)); - } - - for (var _i10 = 0; _i10 < fields.length; _i10++) { - var field = fields[_i10]; - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an output type - - if (!(0, _definition.isOutputType)(field.type)) { - var _field$astNode; - - 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) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type); - } // Ensure the arguments are valid - - - for (var _i12 = 0, _field$args2 = field.args; _i12 < _field$args2.length; _i12++) { - var arg = _field$args2[_i12]; - var argName = arg.name; // Ensure they are named correctly. - - validateName(context, arg); // Ensure the type is an input type - - if (!(0, _definition.isInputType)(arg.type)) { - var _arg$astNode2; - - 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$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type); - } - - if ((0, _definition.isRequiredArgument)(arg) && arg.deprecationReason != null) { - var _arg$astNode3; - - context.reportError("Required argument ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) cannot be deprecated."), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests) - (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 ? void 0 : _arg$astNode3.type]); - } - } - } -} - -function validateInterfaces(context, type) { - var ifaceTypeNames = Object.create(null); - - for (var _i14 = 0, _type$getInterfaces2 = type.getInterfaces(); _i14 < _type$getInterfaces2.length; _i14++) { - var iface = _type$getInterfaces2[_i14]; - - if (!(0, _definition.isInterfaceType)(iface)) { - context.reportError("Type ".concat((0, _inspect.default)(type), " must only implement Interface types, ") + "it cannot implement ".concat((0, _inspect.default)(iface), "."), getAllImplementsInterfaceNodes(type, iface)); - continue; - } - - if (type === iface) { - context.reportError("Type ".concat(type.name, " cannot implement itself because it would create a circular reference."), getAllImplementsInterfaceNodes(type, iface)); - continue; - } - - if (ifaceTypeNames[iface.name]) { - context.reportError("Type ".concat(type.name, " can only implement ").concat(iface.name, " once."), getAllImplementsInterfaceNodes(type, iface)); - continue; - } - - ifaceTypeNames[iface.name] = true; - validateTypeImplementsAncestors(context, type, iface); - validateTypeImplementsInterface(context, type, iface); - } -} - -function validateTypeImplementsInterface(context, type, iface) { - var typeFieldMap = type.getFields(); // Assert each interface field is implemented. - - for (var _i16 = 0, _objectValues4 = (0, _objectValues5.default)(iface.getFields()); _i16 < _objectValues4.length; _i16++) { - var ifaceField = _objectValues4[_i16]; - var fieldName = ifaceField.name; - var typeField = typeFieldMap[fieldName]; // Assert interface field exists on type. - - if (!typeField) { - context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expected but ").concat(type.name, " does not provide it."), [ifaceField.astNode].concat(getAllNodes(type))); - continue; - } // Assert interface field type is satisfied by type field type, by being - // a valid subtype. (covariant) - - - if (!(0, _typeComparators.isTypeSubTypeOf)(context.schema, typeField.type, ifaceField.type)) { - var _ifaceField$astNode, _typeField$astNode; - - context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expects type ") + "".concat((0, _inspect.default)(ifaceField.type), " but ").concat(type.name, ".").concat(fieldName, " ") + "is type ".concat((0, _inspect.default)(typeField.type), "."), [// istanbul ignore next (TODO need to write coverage tests) - (_ifaceField$astNode = ifaceField.astNode) === null || _ifaceField$astNode === void 0 ? void 0 : _ifaceField$astNode.type, // istanbul ignore next (TODO need to write coverage tests) - (_typeField$astNode = typeField.astNode) === null || _typeField$astNode === void 0 ? void 0 : _typeField$astNode.type]); - } // Assert each interface field arg is implemented. - - - var _loop = function _loop(_i18, _ifaceField$args2) { - var ifaceArg = _ifaceField$args2[_i18]; - var argName = ifaceArg.name; - var typeArg = (0, _find.default)(typeField.args, function (arg) { - return arg.name === argName; - }); // Assert interface field arg exists on object field. - - if (!typeArg) { - context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) expected but ").concat(type.name, ".").concat(fieldName, " does not provide it."), [ifaceArg.astNode, typeField.astNode]); - return "continue"; - } // Assert interface field arg type matches object field arg type. - // (invariant) - // TODO: change to contravariant? - - - if (!(0, _typeComparators.isEqualType)(ifaceArg.type, typeArg.type)) { - var _ifaceArg$astNode, _typeArg$astNode; - - context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) ") + "expects type ".concat((0, _inspect.default)(ifaceArg.type), " but ") + "".concat(type.name, ".").concat(fieldName, "(").concat(argName, ":) is type ") + "".concat((0, _inspect.default)(typeArg.type), "."), [// istanbul ignore next (TODO need to write coverage tests) - (_ifaceArg$astNode = ifaceArg.astNode) === null || _ifaceArg$astNode === void 0 ? void 0 : _ifaceArg$astNode.type, // istanbul ignore next (TODO need to write coverage tests) - (_typeArg$astNode = typeArg.astNode) === null || _typeArg$astNode === void 0 ? void 0 : _typeArg$astNode.type]); - } // TODO: validate default values? - - }; - - for (var _i18 = 0, _ifaceField$args2 = ifaceField.args; _i18 < _ifaceField$args2.length; _i18++) { - var _ret = _loop(_i18, _ifaceField$args2); - - if (_ret === "continue") continue; - } // Assert additional arguments must not be required. - - - var _loop2 = function _loop2(_i20, _typeField$args2) { - var typeArg = _typeField$args2[_i20]; - var argName = typeArg.name; - var ifaceArg = (0, _find.default)(ifaceField.args, function (arg) { - return arg.name === argName; - }); - - if (!ifaceArg && (0, _definition.isRequiredArgument)(typeArg)) { - context.reportError("Object field ".concat(type.name, ".").concat(fieldName, " includes required argument ").concat(argName, " that is missing from the Interface field ").concat(iface.name, ".").concat(fieldName, "."), [typeArg.astNode, ifaceField.astNode]); - } - }; - - for (var _i20 = 0, _typeField$args2 = typeField.args; _i20 < _typeField$args2.length; _i20++) { - _loop2(_i20, _typeField$args2); - } - } -} - -function validateTypeImplementsAncestors(context, type, iface) { - var ifaceInterfaces = type.getInterfaces(); - - for (var _i22 = 0, _iface$getInterfaces2 = iface.getInterfaces(); _i22 < _iface$getInterfaces2.length; _i22++) { - var transitive = _iface$getInterfaces2[_i22]; - - if (ifaceInterfaces.indexOf(transitive) === -1) { - context.reportError(transitive === type ? "Type ".concat(type.name, " cannot implement ").concat(iface.name, " because it would create a circular reference.") : "Type ".concat(type.name, " must implement ").concat(transitive.name, " because it is implemented by ").concat(iface.name, "."), [].concat(getAllImplementsInterfaceNodes(iface, transitive), getAllImplementsInterfaceNodes(type, iface))); - } - } -} - -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); - - for (var _i24 = 0; _i24 < memberTypes.length; _i24++) { - var memberType = memberTypes[_i24]; - - 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))); - } - } -} - -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)); - } - - for (var _i26 = 0; _i26 < enumValues.length; _i26++) { - var enumValue = enumValues[_i26]; - 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); - } - } -} - -function validateInputFields(context, inputObj) { - var fields = (0, _objectValues5.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 - - - for (var _i28 = 0; _i28 < fields.length; _i28++) { - var field = fields[_i28]; - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an input type - - if (!(0, _definition.isInputType)(field.type)) { - var _field$astNode2; - - context.reportError("The type of ".concat(inputObj.name, ".").concat(field.name, " must be Input Type ") + "but got: ".concat((0, _inspect.default)(field.type), "."), (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 ? void 0 : _field$astNode2.type); - } - - if ((0, _definition.isRequiredInputField)(field) && field.deprecationReason != null) { - var _field$astNode3; - - context.reportError("Required input field ".concat(inputObj.name, ".").concat(field.name, " cannot be deprecated."), [getDeprecatedDirectiveNode(field.astNode), // istanbul ignore next (TODO need to write coverage tests) - (_field$astNode3 = field.astNode) === null || _field$astNode3 === void 0 ? void 0 : _field$astNode3.type]); - } - } -} - -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, _objectValues5.default)(inputObj.getFields()); - - for (var _i30 = 0; _i30 < fields.length; _i30++) { - var field = fields[_i30]; - - 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(); - } - } - - fieldPathIndexByTypeName[inputObj.name] = undefined; - } -} - -function getAllNodes(object) { - var astNode = object.astNode, - extensionASTNodes = object.extensionASTNodes; - return astNode ? extensionASTNodes ? [astNode].concat(extensionASTNodes) : [astNode] : extensionASTNodes !== null && extensionASTNodes !== void 0 ? extensionASTNodes : []; -} - -function getAllSubNodes(object, getter) { - var subNodes = []; - - for (var _i32 = 0, _getAllNodes2 = getAllNodes(object); _i32 < _getAllNodes2.length; _i32++) { - var _getter; - - var node = _getAllNodes2[_i32]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - subNodes = subNodes.concat((_getter = getter(node)) !== null && _getter !== void 0 ? _getter : []); - } - - return subNodes; -} - -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; - }); -} - -function getDeprecatedDirectiveNode(definitionNode) { - var _definitionNode$direc; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - return definitionNode === null || definitionNode === void 0 ? void 0 : (_definitionNode$direc = definitionNode.directives) === null || _definitionNode$direc === void 0 ? void 0 : _definitionNode$direc.find(function (node) { - return node.name.value === _directives.GraphQLDeprecatedDirective.name; - }); -} diff --git a/JS/node_modules/graphql/type/validate.js.flow b/JS/node_modules/graphql/type/validate.js.flow deleted file mode 100644 index f870b20..0000000 --- a/JS/node_modules/graphql/type/validate.js.flow +++ /dev/null @@ -1,670 +0,0 @@ -// @flow strict -import find from '../polyfills/find'; -import objectValues from '../polyfills/objectValues'; - -import inspect from '../jsutils/inspect'; - -import { GraphQLError } from '../error/GraphQLError'; -import { locatedError } from '../error/locatedError'; - -import type { - ASTNode, - NamedTypeNode, - DirectiveNode, - OperationTypeNode, -} from '../language/ast'; - -import { isValidNameError } from '../utilities/assertValidName'; -import { isEqualType, isTypeSubTypeOf } from '../utilities/typeComparators'; - -import type { GraphQLSchema } from './schema'; -import type { - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, -} from './definition'; -import { assertSchema } from './schema'; -import { isIntrospectionType } from './introspection'; -import { isDirective, GraphQLDeprecatedDirective } from './directives'; -import { - isObjectType, - isInterfaceType, - isUnionType, - isEnumType, - isInputObjectType, - isNamedType, - isNonNullType, - isInputType, - isOutputType, - isRequiredArgument, - isRequiredInputField, -} from './definition'; - -/** - * 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: SchemaValidationContext): void { - 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, 'query') ?? queryType.astNode, - ); - } - - 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, 'mutation') ?? mutationType.astNode, - ); - } - - 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, 'subscription') ?? subscriptionType.astNode, - ); - } -} - -function getOperationTypeNode( - schema: GraphQLSchema, - operation: OperationTypeNode, -): ?ASTNode { - const operationNodes = getAllSubNodes(schema, (node) => node.operationTypes); - for (const node of operationNodes) { - if (node.operation === operation) { - return node.type; - } - } - return undefined; -} - -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?.astNode, - ); - continue; - } - - // Ensure they are named correctly. - validateName(context, directive); - - // TODO: Ensure proper locations. - - // Ensure the arguments are valid. - for (const arg of directive.args) { - // Ensure they are named correctly. - validateName(context, arg); - - // Ensure the type is an input type. - if (!isInputType(arg.type)) { - context.reportError( - `The type of @${directive.name}(${arg.name}:) must be Input Type ` + - `but got: ${inspect(arg.type)}.`, - arg.astNode, - ); - } - - if (isRequiredArgument(arg) && arg.deprecationReason != null) { - context.reportError( - `Required argument @${directive.name}(${arg.name}:) cannot be deprecated.`, - [ - getDeprecatedDirectiveNode(arg.astNode), - // istanbul ignore next (TODO need to write coverage tests) - arg.astNode?.type, - ], - ); - } - } - } -} - -function validateName( - context: SchemaValidationContext, - node: { +name: string, +astNode: ?ASTNode, ... }, -): void { - // Ensure names are valid, however introspection types opt out. - const error = isValidNameError(node.name); - if (error) { - context.addError(locatedError(error, node.astNode)); - } -} - -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.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. - validateInterfaces(context, type); - } else if (isInterfaceType(type)) { - // Ensure fields are valid. - validateFields(context, type); - - // Ensure interfaces implement the interfaces they claim to. - validateInterfaces(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?.type, - ); - } - - // Ensure the arguments are valid - for (const arg of field.args) { - const argName = arg.name; - - // Ensure they are named correctly. - validateName(context, arg); - - // 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?.type, - ); - } - - if (isRequiredArgument(arg) && arg.deprecationReason != null) { - context.reportError( - `Required argument ${type.name}.${field.name}(${argName}:) cannot be deprecated.`, - [ - getDeprecatedDirectiveNode(arg.astNode), - // istanbul ignore next (TODO need to write coverage tests) - arg.astNode?.type, - ], - ); - } - } - } -} - -function validateInterfaces( - context: SchemaValidationContext, - type: GraphQLObjectType | GraphQLInterfaceType, -): void { - const ifaceTypeNames = Object.create(null); - for (const iface of type.getInterfaces()) { - if (!isInterfaceType(iface)) { - context.reportError( - `Type ${inspect(type)} must only implement Interface types, ` + - `it cannot implement ${inspect(iface)}.`, - getAllImplementsInterfaceNodes(type, iface), - ); - continue; - } - - if (type === iface) { - context.reportError( - `Type ${type.name} cannot implement itself because it would create a circular reference.`, - getAllImplementsInterfaceNodes(type, iface), - ); - continue; - } - - if (ifaceTypeNames[iface.name]) { - context.reportError( - `Type ${type.name} can only implement ${iface.name} once.`, - getAllImplementsInterfaceNodes(type, iface), - ); - continue; - } - - ifaceTypeNames[iface.name] = true; - - validateTypeImplementsAncestors(context, type, iface); - validateTypeImplementsInterface(context, type, iface); - } -} - -function validateTypeImplementsInterface( - context: SchemaValidationContext, - type: GraphQLObjectType | GraphQLInterfaceType, - iface: GraphQLInterfaceType, -): void { - const typeFieldMap = type.getFields(); - - // Assert each interface field is implemented. - for (const ifaceField of objectValues(iface.getFields())) { - const fieldName = ifaceField.name; - const typeField = typeFieldMap[fieldName]; - - // Assert interface field exists on type. - if (!typeField) { - context.reportError( - `Interface field ${iface.name}.${fieldName} expected but ${type.name} does not provide it.`, - [ifaceField.astNode, ...getAllNodes(type)], - ); - continue; - } - - // Assert interface field type is satisfied by type field type, by being - // a valid subtype. (covariant) - if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) { - context.reportError( - `Interface field ${iface.name}.${fieldName} expects type ` + - `${inspect(ifaceField.type)} but ${type.name}.${fieldName} ` + - `is type ${inspect(typeField.type)}.`, - [ - // istanbul ignore next (TODO need to write coverage tests) - ifaceField.astNode?.type, - // istanbul ignore next (TODO need to write coverage tests) - typeField.astNode?.type, - ], - ); - } - - // Assert each interface field arg is implemented. - for (const ifaceArg of ifaceField.args) { - const argName = ifaceArg.name; - const typeArg = find(typeField.args, (arg) => arg.name === argName); - - // Assert interface field arg exists on object field. - if (!typeArg) { - context.reportError( - `Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${type.name}.${fieldName} does not provide it.`, - [ifaceArg.astNode, typeField.astNode], - ); - continue; - } - - // Assert interface field arg type matches object field arg type. - // (invariant) - // TODO: change to contravariant? - if (!isEqualType(ifaceArg.type, typeArg.type)) { - context.reportError( - `Interface field argument ${iface.name}.${fieldName}(${argName}:) ` + - `expects type ${inspect(ifaceArg.type)} but ` + - `${type.name}.${fieldName}(${argName}:) is type ` + - `${inspect(typeArg.type)}.`, - [ - // istanbul ignore next (TODO need to write coverage tests) - ifaceArg.astNode?.type, - // istanbul ignore next (TODO need to write coverage tests) - typeArg.astNode?.type, - ], - ); - } - - // TODO: validate default values? - } - - // Assert additional arguments must not be required. - for (const typeArg of typeField.args) { - const argName = typeArg.name; - const ifaceArg = find(ifaceField.args, (arg) => arg.name === argName); - if (!ifaceArg && isRequiredArgument(typeArg)) { - context.reportError( - `Object field ${type.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`, - [typeArg.astNode, ifaceField.astNode], - ); - } - } - } -} - -function validateTypeImplementsAncestors( - context: SchemaValidationContext, - type: GraphQLObjectType | GraphQLInterfaceType, - iface: GraphQLInterfaceType, -): void { - const ifaceInterfaces = type.getInterfaces(); - for (const transitive of iface.getInterfaces()) { - if (ifaceInterfaces.indexOf(transitive) === -1) { - context.reportError( - transitive === type - ? `Type ${type.name} cannot implement ${iface.name} because it would create a circular reference.` - : `Type ${type.name} must implement ${transitive.name} because it is implemented by ${iface.name}.`, - [ - ...getAllImplementsInterfaceNodes(iface, transitive), - ...getAllImplementsInterfaceNodes(type, iface), - ], - ); - } - } -} - -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?.type, - ); - } - - if (isRequiredInputField(field) && field.deprecationReason != null) { - context.reportError( - `Required input field ${inputObj.name}.${field.name} cannot be deprecated.`, - [ - getDeprecatedDirectiveNode(field.astNode), - // istanbul ignore next (TODO need to write coverage tests) - field.astNode?.type, - ], - ); - } - } -} - -function createInputObjectCircularRefsValidator( - context: SchemaValidationContext, -): (GraphQLInputObjectType) => void { - // 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): void { - 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 { - let subNodes = []; - for (const node of getAllNodes(object)) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - subNodes = subNodes.concat(getter(node) ?? []); - } - return subNodes; -} - -function getAllImplementsInterfaceNodes( - type: GraphQLObjectType | GraphQLInterfaceType, - 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, - ); -} - -function getDeprecatedDirectiveNode( - definitionNode: ?{ +directives?: $ReadOnlyArray, ... }, -): ?DirectiveNode { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - return definitionNode?.directives?.find( - (node) => node.name.value === GraphQLDeprecatedDirective.name, - ); -} diff --git a/JS/node_modules/graphql/type/validate.mjs b/JS/node_modules/graphql/type/validate.mjs deleted file mode 100644 index ce9f7b0..0000000 --- a/JS/node_modules/graphql/type/validate.mjs +++ /dev/null @@ -1,528 +0,0 @@ -import find from "../polyfills/find.mjs"; -import objectValues from "../polyfills/objectValues.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { locatedError } from "../error/locatedError.mjs"; -import { isValidNameError } from "../utilities/assertValidName.mjs"; -import { isEqualType, isTypeSubTypeOf } from "../utilities/typeComparators.mjs"; -import { assertSchema } from "./schema.mjs"; -import { isIntrospectionType } from "./introspection.mjs"; -import { isDirective, GraphQLDeprecatedDirective } from "./directives.mjs"; -import { isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNamedType, isNonNullType, isInputType, isOutputType, isRequiredArgument, isRequiredInputField } from "./definition.mjs"; -/** - * 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)) { - var _getOperationTypeNode; - - context.reportError("Query root type must be Object type, it cannot be ".concat(inspect(queryType), "."), (_getOperationTypeNode = getOperationTypeNode(schema, 'query')) !== null && _getOperationTypeNode !== void 0 ? _getOperationTypeNode : queryType.astNode); - } - - var mutationType = schema.getMutationType(); - - if (mutationType && !isObjectType(mutationType)) { - var _getOperationTypeNode2; - - context.reportError('Mutation root type must be Object type if provided, it cannot be ' + "".concat(inspect(mutationType), "."), (_getOperationTypeNode2 = getOperationTypeNode(schema, 'mutation')) !== null && _getOperationTypeNode2 !== void 0 ? _getOperationTypeNode2 : mutationType.astNode); - } - - var subscriptionType = schema.getSubscriptionType(); - - if (subscriptionType && !isObjectType(subscriptionType)) { - var _getOperationTypeNode3; - - context.reportError('Subscription root type must be Object type if provided, it cannot be ' + "".concat(inspect(subscriptionType), "."), (_getOperationTypeNode3 = getOperationTypeNode(schema, 'subscription')) !== null && _getOperationTypeNode3 !== void 0 ? _getOperationTypeNode3 : subscriptionType.astNode); - } -} - -function getOperationTypeNode(schema, operation) { - var operationNodes = getAllSubNodes(schema, function (node) { - return node.operationTypes; - }); - - for (var _i2 = 0; _i2 < operationNodes.length; _i2++) { - var node = operationNodes[_i2]; - - if (node.operation === operation) { - return node.type; - } - } - - return undefined; -} - -function validateDirectives(context) { - for (var _i4 = 0, _context$schema$getDi2 = context.schema.getDirectives(); _i4 < _context$schema$getDi2.length; _i4++) { - var directive = _context$schema$getDi2[_i4]; - - // Ensure all directives are in fact GraphQL directives. - if (!isDirective(directive)) { - context.reportError("Expected directive but got: ".concat(inspect(directive), "."), directive === null || directive === void 0 ? void 0 : directive.astNode); - continue; - } // Ensure they are named correctly. - - - validateName(context, directive); // TODO: Ensure proper locations. - // Ensure the arguments are valid. - - for (var _i6 = 0, _directive$args2 = directive.args; _i6 < _directive$args2.length; _i6++) { - var arg = _directive$args2[_i6]; - // Ensure they are named correctly. - validateName(context, arg); // Ensure the type is an input type. - - if (!isInputType(arg.type)) { - context.reportError("The type of @".concat(directive.name, "(").concat(arg.name, ":) must be Input Type ") + "but got: ".concat(inspect(arg.type), "."), arg.astNode); - } - - if (isRequiredArgument(arg) && arg.deprecationReason != null) { - var _arg$astNode; - - context.reportError("Required argument @".concat(directive.name, "(").concat(arg.name, ":) cannot be deprecated."), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests) - (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0 ? void 0 : _arg$astNode.type]); - } - } - } -} - -function validateName(context, node) { - // Ensure names are valid, however introspection types opt out. - var error = isValidNameError(node.name); - - if (error) { - context.addError(locatedError(error, node.astNode)); - } -} - -function validateTypes(context) { - var validateInputObjectCircularRefs = createInputObjectCircularRefsValidator(context); - var typeMap = context.schema.getTypeMap(); - - for (var _i8 = 0, _objectValues2 = objectValues(typeMap); _i8 < _objectValues2.length; _i8++) { - var type = _objectValues2[_i8]; - - // Ensure all provided types are in fact GraphQL type. - if (!isNamedType(type)) { - context.reportError("Expected GraphQL named type but got: ".concat(inspect(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. - - validateInterfaces(context, type); - } else if (isInterfaceType(type)) { - // Ensure fields are valid. - validateFields(context, type); // Ensure interfaces implement the interfaces they claim to. - - validateInterfaces(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, 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)); - } - - for (var _i10 = 0; _i10 < fields.length; _i10++) { - var field = fields[_i10]; - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an output type - - if (!isOutputType(field.type)) { - var _field$astNode; - - 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) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type); - } // Ensure the arguments are valid - - - for (var _i12 = 0, _field$args2 = field.args; _i12 < _field$args2.length; _i12++) { - var arg = _field$args2[_i12]; - var argName = arg.name; // Ensure they are named correctly. - - validateName(context, arg); // Ensure the type is an input type - - if (!isInputType(arg.type)) { - var _arg$astNode2; - - context.reportError("The type of ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) must be Input ") + "Type but got: ".concat(inspect(arg.type), "."), (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type); - } - - if (isRequiredArgument(arg) && arg.deprecationReason != null) { - var _arg$astNode3; - - context.reportError("Required argument ".concat(type.name, ".").concat(field.name, "(").concat(argName, ":) cannot be deprecated."), [getDeprecatedDirectiveNode(arg.astNode), // istanbul ignore next (TODO need to write coverage tests) - (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0 ? void 0 : _arg$astNode3.type]); - } - } - } -} - -function validateInterfaces(context, type) { - var ifaceTypeNames = Object.create(null); - - for (var _i14 = 0, _type$getInterfaces2 = type.getInterfaces(); _i14 < _type$getInterfaces2.length; _i14++) { - var iface = _type$getInterfaces2[_i14]; - - if (!isInterfaceType(iface)) { - context.reportError("Type ".concat(inspect(type), " must only implement Interface types, ") + "it cannot implement ".concat(inspect(iface), "."), getAllImplementsInterfaceNodes(type, iface)); - continue; - } - - if (type === iface) { - context.reportError("Type ".concat(type.name, " cannot implement itself because it would create a circular reference."), getAllImplementsInterfaceNodes(type, iface)); - continue; - } - - if (ifaceTypeNames[iface.name]) { - context.reportError("Type ".concat(type.name, " can only implement ").concat(iface.name, " once."), getAllImplementsInterfaceNodes(type, iface)); - continue; - } - - ifaceTypeNames[iface.name] = true; - validateTypeImplementsAncestors(context, type, iface); - validateTypeImplementsInterface(context, type, iface); - } -} - -function validateTypeImplementsInterface(context, type, iface) { - var typeFieldMap = type.getFields(); // Assert each interface field is implemented. - - for (var _i16 = 0, _objectValues4 = objectValues(iface.getFields()); _i16 < _objectValues4.length; _i16++) { - var ifaceField = _objectValues4[_i16]; - var fieldName = ifaceField.name; - var typeField = typeFieldMap[fieldName]; // Assert interface field exists on type. - - if (!typeField) { - context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expected but ").concat(type.name, " does not provide it."), [ifaceField.astNode].concat(getAllNodes(type))); - continue; - } // Assert interface field type is satisfied by type field type, by being - // a valid subtype. (covariant) - - - if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) { - var _ifaceField$astNode, _typeField$astNode; - - context.reportError("Interface field ".concat(iface.name, ".").concat(fieldName, " expects type ") + "".concat(inspect(ifaceField.type), " but ").concat(type.name, ".").concat(fieldName, " ") + "is type ".concat(inspect(typeField.type), "."), [// istanbul ignore next (TODO need to write coverage tests) - (_ifaceField$astNode = ifaceField.astNode) === null || _ifaceField$astNode === void 0 ? void 0 : _ifaceField$astNode.type, // istanbul ignore next (TODO need to write coverage tests) - (_typeField$astNode = typeField.astNode) === null || _typeField$astNode === void 0 ? void 0 : _typeField$astNode.type]); - } // Assert each interface field arg is implemented. - - - var _loop = function _loop(_i18, _ifaceField$args2) { - var ifaceArg = _ifaceField$args2[_i18]; - var argName = ifaceArg.name; - var typeArg = find(typeField.args, function (arg) { - return arg.name === argName; - }); // Assert interface field arg exists on object field. - - if (!typeArg) { - context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) expected but ").concat(type.name, ".").concat(fieldName, " does not provide it."), [ifaceArg.astNode, typeField.astNode]); - return "continue"; - } // Assert interface field arg type matches object field arg type. - // (invariant) - // TODO: change to contravariant? - - - if (!isEqualType(ifaceArg.type, typeArg.type)) { - var _ifaceArg$astNode, _typeArg$astNode; - - context.reportError("Interface field argument ".concat(iface.name, ".").concat(fieldName, "(").concat(argName, ":) ") + "expects type ".concat(inspect(ifaceArg.type), " but ") + "".concat(type.name, ".").concat(fieldName, "(").concat(argName, ":) is type ") + "".concat(inspect(typeArg.type), "."), [// istanbul ignore next (TODO need to write coverage tests) - (_ifaceArg$astNode = ifaceArg.astNode) === null || _ifaceArg$astNode === void 0 ? void 0 : _ifaceArg$astNode.type, // istanbul ignore next (TODO need to write coverage tests) - (_typeArg$astNode = typeArg.astNode) === null || _typeArg$astNode === void 0 ? void 0 : _typeArg$astNode.type]); - } // TODO: validate default values? - - }; - - for (var _i18 = 0, _ifaceField$args2 = ifaceField.args; _i18 < _ifaceField$args2.length; _i18++) { - var _ret = _loop(_i18, _ifaceField$args2); - - if (_ret === "continue") continue; - } // Assert additional arguments must not be required. - - - var _loop2 = function _loop2(_i20, _typeField$args2) { - var typeArg = _typeField$args2[_i20]; - var argName = typeArg.name; - var ifaceArg = find(ifaceField.args, function (arg) { - return arg.name === argName; - }); - - if (!ifaceArg && isRequiredArgument(typeArg)) { - context.reportError("Object field ".concat(type.name, ".").concat(fieldName, " includes required argument ").concat(argName, " that is missing from the Interface field ").concat(iface.name, ".").concat(fieldName, "."), [typeArg.astNode, ifaceField.astNode]); - } - }; - - for (var _i20 = 0, _typeField$args2 = typeField.args; _i20 < _typeField$args2.length; _i20++) { - _loop2(_i20, _typeField$args2); - } - } -} - -function validateTypeImplementsAncestors(context, type, iface) { - var ifaceInterfaces = type.getInterfaces(); - - for (var _i22 = 0, _iface$getInterfaces2 = iface.getInterfaces(); _i22 < _iface$getInterfaces2.length; _i22++) { - var transitive = _iface$getInterfaces2[_i22]; - - if (ifaceInterfaces.indexOf(transitive) === -1) { - context.reportError(transitive === type ? "Type ".concat(type.name, " cannot implement ").concat(iface.name, " because it would create a circular reference.") : "Type ".concat(type.name, " must implement ").concat(transitive.name, " because it is implemented by ").concat(iface.name, "."), [].concat(getAllImplementsInterfaceNodes(iface, transitive), getAllImplementsInterfaceNodes(type, iface))); - } - } -} - -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); - - for (var _i24 = 0; _i24 < memberTypes.length; _i24++) { - var memberType = memberTypes[_i24]; - - 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))); - } - } -} - -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)); - } - - for (var _i26 = 0; _i26 < enumValues.length; _i26++) { - var enumValue = enumValues[_i26]; - 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); - } - } -} - -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 - - - for (var _i28 = 0; _i28 < fields.length; _i28++) { - var field = fields[_i28]; - // Ensure they are named correctly. - validateName(context, field); // Ensure the type is an input type - - if (!isInputType(field.type)) { - var _field$astNode2; - - context.reportError("The type of ".concat(inputObj.name, ".").concat(field.name, " must be Input Type ") + "but got: ".concat(inspect(field.type), "."), (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 ? void 0 : _field$astNode2.type); - } - - if (isRequiredInputField(field) && field.deprecationReason != null) { - var _field$astNode3; - - context.reportError("Required input field ".concat(inputObj.name, ".").concat(field.name, " cannot be deprecated."), [getDeprecatedDirectiveNode(field.astNode), // istanbul ignore next (TODO need to write coverage tests) - (_field$astNode3 = field.astNode) === null || _field$astNode3 === void 0 ? void 0 : _field$astNode3.type]); - } - } -} - -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()); - - for (var _i30 = 0; _i30 < fields.length; _i30++) { - var field = fields[_i30]; - - 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(); - } - } - - fieldPathIndexByTypeName[inputObj.name] = undefined; - } -} - -function getAllNodes(object) { - var astNode = object.astNode, - extensionASTNodes = object.extensionASTNodes; - return astNode ? extensionASTNodes ? [astNode].concat(extensionASTNodes) : [astNode] : extensionASTNodes !== null && extensionASTNodes !== void 0 ? extensionASTNodes : []; -} - -function getAllSubNodes(object, getter) { - var subNodes = []; - - for (var _i32 = 0, _getAllNodes2 = getAllNodes(object); _i32 < _getAllNodes2.length; _i32++) { - var _getter; - - var node = _getAllNodes2[_i32]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - subNodes = subNodes.concat((_getter = getter(node)) !== null && _getter !== void 0 ? _getter : []); - } - - return subNodes; -} - -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; - }); -} - -function getDeprecatedDirectiveNode(definitionNode) { - var _definitionNode$direc; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - return definitionNode === null || definitionNode === void 0 ? void 0 : (_definitionNode$direc = definitionNode.directives) === null || _definitionNode$direc === void 0 ? void 0 : _definitionNode$direc.find(function (node) { - return node.name.value === GraphQLDeprecatedDirective.name; - }); -} diff --git a/JS/node_modules/graphql/utilities/TypeInfo.d.ts b/JS/node_modules/graphql/utilities/TypeInfo.d.ts deleted file mode 100644 index 499fb02..0000000 --- a/JS/node_modules/graphql/utilities/TypeInfo.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { Visitor } from '../language/visitor'; -import { ASTNode, ASTKindToNode, FieldNode } from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; -import { GraphQLDirective } from '../type/directives'; -import { - GraphQLType, - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, - GraphQLEnumValue, -} from '../type/definition'; - -/** - * 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 { - constructor( - schema: GraphQLSchema, - // NOTE: this experimental optional second parameter is only needed in order - // to support non-spec-compliant code bases. You should never need to use it. - // It may disappear in the future. - getFieldDefFn?: getFieldDef, - // Initial type may be provided in rare cases to facilitate traversals - // beginning somewhere other than documents. - initialType?: GraphQLType, - ); - - getType(): Maybe; - getParentType(): Maybe; - getInputType(): Maybe; - getParentInputType(): Maybe; - getFieldDef(): GraphQLField>; - getDefaultValue(): Maybe; - getDirective(): Maybe; - getArgument(): Maybe; - getEnumValue(): Maybe; - enter(node: ASTNode): any; - leave(node: ASTNode): any; -} - -type getFieldDef = ( - schema: GraphQLSchema, - parentType: GraphQLType, - fieldNode: FieldNode, -) => Maybe>; - -/** - * Creates a new visitor instance which maintains a provided TypeInfo instance - * along with visiting visitor. - */ -export function visitWithTypeInfo( - typeInfo: TypeInfo, - visitor: Visitor, -): Visitor; diff --git a/JS/node_modules/graphql/utilities/TypeInfo.js b/JS/node_modules/graphql/utilities/TypeInfo.js deleted file mode 100644 index ccffc74..0000000 --- a/JS/node_modules/graphql/utilities/TypeInfo.js +++ /dev/null @@ -1,397 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.visitWithTypeInfo = visitWithTypeInfo; -exports.TypeInfo = void 0; - -var _find = _interopRequireDefault(require("../polyfills/find.js")); - -var _kinds = require("../language/kinds.js"); - -var _ast = require("../language/ast.js"); - -var _visitor = require("../language/visitor.js"); - -var _definition = require("../type/definition.js"); - -var _introspection = require("../type/introspection.js"); - -var _typeFromAST = require("./typeFromAST.js"); - -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 code bases. 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 !== null && getFieldDefFn !== void 0 ? 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; - - switch (node.operation) { - case 'query': - type = schema.getQueryType(); - break; - - case 'mutation': - type = schema.getMutationType(); - break; - - case 'subscription': - type = schema.getSubscriptionType(); - break; - } - - 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 _this$getDirective; - - var argDef; - var argType; - var fieldOrDirective = (_this$getDirective = this.getDirective()) !== null && _this$getDirective !== void 0 ? _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]; - } -} -/** - * 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 = (0, _visitor.getVisitFn)(visitor, node.kind, - /* isLeaving */ - false); - - if (fn) { - var result = fn.apply(visitor, arguments); - - if (result !== undefined) { - typeInfo.leave(node); - - if ((0, _ast.isNode)(result)) { - typeInfo.enter(result); - } - } - - return result; - } - }, - leave: function leave(node) { - var fn = (0, _visitor.getVisitFn)(visitor, node.kind, - /* isLeaving */ - true); - var result; - - if (fn) { - result = fn.apply(visitor, arguments); - } - - typeInfo.leave(node); - return result; - } - }; -} diff --git a/JS/node_modules/graphql/utilities/TypeInfo.js.flow b/JS/node_modules/graphql/utilities/TypeInfo.js.flow deleted file mode 100644 index aac8c78..0000000 --- a/JS/node_modules/graphql/utilities/TypeInfo.js.flow +++ /dev/null @@ -1,359 +0,0 @@ -// @flow strict -import find from '../polyfills/find'; - -import type { Visitor } from '../language/visitor'; -import type { ASTNode, ASTKindToNode, FieldNode } from '../language/ast'; -import { Kind } from '../language/kinds'; -import { isNode } from '../language/ast'; -import { getVisitFn } from '../language/visitor'; - -import type { GraphQLSchema } from '../type/schema'; -import type { GraphQLDirective } from '../type/directives'; -import type { - GraphQLType, - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, - GraphQLInputField, - GraphQLEnumValue, -} from '../type/definition'; -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 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 code bases. 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, - ) { - 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; - switch (node.operation) { - case 'query': - type = schema.getQueryType(); - break; - case 'mutation': - type = schema.getMutationType(); - break; - case 'subscription': - type = schema.getSubscriptionType(); - break; - } - 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]; - } -} - -/** - * 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; - }, - }; -} diff --git a/JS/node_modules/graphql/utilities/TypeInfo.mjs b/JS/node_modules/graphql/utilities/TypeInfo.mjs deleted file mode 100644 index 00e988f..0000000 --- a/JS/node_modules/graphql/utilities/TypeInfo.mjs +++ /dev/null @@ -1,378 +0,0 @@ -import find from "../polyfills/find.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { isNode } from "../language/ast.mjs"; -import { getVisitFn } from "../language/visitor.mjs"; -import { isObjectType, isInterfaceType, isEnumType, isInputObjectType, isListType, isCompositeType, isInputType, isOutputType, getNullableType, getNamedType } from "../type/definition.mjs"; -import { SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from "../type/introspection.mjs"; -import { typeFromAST } from "./typeFromAST.mjs"; -/** - * 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 code bases. 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 !== null && getFieldDefFn !== void 0 ? 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; - - switch (node.operation) { - case 'query': - type = schema.getQueryType(); - break; - - case 'mutation': - type = schema.getMutationType(); - break; - - case 'subscription': - type = schema.getSubscriptionType(); - break; - } - - 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 _this$getDirective; - - var argDef; - var argType; - var fieldOrDirective = (_this$getDirective = this.getDirective()) !== null && _this$getDirective !== void 0 ? _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]; - } -} -/** - * 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; - } - }; -} diff --git a/JS/node_modules/graphql/utilities/assertValidName.d.ts b/JS/node_modules/graphql/utilities/assertValidName.d.ts deleted file mode 100644 index 5a1011e..0000000 --- a/JS/node_modules/graphql/utilities/assertValidName.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { GraphQLError } from '../error/GraphQLError'; - -/** - * Upholds the spec rules about naming. - */ -export function assertValidName(name: string): string; - -/** - * Returns an Error if a name is invalid. - */ -export function isValidNameError(name: string): GraphQLError | undefined; diff --git a/JS/node_modules/graphql/utilities/assertValidName.js b/JS/node_modules/graphql/utilities/assertValidName.js deleted file mode 100644 index 5affb00..0000000 --- a/JS/node_modules/graphql/utilities/assertValidName.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.assertValidName = assertValidName; -exports.isValidNameError = isValidNameError; - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _GraphQLError = require("../error/GraphQLError.js"); - -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) { - typeof name === 'string' || (0, _devAssert.default)(0, 'Expected name to be a string.'); - - 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.")); - } - - if (!NAME_RX.test(name)) { - return new _GraphQLError.GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not.")); - } -} diff --git a/JS/node_modules/graphql/utilities/assertValidName.js.flow b/JS/node_modules/graphql/utilities/assertValidName.js.flow deleted file mode 100644 index 2e2493a..0000000 --- a/JS/node_modules/graphql/utilities/assertValidName.js.flow +++ /dev/null @@ -1,34 +0,0 @@ -// @flow strict -import devAssert from '../jsutils/devAssert'; - -import { GraphQLError } from '../error/GraphQLError'; - -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): GraphQLError | void { - devAssert(typeof name === 'string', 'Expected name to be a string.'); - if (name.length > 1 && name[0] === '_' && name[1] === '_') { - return new GraphQLError( - `Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.`, - ); - } - if (!NAME_RX.test(name)) { - return new GraphQLError( - `Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "${name}" does not.`, - ); - } -} diff --git a/JS/node_modules/graphql/utilities/assertValidName.mjs b/JS/node_modules/graphql/utilities/assertValidName.mjs deleted file mode 100644 index d504d22..0000000 --- a/JS/node_modules/graphql/utilities/assertValidName.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import devAssert from "../jsutils/devAssert.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -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) { - typeof name === 'string' || devAssert(0, 'Expected name to be a string.'); - - if (name.length > 1 && name[0] === '_' && name[1] === '_') { - return new GraphQLError("Name \"".concat(name, "\" must not begin with \"__\", which is reserved by GraphQL introspection.")); - } - - if (!NAME_RX.test(name)) { - return new GraphQLError("Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"".concat(name, "\" does not.")); - } -} diff --git a/JS/node_modules/graphql/utilities/astFromValue.d.ts b/JS/node_modules/graphql/utilities/astFromValue.d.ts deleted file mode 100644 index 19f0a8f..0000000 --- a/JS/node_modules/graphql/utilities/astFromValue.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { ValueNode } from '../language/ast'; -import { GraphQLInputType } from '../type/definition'; - -/** - * 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: any, - type: GraphQLInputType, -): Maybe; diff --git a/JS/node_modules/graphql/utilities/astFromValue.js b/JS/node_modules/graphql/utilities/astFromValue.js deleted file mode 100644 index 6872309..0000000 --- a/JS/node_modules/graphql/utilities/astFromValue.js +++ /dev/null @@ -1,196 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.astFromValue = astFromValue; - -var _isFinite = _interopRequireDefault(require("../polyfills/isFinite.js")); - -var _objectValues3 = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _safeArrayFrom = _interopRequireDefault(require("../jsutils/safeArrayFrom.js")); - -var _kinds = require("../language/kinds.js"); - -var _scalars = require("../type/scalars.js"); - -var _definition = require("../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Produces a GraphQL Value AST given a JavaScript object. - * Function will match JavaScript/JSON values to GraphQL AST schema format - * by using suggested GraphQLInputType. For example: - * - * astFromValue("value", GraphQLString) - * - * 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 === null || astValue === void 0 ? void 0 : astValue.kind) === _kinds.Kind.NULL) { - return null; - } - - return astValue; - } // only explicit null, not undefined, NaN - - - if (value === null) { - return { - kind: _kinds.Kind.NULL - }; - } // undefined - - - if (value === undefined) { - 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; - var items = (0, _safeArrayFrom.default)(value); - - if (items != null) { - var valuesNodes = []; - - for (var _i2 = 0; _i2 < items.length; _i2++) { - var item = items[_i2]; - var itemNode = astFromValue(item, itemType); - - if (itemNode != null) { - 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 = []; - - for (var _i4 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) { - var field = _objectValues2[_i4]; - 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 - }); - } - } - - return { - kind: _kinds.Kind.OBJECT, - fields: fieldNodes - }; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - 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 (serialized == null) { - 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' && (0, _isFinite.default)(serialized)) { - 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), ".")); - } // istanbul ignore next (Not reachable. All possible input types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type)); -} -/** - * IntValue: - * - NegativeSign? 0 - * - NegativeSign? NonZeroDigit ( Digit+ )? - */ - - -var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/JS/node_modules/graphql/utilities/astFromValue.js.flow b/JS/node_modules/graphql/utilities/astFromValue.js.flow deleted file mode 100644 index d7528ee..0000000 --- a/JS/node_modules/graphql/utilities/astFromValue.js.flow +++ /dev/null @@ -1,154 +0,0 @@ -// @flow strict -import isFinite from '../polyfills/isFinite'; -import objectValues from '../polyfills/objectValues'; - -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; -import isObjectLike from '../jsutils/isObjectLike'; -import safeArrayFrom from '../jsutils/safeArrayFrom'; - -import type { ValueNode } from '../language/ast'; -import { Kind } from '../language/kinds'; - -import type { GraphQLInputType } from '../type/definition'; -import { GraphQLID } from '../type/scalars'; -import { - isLeafType, - isEnumType, - isInputObjectType, - isListType, - isNonNullType, -} from '../type/definition'; - -/** - * Produces a GraphQL Value AST given a JavaScript object. - * Function will match JavaScript/JSON values to GraphQL AST schema format - * by using suggested GraphQLInputType. For example: - * - * astFromValue("value", GraphQLString) - * - * 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?.kind === Kind.NULL) { - return null; - } - return astValue; - } - - // only explicit null, not undefined, NaN - if (value === null) { - return { kind: Kind.NULL }; - } - - // undefined - if (value === undefined) { - 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; - - const items = safeArrayFrom(value); - if (items != null) { - const valuesNodes = []; - for (const item of items) { - const itemNode = astFromValue(item, itemType); - if (itemNode != null) { - 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 }; - } - - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - 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 (serialized == null) { - 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' && isFinite(serialized)) { - 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)}.`); - } - - // istanbul ignore next (Not reachable. All possible input types have been considered) - invariant(false, 'Unexpected input type: ' + inspect((type: empty))); -} - -/** - * IntValue: - * - NegativeSign? 0 - * - NegativeSign? NonZeroDigit ( Digit+ )? - */ -const integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/JS/node_modules/graphql/utilities/astFromValue.mjs b/JS/node_modules/graphql/utilities/astFromValue.mjs deleted file mode 100644 index b35fb6c..0000000 --- a/JS/node_modules/graphql/utilities/astFromValue.mjs +++ /dev/null @@ -1,178 +0,0 @@ -import isFinite from "../polyfills/isFinite.mjs"; -import objectValues from "../polyfills/objectValues.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import safeArrayFrom from "../jsutils/safeArrayFrom.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { GraphQLID } from "../type/scalars.mjs"; -import { isLeafType, isEnumType, isInputObjectType, isListType, isNonNullType } from "../type/definition.mjs"; -/** - * Produces a GraphQL Value AST given a JavaScript object. - * Function will match JavaScript/JSON values to GraphQL AST schema format - * by using suggested GraphQLInputType. For example: - * - * astFromValue("value", GraphQLString) - * - * 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 === null || astValue === void 0 ? void 0 : astValue.kind) === Kind.NULL) { - return null; - } - - return astValue; - } // only explicit null, not undefined, NaN - - - if (value === null) { - return { - kind: Kind.NULL - }; - } // undefined - - - if (value === undefined) { - 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; - var items = safeArrayFrom(value); - - if (items != null) { - var valuesNodes = []; - - for (var _i2 = 0; _i2 < items.length; _i2++) { - var item = items[_i2]; - var itemNode = astFromValue(item, itemType); - - if (itemNode != null) { - 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 = []; - - for (var _i4 = 0, _objectValues2 = objectValues(type.getFields()); _i4 < _objectValues2.length; _i4++) { - var field = _objectValues2[_i4]; - 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 - }); - } - } - - return { - kind: Kind.OBJECT, - fields: fieldNodes - }; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - 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 (serialized == null) { - 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' && isFinite(serialized)) { - 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), ".")); - } // istanbul ignore next (Not reachable. All possible input types have been considered) - - - false || invariant(0, 'Unexpected input type: ' + inspect(type)); -} -/** - * IntValue: - * - NegativeSign? 0 - * - NegativeSign? NonZeroDigit ( Digit+ )? - */ - -var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; diff --git a/JS/node_modules/graphql/utilities/buildASTSchema.d.ts b/JS/node_modules/graphql/utilities/buildASTSchema.d.ts deleted file mode 100644 index e051436..0000000 --- a/JS/node_modules/graphql/utilities/buildASTSchema.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { DocumentNode } from '../language/ast'; -import { Source } from '../language/source'; -import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; -import { ParseOptions } from '../language/parser'; - -export interface BuildSchemaOptions extends 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; - -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - */ -export function buildSchema( - source: string | Source, - options?: BuildSchemaOptions & ParseOptions, -): GraphQLSchema; diff --git a/JS/node_modules/graphql/utilities/buildASTSchema.js b/JS/node_modules/graphql/utilities/buildASTSchema.js deleted file mode 100644 index 859e869..0000000 --- a/JS/node_modules/graphql/utilities/buildASTSchema.js +++ /dev/null @@ -1,117 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.buildASTSchema = buildASTSchema; -exports.buildSchema = buildSchema; - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _kinds = require("../language/kinds.js"); - -var _parser = require("../language/parser.js"); - -var _validate = require("../validation/validate.js"); - -var _schema = require("../type/schema.js"); - -var _directives = require("../type/directives.js"); - -var _extendSchema = require("./extendSchema.js"); - -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 != null && documentAST.kind === _kinds.Kind.DOCUMENT || (0, _devAssert.default)(0, 'Must provide valid Document AST.'); - - if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) { - (0, _validate.assertValidSDL)(documentAST); - } - - var emptySchemaConfig = { - description: undefined, - types: [], - directives: [], - extensions: undefined, - extensionASTNodes: [], - assumeValid: false - }; - var config = (0, _extendSchema.extendSchemaImpl)(emptySchemaConfig, documentAST, options); - - if (config.astNode == null) { - for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) { - var type = _config$types2[_i2]; - - switch (type.name) { - // 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. - case 'Query': - config.query = type; - break; - - case 'Mutation': - config.mutation = type; - break; - - case 'Subscription': - config.subscription = type; - break; - } - } - } - - var directives = config.directives; // If specified directives were not explicitly declared, add them. - - var _loop = function _loop(_i4) { - var stdDirective = _directives.specifiedDirectives[_i4]; - - if (directives.every(function (directive) { - return directive.name !== stdDirective.name; - })) { - directives.push(stdDirective); - } - }; - - for (var _i4 = 0; _i4 < _directives.specifiedDirectives.length; _i4++) { - _loop(_i4); - } - - return new _schema.GraphQLSchema(config); -} -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - */ - - -function buildSchema(source, options) { - var document = (0, _parser.parse)(source, { - noLocation: options === null || options === void 0 ? void 0 : options.noLocation, - allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields, - allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces, - experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables - }); - return buildASTSchema(document, { - commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions, - assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL, - assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid - }); -} diff --git a/JS/node_modules/graphql/utilities/buildASTSchema.js.flow b/JS/node_modules/graphql/utilities/buildASTSchema.js.flow deleted file mode 100644 index a271c8c..0000000 --- a/JS/node_modules/graphql/utilities/buildASTSchema.js.flow +++ /dev/null @@ -1,129 +0,0 @@ -// @flow strict -import devAssert from '../jsutils/devAssert'; - -import type { Source } from '../language/source'; -import type { DocumentNode } from '../language/ast'; -import type { ParseOptions } from '../language/parser'; -import { Kind } from '../language/kinds'; -import { parse } from '../language/parser'; - -import { assertValidSDL } from '../validation/validate'; - -import type { GraphQLSchemaValidationOptions } from '../type/schema'; -import { GraphQLSchema } from '../type/schema'; -import { specifiedDirectives } from '../type/directives'; - -import { extendSchemaImpl } from './extendSchema'; - -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 { - devAssert( - documentAST != null && documentAST.kind === Kind.DOCUMENT, - 'Must provide valid Document AST.', - ); - - if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { - assertValidSDL(documentAST); - } - - const emptySchemaConfig = { - description: undefined, - types: [], - directives: [], - extensions: undefined, - extensionASTNodes: [], - assumeValid: false, - }; - const config = extendSchemaImpl(emptySchemaConfig, documentAST, options); - - if (config.astNode == null) { - for (const type of config.types) { - switch (type.name) { - // 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. - case 'Query': - config.query = (type: any); - break; - case 'Mutation': - config.mutation = (type: any); - break; - case 'Subscription': - config.subscription = (type: any); - break; - } - } - } - - const { directives } = config; - // If specified directives were not explicitly declared, add them. - for (const stdDirective of specifiedDirectives) { - if (directives.every((directive) => directive.name !== stdDirective.name)) { - directives.push(stdDirective); - } - } - - return new GraphQLSchema(config); -} - -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - */ -export function buildSchema( - source: string | Source, - options?: {| ...BuildSchemaOptions, ...ParseOptions |}, -): GraphQLSchema { - const document = parse(source, { - noLocation: options?.noLocation, - allowLegacySDLEmptyFields: options?.allowLegacySDLEmptyFields, - allowLegacySDLImplementsInterfaces: - options?.allowLegacySDLImplementsInterfaces, - experimentalFragmentVariables: options?.experimentalFragmentVariables, - }); - - return buildASTSchema(document, { - commentDescriptions: options?.commentDescriptions, - assumeValidSDL: options?.assumeValidSDL, - assumeValid: options?.assumeValid, - }); -} diff --git a/JS/node_modules/graphql/utilities/buildASTSchema.mjs b/JS/node_modules/graphql/utilities/buildASTSchema.mjs deleted file mode 100644 index 8c4d4b1..0000000 --- a/JS/node_modules/graphql/utilities/buildASTSchema.mjs +++ /dev/null @@ -1,100 +0,0 @@ -import devAssert from "../jsutils/devAssert.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { parse } from "../language/parser.mjs"; -import { assertValidSDL } from "../validation/validate.mjs"; -import { GraphQLSchema } from "../type/schema.mjs"; -import { specifiedDirectives } from "../type/directives.mjs"; -import { extendSchemaImpl } from "./extendSchema.mjs"; - -/** - * 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 != null && documentAST.kind === Kind.DOCUMENT || devAssert(0, 'Must provide valid Document AST.'); - - if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) { - assertValidSDL(documentAST); - } - - var emptySchemaConfig = { - description: undefined, - types: [], - directives: [], - extensions: undefined, - extensionASTNodes: [], - assumeValid: false - }; - var config = extendSchemaImpl(emptySchemaConfig, documentAST, options); - - if (config.astNode == null) { - for (var _i2 = 0, _config$types2 = config.types; _i2 < _config$types2.length; _i2++) { - var type = _config$types2[_i2]; - - switch (type.name) { - // 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. - case 'Query': - config.query = type; - break; - - case 'Mutation': - config.mutation = type; - break; - - case 'Subscription': - config.subscription = type; - break; - } - } - } - - var directives = config.directives; // If specified directives were not explicitly declared, add them. - - var _loop = function _loop(_i4) { - var stdDirective = specifiedDirectives[_i4]; - - if (directives.every(function (directive) { - return directive.name !== stdDirective.name; - })) { - directives.push(stdDirective); - } - }; - - for (var _i4 = 0; _i4 < specifiedDirectives.length; _i4++) { - _loop(_i4); - } - - return new GraphQLSchema(config); -} -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - */ - -export function buildSchema(source, options) { - var document = parse(source, { - noLocation: options === null || options === void 0 ? void 0 : options.noLocation, - allowLegacySDLEmptyFields: options === null || options === void 0 ? void 0 : options.allowLegacySDLEmptyFields, - allowLegacySDLImplementsInterfaces: options === null || options === void 0 ? void 0 : options.allowLegacySDLImplementsInterfaces, - experimentalFragmentVariables: options === null || options === void 0 ? void 0 : options.experimentalFragmentVariables - }); - return buildASTSchema(document, { - commentDescriptions: options === null || options === void 0 ? void 0 : options.commentDescriptions, - assumeValidSDL: options === null || options === void 0 ? void 0 : options.assumeValidSDL, - assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid - }); -} diff --git a/JS/node_modules/graphql/utilities/buildClientSchema.d.ts b/JS/node_modules/graphql/utilities/buildClientSchema.d.ts deleted file mode 100644 index a541cd3..0000000 --- a/JS/node_modules/graphql/utilities/buildClientSchema.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { GraphQLSchema, GraphQLSchemaValidationOptions } from '../type/schema'; - -import { IntrospectionQuery } from './getIntrospectionQuery'; - -/** - * 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?: GraphQLSchemaValidationOptions, -): GraphQLSchema; diff --git a/JS/node_modules/graphql/utilities/buildClientSchema.js b/JS/node_modules/graphql/utilities/buildClientSchema.js deleted file mode 100644 index 979f6d0..0000000 --- a/JS/node_modules/graphql/utilities/buildClientSchema.js +++ /dev/null @@ -1,335 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.buildClientSchema = buildClientSchema; - -var _objectValues = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _parser = require("../language/parser.js"); - -var _schema = require("../type/schema.js"); - -var _directives = require("../type/directives.js"); - -var _scalars = require("../type/scalars.js"); - -var _introspection = require("../type/introspection.js"); - -var _definition = require("../type/definition.js"); - -var _valueFromAST = require("./valueFromAST.js"); - -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, _devAssert.default)(0, "Invalid or incomplete introspection result. Ensure that you are passing \"data\" property of introspection response and no \"errors\" was returned alongside: ".concat((0, _inspect.default)(introspection), ".")); // 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); - }); // Include standard types only if they are used. - - for (var _i2 = 0, _ref2 = [].concat(_scalars.specifiedScalarTypes, _introspection.introspectionTypes); _i2 < _ref2.length; _i2++) { - var stdType = _ref2[_i2]; - - 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({ - description: schemaIntrospection.description, - query: queryType, - mutation: mutationType, - subscription: subscriptionType, - types: (0, _objectValues.default)(typeMap), - directives: directives, - assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid - }); // 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 new _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 new _definition.GraphQLNonNull((0, _definition.assertNullableType)(nullableType)); - } - - return getNamedType(typeRef); - } - - function getNamedType(typeRef) { - var typeName = typeRef.name; - - if (!typeName) { - throw new Error("Unknown type reference: ".concat((0, _inspect.default)(typeRef), ".")); - } - - 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 getObjectType(typeRef) { - return (0, _definition.assertObjectType)(getNamedType(typeRef)); - } - - function getInterfaceType(typeRef) { - return (0, _definition.assertInterfaceType)(getNamedType(typeRef)); - } // Given a type's introspection result, construct the correct - // GraphQLType instance. - - - function buildType(type) { - if (type != null && type.name != null && type.kind != null) { - 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); - } - } - - var typeStr = (0, _inspect.default)(type); - throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(typeStr, ".")); - } - - function buildScalarDef(scalarIntrospection) { - return new _definition.GraphQLScalarType({ - name: scalarIntrospection.name, - description: scalarIntrospection.description, - specifiedByUrl: scalarIntrospection.specifiedByUrl - }); - } - - function buildImplementationsList(implementingIntrospection) { - // TODO: Temporary workaround until GraphQL ecosystem will fully support - // 'interfaces' on interface types. - if (implementingIntrospection.interfaces === null && implementingIntrospection.kind === _introspection.TypeKind.INTERFACE) { - return []; - } - - if (!implementingIntrospection.interfaces) { - var implementingIntrospectionStr = (0, _inspect.default)(implementingIntrospection); - throw new Error("Introspection result missing interfaces: ".concat(implementingIntrospectionStr, ".")); - } - - return implementingIntrospection.interfaces.map(getInterfaceType); - } - - function buildObjectDef(objectIntrospection) { - return new _definition.GraphQLObjectType({ - name: objectIntrospection.name, - description: objectIntrospection.description, - interfaces: function interfaces() { - return buildImplementationsList(objectIntrospection); - }, - fields: function fields() { - return buildFieldDefMap(objectIntrospection); - } - }); - } - - function buildInterfaceDef(interfaceIntrospection) { - return new _definition.GraphQLInterfaceType({ - name: interfaceIntrospection.name, - description: interfaceIntrospection.description, - interfaces: function interfaces() { - return buildImplementationsList(interfaceIntrospection); - }, - fields: function fields() { - return buildFieldDefMap(interfaceIntrospection); - } - }); - } - - function buildUnionDef(unionIntrospection) { - if (!unionIntrospection.possibleTypes) { - var unionIntrospectionStr = (0, _inspect.default)(unionIntrospection); - throw new Error("Introspection result missing possibleTypes: ".concat(unionIntrospectionStr, ".")); - } - - return new _definition.GraphQLUnionType({ - name: unionIntrospection.name, - description: unionIntrospection.description, - types: function types() { - return unionIntrospection.possibleTypes.map(getObjectType); - } - }); - } - - function buildEnumDef(enumIntrospection) { - if (!enumIntrospection.enumValues) { - var enumIntrospectionStr = (0, _inspect.default)(enumIntrospection); - throw new Error("Introspection result missing enumValues: ".concat(enumIntrospectionStr, ".")); - } - - 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) { - var inputObjectIntrospectionStr = (0, _inspect.default)(inputObjectIntrospection); - throw new Error("Introspection result missing inputFields: ".concat(inputObjectIntrospectionStr, ".")); - } - - 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: ".concat((0, _inspect.default)(typeIntrospection), ".")); - } - - return (0, _keyValMap.default)(typeIntrospection.fields, function (fieldIntrospection) { - return fieldIntrospection.name; - }, buildField); - } - - function buildField(fieldIntrospection) { - var type = getType(fieldIntrospection.type); - - if (!(0, _definition.isOutputType)(type)) { - var typeStr = (0, _inspect.default)(type); - throw new Error("Introspection must provide output type for fields, but received: ".concat(typeStr, ".")); - } - - if (!fieldIntrospection.args) { - var fieldIntrospectionStr = (0, _inspect.default)(fieldIntrospection); - throw new Error("Introspection result missing field args: ".concat(fieldIntrospectionStr, ".")); - } - - return { - description: fieldIntrospection.description, - deprecationReason: fieldIntrospection.deprecationReason, - type: type, - args: buildInputValueDefMap(fieldIntrospection.args) - }; - } - - function buildInputValueDefMap(inputValueIntrospections) { - return (0, _keyValMap.default)(inputValueIntrospections, function (inputValue) { - return inputValue.name; - }, buildInputValue); - } - - function buildInputValue(inputValueIntrospection) { - var type = getType(inputValueIntrospection.type); - - if (!(0, _definition.isInputType)(type)) { - var typeStr = (0, _inspect.default)(type); - throw new Error("Introspection must provide input type for arguments, but received: ".concat(typeStr, ".")); - } - - var defaultValue = inputValueIntrospection.defaultValue != null ? (0, _valueFromAST.valueFromAST)((0, _parser.parseValue)(inputValueIntrospection.defaultValue), type) : undefined; - return { - description: inputValueIntrospection.description, - type: type, - defaultValue: defaultValue, - deprecationReason: inputValueIntrospection.deprecationReason - }; - } - - function buildDirective(directiveIntrospection) { - if (!directiveIntrospection.args) { - var directiveIntrospectionStr = (0, _inspect.default)(directiveIntrospection); - throw new Error("Introspection result missing directive args: ".concat(directiveIntrospectionStr, ".")); - } - - if (!directiveIntrospection.locations) { - var _directiveIntrospectionStr = (0, _inspect.default)(directiveIntrospection); - - throw new Error("Introspection result missing directive locations: ".concat(_directiveIntrospectionStr, ".")); - } - - return new _directives.GraphQLDirective({ - name: directiveIntrospection.name, - description: directiveIntrospection.description, - isRepeatable: directiveIntrospection.isRepeatable, - locations: directiveIntrospection.locations.slice(), - args: buildInputValueDefMap(directiveIntrospection.args) - }); - } -} diff --git a/JS/node_modules/graphql/utilities/buildClientSchema.js.flow b/JS/node_modules/graphql/utilities/buildClientSchema.js.flow deleted file mode 100644 index 6123954..0000000 --- a/JS/node_modules/graphql/utilities/buildClientSchema.js.flow +++ /dev/null @@ -1,408 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import inspect from '../jsutils/inspect'; -import devAssert from '../jsutils/devAssert'; -import keyValMap from '../jsutils/keyValMap'; -import isObjectLike from '../jsutils/isObjectLike'; - -import { parseValue } from '../language/parser'; - -import type { GraphQLSchemaValidationOptions } from '../type/schema'; -import type { - GraphQLType, - GraphQLNamedType, - GraphQLFieldConfig, - GraphQLFieldConfigMap, -} from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; -import { GraphQLDirective } from '../type/directives'; -import { specifiedScalarTypes } from '../type/scalars'; -import { introspectionTypes, TypeKind } from '../type/introspection'; -import { - isInputType, - isOutputType, - GraphQLList, - GraphQLNonNull, - GraphQLScalarType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, - assertNullableType, - assertObjectType, - assertInterfaceType, -} from '../type/definition'; - -import type { - IntrospectionQuery, - IntrospectionDirective, - IntrospectionField, - IntrospectionInputValue, - IntrospectionType, - IntrospectionScalarType, - IntrospectionObjectType, - IntrospectionInterfaceType, - IntrospectionUnionType, - IntrospectionEnumType, - IntrospectionInputObjectType, - IntrospectionTypeRef, - IntrospectionNamedTypeRef, -} from './getIntrospectionQuery'; -import { valueFromAST } from './valueFromAST'; - -/** - * 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?: GraphQLSchemaValidationOptions, -): GraphQLSchema { - devAssert( - 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), - ); - - // Include standard types only if they are used. - 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({ - description: schemaIntrospection.description, - query: queryType, - mutation: mutationType, - subscription: subscriptionType, - types: objectValues(typeMap), - directives, - assumeValid: options?.assumeValid, - }); - - // 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 new 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 new GraphQLNonNull(assertNullableType(nullableType)); - } - return getNamedType(typeRef); - } - - function getNamedType( - typeRef: IntrospectionNamedTypeRef<>, - ): GraphQLNamedType { - const typeName = typeRef.name; - if (!typeName) { - throw new Error(`Unknown type reference: ${inspect(typeRef)}.`); - } - - 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 getObjectType( - typeRef: IntrospectionNamedTypeRef, - ): GraphQLObjectType { - return assertObjectType(getNamedType(typeRef)); - } - - function getInterfaceType( - typeRef: IntrospectionNamedTypeRef, - ): GraphQLInterfaceType { - return assertInterfaceType(getNamedType(typeRef)); - } - - // Given a type's introspection result, construct the correct - // GraphQLType instance. - function buildType(type: IntrospectionType): GraphQLNamedType { - if (type != null && type.name != null && type.kind != null) { - 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); - } - } - const typeStr = inspect(type); - throw new Error( - `Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${typeStr}.`, - ); - } - - function buildScalarDef( - scalarIntrospection: IntrospectionScalarType, - ): GraphQLScalarType { - return new GraphQLScalarType({ - name: scalarIntrospection.name, - description: scalarIntrospection.description, - specifiedByUrl: scalarIntrospection.specifiedByUrl, - }); - } - - function buildImplementationsList( - implementingIntrospection: - | IntrospectionObjectType - | IntrospectionInterfaceType, - ): Array { - // TODO: Temporary workaround until GraphQL ecosystem will fully support - // 'interfaces' on interface types. - if ( - implementingIntrospection.interfaces === null && - implementingIntrospection.kind === TypeKind.INTERFACE - ) { - return []; - } - - if (!implementingIntrospection.interfaces) { - const implementingIntrospectionStr = inspect(implementingIntrospection); - throw new Error( - `Introspection result missing interfaces: ${implementingIntrospectionStr}.`, - ); - } - - return implementingIntrospection.interfaces.map(getInterfaceType); - } - - function buildObjectDef( - objectIntrospection: IntrospectionObjectType, - ): GraphQLObjectType { - return new GraphQLObjectType({ - name: objectIntrospection.name, - description: objectIntrospection.description, - interfaces: () => buildImplementationsList(objectIntrospection), - fields: () => buildFieldDefMap(objectIntrospection), - }); - } - - function buildInterfaceDef( - interfaceIntrospection: IntrospectionInterfaceType, - ): GraphQLInterfaceType { - return new GraphQLInterfaceType({ - name: interfaceIntrospection.name, - description: interfaceIntrospection.description, - interfaces: () => buildImplementationsList(interfaceIntrospection), - fields: () => buildFieldDefMap(interfaceIntrospection), - }); - } - - function buildUnionDef( - unionIntrospection: IntrospectionUnionType, - ): GraphQLUnionType { - if (!unionIntrospection.possibleTypes) { - const unionIntrospectionStr = inspect(unionIntrospection); - throw new Error( - `Introspection result missing possibleTypes: ${unionIntrospectionStr}.`, - ); - } - return new GraphQLUnionType({ - name: unionIntrospection.name, - description: unionIntrospection.description, - types: () => unionIntrospection.possibleTypes.map(getObjectType), - }); - } - - function buildEnumDef( - enumIntrospection: IntrospectionEnumType, - ): GraphQLEnumType { - if (!enumIntrospection.enumValues) { - const enumIntrospectionStr = inspect(enumIntrospection); - throw new Error( - `Introspection result missing enumValues: ${enumIntrospectionStr}.`, - ); - } - 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) { - const inputObjectIntrospectionStr = inspect(inputObjectIntrospection); - throw new Error( - `Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`, - ); - } - return new GraphQLInputObjectType({ - name: inputObjectIntrospection.name, - description: inputObjectIntrospection.description, - fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), - }); - } - - function buildFieldDefMap( - typeIntrospection: IntrospectionObjectType | IntrospectionInterfaceType, - ): GraphQLFieldConfigMap { - if (!typeIntrospection.fields) { - throw new Error( - `Introspection result missing fields: ${inspect(typeIntrospection)}.`, - ); - } - - return keyValMap( - typeIntrospection.fields, - (fieldIntrospection) => fieldIntrospection.name, - buildField, - ); - } - - function buildField( - fieldIntrospection: IntrospectionField, - ): GraphQLFieldConfig { - const type = getType(fieldIntrospection.type); - if (!isOutputType(type)) { - const typeStr = inspect(type); - throw new Error( - `Introspection must provide output type for fields, but received: ${typeStr}.`, - ); - } - - if (!fieldIntrospection.args) { - const fieldIntrospectionStr = inspect(fieldIntrospection); - throw new Error( - `Introspection result missing field args: ${fieldIntrospectionStr}.`, - ); - } - - return { - description: fieldIntrospection.description, - deprecationReason: fieldIntrospection.deprecationReason, - type, - args: buildInputValueDefMap(fieldIntrospection.args), - }; - } - - function buildInputValueDefMap( - inputValueIntrospections: $ReadOnlyArray, - ) { - return keyValMap( - inputValueIntrospections, - (inputValue) => inputValue.name, - buildInputValue, - ); - } - - function buildInputValue(inputValueIntrospection: IntrospectionInputValue) { - const type = getType(inputValueIntrospection.type); - if (!isInputType(type)) { - const typeStr = inspect(type); - throw new Error( - `Introspection must provide input type for arguments, but received: ${typeStr}.`, - ); - } - - const defaultValue = - inputValueIntrospection.defaultValue != null - ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) - : undefined; - return { - description: inputValueIntrospection.description, - type, - defaultValue, - deprecationReason: inputValueIntrospection.deprecationReason, - }; - } - - function buildDirective( - directiveIntrospection: IntrospectionDirective, - ): GraphQLDirective { - if (!directiveIntrospection.args) { - const directiveIntrospectionStr = inspect(directiveIntrospection); - throw new Error( - `Introspection result missing directive args: ${directiveIntrospectionStr}.`, - ); - } - if (!directiveIntrospection.locations) { - const directiveIntrospectionStr = inspect(directiveIntrospection); - throw new Error( - `Introspection result missing directive locations: ${directiveIntrospectionStr}.`, - ); - } - return new GraphQLDirective({ - name: directiveIntrospection.name, - description: directiveIntrospection.description, - isRepeatable: directiveIntrospection.isRepeatable, - locations: directiveIntrospection.locations.slice(), - args: buildInputValueDefMap(directiveIntrospection.args), - }); - } -} diff --git a/JS/node_modules/graphql/utilities/buildClientSchema.mjs b/JS/node_modules/graphql/utilities/buildClientSchema.mjs deleted file mode 100644 index 8651a3d..0000000 --- a/JS/node_modules/graphql/utilities/buildClientSchema.mjs +++ /dev/null @@ -1,315 +0,0 @@ -import objectValues from "../polyfills/objectValues.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import devAssert from "../jsutils/devAssert.mjs"; -import keyValMap from "../jsutils/keyValMap.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import { parseValue } from "../language/parser.mjs"; -import { GraphQLSchema } from "../type/schema.mjs"; -import { GraphQLDirective } from "../type/directives.mjs"; -import { specifiedScalarTypes } from "../type/scalars.mjs"; -import { introspectionTypes, TypeKind } from "../type/introspection.mjs"; -import { isInputType, isOutputType, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, assertNullableType, assertObjectType, assertInterfaceType } from "../type/definition.mjs"; -import { valueFromAST } from "./valueFromAST.mjs"; -/** - * 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) || devAssert(0, "Invalid or incomplete introspection result. Ensure that you are passing \"data\" property of introspection response and no \"errors\" was returned alongside: ".concat(inspect(introspection), ".")); // 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); - }); // Include standard types only if they are used. - - for (var _i2 = 0, _ref2 = [].concat(specifiedScalarTypes, introspectionTypes); _i2 < _ref2.length; _i2++) { - var stdType = _ref2[_i2]; - - 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({ - description: schemaIntrospection.description, - query: queryType, - mutation: mutationType, - subscription: subscriptionType, - types: objectValues(typeMap), - directives: directives, - assumeValid: options === null || options === void 0 ? void 0 : options.assumeValid - }); // 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 new 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 new GraphQLNonNull(assertNullableType(nullableType)); - } - - return getNamedType(typeRef); - } - - function getNamedType(typeRef) { - var typeName = typeRef.name; - - if (!typeName) { - throw new Error("Unknown type reference: ".concat(inspect(typeRef), ".")); - } - - 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 getObjectType(typeRef) { - return assertObjectType(getNamedType(typeRef)); - } - - function getInterfaceType(typeRef) { - return assertInterfaceType(getNamedType(typeRef)); - } // Given a type's introspection result, construct the correct - // GraphQLType instance. - - - function buildType(type) { - if (type != null && type.name != null && type.kind != null) { - 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); - } - } - - var typeStr = inspect(type); - throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(typeStr, ".")); - } - - function buildScalarDef(scalarIntrospection) { - return new GraphQLScalarType({ - name: scalarIntrospection.name, - description: scalarIntrospection.description, - specifiedByUrl: scalarIntrospection.specifiedByUrl - }); - } - - function buildImplementationsList(implementingIntrospection) { - // TODO: Temporary workaround until GraphQL ecosystem will fully support - // 'interfaces' on interface types. - if (implementingIntrospection.interfaces === null && implementingIntrospection.kind === TypeKind.INTERFACE) { - return []; - } - - if (!implementingIntrospection.interfaces) { - var implementingIntrospectionStr = inspect(implementingIntrospection); - throw new Error("Introspection result missing interfaces: ".concat(implementingIntrospectionStr, ".")); - } - - return implementingIntrospection.interfaces.map(getInterfaceType); - } - - function buildObjectDef(objectIntrospection) { - return new GraphQLObjectType({ - name: objectIntrospection.name, - description: objectIntrospection.description, - interfaces: function interfaces() { - return buildImplementationsList(objectIntrospection); - }, - fields: function fields() { - return buildFieldDefMap(objectIntrospection); - } - }); - } - - function buildInterfaceDef(interfaceIntrospection) { - return new GraphQLInterfaceType({ - name: interfaceIntrospection.name, - description: interfaceIntrospection.description, - interfaces: function interfaces() { - return buildImplementationsList(interfaceIntrospection); - }, - fields: function fields() { - return buildFieldDefMap(interfaceIntrospection); - } - }); - } - - function buildUnionDef(unionIntrospection) { - if (!unionIntrospection.possibleTypes) { - var unionIntrospectionStr = inspect(unionIntrospection); - throw new Error("Introspection result missing possibleTypes: ".concat(unionIntrospectionStr, ".")); - } - - return new GraphQLUnionType({ - name: unionIntrospection.name, - description: unionIntrospection.description, - types: function types() { - return unionIntrospection.possibleTypes.map(getObjectType); - } - }); - } - - function buildEnumDef(enumIntrospection) { - if (!enumIntrospection.enumValues) { - var enumIntrospectionStr = inspect(enumIntrospection); - throw new Error("Introspection result missing enumValues: ".concat(enumIntrospectionStr, ".")); - } - - 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) { - var inputObjectIntrospectionStr = inspect(inputObjectIntrospection); - throw new Error("Introspection result missing inputFields: ".concat(inputObjectIntrospectionStr, ".")); - } - - 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: ".concat(inspect(typeIntrospection), ".")); - } - - return keyValMap(typeIntrospection.fields, function (fieldIntrospection) { - return fieldIntrospection.name; - }, buildField); - } - - function buildField(fieldIntrospection) { - var type = getType(fieldIntrospection.type); - - if (!isOutputType(type)) { - var typeStr = inspect(type); - throw new Error("Introspection must provide output type for fields, but received: ".concat(typeStr, ".")); - } - - if (!fieldIntrospection.args) { - var fieldIntrospectionStr = inspect(fieldIntrospection); - throw new Error("Introspection result missing field args: ".concat(fieldIntrospectionStr, ".")); - } - - return { - description: fieldIntrospection.description, - deprecationReason: fieldIntrospection.deprecationReason, - type: type, - args: buildInputValueDefMap(fieldIntrospection.args) - }; - } - - function buildInputValueDefMap(inputValueIntrospections) { - return keyValMap(inputValueIntrospections, function (inputValue) { - return inputValue.name; - }, buildInputValue); - } - - function buildInputValue(inputValueIntrospection) { - var type = getType(inputValueIntrospection.type); - - if (!isInputType(type)) { - var typeStr = inspect(type); - throw new Error("Introspection must provide input type for arguments, but received: ".concat(typeStr, ".")); - } - - var defaultValue = inputValueIntrospection.defaultValue != null ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) : undefined; - return { - description: inputValueIntrospection.description, - type: type, - defaultValue: defaultValue, - deprecationReason: inputValueIntrospection.deprecationReason - }; - } - - function buildDirective(directiveIntrospection) { - if (!directiveIntrospection.args) { - var directiveIntrospectionStr = inspect(directiveIntrospection); - throw new Error("Introspection result missing directive args: ".concat(directiveIntrospectionStr, ".")); - } - - if (!directiveIntrospection.locations) { - var _directiveIntrospectionStr = inspect(directiveIntrospection); - - throw new Error("Introspection result missing directive locations: ".concat(_directiveIntrospectionStr, ".")); - } - - return new GraphQLDirective({ - name: directiveIntrospection.name, - description: directiveIntrospection.description, - isRepeatable: directiveIntrospection.isRepeatable, - locations: directiveIntrospection.locations.slice(), - args: buildInputValueDefMap(directiveIntrospection.args) - }); - } -} diff --git a/JS/node_modules/graphql/utilities/coerceInputValue.d.ts b/JS/node_modules/graphql/utilities/coerceInputValue.d.ts deleted file mode 100644 index 45c70a5..0000000 --- a/JS/node_modules/graphql/utilities/coerceInputValue.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { GraphQLInputType } from '../type/definition'; -import { GraphQLError } from '../error/GraphQLError'; - -type OnErrorCB = ( - path: ReadonlyArray, - invalidValue: any, - error: GraphQLError, -) => void; - -/** - * Coerces a JavaScript value given a GraphQL Input Type. - */ -export function coerceInputValue( - inputValue: any, - type: GraphQLInputType, - onError?: OnErrorCB, -): any; diff --git a/JS/node_modules/graphql/utilities/coerceInputValue.js b/JS/node_modules/graphql/utilities/coerceInputValue.js deleted file mode 100644 index aa2381a..0000000 --- a/JS/node_modules/graphql/utilities/coerceInputValue.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.coerceInputValue = coerceInputValue; - -var _objectValues3 = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _didYouMean = _interopRequireDefault(require("../jsutils/didYouMean.js")); - -var _isObjectLike = _interopRequireDefault(require("../jsutils/isObjectLike.js")); - -var _safeArrayFrom = _interopRequireDefault(require("../jsutils/safeArrayFrom.js")); - -var _suggestionList = _interopRequireDefault(require("../jsutils/suggestionList.js")); - -var _printPathArray = _interopRequireDefault(require("../jsutils/printPathArray.js")); - -var _Path = require("../jsutils/Path.js"); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _definition = require("../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Coerces a JavaScript value given a GraphQL Input Type. - */ -function coerceInputValue(inputValue, type) { - var onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultOnError; - return coerceInputValueImpl(inputValue, type, onError); -} - -function defaultOnError(path, invalidValue, error) { - var errorPrefix = 'Invalid value ' + (0, _inspect.default)(invalidValue); - - if (path.length > 0) { - errorPrefix += " at \"value".concat((0, _printPathArray.default)(path), "\""); - } - - error.message = errorPrefix + ': ' + error.message; - throw error; -} - -function coerceInputValueImpl(inputValue, type, onError, path) { - if ((0, _definition.isNonNullType)(type)) { - if (inputValue != null) { - return coerceInputValueImpl(inputValue, type.ofType, onError, path); - } - - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected non-nullable type \"".concat((0, _inspect.default)(type), "\" not to be null."))); - return; - } - - if (inputValue == null) { - // Explicitly return the value null. - return null; - } - - if ((0, _definition.isListType)(type)) { - var itemType = type.ofType; - var coercedList = (0, _safeArrayFrom.default)(inputValue, function (itemValue, index) { - var itemPath = (0, _Path.addPath)(path, index, undefined); - return coerceInputValueImpl(itemValue, itemType, onError, itemPath); - }); - - if (coercedList != null) { - return coercedList; - } // Lists accept a non-list value as a list of one. - - - return [coerceInputValueImpl(inputValue, itemType, onError, path)]; - } - - if ((0, _definition.isInputObjectType)(type)) { - if (!(0, _isObjectLike.default)(inputValue)) { - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected type \"".concat(type.name, "\" to be an object."))); - return; - } - - var coercedValue = {}; - var fieldDefs = type.getFields(); - - for (var _i2 = 0, _objectValues2 = (0, _objectValues3.default)(fieldDefs); _i2 < _objectValues2.length; _i2++) { - var field = _objectValues2[_i2]; - var fieldValue = inputValue[field.name]; - - if (fieldValue === undefined) { - if (field.defaultValue !== undefined) { - coercedValue[field.name] = field.defaultValue; - } else if ((0, _definition.isNonNullType)(field.type)) { - var typeStr = (0, _inspect.default)(field.type); - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Field \"".concat(field.name, "\" of required type \"").concat(typeStr, "\" was not provided."))); - } - - continue; - } - - coercedValue[field.name] = coerceInputValueImpl(fieldValue, field.type, onError, (0, _Path.addPath)(path, field.name, type.name)); - } // Ensure every provided field is defined. - - - for (var _i4 = 0, _Object$keys2 = Object.keys(inputValue); _i4 < _Object$keys2.length; _i4++) { - var fieldName = _Object$keys2[_i4]; - - if (!fieldDefs[fieldName]) { - var suggestions = (0, _suggestionList.default)(fieldName, Object.keys(type.getFields())); - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Field \"".concat(fieldName, "\" is not defined by type \"").concat(type.name, "\".") + (0, _didYouMean.default)(suggestions))); - } - } - - return coercedValue; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isLeafType)(type)) { - var parseResult; // Scalars and Enums determine if a input value is valid via parseValue(), - // which can throw to indicate failure. If it throws, maintain a reference - // to the original error. - - try { - parseResult = type.parseValue(inputValue); - } catch (error) { - if (error instanceof _GraphQLError.GraphQLError) { - onError((0, _Path.pathToArray)(path), inputValue, error); - } else { - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected type \"".concat(type.name, "\". ") + error.message, undefined, undefined, undefined, undefined, error)); - } - - return; - } - - if (parseResult === undefined) { - onError((0, _Path.pathToArray)(path), inputValue, new _GraphQLError.GraphQLError("Expected type \"".concat(type.name, "\"."))); - } - - return parseResult; - } // istanbul ignore next (Not reachable. All possible input types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected input type: ' + (0, _inspect.default)(type)); -} diff --git a/JS/node_modules/graphql/utilities/coerceInputValue.js.flow b/JS/node_modules/graphql/utilities/coerceInputValue.js.flow deleted file mode 100644 index a42fa06..0000000 --- a/JS/node_modules/graphql/utilities/coerceInputValue.js.flow +++ /dev/null @@ -1,195 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import type { Path } from '../jsutils/Path'; -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; -import didYouMean from '../jsutils/didYouMean'; -import isObjectLike from '../jsutils/isObjectLike'; -import safeArrayFrom from '../jsutils/safeArrayFrom'; -import suggestionList from '../jsutils/suggestionList'; -import printPathArray from '../jsutils/printPathArray'; -import { addPath, pathToArray } from '../jsutils/Path'; - -import { GraphQLError } from '../error/GraphQLError'; - -import type { GraphQLInputType } from '../type/definition'; -import { - isLeafType, - isInputObjectType, - isListType, - isNonNullType, -} from '../type/definition'; - -type OnErrorCB = ( - path: $ReadOnlyArray, - invalidValue: mixed, - error: GraphQLError, -) => void; - -/** - * Coerces a JavaScript value given a GraphQL Input Type. - */ -export function coerceInputValue( - inputValue: mixed, - type: GraphQLInputType, - onError: OnErrorCB = defaultOnError, -): mixed { - return coerceInputValueImpl(inputValue, type, onError); -} - -function defaultOnError( - path: $ReadOnlyArray, - invalidValue: mixed, - error: GraphQLError, -): void { - let errorPrefix = 'Invalid value ' + inspect(invalidValue); - if (path.length > 0) { - errorPrefix += ` at "value${printPathArray(path)}"`; - } - error.message = errorPrefix + ': ' + error.message; - throw error; -} - -function coerceInputValueImpl( - inputValue: mixed, - type: GraphQLInputType, - onError: OnErrorCB, - path: Path | void, -): mixed { - if (isNonNullType(type)) { - if (inputValue != null) { - return coerceInputValueImpl(inputValue, type.ofType, onError, path); - } - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Expected non-nullable type "${inspect(type)}" not to be null.`, - ), - ); - return; - } - - if (inputValue == null) { - // Explicitly return the value null. - return null; - } - - if (isListType(type)) { - const itemType = type.ofType; - - const coercedList = safeArrayFrom(inputValue, (itemValue, index) => { - const itemPath = addPath(path, index, undefined); - return coerceInputValueImpl(itemValue, itemType, onError, itemPath); - }); - - if (coercedList != null) { - return coercedList; - } - - // Lists accept a non-list value as a list of one. - return [coerceInputValueImpl(inputValue, itemType, onError, path)]; - } - - if (isInputObjectType(type)) { - if (!isObjectLike(inputValue)) { - onError( - pathToArray(path), - inputValue, - new GraphQLError(`Expected type "${type.name}" to be an object.`), - ); - return; - } - - const coercedValue = {}; - const fieldDefs = type.getFields(); - - for (const field of objectValues(fieldDefs)) { - const fieldValue = inputValue[field.name]; - - if (fieldValue === undefined) { - if (field.defaultValue !== undefined) { - coercedValue[field.name] = field.defaultValue; - } else if (isNonNullType(field.type)) { - const typeStr = inspect(field.type); - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Field "${field.name}" of required type "${typeStr}" was not provided.`, - ), - ); - } - continue; - } - - coercedValue[field.name] = coerceInputValueImpl( - fieldValue, - field.type, - onError, - addPath(path, field.name, type.name), - ); - } - - // Ensure every provided field is defined. - for (const fieldName of Object.keys(inputValue)) { - if (!fieldDefs[fieldName]) { - const suggestions = suggestionList( - fieldName, - Object.keys(type.getFields()), - ); - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Field "${fieldName}" is not defined by type "${type.name}".` + - didYouMean(suggestions), - ), - ); - } - } - return coercedValue; - } - - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isLeafType(type)) { - let parseResult; - - // Scalars and Enums determine if a input value is valid via parseValue(), - // which can throw to indicate failure. If it throws, maintain a reference - // to the original error. - try { - parseResult = type.parseValue(inputValue); - } catch (error) { - if (error instanceof GraphQLError) { - onError(pathToArray(path), inputValue, error); - } else { - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Expected type "${type.name}". ` + error.message, - undefined, - undefined, - undefined, - undefined, - error, - ), - ); - } - return; - } - if (parseResult === undefined) { - onError( - pathToArray(path), - inputValue, - new GraphQLError(`Expected type "${type.name}".`), - ); - } - return parseResult; - } - - // istanbul ignore next (Not reachable. All possible input types have been considered) - invariant(false, 'Unexpected input type: ' + inspect((type: empty))); -} diff --git a/JS/node_modules/graphql/utilities/coerceInputValue.mjs b/JS/node_modules/graphql/utilities/coerceInputValue.mjs deleted file mode 100644 index dbca94c..0000000 --- a/JS/node_modules/graphql/utilities/coerceInputValue.mjs +++ /dev/null @@ -1,129 +0,0 @@ -import objectValues from "../polyfills/objectValues.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import didYouMean from "../jsutils/didYouMean.mjs"; -import isObjectLike from "../jsutils/isObjectLike.mjs"; -import safeArrayFrom from "../jsutils/safeArrayFrom.mjs"; -import suggestionList from "../jsutils/suggestionList.mjs"; -import printPathArray from "../jsutils/printPathArray.mjs"; -import { addPath, pathToArray } from "../jsutils/Path.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { isLeafType, isInputObjectType, isListType, isNonNullType } from "../type/definition.mjs"; - -/** - * Coerces a JavaScript value given a GraphQL Input Type. - */ -export function coerceInputValue(inputValue, type) { - var onError = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultOnError; - return coerceInputValueImpl(inputValue, type, onError); -} - -function defaultOnError(path, invalidValue, error) { - var errorPrefix = 'Invalid value ' + inspect(invalidValue); - - if (path.length > 0) { - errorPrefix += " at \"value".concat(printPathArray(path), "\""); - } - - error.message = errorPrefix + ': ' + error.message; - throw error; -} - -function coerceInputValueImpl(inputValue, type, onError, path) { - if (isNonNullType(type)) { - if (inputValue != null) { - return coerceInputValueImpl(inputValue, type.ofType, onError, path); - } - - onError(pathToArray(path), inputValue, new GraphQLError("Expected non-nullable type \"".concat(inspect(type), "\" not to be null."))); - return; - } - - if (inputValue == null) { - // Explicitly return the value null. - return null; - } - - if (isListType(type)) { - var itemType = type.ofType; - var coercedList = safeArrayFrom(inputValue, function (itemValue, index) { - var itemPath = addPath(path, index, undefined); - return coerceInputValueImpl(itemValue, itemType, onError, itemPath); - }); - - if (coercedList != null) { - return coercedList; - } // Lists accept a non-list value as a list of one. - - - return [coerceInputValueImpl(inputValue, itemType, onError, path)]; - } - - if (isInputObjectType(type)) { - if (!isObjectLike(inputValue)) { - onError(pathToArray(path), inputValue, new GraphQLError("Expected type \"".concat(type.name, "\" to be an object."))); - return; - } - - var coercedValue = {}; - var fieldDefs = type.getFields(); - - for (var _i2 = 0, _objectValues2 = objectValues(fieldDefs); _i2 < _objectValues2.length; _i2++) { - var field = _objectValues2[_i2]; - var fieldValue = inputValue[field.name]; - - if (fieldValue === undefined) { - if (field.defaultValue !== undefined) { - coercedValue[field.name] = field.defaultValue; - } else if (isNonNullType(field.type)) { - var typeStr = inspect(field.type); - onError(pathToArray(path), inputValue, new GraphQLError("Field \"".concat(field.name, "\" of required type \"").concat(typeStr, "\" was not provided."))); - } - - continue; - } - - coercedValue[field.name] = coerceInputValueImpl(fieldValue, field.type, onError, addPath(path, field.name, type.name)); - } // Ensure every provided field is defined. - - - for (var _i4 = 0, _Object$keys2 = Object.keys(inputValue); _i4 < _Object$keys2.length; _i4++) { - var fieldName = _Object$keys2[_i4]; - - if (!fieldDefs[fieldName]) { - var suggestions = suggestionList(fieldName, Object.keys(type.getFields())); - onError(pathToArray(path), inputValue, new GraphQLError("Field \"".concat(fieldName, "\" is not defined by type \"").concat(type.name, "\".") + didYouMean(suggestions))); - } - } - - return coercedValue; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isLeafType(type)) { - var parseResult; // Scalars and Enums determine if a input value is valid via parseValue(), - // which can throw to indicate failure. If it throws, maintain a reference - // to the original error. - - try { - parseResult = type.parseValue(inputValue); - } catch (error) { - if (error instanceof GraphQLError) { - onError(pathToArray(path), inputValue, error); - } else { - onError(pathToArray(path), inputValue, new GraphQLError("Expected type \"".concat(type.name, "\". ") + error.message, undefined, undefined, undefined, undefined, error)); - } - - return; - } - - if (parseResult === undefined) { - onError(pathToArray(path), inputValue, new GraphQLError("Expected type \"".concat(type.name, "\"."))); - } - - return parseResult; - } // istanbul ignore next (Not reachable. All possible input types have been considered) - - - false || invariant(0, 'Unexpected input type: ' + inspect(type)); -} diff --git a/JS/node_modules/graphql/utilities/concatAST.d.ts b/JS/node_modules/graphql/utilities/concatAST.d.ts deleted file mode 100644 index 03d441e..0000000 --- a/JS/node_modules/graphql/utilities/concatAST.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { 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; diff --git a/JS/node_modules/graphql/utilities/concatAST.js b/JS/node_modules/graphql/utilities/concatAST.js deleted file mode 100644 index 9c3ac48..0000000 --- a/JS/node_modules/graphql/utilities/concatAST.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.concatAST = concatAST; - -/** - * 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(documents) { - var definitions = []; - - for (var _i2 = 0; _i2 < documents.length; _i2++) { - var doc = documents[_i2]; - definitions = definitions.concat(doc.definitions); - } - - return { - kind: 'Document', - definitions: definitions - }; -} diff --git a/JS/node_modules/graphql/utilities/concatAST.js.flow b/JS/node_modules/graphql/utilities/concatAST.js.flow deleted file mode 100644 index 0e0bb5f..0000000 --- a/JS/node_modules/graphql/utilities/concatAST.js.flow +++ /dev/null @@ -1,17 +0,0 @@ -// @flow strict -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( - documents: $ReadOnlyArray, -): DocumentNode { - let definitions = []; - for (const doc of documents) { - definitions = definitions.concat(doc.definitions); - } - return { kind: 'Document', definitions }; -} diff --git a/JS/node_modules/graphql/utilities/concatAST.mjs b/JS/node_modules/graphql/utilities/concatAST.mjs deleted file mode 100644 index 4e9e9ee..0000000 --- a/JS/node_modules/graphql/utilities/concatAST.mjs +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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(documents) { - var definitions = []; - - for (var _i2 = 0; _i2 < documents.length; _i2++) { - var doc = documents[_i2]; - definitions = definitions.concat(doc.definitions); - } - - return { - kind: 'Document', - definitions: definitions - }; -} diff --git a/JS/node_modules/graphql/utilities/extendSchema.d.ts b/JS/node_modules/graphql/utilities/extendSchema.d.ts deleted file mode 100644 index 6795e01..0000000 --- a/JS/node_modules/graphql/utilities/extendSchema.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { Location, DocumentNode, StringValueNode } from '../language/ast'; -import { - GraphQLSchemaValidationOptions, - GraphQLSchema, - GraphQLSchemaNormalizedConfig, -} from '../type/schema'; - -interface Options extends 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; - -/** - * @internal - */ -export function extendSchemaImpl( - schemaConfig: GraphQLSchemaNormalizedConfig, - documentAST: DocumentNode, - options?: Options, -): GraphQLSchemaNormalizedConfig; - -/** - * 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: { readonly description?: StringValueNode; readonly loc?: Location }, - options?: Maybe<{ commentDescriptions?: boolean }>, -): string | undefined; diff --git a/JS/node_modules/graphql/utilities/extendSchema.js b/JS/node_modules/graphql/utilities/extendSchema.js deleted file mode 100644 index 0b0201d..0000000 --- a/JS/node_modules/graphql/utilities/extendSchema.js +++ /dev/null @@ -1,719 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.extendSchema = extendSchema; -exports.extendSchemaImpl = extendSchemaImpl; -exports.getDescription = getDescription; - -var _objectValues = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _keyMap = _interopRequireDefault(require("../jsutils/keyMap.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _mapValue = _interopRequireDefault(require("../jsutils/mapValue.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _kinds = require("../language/kinds.js"); - -var _tokenKind = require("../language/tokenKind.js"); - -var _blockString = require("../language/blockString.js"); - -var _predicates = require("../language/predicates.js"); - -var _validate = require("../validation/validate.js"); - -var _values = require("../execution/values.js"); - -var _schema = require("../type/schema.js"); - -var _scalars = require("../type/scalars.js"); - -var _introspection = require("../type/introspection.js"); - -var _directives = require("../type/directives.js"); - -var _definition = require("../type/definition.js"); - -var _valueFromAST = require("./valueFromAST.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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 != null && documentAST.kind === _kinds.Kind.DOCUMENT || (0, _devAssert.default)(0, 'Must provide valid Document AST.'); - - if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) { - (0, _validate.assertValidSDLExtension)(documentAST, schema); - } - - var schemaConfig = schema.toConfig(); - var extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); - return schemaConfig === extendedConfig ? schema : new _schema.GraphQLSchema(extendedConfig); -} -/** - * @internal - */ - - -function extendSchemaImpl(schemaConfig, documentAST, options) { - var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid; - - // Collect the type definitions and extensions found in the document. - var typeDefs = []; - var typeExtensionsMap = 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 schemaExtensions = []; - - for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { - var def = _documentAST$definiti2[_i2]; - - if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) { - schemaDef = def; - } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) { - schemaExtensions.push(def); - } else if ((0, _predicates.isTypeDefinitionNode)(def)) { - typeDefs.push(def); - } else if ((0, _predicates.isTypeExtensionNode)(def)) { - var extendedTypeName = def.name.value; - var existingTypeExtensions = typeExtensionsMap[extendedTypeName]; - typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.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. - - - if (Object.keys(typeExtensionsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExtensions.length === 0 && schemaDef == null) { - return schemaConfig; - } - - var typeMap = Object.create(null); - - for (var _i4 = 0, _schemaConfig$types2 = schemaConfig.types; _i4 < _schemaConfig$types2.length; _i4++) { - var existingType = _schemaConfig$types2[_i4]; - typeMap[existingType.name] = extendNamedType(existingType); - } - - for (var _i6 = 0; _i6 < typeDefs.length; _i6++) { - var _stdTypeMap$name; - - var typeNode = typeDefs[_i6]; - var name = typeNode.name.value; - typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode); - } - - var operationTypes = _objectSpread(_objectSpread({ - // Get the extended root operation types. - query: schemaConfig.query && replaceNamedType(schemaConfig.query), - mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation), - subscription: schemaConfig.subscription && replaceNamedType(schemaConfig.subscription) - }, schemaDef && getOperationTypes([schemaDef])), getOperationTypes(schemaExtensions)); // Then produce and return a Schema config with these types. - - - return _objectSpread(_objectSpread({ - description: (_schemaDef = schemaDef) === null || _schemaDef === void 0 ? void 0 : (_schemaDef$descriptio = _schemaDef.description) === null || _schemaDef$descriptio === void 0 ? void 0 : _schemaDef$descriptio.value - }, operationTypes), {}, { - types: (0, _objectValues.default)(typeMap), - directives: [].concat(schemaConfig.directives.map(replaceDirective), directiveDefs.map(buildDirective)), - extensions: undefined, - astNode: (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0 ? _schemaDef2 : schemaConfig.astNode, - extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions), - assumeValid: (_options$assumeValid = options === null || options === void 0 ? void 0 : options.assumeValid) !== null && _options$assumeValid !== void 0 ? _options$assumeValid : false - }); // 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)) { - // $FlowFixMe[incompatible-return] - return new _definition.GraphQLList(replaceType(type.ofType)); - } - - if ((0, _definition.isNonNullType)(type)) { - // $FlowFixMe[incompatible-return] - return new _definition.GraphQLNonNull(replaceType(type.ofType)); - } - - return replaceNamedType(type); - } - - function replaceNamedType(type) { - // 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. - return typeMap[type.name]; - } - - function replaceDirective(directive) { - var config = directive.toConfig(); - return new _directives.GraphQLDirective(_objectSpread(_objectSpread({}, config), {}, { - args: (0, _mapValue.default)(config.args, extendArg) - })); - } - - function extendNamedType(type) { - if ((0, _introspection.isIntrospectionType)(type) || (0, _scalars.isSpecifiedScalarType)(type)) { - // Builtin types are not extended. - return type; - } - - if ((0, _definition.isScalarType)(type)) { - return extendScalarType(type); - } - - if ((0, _definition.isObjectType)(type)) { - return extendObjectType(type); - } - - if ((0, _definition.isInterfaceType)(type)) { - return extendInterfaceType(type); - } - - if ((0, _definition.isUnionType)(type)) { - return extendUnionType(type); - } - - if ((0, _definition.isEnumType)(type)) { - return extendEnumType(type); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isInputObjectType)(type)) { - return extendInputObjectType(type); - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected type: ' + (0, _inspect.default)(type)); - } - - function extendInputObjectType(type) { - var _typeExtensionsMap$co; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : []; - return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, config), {}, { - fields: function fields() { - return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config.fields, function (field) { - return _objectSpread(_objectSpread({}, field), {}, { - type: replaceType(field.type) - }); - })), buildInputFieldMap(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendEnumType(type) { - var _typeExtensionsMap$ty; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : []; - return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, config), {}, { - values: _objectSpread(_objectSpread({}, config.values), buildEnumValueMap(extensions)), - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendScalarType(type) { - var _typeExtensionsMap$co2; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : []; - var specifiedByUrl = config.specifiedByUrl; - - for (var _i8 = 0; _i8 < extensions.length; _i8++) { - var _getSpecifiedByUrl; - - var extensionNode = extensions[_i8]; - specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl; - } - - return new _definition.GraphQLScalarType(_objectSpread(_objectSpread({}, config), {}, { - specifiedByUrl: specifiedByUrl, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendObjectType(type) { - var _typeExtensionsMap$co3; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : []; - return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config), {}, { - interfaces: function interfaces() { - return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions)); - }, - fields: function fields() { - return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config.fields, extendField)), buildFieldMap(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendInterfaceType(type) { - var _typeExtensionsMap$co4; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : []; - return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, config), {}, { - interfaces: function interfaces() { - return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions)); - }, - fields: function fields() { - return _objectSpread(_objectSpread({}, (0, _mapValue.default)(config.fields, extendField)), buildFieldMap(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendUnionType(type) { - var _typeExtensionsMap$co5; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : []; - return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, config), {}, { - types: function types() { - return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendField(field) { - return _objectSpread(_objectSpread({}, field), {}, { - type: replaceType(field.type), - // $FlowFixMe[incompatible-call] - args: (0, _mapValue.default)(field.args, extendArg) - }); - } - - function extendArg(arg) { - return _objectSpread(_objectSpread({}, arg), {}, { - type: replaceType(arg.type) - }); - } - - function getOperationTypes(nodes) { - var opTypes = {}; - - for (var _i10 = 0; _i10 < nodes.length; _i10++) { - var _node$operationTypes; - - var node = nodes[_i10]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; - - for (var _i12 = 0; _i12 < operationTypesNodes.length; _i12++) { - var operationType = operationTypesNodes[_i12]; - opTypes[operationType.operation] = getNamedType(operationType.type); - } - } // 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. - - - return opTypes; - } - - function getNamedType(node) { - var _stdTypeMap$name2; - - var name = node.name.value; - var type = (_stdTypeMap$name2 = stdTypeMap[name]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name]; - - if (type === undefined) { - throw new Error("Unknown type: \"".concat(name, "\".")); - } - - return type; - } - - function getWrappedType(node) { - if (node.kind === _kinds.Kind.LIST_TYPE) { - return new _definition.GraphQLList(getWrappedType(node.type)); - } - - if (node.kind === _kinds.Kind.NON_NULL_TYPE) { - return new _definition.GraphQLNonNull(getWrappedType(node.type)); - } - - return getNamedType(node); - } - - function buildDirective(node) { - var locations = node.locations.map(function (_ref) { - var value = _ref.value; - return value; - }); - return new _directives.GraphQLDirective({ - name: node.name.value, - description: getDescription(node, options), - locations: locations, - isRepeatable: node.repeatable, - args: buildArgumentMap(node.arguments), - astNode: node - }); - } - - function buildFieldMap(nodes) { - var fieldConfigMap = Object.create(null); - - for (var _i14 = 0; _i14 < nodes.length; _i14++) { - var _node$fields; - - var node = nodes[_i14]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var nodeFields = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; - - for (var _i16 = 0; _i16 < nodeFields.length; _i16++) { - var field = nodeFields[_i16]; - fieldConfigMap[field.name.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. - type: getWrappedType(field.type), - description: getDescription(field, options), - args: buildArgumentMap(field.arguments), - deprecationReason: getDeprecationReason(field), - astNode: field - }; - } - } - - return fieldConfigMap; - } - - function buildArgumentMap(args) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var argsNodes = args !== null && args !== void 0 ? args : []; - var argConfigMap = Object.create(null); - - for (var _i18 = 0; _i18 < argsNodes.length; _i18++) { - var arg = argsNodes[_i18]; - // 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 = getWrappedType(arg.type); - argConfigMap[arg.name.value] = { - type: type, - description: getDescription(arg, options), - defaultValue: (0, _valueFromAST.valueFromAST)(arg.defaultValue, type), - deprecationReason: getDeprecationReason(arg), - astNode: arg - }; - } - - return argConfigMap; - } - - function buildInputFieldMap(nodes) { - var inputFieldMap = Object.create(null); - - for (var _i20 = 0; _i20 < nodes.length; _i20++) { - var _node$fields2; - - var node = nodes[_i20]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var fieldsNodes = (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 ? _node$fields2 : []; - - for (var _i22 = 0; _i22 < fieldsNodes.length; _i22++) { - var field = fieldsNodes[_i22]; - // 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 = getWrappedType(field.type); - inputFieldMap[field.name.value] = { - type: type, - description: getDescription(field, options), - defaultValue: (0, _valueFromAST.valueFromAST)(field.defaultValue, type), - deprecationReason: getDeprecationReason(field), - astNode: field - }; - } - } - - return inputFieldMap; - } - - function buildEnumValueMap(nodes) { - var enumValueMap = Object.create(null); - - for (var _i24 = 0; _i24 < nodes.length; _i24++) { - var _node$values; - - var node = nodes[_i24]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var valuesNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; - - for (var _i26 = 0; _i26 < valuesNodes.length; _i26++) { - var value = valuesNodes[_i26]; - enumValueMap[value.name.value] = { - description: getDescription(value, options), - deprecationReason: getDeprecationReason(value), - astNode: value - }; - } - } - - return enumValueMap; - } - - function buildInterfaces(nodes) { - var interfaces = []; - - for (var _i28 = 0; _i28 < nodes.length; _i28++) { - var _node$interfaces; - - var node = nodes[_i28]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var interfacesNodes = (_node$interfaces = node.interfaces) !== null && _node$interfaces !== void 0 ? _node$interfaces : []; - - for (var _i30 = 0; _i30 < interfacesNodes.length; _i30++) { - var type = interfacesNodes[_i30]; - // 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. - interfaces.push(getNamedType(type)); - } - } - - return interfaces; - } - - function buildUnionTypes(nodes) { - var types = []; - - for (var _i32 = 0; _i32 < nodes.length; _i32++) { - var _node$types; - - var node = nodes[_i32]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : []; - - for (var _i34 = 0; _i34 < typeNodes.length; _i34++) { - var type = typeNodes[_i34]; - // 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. - types.push(getNamedType(type)); - } - } - - return types; - } - - function buildType(astNode) { - var _typeExtensionsMap$na; - - var name = astNode.name.value; - var description = getDescription(astNode, options); - var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : []; - - switch (astNode.kind) { - case _kinds.Kind.OBJECT_TYPE_DEFINITION: - { - var extensionASTNodes = extensionNodes; - var allNodes = [astNode].concat(extensionASTNodes); - return new _definition.GraphQLObjectType({ - name: name, - description: description, - interfaces: function interfaces() { - return buildInterfaces(allNodes); - }, - fields: function fields() { - return buildFieldMap(allNodes); - }, - astNode: astNode, - extensionASTNodes: extensionASTNodes - }); - } - - case _kinds.Kind.INTERFACE_TYPE_DEFINITION: - { - var _extensionASTNodes = extensionNodes; - - var _allNodes = [astNode].concat(_extensionASTNodes); - - return new _definition.GraphQLInterfaceType({ - name: name, - description: description, - interfaces: function interfaces() { - return buildInterfaces(_allNodes); - }, - fields: function fields() { - return buildFieldMap(_allNodes); - }, - astNode: astNode, - extensionASTNodes: _extensionASTNodes - }); - } - - case _kinds.Kind.ENUM_TYPE_DEFINITION: - { - var _extensionASTNodes2 = extensionNodes; - - var _allNodes2 = [astNode].concat(_extensionASTNodes2); - - return new _definition.GraphQLEnumType({ - name: name, - description: description, - values: buildEnumValueMap(_allNodes2), - astNode: astNode, - extensionASTNodes: _extensionASTNodes2 - }); - } - - case _kinds.Kind.UNION_TYPE_DEFINITION: - { - var _extensionASTNodes3 = extensionNodes; - - var _allNodes3 = [astNode].concat(_extensionASTNodes3); - - return new _definition.GraphQLUnionType({ - name: name, - description: description, - types: function types() { - return buildUnionTypes(_allNodes3); - }, - astNode: astNode, - extensionASTNodes: _extensionASTNodes3 - }); - } - - case _kinds.Kind.SCALAR_TYPE_DEFINITION: - { - var _extensionASTNodes4 = extensionNodes; - return new _definition.GraphQLScalarType({ - name: name, - description: description, - specifiedByUrl: getSpecifiedByUrl(astNode), - astNode: astNode, - extensionASTNodes: _extensionASTNodes4 - }); - } - - case _kinds.Kind.INPUT_OBJECT_TYPE_DEFINITION: - { - var _extensionASTNodes5 = extensionNodes; - - var _allNodes4 = [astNode].concat(_extensionASTNodes5); - - return new _definition.GraphQLInputObjectType({ - name: name, - description: description, - fields: function fields() { - return buildInputFieldMap(_allNodes4); - }, - astNode: astNode, - extensionASTNodes: _extensionASTNodes5 - }); - } - } // istanbul ignore next (Not reachable. All possible type definition nodes have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected type definition node: ' + (0, _inspect.default)(astNode)); - } -} - -var stdTypeMap = (0, _keyMap.default)(_scalars.specifiedScalarTypes.concat(_introspection.introspectionTypes), function (type) { - return type.name; -}); -/** - * 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 === null || deprecated === void 0 ? void 0 : deprecated.reason; -} -/** - * Given a scalar node, returns the string value for the specifiedByUrl. - */ - - -function getSpecifiedByUrl(node) { - var specifiedBy = (0, _values.getDirectiveValues)(_directives.GraphQLSpecifiedByDirective, node); - return specifiedBy === null || specifiedBy === void 0 ? void 0 : specifiedBy.url; -} -/** - * 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 === null || options === void 0 ? void 0 : options.commentDescriptions) === true) { - 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 != null && 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.length > 0 ? comments.reverse().join('\n') : undefined; -} diff --git a/JS/node_modules/graphql/utilities/extendSchema.js.flow b/JS/node_modules/graphql/utilities/extendSchema.js.flow deleted file mode 100644 index 2d5a229..0000000 --- a/JS/node_modules/graphql/utilities/extendSchema.js.flow +++ /dev/null @@ -1,782 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import keyMap from '../jsutils/keyMap'; -import inspect from '../jsutils/inspect'; -import mapValue from '../jsutils/mapValue'; -import invariant from '../jsutils/invariant'; -import devAssert from '../jsutils/devAssert'; - -import type { DirectiveLocationEnum } from '../language/directiveLocation'; -import type { - Location, - DocumentNode, - StringValueNode, - TypeNode, - NamedTypeNode, - SchemaDefinitionNode, - SchemaExtensionNode, - TypeDefinitionNode, - InterfaceTypeDefinitionNode, - InterfaceTypeExtensionNode, - ObjectTypeDefinitionNode, - ObjectTypeExtensionNode, - UnionTypeDefinitionNode, - UnionTypeExtensionNode, - FieldDefinitionNode, - InputObjectTypeDefinitionNode, - InputObjectTypeExtensionNode, - InputValueDefinitionNode, - EnumTypeDefinitionNode, - EnumTypeExtensionNode, - EnumValueDefinitionNode, - DirectiveDefinitionNode, - ScalarTypeDefinitionNode, - ScalarTypeExtensionNode, -} from '../language/ast'; -import { Kind } from '../language/kinds'; -import { TokenKind } from '../language/tokenKind'; -import { dedentBlockStringValue } from '../language/blockString'; -import { - isTypeDefinitionNode, - isTypeExtensionNode, -} from '../language/predicates'; - -import { assertValidSDLExtension } from '../validation/validate'; - -import { getDirectiveValues } from '../execution/values'; - -import type { - GraphQLSchemaValidationOptions, - GraphQLSchemaNormalizedConfig, -} from '../type/schema'; -import type { - GraphQLType, - GraphQLNamedType, - GraphQLFieldConfig, - GraphQLFieldConfigMap, - GraphQLArgumentConfig, - GraphQLFieldConfigArgumentMap, - GraphQLEnumValueConfigMap, - GraphQLInputFieldConfigMap, -} from '../type/definition'; -import { assertSchema, GraphQLSchema } from '../type/schema'; -import { specifiedScalarTypes, isSpecifiedScalarType } from '../type/scalars'; -import { introspectionTypes, isIntrospectionType } from '../type/introspection'; -import { - GraphQLDirective, - GraphQLDeprecatedDirective, - GraphQLSpecifiedByDirective, -} from '../type/directives'; -import { - isScalarType, - isObjectType, - isInterfaceType, - isUnionType, - isListType, - isNonNullType, - isEnumType, - isInputObjectType, - GraphQLList, - GraphQLNonNull, - GraphQLScalarType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, -} from '../type/definition'; - -import { valueFromAST } from './valueFromAST'; - -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); - - devAssert( - documentAST != null && documentAST.kind === Kind.DOCUMENT, - 'Must provide valid Document AST.', - ); - - if (options?.assumeValid !== true && options?.assumeValidSDL !== true) { - assertValidSDLExtension(documentAST, schema); - } - - const schemaConfig = schema.toConfig(); - const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); - return schemaConfig === extendedConfig - ? schema - : new GraphQLSchema(extendedConfig); -} - -/** - * @internal - */ -export function extendSchemaImpl( - schemaConfig: GraphQLSchemaNormalizedConfig, - documentAST: DocumentNode, - options?: Options, -): GraphQLSchemaNormalizedConfig { - // Collect the type definitions and extensions found in the document. - const typeDefs: Array = []; - const typeExtensionsMap = 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 schemaExtensions: Array = []; - - for (const def of documentAST.definitions) { - if (def.kind === Kind.SCHEMA_DEFINITION) { - schemaDef = def; - } else if (def.kind === Kind.SCHEMA_EXTENSION) { - schemaExtensions.push(def); - } else if (isTypeDefinitionNode(def)) { - typeDefs.push(def); - } else if (isTypeExtensionNode(def)) { - const extendedTypeName = def.name.value; - const existingTypeExtensions = typeExtensionsMap[extendedTypeName]; - typeExtensionsMap[extendedTypeName] = existingTypeExtensions - ? existingTypeExtensions.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(typeExtensionsMap).length === 0 && - typeDefs.length === 0 && - directiveDefs.length === 0 && - schemaExtensions.length === 0 && - schemaDef == null - ) { - return schemaConfig; - } - - const typeMap = Object.create(null); - for (const existingType of schemaConfig.types) { - typeMap[existingType.name] = extendNamedType(existingType); - } - - for (const typeNode of typeDefs) { - const name = typeNode.name.value; - typeMap[name] = stdTypeMap[name] ?? buildType(typeNode); - } - - const operationTypes = { - // Get the extended root operation types. - query: schemaConfig.query && replaceNamedType(schemaConfig.query), - mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation), - subscription: - schemaConfig.subscription && replaceNamedType(schemaConfig.subscription), - // Then, incorporate schema definition and all schema extensions. - ...(schemaDef && getOperationTypes([schemaDef])), - ...getOperationTypes(schemaExtensions), - }; - - // Then produce and return a Schema config with these types. - return { - description: schemaDef?.description?.value, - ...operationTypes, - types: objectValues(typeMap), - directives: [ - ...schemaConfig.directives.map(replaceDirective), - ...directiveDefs.map(buildDirective), - ], - extensions: undefined, - astNode: schemaDef ?? schemaConfig.astNode, - extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions), - assumeValid: options?.assumeValid ?? false, - }; - - // 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: T): T { - if (isListType(type)) { - // $FlowFixMe[incompatible-return] - return new GraphQLList(replaceType(type.ofType)); - } - if (isNonNullType(type)) { - // $FlowFixMe[incompatible-return] - return new GraphQLNonNull(replaceType(type.ofType)); - } - return replaceNamedType(type); - } - - function replaceNamedType(type: T): T { - // 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. - return ((typeMap[type.name]: any): T); - } - - function replaceDirective(directive: GraphQLDirective): GraphQLDirective { - const config = directive.toConfig(); - return new GraphQLDirective({ - ...config, - args: mapValue(config.args, extendArg), - }); - } - - function extendNamedType(type: GraphQLNamedType): GraphQLNamedType { - if (isIntrospectionType(type) || isSpecifiedScalarType(type)) { - // Builtin types are not extended. - return type; - } - if (isScalarType(type)) { - return extendScalarType(type); - } - if (isObjectType(type)) { - return extendObjectType(type); - } - if (isInterfaceType(type)) { - return extendInterfaceType(type); - } - if (isUnionType(type)) { - return extendUnionType(type); - } - if (isEnumType(type)) { - return extendEnumType(type); - } - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isInputObjectType(type)) { - return extendInputObjectType(type); - } - - // istanbul ignore next (Not reachable. All possible types have been considered) - invariant(false, 'Unexpected type: ' + inspect((type: empty))); - } - - function extendInputObjectType( - type: GraphQLInputObjectType, - ): GraphQLInputObjectType { - const config = type.toConfig(); - const extensions = typeExtensionsMap[config.name] ?? []; - - return new GraphQLInputObjectType({ - ...config, - fields: () => ({ - ...mapValue(config.fields, (field) => ({ - ...field, - type: replaceType(field.type), - })), - ...buildInputFieldMap(extensions), - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendEnumType(type: GraphQLEnumType): GraphQLEnumType { - const config = type.toConfig(); - const extensions = typeExtensionsMap[type.name] ?? []; - - return new GraphQLEnumType({ - ...config, - values: { - ...config.values, - ...buildEnumValueMap(extensions), - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendScalarType(type: GraphQLScalarType): GraphQLScalarType { - const config = type.toConfig(); - const extensions = typeExtensionsMap[config.name] ?? []; - - let specifiedByUrl = config.specifiedByUrl; - for (const extensionNode of extensions) { - specifiedByUrl = getSpecifiedByUrl(extensionNode) ?? specifiedByUrl; - } - - return new GraphQLScalarType({ - ...config, - specifiedByUrl, - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendObjectType(type: GraphQLObjectType): GraphQLObjectType { - const config = type.toConfig(); - const extensions = typeExtensionsMap[config.name] ?? []; - - return new GraphQLObjectType({ - ...config, - interfaces: () => [ - ...type.getInterfaces().map(replaceNamedType), - ...buildInterfaces(extensions), - ], - fields: () => ({ - ...mapValue(config.fields, extendField), - ...buildFieldMap(extensions), - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendInterfaceType( - type: GraphQLInterfaceType, - ): GraphQLInterfaceType { - const config = type.toConfig(); - const extensions = typeExtensionsMap[config.name] ?? []; - - return new GraphQLInterfaceType({ - ...config, - interfaces: () => [ - ...type.getInterfaces().map(replaceNamedType), - ...buildInterfaces(extensions), - ], - fields: () => ({ - ...mapValue(config.fields, extendField), - ...buildFieldMap(extensions), - }), - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendUnionType(type: GraphQLUnionType): GraphQLUnionType { - const config = type.toConfig(); - const extensions = typeExtensionsMap[config.name] ?? []; - - return new GraphQLUnionType({ - ...config, - types: () => [ - ...type.getTypes().map(replaceNamedType), - ...buildUnionTypes(extensions), - ], - extensionASTNodes: config.extensionASTNodes.concat(extensions), - }); - } - - function extendField( - field: GraphQLFieldConfig, - ): GraphQLFieldConfig { - return { - ...field, - type: replaceType(field.type), - // $FlowFixMe[incompatible-call] - args: mapValue(field.args, extendArg), - }; - } - - function extendArg(arg: GraphQLArgumentConfig) { - return { - ...arg, - type: replaceType(arg.type), - }; - } - - function getOperationTypes( - nodes: $ReadOnlyArray, - ): {| - query: ?GraphQLObjectType, - mutation: ?GraphQLObjectType, - subscription: ?GraphQLObjectType, - |} { - const opTypes = {}; - for (const node of nodes) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const operationTypesNodes = node.operationTypes ?? []; - - for (const operationType of operationTypesNodes) { - opTypes[operationType.operation] = getNamedType(operationType.type); - } - } - - // 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. - return (opTypes: any); - } - - function getNamedType(node: NamedTypeNode): GraphQLNamedType { - const name = node.name.value; - const type = stdTypeMap[name] ?? typeMap[name]; - - if (type === undefined) { - throw new Error(`Unknown type: "${name}".`); - } - return type; - } - - function getWrappedType(node: TypeNode): GraphQLType { - if (node.kind === Kind.LIST_TYPE) { - return new GraphQLList(getWrappedType(node.type)); - } - if (node.kind === Kind.NON_NULL_TYPE) { - return new GraphQLNonNull(getWrappedType(node.type)); - } - return getNamedType(node); - } - - function buildDirective(node: DirectiveDefinitionNode): GraphQLDirective { - const locations = node.locations.map( - ({ value }) => ((value: any): DirectiveLocationEnum), - ); - - return new GraphQLDirective({ - name: node.name.value, - description: getDescription(node, options), - locations, - isRepeatable: node.repeatable, - args: buildArgumentMap(node.arguments), - astNode: node, - }); - } - - function buildFieldMap( - nodes: $ReadOnlyArray< - | InterfaceTypeDefinitionNode - | InterfaceTypeExtensionNode - | ObjectTypeDefinitionNode - | ObjectTypeExtensionNode, - >, - ): GraphQLFieldConfigMap { - const fieldConfigMap = Object.create(null); - for (const node of nodes) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const nodeFields = node.fields ?? []; - - for (const field of nodeFields) { - fieldConfigMap[field.name.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. - type: (getWrappedType(field.type): any), - description: getDescription(field, options), - args: buildArgumentMap(field.arguments), - deprecationReason: getDeprecationReason(field), - astNode: field, - }; - } - } - return fieldConfigMap; - } - - function buildArgumentMap( - args: ?$ReadOnlyArray, - ): GraphQLFieldConfigArgumentMap { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const argsNodes = args ?? []; - - const argConfigMap = Object.create(null); - for (const arg of argsNodes) { - // 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 = getWrappedType(arg.type); - - argConfigMap[arg.name.value] = { - type, - description: getDescription(arg, options), - defaultValue: valueFromAST(arg.defaultValue, type), - deprecationReason: getDeprecationReason(arg), - astNode: arg, - }; - } - return argConfigMap; - } - - function buildInputFieldMap( - nodes: $ReadOnlyArray< - InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode, - >, - ): GraphQLInputFieldConfigMap { - const inputFieldMap = Object.create(null); - for (const node of nodes) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const fieldsNodes = node.fields ?? []; - - for (const field of fieldsNodes) { - // 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 = getWrappedType(field.type); - - inputFieldMap[field.name.value] = { - type, - description: getDescription(field, options), - defaultValue: valueFromAST(field.defaultValue, type), - deprecationReason: getDeprecationReason(field), - astNode: field, - }; - } - } - return inputFieldMap; - } - - function buildEnumValueMap( - nodes: $ReadOnlyArray, - ): GraphQLEnumValueConfigMap { - const enumValueMap = Object.create(null); - for (const node of nodes) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const valuesNodes = node.values ?? []; - - for (const value of valuesNodes) { - enumValueMap[value.name.value] = { - description: getDescription(value, options), - deprecationReason: getDeprecationReason(value), - astNode: value, - }; - } - } - return enumValueMap; - } - - function buildInterfaces( - nodes: $ReadOnlyArray< - | InterfaceTypeDefinitionNode - | InterfaceTypeExtensionNode - | ObjectTypeDefinitionNode - | ObjectTypeExtensionNode, - >, - ): Array { - const interfaces = []; - for (const node of nodes) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const interfacesNodes = node.interfaces ?? []; - - for (const type of interfacesNodes) { - // 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. - interfaces.push((getNamedType(type): any)); - } - } - return interfaces; - } - - function buildUnionTypes( - nodes: $ReadOnlyArray, - ): Array { - const types = []; - for (const node of nodes) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const typeNodes = node.types ?? []; - - for (const type of typeNodes) { - // 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. - types.push((getNamedType(type): any)); - } - } - return types; - } - - function buildType(astNode: TypeDefinitionNode): GraphQLNamedType { - const name = astNode.name.value; - const description = getDescription(astNode, options); - const extensionNodes = typeExtensionsMap[name] ?? []; - - switch (astNode.kind) { - case Kind.OBJECT_TYPE_DEFINITION: { - const extensionASTNodes = (extensionNodes: any); - const allNodes = [astNode, ...extensionASTNodes]; - - return new GraphQLObjectType({ - name, - description, - interfaces: () => buildInterfaces(allNodes), - fields: () => buildFieldMap(allNodes), - astNode, - extensionASTNodes, - }); - } - case Kind.INTERFACE_TYPE_DEFINITION: { - const extensionASTNodes = (extensionNodes: any); - const allNodes = [astNode, ...extensionASTNodes]; - - return new GraphQLInterfaceType({ - name, - description, - interfaces: () => buildInterfaces(allNodes), - fields: () => buildFieldMap(allNodes), - astNode, - extensionASTNodes, - }); - } - case Kind.ENUM_TYPE_DEFINITION: { - const extensionASTNodes = (extensionNodes: any); - const allNodes = [astNode, ...extensionASTNodes]; - - return new GraphQLEnumType({ - name, - description, - values: buildEnumValueMap(allNodes), - astNode, - extensionASTNodes, - }); - } - case Kind.UNION_TYPE_DEFINITION: { - const extensionASTNodes = (extensionNodes: any); - const allNodes = [astNode, ...extensionASTNodes]; - - return new GraphQLUnionType({ - name, - description, - types: () => buildUnionTypes(allNodes), - astNode, - extensionASTNodes, - }); - } - case Kind.SCALAR_TYPE_DEFINITION: { - const extensionASTNodes = (extensionNodes: any); - - return new GraphQLScalarType({ - name, - description, - specifiedByUrl: getSpecifiedByUrl(astNode), - astNode, - extensionASTNodes, - }); - } - case Kind.INPUT_OBJECT_TYPE_DEFINITION: { - const extensionASTNodes = (extensionNodes: any); - const allNodes = [astNode, ...extensionASTNodes]; - - return new GraphQLInputObjectType({ - name, - description, - fields: () => buildInputFieldMap(allNodes), - astNode, - extensionASTNodes, - }); - } - } - - // istanbul ignore next (Not reachable. All possible type definition nodes have been considered) - invariant( - false, - 'Unexpected type definition node: ' + inspect((astNode: empty)), - ); - } -} - -const stdTypeMap = keyMap( - specifiedScalarTypes.concat(introspectionTypes), - (type) => type.name, -); - -/** - * Given a field or enum value node, returns the string value for the - * deprecation reason. - */ -function getDeprecationReason( - node: - | EnumValueDefinitionNode - | FieldDefinitionNode - | InputValueDefinitionNode, -): ?string { - const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); - return (deprecated?.reason: any); -} - -/** - * Given a scalar node, returns the string value for the specifiedByUrl. - */ -function getSpecifiedByUrl( - node: ScalarTypeDefinitionNode | ScalarTypeExtensionNode, -): ?string { - const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node); - return (specifiedBy?.url: 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: ?{ commentDescriptions?: boolean, ... }, -): void | string { - if (node.description) { - return node.description.value; - } - if (options?.commentDescriptions === true) { - 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 != null && - 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.length > 0 ? comments.reverse().join('\n') : undefined; -} diff --git a/JS/node_modules/graphql/utilities/extendSchema.mjs b/JS/node_modules/graphql/utilities/extendSchema.mjs deleted file mode 100644 index b6ee4c9..0000000 --- a/JS/node_modules/graphql/utilities/extendSchema.mjs +++ /dev/null @@ -1,689 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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.mjs"; -import keyMap from "../jsutils/keyMap.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import mapValue from "../jsutils/mapValue.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import devAssert from "../jsutils/devAssert.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { TokenKind } from "../language/tokenKind.mjs"; -import { dedentBlockStringValue } from "../language/blockString.mjs"; -import { isTypeDefinitionNode, isTypeExtensionNode } from "../language/predicates.mjs"; -import { assertValidSDLExtension } from "../validation/validate.mjs"; -import { getDirectiveValues } from "../execution/values.mjs"; -import { assertSchema, GraphQLSchema } from "../type/schema.mjs"; -import { specifiedScalarTypes, isSpecifiedScalarType } from "../type/scalars.mjs"; -import { introspectionTypes, isIntrospectionType } from "../type/introspection.mjs"; -import { GraphQLDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective } from "../type/directives.mjs"; -import { isScalarType, isObjectType, isInterfaceType, isUnionType, isListType, isNonNullType, isEnumType, isInputObjectType, GraphQLList, GraphQLNonNull, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType } from "../type/definition.mjs"; -import { valueFromAST } from "./valueFromAST.mjs"; - -/** - * 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 != null && documentAST.kind === Kind.DOCUMENT || devAssert(0, 'Must provide valid Document AST.'); - - if ((options === null || options === void 0 ? void 0 : options.assumeValid) !== true && (options === null || options === void 0 ? void 0 : options.assumeValidSDL) !== true) { - assertValidSDLExtension(documentAST, schema); - } - - var schemaConfig = schema.toConfig(); - var extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); - return schemaConfig === extendedConfig ? schema : new GraphQLSchema(extendedConfig); -} -/** - * @internal - */ - -export function extendSchemaImpl(schemaConfig, documentAST, options) { - var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid; - - // Collect the type definitions and extensions found in the document. - var typeDefs = []; - var typeExtensionsMap = 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 schemaExtensions = []; - - for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { - var def = _documentAST$definiti2[_i2]; - - if (def.kind === Kind.SCHEMA_DEFINITION) { - schemaDef = def; - } else if (def.kind === Kind.SCHEMA_EXTENSION) { - schemaExtensions.push(def); - } else if (isTypeDefinitionNode(def)) { - typeDefs.push(def); - } else if (isTypeExtensionNode(def)) { - var extendedTypeName = def.name.value; - var existingTypeExtensions = typeExtensionsMap[extendedTypeName]; - typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.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(typeExtensionsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExtensions.length === 0 && schemaDef == null) { - return schemaConfig; - } - - var typeMap = Object.create(null); - - for (var _i4 = 0, _schemaConfig$types2 = schemaConfig.types; _i4 < _schemaConfig$types2.length; _i4++) { - var existingType = _schemaConfig$types2[_i4]; - typeMap[existingType.name] = extendNamedType(existingType); - } - - for (var _i6 = 0; _i6 < typeDefs.length; _i6++) { - var _stdTypeMap$name; - - var typeNode = typeDefs[_i6]; - var name = typeNode.name.value; - typeMap[name] = (_stdTypeMap$name = stdTypeMap[name]) !== null && _stdTypeMap$name !== void 0 ? _stdTypeMap$name : buildType(typeNode); - } - - var operationTypes = _objectSpread(_objectSpread({ - // Get the extended root operation types. - query: schemaConfig.query && replaceNamedType(schemaConfig.query), - mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation), - subscription: schemaConfig.subscription && replaceNamedType(schemaConfig.subscription) - }, schemaDef && getOperationTypes([schemaDef])), getOperationTypes(schemaExtensions)); // Then produce and return a Schema config with these types. - - - return _objectSpread(_objectSpread({ - description: (_schemaDef = schemaDef) === null || _schemaDef === void 0 ? void 0 : (_schemaDef$descriptio = _schemaDef.description) === null || _schemaDef$descriptio === void 0 ? void 0 : _schemaDef$descriptio.value - }, operationTypes), {}, { - types: objectValues(typeMap), - directives: [].concat(schemaConfig.directives.map(replaceDirective), directiveDefs.map(buildDirective)), - extensions: undefined, - astNode: (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0 ? _schemaDef2 : schemaConfig.astNode, - extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions), - assumeValid: (_options$assumeValid = options === null || options === void 0 ? void 0 : options.assumeValid) !== null && _options$assumeValid !== void 0 ? _options$assumeValid : false - }); // 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)) { - // $FlowFixMe[incompatible-return] - return new GraphQLList(replaceType(type.ofType)); - } - - if (isNonNullType(type)) { - // $FlowFixMe[incompatible-return] - return new GraphQLNonNull(replaceType(type.ofType)); - } - - return replaceNamedType(type); - } - - function replaceNamedType(type) { - // 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. - return typeMap[type.name]; - } - - function replaceDirective(directive) { - var config = directive.toConfig(); - return new GraphQLDirective(_objectSpread(_objectSpread({}, config), {}, { - args: mapValue(config.args, extendArg) - })); - } - - function extendNamedType(type) { - if (isIntrospectionType(type) || isSpecifiedScalarType(type)) { - // Builtin types are not extended. - return type; - } - - if (isScalarType(type)) { - return extendScalarType(type); - } - - if (isObjectType(type)) { - return extendObjectType(type); - } - - if (isInterfaceType(type)) { - return extendInterfaceType(type); - } - - if (isUnionType(type)) { - return extendUnionType(type); - } - - if (isEnumType(type)) { - return extendEnumType(type); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isInputObjectType(type)) { - return extendInputObjectType(type); - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || invariant(0, 'Unexpected type: ' + inspect(type)); - } - - function extendInputObjectType(type) { - var _typeExtensionsMap$co; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co !== void 0 ? _typeExtensionsMap$co : []; - return new GraphQLInputObjectType(_objectSpread(_objectSpread({}, config), {}, { - fields: function fields() { - return _objectSpread(_objectSpread({}, mapValue(config.fields, function (field) { - return _objectSpread(_objectSpread({}, field), {}, { - type: replaceType(field.type) - }); - })), buildInputFieldMap(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendEnumType(type) { - var _typeExtensionsMap$ty; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null && _typeExtensionsMap$ty !== void 0 ? _typeExtensionsMap$ty : []; - return new GraphQLEnumType(_objectSpread(_objectSpread({}, config), {}, { - values: _objectSpread(_objectSpread({}, config.values), buildEnumValueMap(extensions)), - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendScalarType(type) { - var _typeExtensionsMap$co2; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co2 !== void 0 ? _typeExtensionsMap$co2 : []; - var specifiedByUrl = config.specifiedByUrl; - - for (var _i8 = 0; _i8 < extensions.length; _i8++) { - var _getSpecifiedByUrl; - - var extensionNode = extensions[_i8]; - specifiedByUrl = (_getSpecifiedByUrl = getSpecifiedByUrl(extensionNode)) !== null && _getSpecifiedByUrl !== void 0 ? _getSpecifiedByUrl : specifiedByUrl; - } - - return new GraphQLScalarType(_objectSpread(_objectSpread({}, config), {}, { - specifiedByUrl: specifiedByUrl, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendObjectType(type) { - var _typeExtensionsMap$co3; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co3 !== void 0 ? _typeExtensionsMap$co3 : []; - return new GraphQLObjectType(_objectSpread(_objectSpread({}, config), {}, { - interfaces: function interfaces() { - return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions)); - }, - fields: function fields() { - return _objectSpread(_objectSpread({}, mapValue(config.fields, extendField)), buildFieldMap(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendInterfaceType(type) { - var _typeExtensionsMap$co4; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co4 !== void 0 ? _typeExtensionsMap$co4 : []; - return new GraphQLInterfaceType(_objectSpread(_objectSpread({}, config), {}, { - interfaces: function interfaces() { - return [].concat(type.getInterfaces().map(replaceNamedType), buildInterfaces(extensions)); - }, - fields: function fields() { - return _objectSpread(_objectSpread({}, mapValue(config.fields, extendField)), buildFieldMap(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendUnionType(type) { - var _typeExtensionsMap$co5; - - var config = type.toConfig(); - var extensions = (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null && _typeExtensionsMap$co5 !== void 0 ? _typeExtensionsMap$co5 : []; - return new GraphQLUnionType(_objectSpread(_objectSpread({}, config), {}, { - types: function types() { - return [].concat(type.getTypes().map(replaceNamedType), buildUnionTypes(extensions)); - }, - extensionASTNodes: config.extensionASTNodes.concat(extensions) - })); - } - - function extendField(field) { - return _objectSpread(_objectSpread({}, field), {}, { - type: replaceType(field.type), - // $FlowFixMe[incompatible-call] - args: mapValue(field.args, extendArg) - }); - } - - function extendArg(arg) { - return _objectSpread(_objectSpread({}, arg), {}, { - type: replaceType(arg.type) - }); - } - - function getOperationTypes(nodes) { - var opTypes = {}; - - for (var _i10 = 0; _i10 < nodes.length; _i10++) { - var _node$operationTypes; - - var node = nodes[_i10]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; - - for (var _i12 = 0; _i12 < operationTypesNodes.length; _i12++) { - var operationType = operationTypesNodes[_i12]; - opTypes[operationType.operation] = getNamedType(operationType.type); - } - } // 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. - - - return opTypes; - } - - function getNamedType(node) { - var _stdTypeMap$name2; - - var name = node.name.value; - var type = (_stdTypeMap$name2 = stdTypeMap[name]) !== null && _stdTypeMap$name2 !== void 0 ? _stdTypeMap$name2 : typeMap[name]; - - if (type === undefined) { - throw new Error("Unknown type: \"".concat(name, "\".")); - } - - return type; - } - - function getWrappedType(node) { - if (node.kind === Kind.LIST_TYPE) { - return new GraphQLList(getWrappedType(node.type)); - } - - if (node.kind === Kind.NON_NULL_TYPE) { - return new GraphQLNonNull(getWrappedType(node.type)); - } - - return getNamedType(node); - } - - function buildDirective(node) { - var locations = node.locations.map(function (_ref) { - var value = _ref.value; - return value; - }); - return new GraphQLDirective({ - name: node.name.value, - description: getDescription(node, options), - locations: locations, - isRepeatable: node.repeatable, - args: buildArgumentMap(node.arguments), - astNode: node - }); - } - - function buildFieldMap(nodes) { - var fieldConfigMap = Object.create(null); - - for (var _i14 = 0; _i14 < nodes.length; _i14++) { - var _node$fields; - - var node = nodes[_i14]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var nodeFields = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; - - for (var _i16 = 0; _i16 < nodeFields.length; _i16++) { - var field = nodeFields[_i16]; - fieldConfigMap[field.name.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. - type: getWrappedType(field.type), - description: getDescription(field, options), - args: buildArgumentMap(field.arguments), - deprecationReason: getDeprecationReason(field), - astNode: field - }; - } - } - - return fieldConfigMap; - } - - function buildArgumentMap(args) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var argsNodes = args !== null && args !== void 0 ? args : []; - var argConfigMap = Object.create(null); - - for (var _i18 = 0; _i18 < argsNodes.length; _i18++) { - var arg = argsNodes[_i18]; - // 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 = getWrappedType(arg.type); - argConfigMap[arg.name.value] = { - type: type, - description: getDescription(arg, options), - defaultValue: valueFromAST(arg.defaultValue, type), - deprecationReason: getDeprecationReason(arg), - astNode: arg - }; - } - - return argConfigMap; - } - - function buildInputFieldMap(nodes) { - var inputFieldMap = Object.create(null); - - for (var _i20 = 0; _i20 < nodes.length; _i20++) { - var _node$fields2; - - var node = nodes[_i20]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var fieldsNodes = (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 ? _node$fields2 : []; - - for (var _i22 = 0; _i22 < fieldsNodes.length; _i22++) { - var field = fieldsNodes[_i22]; - // 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 = getWrappedType(field.type); - inputFieldMap[field.name.value] = { - type: type, - description: getDescription(field, options), - defaultValue: valueFromAST(field.defaultValue, type), - deprecationReason: getDeprecationReason(field), - astNode: field - }; - } - } - - return inputFieldMap; - } - - function buildEnumValueMap(nodes) { - var enumValueMap = Object.create(null); - - for (var _i24 = 0; _i24 < nodes.length; _i24++) { - var _node$values; - - var node = nodes[_i24]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var valuesNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; - - for (var _i26 = 0; _i26 < valuesNodes.length; _i26++) { - var value = valuesNodes[_i26]; - enumValueMap[value.name.value] = { - description: getDescription(value, options), - deprecationReason: getDeprecationReason(value), - astNode: value - }; - } - } - - return enumValueMap; - } - - function buildInterfaces(nodes) { - var interfaces = []; - - for (var _i28 = 0; _i28 < nodes.length; _i28++) { - var _node$interfaces; - - var node = nodes[_i28]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var interfacesNodes = (_node$interfaces = node.interfaces) !== null && _node$interfaces !== void 0 ? _node$interfaces : []; - - for (var _i30 = 0; _i30 < interfacesNodes.length; _i30++) { - var type = interfacesNodes[_i30]; - // 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. - interfaces.push(getNamedType(type)); - } - } - - return interfaces; - } - - function buildUnionTypes(nodes) { - var types = []; - - for (var _i32 = 0; _i32 < nodes.length; _i32++) { - var _node$types; - - var node = nodes[_i32]; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var typeNodes = (_node$types = node.types) !== null && _node$types !== void 0 ? _node$types : []; - - for (var _i34 = 0; _i34 < typeNodes.length; _i34++) { - var type = typeNodes[_i34]; - // 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. - types.push(getNamedType(type)); - } - } - - return types; - } - - function buildType(astNode) { - var _typeExtensionsMap$na; - - var name = astNode.name.value; - var description = getDescription(astNode, options); - var extensionNodes = (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null && _typeExtensionsMap$na !== void 0 ? _typeExtensionsMap$na : []; - - switch (astNode.kind) { - case Kind.OBJECT_TYPE_DEFINITION: - { - var extensionASTNodes = extensionNodes; - var allNodes = [astNode].concat(extensionASTNodes); - return new GraphQLObjectType({ - name: name, - description: description, - interfaces: function interfaces() { - return buildInterfaces(allNodes); - }, - fields: function fields() { - return buildFieldMap(allNodes); - }, - astNode: astNode, - extensionASTNodes: extensionASTNodes - }); - } - - case Kind.INTERFACE_TYPE_DEFINITION: - { - var _extensionASTNodes = extensionNodes; - - var _allNodes = [astNode].concat(_extensionASTNodes); - - return new GraphQLInterfaceType({ - name: name, - description: description, - interfaces: function interfaces() { - return buildInterfaces(_allNodes); - }, - fields: function fields() { - return buildFieldMap(_allNodes); - }, - astNode: astNode, - extensionASTNodes: _extensionASTNodes - }); - } - - case Kind.ENUM_TYPE_DEFINITION: - { - var _extensionASTNodes2 = extensionNodes; - - var _allNodes2 = [astNode].concat(_extensionASTNodes2); - - return new GraphQLEnumType({ - name: name, - description: description, - values: buildEnumValueMap(_allNodes2), - astNode: astNode, - extensionASTNodes: _extensionASTNodes2 - }); - } - - case Kind.UNION_TYPE_DEFINITION: - { - var _extensionASTNodes3 = extensionNodes; - - var _allNodes3 = [astNode].concat(_extensionASTNodes3); - - return new GraphQLUnionType({ - name: name, - description: description, - types: function types() { - return buildUnionTypes(_allNodes3); - }, - astNode: astNode, - extensionASTNodes: _extensionASTNodes3 - }); - } - - case Kind.SCALAR_TYPE_DEFINITION: - { - var _extensionASTNodes4 = extensionNodes; - return new GraphQLScalarType({ - name: name, - description: description, - specifiedByUrl: getSpecifiedByUrl(astNode), - astNode: astNode, - extensionASTNodes: _extensionASTNodes4 - }); - } - - case Kind.INPUT_OBJECT_TYPE_DEFINITION: - { - var _extensionASTNodes5 = extensionNodes; - - var _allNodes4 = [astNode].concat(_extensionASTNodes5); - - return new GraphQLInputObjectType({ - name: name, - description: description, - fields: function fields() { - return buildInputFieldMap(_allNodes4); - }, - astNode: astNode, - extensionASTNodes: _extensionASTNodes5 - }); - } - } // istanbul ignore next (Not reachable. All possible type definition nodes have been considered) - - - false || invariant(0, 'Unexpected type definition node: ' + inspect(astNode)); - } -} -var stdTypeMap = keyMap(specifiedScalarTypes.concat(introspectionTypes), function (type) { - return type.name; -}); -/** - * 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 === null || deprecated === void 0 ? void 0 : deprecated.reason; -} -/** - * Given a scalar node, returns the string value for the specifiedByUrl. - */ - - -function getSpecifiedByUrl(node) { - var specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node); - return specifiedBy === null || specifiedBy === void 0 ? void 0 : specifiedBy.url; -} -/** - * 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 === null || options === void 0 ? void 0 : options.commentDescriptions) === true) { - 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 != null && 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.length > 0 ? comments.reverse().join('\n') : undefined; -} diff --git a/JS/node_modules/graphql/utilities/findBreakingChanges.d.ts b/JS/node_modules/graphql/utilities/findBreakingChanges.d.ts deleted file mode 100644 index df35805..0000000 --- a/JS/node_modules/graphql/utilities/findBreakingChanges.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { GraphQLSchema } from '../type/schema'; - -export const BreakingChangeType: { - 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'; - IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED'; - 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_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED'; - DIRECTIVE_LOCATION_REMOVED: 'DIRECTIVE_LOCATION_REMOVED'; -}; - -export const DangerousChangeType: { - 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'; - IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED'; - ARG_DEFAULT_VALUE_CHANGE: 'ARG_DEFAULT_VALUE_CHANGE'; -}; - -export interface BreakingChange { - type: keyof typeof BreakingChangeType; - description: string; -} - -export interface DangerousChange { - type: keyof typeof DangerousChangeType; - 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; - -/** - * 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; diff --git a/JS/node_modules/graphql/utilities/findBreakingChanges.js b/JS/node_modules/graphql/utilities/findBreakingChanges.js deleted file mode 100644 index 699c88f..0000000 --- a/JS/node_modules/graphql/utilities/findBreakingChanges.js +++ /dev/null @@ -1,522 +0,0 @@ -"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.js")); - -var _keyMap = _interopRequireDefault(require("../jsutils/keyMap.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _naturalCompare = _interopRequireDefault(require("../jsutils/naturalCompare.js")); - -var _printer = require("../language/printer.js"); - -var _visitor = require("../language/visitor.js"); - -var _scalars = require("../type/scalars.js"); - -var _definition = require("../type/definition.js"); - -var _astFromValue = require("./astFromValue.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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; } - -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', - IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED', - 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_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED', - 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', - IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED', - 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()); - - for (var _i2 = 0, _directivesDiff$remov2 = directivesDiff.removed; _i2 < _directivesDiff$remov2.length; _i2++) { - var oldDirective = _directivesDiff$remov2[_i2]; - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REMOVED, - description: "".concat(oldDirective.name, " was removed.") - }); - } - - for (var _i4 = 0, _directivesDiff$persi2 = directivesDiff.persisted; _i4 < _directivesDiff$persi2.length; _i4++) { - var _ref2 = _directivesDiff$persi2[_i4]; - var _oldDirective = _ref2[0]; - var newDirective = _ref2[1]; - var argsDiff = diff(_oldDirective.args, newDirective.args); - - for (var _i6 = 0, _argsDiff$added2 = argsDiff.added; _i6 < _argsDiff$added2.length; _i6++) { - var newArg = _argsDiff$added2[_i6]; - - 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.") - }); - } - } - - for (var _i8 = 0, _argsDiff$removed2 = argsDiff.removed; _i8 < _argsDiff$removed2.length; _i8++) { - var oldArg = _argsDiff$removed2[_i8]; - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, - description: "".concat(oldArg.name, " was removed from ").concat(_oldDirective.name, ".") - }); - } - - if (_oldDirective.isRepeatable && !newDirective.isRepeatable) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, - description: "Repeatable flag was removed from ".concat(_oldDirective.name, ".") - }); - } - - for (var _i10 = 0, _oldDirective$locatio2 = _oldDirective.locations; _i10 < _oldDirective$locatio2.length; _i10++) { - var location = _oldDirective$locatio2[_i10]; - - if (newDirective.locations.indexOf(location) === -1) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, - description: "".concat(location, " was removed from ").concat(_oldDirective.name, ".") - }); - } - } - } - - return schemaChanges; -} - -function findTypeChanges(oldSchema, newSchema) { - var schemaChanges = []; - var typesDiff = diff((0, _objectValues.default)(oldSchema.getTypeMap()), (0, _objectValues.default)(newSchema.getTypeMap())); - - for (var _i12 = 0, _typesDiff$removed2 = typesDiff.removed; _i12 < _typesDiff$removed2.length; _i12++) { - var oldType = _typesDiff$removed2[_i12]; - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED, - description: (0, _scalars.isSpecifiedScalarType)(oldType) ? "Standard scalar ".concat(oldType.name, " was removed because it is not referenced anymore.") : "".concat(oldType.name, " was removed.") - }); - } - - for (var _i14 = 0, _typesDiff$persisted2 = typesDiff.persisted; _i14 < _typesDiff$persisted2.length; _i14++) { - var _ref4 = _typesDiff$persisted2[_i14]; - 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, findFieldChanges(_oldType, newType).concat(findImplementedInterfacesChanges(_oldType, newType))); - } else if ((0, _definition.isInterfaceType)(_oldType) && (0, _definition.isInterfaceType)(newType)) { - schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType).concat(findImplementedInterfacesChanges(_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), ".") - }); - } - } - - return schemaChanges; -} - -function findInputObjectTypeChanges(oldType, newType) { - var schemaChanges = []; - var fieldsDiff = diff((0, _objectValues.default)(oldType.getFields()), (0, _objectValues.default)(newType.getFields())); - - for (var _i16 = 0, _fieldsDiff$added2 = fieldsDiff.added; _i16 < _fieldsDiff$added2.length; _i16++) { - var newField = _fieldsDiff$added2[_i16]; - - 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.") - }); - } - } - - for (var _i18 = 0, _fieldsDiff$removed2 = fieldsDiff.removed; _i18 < _fieldsDiff$removed2.length; _i18++) { - var oldField = _fieldsDiff$removed2[_i18]; - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") - }); - } - - for (var _i20 = 0, _fieldsDiff$persisted2 = fieldsDiff.persisted; _i20 < _fieldsDiff$persisted2.length; _i20++) { - var _ref6 = _fieldsDiff$persisted2[_i20]; - 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), ".") - }); - } - } - - return schemaChanges; -} - -function findUnionTypeChanges(oldType, newType) { - var schemaChanges = []; - var possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); - - for (var _i22 = 0, _possibleTypesDiff$ad2 = possibleTypesDiff.added; _i22 < _possibleTypesDiff$ad2.length; _i22++) { - var newPossibleType = _possibleTypesDiff$ad2[_i22]; - schemaChanges.push({ - type: DangerousChangeType.TYPE_ADDED_TO_UNION, - description: "".concat(newPossibleType.name, " was added to union type ").concat(oldType.name, ".") - }); - } - - for (var _i24 = 0, _possibleTypesDiff$re2 = possibleTypesDiff.removed; _i24 < _possibleTypesDiff$re2.length; _i24++) { - var oldPossibleType = _possibleTypesDiff$re2[_i24]; - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, - description: "".concat(oldPossibleType.name, " was removed from union type ").concat(oldType.name, ".") - }); - } - - return schemaChanges; -} - -function findEnumTypeChanges(oldType, newType) { - var schemaChanges = []; - var valuesDiff = diff(oldType.getValues(), newType.getValues()); - - for (var _i26 = 0, _valuesDiff$added2 = valuesDiff.added; _i26 < _valuesDiff$added2.length; _i26++) { - var newValue = _valuesDiff$added2[_i26]; - schemaChanges.push({ - type: DangerousChangeType.VALUE_ADDED_TO_ENUM, - description: "".concat(newValue.name, " was added to enum type ").concat(oldType.name, ".") - }); - } - - for (var _i28 = 0, _valuesDiff$removed2 = valuesDiff.removed; _i28 < _valuesDiff$removed2.length; _i28++) { - var oldValue = _valuesDiff$removed2[_i28]; - schemaChanges.push({ - type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, - description: "".concat(oldValue.name, " was removed from enum type ").concat(oldType.name, ".") - }); - } - - return schemaChanges; -} - -function findImplementedInterfacesChanges(oldType, newType) { - var schemaChanges = []; - var interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); - - for (var _i30 = 0, _interfacesDiff$added2 = interfacesDiff.added; _i30 < _interfacesDiff$added2.length; _i30++) { - var newInterface = _interfacesDiff$added2[_i30]; - schemaChanges.push({ - type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, - description: "".concat(newInterface.name, " added to interfaces implemented by ").concat(oldType.name, ".") - }); - } - - for (var _i32 = 0, _interfacesDiff$remov2 = interfacesDiff.removed; _i32 < _interfacesDiff$remov2.length; _i32++) { - var oldInterface = _interfacesDiff$remov2[_i32]; - schemaChanges.push({ - type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, - description: "".concat(oldType.name, " no longer implements interface ").concat(oldInterface.name, ".") - }); - } - - return schemaChanges; -} - -function findFieldChanges(oldType, newType) { - var schemaChanges = []; - var fieldsDiff = diff((0, _objectValues.default)(oldType.getFields()), (0, _objectValues.default)(newType.getFields())); - - for (var _i34 = 0, _fieldsDiff$removed4 = fieldsDiff.removed; _i34 < _fieldsDiff$removed4.length; _i34++) { - var oldField = _fieldsDiff$removed4[_i34]; - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") - }); - } - - for (var _i36 = 0, _fieldsDiff$persisted4 = fieldsDiff.persisted; _i36 < _fieldsDiff$persisted4.length; _i36++) { - var _ref8 = _fieldsDiff$persisted4[_i36]; - 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), ".") - }); - } - } - - return schemaChanges; -} - -function findArgChanges(oldType, oldField, newField) { - var schemaChanges = []; - var argsDiff = diff(oldField.args, newField.args); - - for (var _i38 = 0, _argsDiff$removed4 = argsDiff.removed; _i38 < _argsDiff$removed4.length; _i38++) { - var oldArg = _argsDiff$removed4[_i38]; - schemaChanges.push({ - type: BreakingChangeType.ARG_REMOVED, - description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(oldArg.name, " was removed.") - }); - } - - for (var _i40 = 0, _argsDiff$persisted2 = argsDiff.persisted; _i40 < _argsDiff$persisted2.length; _i40++) { - var _ref10 = _argsDiff$persisted2[_i40]; - 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 { - // Since we looking only for client's observable changes we should - // compare default values in the same representation as they are - // represented inside introspection. - 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, ".") - }); - } - } - } - } - - for (var _i42 = 0, _argsDiff$added4 = argsDiff.added; _i42 < _argsDiff$added4.length; _i42++) { - var _newArg = _argsDiff$added4[_i42]; - - 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.") - }); - } - } - - 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'; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isInputObjectType)(type)) { - return 'an Input type'; - } // istanbul ignore next (Not reachable. All possible named types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected type: ' + (0, _inspect.default)(type)); -} - -function stringifyValue(value, type) { - var ast = (0, _astFromValue.astFromValue)(value, type); - ast != null || (0, _invariant.default)(0); - var sortedAST = (0, _visitor.visit)(ast, { - ObjectValue: function ObjectValue(objectNode) { - // Make a copy since sort mutates array - var fields = [].concat(objectNode.fields); - fields.sort(function (fieldA, fieldB) { - return (0, _naturalCompare.default)(fieldA.name.value, fieldB.name.value); - }); - return _objectSpread(_objectSpread({}, objectNode), {}, { - fields: fields - }); - } - }); - return (0, _printer.print)(sortedAST); -} - -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; - }); - - for (var _i44 = 0; _i44 < oldArray.length; _i44++) { - var oldItem = oldArray[_i44]; - var newItem = newMap[oldItem.name]; - - if (newItem === undefined) { - removed.push(oldItem); - } else { - persisted.push([oldItem, newItem]); - } - } - - for (var _i46 = 0; _i46 < newArray.length; _i46++) { - var _newItem = newArray[_i46]; - - if (oldMap[_newItem.name] === undefined) { - added.push(_newItem); - } - } - - return { - added: added, - persisted: persisted, - removed: removed - }; -} diff --git a/JS/node_modules/graphql/utilities/findBreakingChanges.js.flow b/JS/node_modules/graphql/utilities/findBreakingChanges.js.flow deleted file mode 100644 index 673b2e8..0000000 --- a/JS/node_modules/graphql/utilities/findBreakingChanges.js.flow +++ /dev/null @@ -1,590 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import keyMap from '../jsutils/keyMap'; -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; -import naturalCompare from '../jsutils/naturalCompare'; - -import { print } from '../language/printer'; -import { visit } from '../language/visitor'; - -import type { GraphQLSchema } from '../type/schema'; -import type { - GraphQLField, - GraphQLType, - GraphQLInputType, - GraphQLNamedType, - GraphQLEnumType, - GraphQLUnionType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLInputObjectType, -} from '../type/definition'; -import { isSpecifiedScalarType } from '../type/scalars'; -import { - isScalarType, - isObjectType, - isInterfaceType, - isUnionType, - isEnumType, - isInputObjectType, - isNonNullType, - isListType, - isNamedType, - isRequiredArgument, - isRequiredInputField, -} from '../type/definition'; - -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', - IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED', - 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_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED', - 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', - IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED', - 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}.`, - }); - } - - if (oldDirective.isRepeatable && !newDirective.isRepeatable) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, - description: `Repeatable flag 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: isSpecifiedScalarType(oldType) - ? `Standard scalar ${oldType.name} was removed because it is not referenced anymore.` - : `${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( - ...findFieldChanges(oldType, newType), - ...findImplementedInterfacesChanges(oldType, newType), - ); - } else if (isInterfaceType(oldType) && isInterfaceType(newType)) { - schemaChanges.push( - ...findFieldChanges(oldType, newType), - ...findImplementedInterfacesChanges(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 findImplementedInterfacesChanges( - oldType: GraphQLObjectType | GraphQLInterfaceType, - newType: GraphQLObjectType | GraphQLInterfaceType, -): Array { - const schemaChanges = []; - const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); - - for (const newInterface of interfacesDiff.added) { - schemaChanges.push({ - type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, - description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.`, - }); - } - - for (const oldInterface of interfacesDiff.removed) { - schemaChanges.push({ - type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, - 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 { - // Since we looking only for client's observable changes we should - // compare default values in the same representation as they are - // represented inside introspection. - 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'; - } - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isInputObjectType(type)) { - return 'an Input type'; - } - - // istanbul ignore next (Not reachable. All possible named types have been considered) - invariant(false, 'Unexpected type: ' + inspect((type: empty))); -} - -function stringifyValue(value: mixed, type: GraphQLInputType): string { - const ast = astFromValue(value, type); - invariant(ast != null); - - const sortedAST = visit(ast, { - ObjectValue(objectNode) { - // Make a copy since sort mutates array - const fields = [...objectNode.fields]; - - fields.sort((fieldA, fieldB) => - naturalCompare(fieldA.name.value, fieldB.name.value), - ); - return { ...objectNode, fields }; - }, - }); - - return print(sortedAST); -} - -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/JS/node_modules/graphql/utilities/findBreakingChanges.mjs b/JS/node_modules/graphql/utilities/findBreakingChanges.mjs deleted file mode 100644 index 52e5804..0000000 --- a/JS/node_modules/graphql/utilities/findBreakingChanges.mjs +++ /dev/null @@ -1,498 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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.mjs"; -import keyMap from "../jsutils/keyMap.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import naturalCompare from "../jsutils/naturalCompare.mjs"; -import { print } from "../language/printer.mjs"; -import { visit } from "../language/visitor.mjs"; -import { isSpecifiedScalarType } from "../type/scalars.mjs"; -import { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isNonNullType, isListType, isNamedType, isRequiredArgument, isRequiredInputField } from "../type/definition.mjs"; -import { astFromValue } from "./astFromValue.mjs"; -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', - IMPLEMENTED_INTERFACE_REMOVED: 'IMPLEMENTED_INTERFACE_REMOVED', - 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_REPEATABLE_REMOVED: 'DIRECTIVE_REPEATABLE_REMOVED', - 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', - IMPLEMENTED_INTERFACE_ADDED: 'IMPLEMENTED_INTERFACE_ADDED', - 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()); - - for (var _i2 = 0, _directivesDiff$remov2 = directivesDiff.removed; _i2 < _directivesDiff$remov2.length; _i2++) { - var oldDirective = _directivesDiff$remov2[_i2]; - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REMOVED, - description: "".concat(oldDirective.name, " was removed.") - }); - } - - for (var _i4 = 0, _directivesDiff$persi2 = directivesDiff.persisted; _i4 < _directivesDiff$persi2.length; _i4++) { - var _ref2 = _directivesDiff$persi2[_i4]; - var _oldDirective = _ref2[0]; - var newDirective = _ref2[1]; - var argsDiff = diff(_oldDirective.args, newDirective.args); - - for (var _i6 = 0, _argsDiff$added2 = argsDiff.added; _i6 < _argsDiff$added2.length; _i6++) { - var newArg = _argsDiff$added2[_i6]; - - 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.") - }); - } - } - - for (var _i8 = 0, _argsDiff$removed2 = argsDiff.removed; _i8 < _argsDiff$removed2.length; _i8++) { - var oldArg = _argsDiff$removed2[_i8]; - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_ARG_REMOVED, - description: "".concat(oldArg.name, " was removed from ").concat(_oldDirective.name, ".") - }); - } - - if (_oldDirective.isRepeatable && !newDirective.isRepeatable) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED, - description: "Repeatable flag was removed from ".concat(_oldDirective.name, ".") - }); - } - - for (var _i10 = 0, _oldDirective$locatio2 = _oldDirective.locations; _i10 < _oldDirective$locatio2.length; _i10++) { - var location = _oldDirective$locatio2[_i10]; - - if (newDirective.locations.indexOf(location) === -1) { - schemaChanges.push({ - type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED, - description: "".concat(location, " was removed from ").concat(_oldDirective.name, ".") - }); - } - } - } - - return schemaChanges; -} - -function findTypeChanges(oldSchema, newSchema) { - var schemaChanges = []; - var typesDiff = diff(objectValues(oldSchema.getTypeMap()), objectValues(newSchema.getTypeMap())); - - for (var _i12 = 0, _typesDiff$removed2 = typesDiff.removed; _i12 < _typesDiff$removed2.length; _i12++) { - var oldType = _typesDiff$removed2[_i12]; - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED, - description: isSpecifiedScalarType(oldType) ? "Standard scalar ".concat(oldType.name, " was removed because it is not referenced anymore.") : "".concat(oldType.name, " was removed.") - }); - } - - for (var _i14 = 0, _typesDiff$persisted2 = typesDiff.persisted; _i14 < _typesDiff$persisted2.length; _i14++) { - var _ref4 = _typesDiff$persisted2[_i14]; - 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, findFieldChanges(_oldType, newType).concat(findImplementedInterfacesChanges(_oldType, newType))); - } else if (isInterfaceType(_oldType) && isInterfaceType(newType)) { - schemaChanges.push.apply(schemaChanges, findFieldChanges(_oldType, newType).concat(findImplementedInterfacesChanges(_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), ".") - }); - } - } - - return schemaChanges; -} - -function findInputObjectTypeChanges(oldType, newType) { - var schemaChanges = []; - var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields())); - - for (var _i16 = 0, _fieldsDiff$added2 = fieldsDiff.added; _i16 < _fieldsDiff$added2.length; _i16++) { - var newField = _fieldsDiff$added2[_i16]; - - 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.") - }); - } - } - - for (var _i18 = 0, _fieldsDiff$removed2 = fieldsDiff.removed; _i18 < _fieldsDiff$removed2.length; _i18++) { - var oldField = _fieldsDiff$removed2[_i18]; - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") - }); - } - - for (var _i20 = 0, _fieldsDiff$persisted2 = fieldsDiff.persisted; _i20 < _fieldsDiff$persisted2.length; _i20++) { - var _ref6 = _fieldsDiff$persisted2[_i20]; - 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), ".") - }); - } - } - - return schemaChanges; -} - -function findUnionTypeChanges(oldType, newType) { - var schemaChanges = []; - var possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes()); - - for (var _i22 = 0, _possibleTypesDiff$ad2 = possibleTypesDiff.added; _i22 < _possibleTypesDiff$ad2.length; _i22++) { - var newPossibleType = _possibleTypesDiff$ad2[_i22]; - schemaChanges.push({ - type: DangerousChangeType.TYPE_ADDED_TO_UNION, - description: "".concat(newPossibleType.name, " was added to union type ").concat(oldType.name, ".") - }); - } - - for (var _i24 = 0, _possibleTypesDiff$re2 = possibleTypesDiff.removed; _i24 < _possibleTypesDiff$re2.length; _i24++) { - var oldPossibleType = _possibleTypesDiff$re2[_i24]; - schemaChanges.push({ - type: BreakingChangeType.TYPE_REMOVED_FROM_UNION, - description: "".concat(oldPossibleType.name, " was removed from union type ").concat(oldType.name, ".") - }); - } - - return schemaChanges; -} - -function findEnumTypeChanges(oldType, newType) { - var schemaChanges = []; - var valuesDiff = diff(oldType.getValues(), newType.getValues()); - - for (var _i26 = 0, _valuesDiff$added2 = valuesDiff.added; _i26 < _valuesDiff$added2.length; _i26++) { - var newValue = _valuesDiff$added2[_i26]; - schemaChanges.push({ - type: DangerousChangeType.VALUE_ADDED_TO_ENUM, - description: "".concat(newValue.name, " was added to enum type ").concat(oldType.name, ".") - }); - } - - for (var _i28 = 0, _valuesDiff$removed2 = valuesDiff.removed; _i28 < _valuesDiff$removed2.length; _i28++) { - var oldValue = _valuesDiff$removed2[_i28]; - schemaChanges.push({ - type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM, - description: "".concat(oldValue.name, " was removed from enum type ").concat(oldType.name, ".") - }); - } - - return schemaChanges; -} - -function findImplementedInterfacesChanges(oldType, newType) { - var schemaChanges = []; - var interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces()); - - for (var _i30 = 0, _interfacesDiff$added2 = interfacesDiff.added; _i30 < _interfacesDiff$added2.length; _i30++) { - var newInterface = _interfacesDiff$added2[_i30]; - schemaChanges.push({ - type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED, - description: "".concat(newInterface.name, " added to interfaces implemented by ").concat(oldType.name, ".") - }); - } - - for (var _i32 = 0, _interfacesDiff$remov2 = interfacesDiff.removed; _i32 < _interfacesDiff$remov2.length; _i32++) { - var oldInterface = _interfacesDiff$remov2[_i32]; - schemaChanges.push({ - type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED, - description: "".concat(oldType.name, " no longer implements interface ").concat(oldInterface.name, ".") - }); - } - - return schemaChanges; -} - -function findFieldChanges(oldType, newType) { - var schemaChanges = []; - var fieldsDiff = diff(objectValues(oldType.getFields()), objectValues(newType.getFields())); - - for (var _i34 = 0, _fieldsDiff$removed4 = fieldsDiff.removed; _i34 < _fieldsDiff$removed4.length; _i34++) { - var oldField = _fieldsDiff$removed4[_i34]; - schemaChanges.push({ - type: BreakingChangeType.FIELD_REMOVED, - description: "".concat(oldType.name, ".").concat(oldField.name, " was removed.") - }); - } - - for (var _i36 = 0, _fieldsDiff$persisted4 = fieldsDiff.persisted; _i36 < _fieldsDiff$persisted4.length; _i36++) { - var _ref8 = _fieldsDiff$persisted4[_i36]; - 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), ".") - }); - } - } - - return schemaChanges; -} - -function findArgChanges(oldType, oldField, newField) { - var schemaChanges = []; - var argsDiff = diff(oldField.args, newField.args); - - for (var _i38 = 0, _argsDiff$removed4 = argsDiff.removed; _i38 < _argsDiff$removed4.length; _i38++) { - var oldArg = _argsDiff$removed4[_i38]; - schemaChanges.push({ - type: BreakingChangeType.ARG_REMOVED, - description: "".concat(oldType.name, ".").concat(oldField.name, " arg ").concat(oldArg.name, " was removed.") - }); - } - - for (var _i40 = 0, _argsDiff$persisted2 = argsDiff.persisted; _i40 < _argsDiff$persisted2.length; _i40++) { - var _ref10 = _argsDiff$persisted2[_i40]; - 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 { - // Since we looking only for client's observable changes we should - // compare default values in the same representation as they are - // represented inside introspection. - 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, ".") - }); - } - } - } - } - - for (var _i42 = 0, _argsDiff$added4 = argsDiff.added; _i42 < _argsDiff$added4.length; _i42++) { - var _newArg = _argsDiff$added4[_i42]; - - 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.") - }); - } - } - - 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'; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isInputObjectType(type)) { - return 'an Input type'; - } // istanbul ignore next (Not reachable. All possible named types have been considered) - - - false || invariant(0, 'Unexpected type: ' + inspect(type)); -} - -function stringifyValue(value, type) { - var ast = astFromValue(value, type); - ast != null || invariant(0); - var sortedAST = visit(ast, { - ObjectValue: function ObjectValue(objectNode) { - // Make a copy since sort mutates array - var fields = [].concat(objectNode.fields); - fields.sort(function (fieldA, fieldB) { - return naturalCompare(fieldA.name.value, fieldB.name.value); - }); - return _objectSpread(_objectSpread({}, objectNode), {}, { - fields: fields - }); - } - }); - return print(sortedAST); -} - -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; - }); - - for (var _i44 = 0; _i44 < oldArray.length; _i44++) { - var oldItem = oldArray[_i44]; - var newItem = newMap[oldItem.name]; - - if (newItem === undefined) { - removed.push(oldItem); - } else { - persisted.push([oldItem, newItem]); - } - } - - for (var _i46 = 0; _i46 < newArray.length; _i46++) { - var _newItem = newArray[_i46]; - - if (oldMap[_newItem.name] === undefined) { - added.push(_newItem); - } - } - - return { - added: added, - persisted: persisted, - removed: removed - }; -} diff --git a/JS/node_modules/graphql/utilities/findDeprecatedUsages.d.ts b/JS/node_modules/graphql/utilities/findDeprecatedUsages.d.ts deleted file mode 100644 index bbdf943..0000000 --- a/JS/node_modules/graphql/utilities/findDeprecatedUsages.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { GraphQLError } from '../error/GraphQLError'; -import { DocumentNode } from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; - -/** - * A validation rule which reports deprecated usages. - * - * Returns a list of GraphQLError instances describing each deprecated use. - * - * @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead: - * - * ``` - * import { validate, NoDeprecatedCustomRule } from 'graphql' - * - * const errors = validate(schema, document, [NoDeprecatedCustomRule]) - * ``` - */ -export function findDeprecatedUsages( - schema: GraphQLSchema, - ast: DocumentNode, -): ReadonlyArray; diff --git a/JS/node_modules/graphql/utilities/findDeprecatedUsages.js b/JS/node_modules/graphql/utilities/findDeprecatedUsages.js deleted file mode 100644 index e27b03e..0000000 --- a/JS/node_modules/graphql/utilities/findDeprecatedUsages.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.findDeprecatedUsages = findDeprecatedUsages; - -var _validate = require("../validation/validate.js"); - -var _NoDeprecatedCustomRule = require("../validation/rules/custom/NoDeprecatedCustomRule.js"); - -/** - * A validation rule which reports deprecated usages. - * - * Returns a list of GraphQLError instances describing each deprecated use. - * - * @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead: - * - * ``` - * import { validate, NoDeprecatedCustomRule } from 'graphql' - * - * const errors = validate(schema, document, [NoDeprecatedCustomRule]) - * ``` - */ -function findDeprecatedUsages(schema, ast) { - return (0, _validate.validate)(schema, ast, [_NoDeprecatedCustomRule.NoDeprecatedCustomRule]); -} diff --git a/JS/node_modules/graphql/utilities/findDeprecatedUsages.js.flow b/JS/node_modules/graphql/utilities/findDeprecatedUsages.js.flow deleted file mode 100644 index 5db22f0..0000000 --- a/JS/node_modules/graphql/utilities/findDeprecatedUsages.js.flow +++ /dev/null @@ -1,29 +0,0 @@ -// @flow strict -import type { GraphQLError } from '../error/GraphQLError'; - -import type { DocumentNode } from '../language/ast'; - -import type { GraphQLSchema } from '../type/schema'; - -import { validate } from '../validation/validate'; -import { NoDeprecatedCustomRule } from '../validation/rules/custom/NoDeprecatedCustomRule'; - -/** - * A validation rule which reports deprecated usages. - * - * Returns a list of GraphQLError instances describing each deprecated use. - * - * @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead: - * - * ``` - * import { validate, NoDeprecatedCustomRule } from 'graphql' - * - * const errors = validate(schema, document, [NoDeprecatedCustomRule]) - * ``` - */ -export function findDeprecatedUsages( - schema: GraphQLSchema, - ast: DocumentNode, -): $ReadOnlyArray { - return validate(schema, ast, [NoDeprecatedCustomRule]); -} diff --git a/JS/node_modules/graphql/utilities/findDeprecatedUsages.mjs b/JS/node_modules/graphql/utilities/findDeprecatedUsages.mjs deleted file mode 100644 index 7a85004..0000000 --- a/JS/node_modules/graphql/utilities/findDeprecatedUsages.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import { validate } from "../validation/validate.mjs"; -import { NoDeprecatedCustomRule } from "../validation/rules/custom/NoDeprecatedCustomRule.mjs"; -/** - * A validation rule which reports deprecated usages. - * - * Returns a list of GraphQLError instances describing each deprecated use. - * - * @deprecated Please use `validate` with `NoDeprecatedCustomRule` instead: - * - * ``` - * import { validate, NoDeprecatedCustomRule } from 'graphql' - * - * const errors = validate(schema, document, [NoDeprecatedCustomRule]) - * ``` - */ - -export function findDeprecatedUsages(schema, ast) { - return validate(schema, ast, [NoDeprecatedCustomRule]); -} diff --git a/JS/node_modules/graphql/utilities/getIntrospectionQuery.d.ts b/JS/node_modules/graphql/utilities/getIntrospectionQuery.d.ts deleted file mode 100644 index 6e5fad1..0000000 --- a/JS/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { DirectiveLocationEnum } from '../language/directiveLocation'; - -export interface IntrospectionOptions { - // Whether to include descriptions in the introspection result. - // Default: true - descriptions?: boolean; - - // Whether to include `specifiedByUrl` in the introspection result. - // Default: false - specifiedByUrl?: boolean; - - // Whether to include `isRepeatable` flag on directives. - // Default: false - directiveIsRepeatable?: boolean; - - // Whether to include `description` field on schema. - // Default: false - schemaDescription?: boolean; - - // Whether target GraphQL server support deprecation of input values. - // Default: false - inputValueDeprecation?: boolean; -} - -export function getIntrospectionQuery(options?: IntrospectionOptions): string; - -export interface IntrospectionQuery { - readonly __schema: IntrospectionSchema; -} - -export interface IntrospectionSchema { - readonly queryType: IntrospectionNamedTypeRef; - readonly mutationType: Maybe< - IntrospectionNamedTypeRef - >; - readonly subscriptionType: Maybe< - IntrospectionNamedTypeRef - >; - readonly types: ReadonlyArray; - readonly 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 interface IntrospectionScalarType { - readonly kind: 'SCALAR'; - readonly name: string; - readonly description?: Maybe; - readonly specifiedByUrl?: Maybe; -} - -export interface IntrospectionObjectType { - readonly kind: 'OBJECT'; - readonly name: string; - readonly description?: Maybe; - readonly fields: ReadonlyArray; - readonly interfaces: ReadonlyArray< - IntrospectionNamedTypeRef - >; -} - -export interface IntrospectionInterfaceType { - readonly kind: 'INTERFACE'; - readonly name: string; - readonly description?: Maybe; - readonly fields: ReadonlyArray; - readonly interfaces: ReadonlyArray< - IntrospectionNamedTypeRef - >; - readonly possibleTypes: ReadonlyArray< - IntrospectionNamedTypeRef - >; -} - -export interface IntrospectionUnionType { - readonly kind: 'UNION'; - readonly name: string; - readonly description?: Maybe; - readonly possibleTypes: ReadonlyArray< - IntrospectionNamedTypeRef - >; -} - -export interface IntrospectionEnumType { - readonly kind: 'ENUM'; - readonly name: string; - readonly description?: Maybe; - readonly enumValues: ReadonlyArray; -} - -export interface IntrospectionInputObjectType { - readonly kind: 'INPUT_OBJECT'; - readonly name: string; - readonly description?: Maybe; - readonly inputFields: ReadonlyArray; -} - -export interface IntrospectionListTypeRef< - T extends IntrospectionTypeRef = IntrospectionTypeRef -> { - readonly kind: 'LIST'; - readonly ofType: T; -} - -export interface IntrospectionNonNullTypeRef< - T extends IntrospectionTypeRef = IntrospectionTypeRef -> { - readonly kind: 'NON_NULL'; - readonly 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 interface IntrospectionNamedTypeRef< - T extends IntrospectionType = IntrospectionType -> { - readonly kind: T['kind']; - readonly name: string; -} - -export interface IntrospectionField { - readonly name: string; - readonly description?: Maybe; - readonly args: ReadonlyArray; - readonly type: IntrospectionOutputTypeRef; - readonly isDeprecated: boolean; - readonly deprecationReason?: Maybe; -} - -export interface IntrospectionInputValue { - readonly name: string; - readonly description?: Maybe; - readonly type: IntrospectionInputTypeRef; - readonly defaultValue?: Maybe; - readonly isDeprecated?: boolean; - readonly deprecationReason?: Maybe; -} - -export interface IntrospectionEnumValue { - readonly name: string; - readonly description?: Maybe; - readonly isDeprecated: boolean; - readonly deprecationReason?: Maybe; -} - -export interface IntrospectionDirective { - readonly name: string; - readonly description?: Maybe; - readonly isRepeatable?: boolean; - readonly locations: ReadonlyArray; - readonly args: ReadonlyArray; -} diff --git a/JS/node_modules/graphql/utilities/getIntrospectionQuery.js b/JS/node_modules/graphql/utilities/getIntrospectionQuery.js deleted file mode 100644 index aac7994..0000000 --- a/JS/node_modules/graphql/utilities/getIntrospectionQuery.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getIntrospectionQuery = getIntrospectionQuery; - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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 getIntrospectionQuery(options) { - var optionsWithDefault = _objectSpread({ - descriptions: true, - specifiedByUrl: false, - directiveIsRepeatable: false, - schemaDescription: false, - inputValueDeprecation: false - }, options); - - var descriptions = optionsWithDefault.descriptions ? 'description' : ''; - var specifiedByUrl = optionsWithDefault.specifiedByUrl ? 'specifiedByUrl' : ''; - var directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable ? 'isRepeatable' : ''; - var schemaDescription = optionsWithDefault.schemaDescription ? descriptions : ''; - - function inputDeprecation(str) { - return optionsWithDefault.inputValueDeprecation ? str : ''; - } - - return "\n query IntrospectionQuery {\n __schema {\n ".concat(schemaDescription, "\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ").concat(descriptions, "\n ").concat(directiveIsRepeatable, "\n locations\n args").concat(inputDeprecation('(includeDeprecated: true)'), " {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ").concat(descriptions, "\n ").concat(specifiedByUrl, "\n fields(includeDeprecated: true) {\n name\n ").concat(descriptions, "\n args").concat(inputDeprecation('(includeDeprecated: true)'), " {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields").concat(inputDeprecation('(includeDeprecated: true)'), " {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ").concat(descriptions, "\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ").concat(descriptions, "\n type { ...TypeRef }\n defaultValue\n ").concat(inputDeprecation('isDeprecated'), "\n ").concat(inputDeprecation('deprecationReason'), "\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 "); -} diff --git a/JS/node_modules/graphql/utilities/getIntrospectionQuery.js.flow b/JS/node_modules/graphql/utilities/getIntrospectionQuery.js.flow deleted file mode 100644 index db72ed4..0000000 --- a/JS/node_modules/graphql/utilities/getIntrospectionQuery.js.flow +++ /dev/null @@ -1,312 +0,0 @@ -// @flow strict -import type { DirectiveLocationEnum } from '../language/directiveLocation'; - -export type IntrospectionOptions = {| - // Whether to include descriptions in the introspection result. - // Default: true - descriptions?: boolean, - - // Whether to include `specifiedByUrl` in the introspection result. - // Default: false - specifiedByUrl?: boolean, - - // Whether to include `isRepeatable` field on directives. - // Default: false - directiveIsRepeatable?: boolean, - - // Whether to include `description` field on schema. - // Default: false - schemaDescription?: boolean, - - // Whether target GraphQL server support deprecation of input values. - // Default: false - inputValueDeprecation?: boolean, -|}; - -export function getIntrospectionQuery(options?: IntrospectionOptions): string { - const optionsWithDefault = { - descriptions: true, - specifiedByUrl: false, - directiveIsRepeatable: false, - schemaDescription: false, - inputValueDeprecation: false, - ...options, - }; - - const descriptions = optionsWithDefault.descriptions ? 'description' : ''; - const specifiedByUrl = optionsWithDefault.specifiedByUrl - ? 'specifiedByUrl' - : ''; - const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable - ? 'isRepeatable' - : ''; - const schemaDescription = optionsWithDefault.schemaDescription - ? descriptions - : ''; - - function inputDeprecation(str) { - return optionsWithDefault.inputValueDeprecation ? str : ''; - } - - return ` - query IntrospectionQuery { - __schema { - ${schemaDescription} - queryType { name } - mutationType { name } - subscriptionType { name } - types { - ...FullType - } - directives { - name - ${descriptions} - ${directiveIsRepeatable} - locations - args${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - } - } - } - - fragment FullType on __Type { - kind - name - ${descriptions} - ${specifiedByUrl} - fields(includeDeprecated: true) { - name - ${descriptions} - args${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - type { - ...TypeRef - } - isDeprecated - deprecationReason - } - inputFields${inputDeprecation('(includeDeprecated: true)')} { - ...InputValue - } - interfaces { - ...TypeRef - } - enumValues(includeDeprecated: true) { - name - ${descriptions} - isDeprecated - deprecationReason - } - possibleTypes { - ...TypeRef - } - } - - fragment InputValue on __InputValue { - name - ${descriptions} - type { ...TypeRef } - defaultValue - ${inputDeprecation('isDeprecated')} - ${inputDeprecation('deprecationReason')} - } - - 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 - } - } - } - } - } - } - } - } - `; -} - -export type IntrospectionQuery = {| - +__schema: IntrospectionSchema, -|}; - -export type IntrospectionSchema = {| - +description?: ?string, - +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, - +specifiedByUrl?: ?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, - +interfaces: $ReadOnlyArray< - IntrospectionNamedTypeRef, - >, - +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, - +isDeprecated?: boolean, - +deprecationReason?: ?string, -|}; - -export type IntrospectionEnumValue = {| - +name: string, - +description?: ?string, - +isDeprecated: boolean, - +deprecationReason: ?string, -|}; - -export type IntrospectionDirective = {| - +name: string, - +description?: ?string, - +isRepeatable?: boolean, - +locations: $ReadOnlyArray, - +args: $ReadOnlyArray, -|}; diff --git a/JS/node_modules/graphql/utilities/getIntrospectionQuery.mjs b/JS/node_modules/graphql/utilities/getIntrospectionQuery.mjs deleted file mode 100644 index 3951060..0000000 --- a/JS/node_modules/graphql/utilities/getIntrospectionQuery.mjs +++ /dev/null @@ -1,26 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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; } - -export function getIntrospectionQuery(options) { - var optionsWithDefault = _objectSpread({ - descriptions: true, - specifiedByUrl: false, - directiveIsRepeatable: false, - schemaDescription: false, - inputValueDeprecation: false - }, options); - - var descriptions = optionsWithDefault.descriptions ? 'description' : ''; - var specifiedByUrl = optionsWithDefault.specifiedByUrl ? 'specifiedByUrl' : ''; - var directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable ? 'isRepeatable' : ''; - var schemaDescription = optionsWithDefault.schemaDescription ? descriptions : ''; - - function inputDeprecation(str) { - return optionsWithDefault.inputValueDeprecation ? str : ''; - } - - return "\n query IntrospectionQuery {\n __schema {\n ".concat(schemaDescription, "\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ").concat(descriptions, "\n ").concat(directiveIsRepeatable, "\n locations\n args").concat(inputDeprecation('(includeDeprecated: true)'), " {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ").concat(descriptions, "\n ").concat(specifiedByUrl, "\n fields(includeDeprecated: true) {\n name\n ").concat(descriptions, "\n args").concat(inputDeprecation('(includeDeprecated: true)'), " {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields").concat(inputDeprecation('(includeDeprecated: true)'), " {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ").concat(descriptions, "\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ").concat(descriptions, "\n type { ...TypeRef }\n defaultValue\n ").concat(inputDeprecation('isDeprecated'), "\n ").concat(inputDeprecation('deprecationReason'), "\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 "); -} diff --git a/JS/node_modules/graphql/utilities/getOperationAST.d.ts b/JS/node_modules/graphql/utilities/getOperationAST.d.ts deleted file mode 100644 index d17a9b4..0000000 --- a/JS/node_modules/graphql/utilities/getOperationAST.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { DocumentNode, 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?: Maybe, -): Maybe; diff --git a/JS/node_modules/graphql/utilities/getOperationAST.js b/JS/node_modules/graphql/utilities/getOperationAST.js deleted file mode 100644 index 976879c..0000000 --- a/JS/node_modules/graphql/utilities/getOperationAST.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getOperationAST = getOperationAST; - -var _kinds = require("../language/kinds.js"); - -/** - * 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; - - for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { - var definition = _documentAST$definiti2[_i2]; - - if (definition.kind === _kinds.Kind.OPERATION_DEFINITION) { - var _definition$name; - - if (operationName == null) { - // 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) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) { - return definition; - } - } - } - - return operation; -} diff --git a/JS/node_modules/graphql/utilities/getOperationAST.js.flow b/JS/node_modules/graphql/utilities/getOperationAST.js.flow deleted file mode 100644 index eaee0b0..0000000 --- a/JS/node_modules/graphql/utilities/getOperationAST.js.flow +++ /dev/null @@ -1,31 +0,0 @@ -// @flow strict -import type { DocumentNode, OperationDefinitionNode } from '../language/ast'; -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: DocumentNode, - operationName?: ?string, -): ?OperationDefinitionNode { - let operation = null; - for (const definition of documentAST.definitions) { - if (definition.kind === Kind.OPERATION_DEFINITION) { - if (operationName == null) { - // 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?.value === operationName) { - return definition; - } - } - } - return operation; -} diff --git a/JS/node_modules/graphql/utilities/getOperationAST.mjs b/JS/node_modules/graphql/utilities/getOperationAST.mjs deleted file mode 100644 index ce72191..0000000 --- a/JS/node_modules/graphql/utilities/getOperationAST.mjs +++ /dev/null @@ -1,33 +0,0 @@ -import { Kind } from "../language/kinds.mjs"; -/** - * 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; - - for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { - var definition = _documentAST$definiti2[_i2]; - - if (definition.kind === Kind.OPERATION_DEFINITION) { - var _definition$name; - - if (operationName == null) { - // 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) === null || _definition$name === void 0 ? void 0 : _definition$name.value) === operationName) { - return definition; - } - } - } - - return operation; -} diff --git a/JS/node_modules/graphql/utilities/getOperationRootType.d.ts b/JS/node_modules/graphql/utilities/getOperationRootType.d.ts deleted file mode 100644 index 5adc59c..0000000 --- a/JS/node_modules/graphql/utilities/getOperationRootType.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { - OperationDefinitionNode, - OperationTypeDefinitionNode, -} from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; -import { GraphQLObjectType } from '../type/definition'; - -/** - * Extracts the root type of the operation from the schema. - */ -export function getOperationRootType( - schema: GraphQLSchema, - operation: OperationDefinitionNode | OperationTypeDefinitionNode, -): GraphQLObjectType; diff --git a/JS/node_modules/graphql/utilities/getOperationRootType.js b/JS/node_modules/graphql/utilities/getOperationRootType.js deleted file mode 100644 index f179fc3..0000000 --- a/JS/node_modules/graphql/utilities/getOperationRootType.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getOperationRootType = getOperationRootType; - -var _GraphQLError = require("../error/GraphQLError.js"); - -/** - * 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/JS/node_modules/graphql/utilities/getOperationRootType.js.flow b/JS/node_modules/graphql/utilities/getOperationRootType.js.flow deleted file mode 100644 index 5358be4..0000000 --- a/JS/node_modules/graphql/utilities/getOperationRootType.js.flow +++ /dev/null @@ -1,56 +0,0 @@ -// @flow strict -import { GraphQLError } from '../error/GraphQLError'; - -import type { - OperationDefinitionNode, - 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/JS/node_modules/graphql/utilities/getOperationRootType.mjs b/JS/node_modules/graphql/utilities/getOperationRootType.mjs deleted file mode 100644 index e0b75d7..0000000 --- a/JS/node_modules/graphql/utilities/getOperationRootType.mjs +++ /dev/null @@ -1,38 +0,0 @@ -import { GraphQLError } from "../error/GraphQLError.mjs"; - -/** - * 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/JS/node_modules/graphql/utilities/index.d.ts b/JS/node_modules/graphql/utilities/index.d.ts deleted file mode 100644 index a8019f9..0000000 --- a/JS/node_modules/graphql/utilities/index.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -export { - // Produce the GraphQL query recommended for a full schema introspection. - // Accepts optional IntrospectionOptions. - getIntrospectionQuery, - IntrospectionOptions, - IntrospectionQuery, - IntrospectionSchema, - IntrospectionType, - IntrospectionInputType, - IntrospectionOutputType, - IntrospectionScalarType, - IntrospectionObjectType, - IntrospectionInterfaceType, - IntrospectionUnionType, - IntrospectionEnumType, - IntrospectionInputObjectType, - IntrospectionTypeRef, - IntrospectionInputTypeRef, - IntrospectionOutputTypeRef, - IntrospectionNamedTypeRef, - IntrospectionListTypeRef, - IntrospectionNonNullTypeRef, - IntrospectionField, - IntrospectionInputValue, - IntrospectionEnumValue, - IntrospectionDirective, -} from './getIntrospectionQuery'; - -// 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, - BuildSchemaOptions, -} from './buildASTSchema'; - -// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. -export { - extendSchema, - // @deprecated: Get the description from a schema AST node and supports legacy - // syntax for specifying descriptions - will be removed in v16 - getDescription, -} from './extendSchema'; - -// Sort a GraphQLSchema. -export { lexicographicSortSchema } from './lexicographicSortSchema'; - -// Print a GraphQLSchema to GraphQL Schema language. -export { - printSchema, - printType, - printIntrospectionSchema, -} from './printSchema'; - -// 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, visitWithTypeInfo } from './TypeInfo'; - -// Coerces a JavaScript value to a GraphQL type, or produces errors. -export { coerceInputValue } from './coerceInputValue'; - -// 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, - BreakingChange, - DangerousChange, -} from './findBreakingChanges'; - -// Wrapper type that contains DocumentNode and types that can be deduced from it. -export { TypedQueryDocumentNode } from './typedQueryDocumentNode'; - -// @deprecated: Report all deprecated usage within a GraphQL document. -export { findDeprecatedUsages } from './findDeprecatedUsages'; diff --git a/JS/node_modules/graphql/utilities/index.js b/JS/node_modules/graphql/utilities/index.js deleted file mode 100644 index 086e5f3..0000000 --- a/JS/node_modules/graphql/utilities/index.js +++ /dev/null @@ -1,247 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "getIntrospectionQuery", { - enumerable: true, - get: function get() { - return _getIntrospectionQuery.getIntrospectionQuery; - } -}); -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, "extendSchema", { - enumerable: true, - get: function get() { - return _extendSchema.extendSchema; - } -}); -Object.defineProperty(exports, "getDescription", { - enumerable: true, - get: function get() { - return _extendSchema.getDescription; - } -}); -Object.defineProperty(exports, "lexicographicSortSchema", { - enumerable: true, - get: function get() { - return _lexicographicSortSchema.lexicographicSortSchema; - } -}); -Object.defineProperty(exports, "printSchema", { - enumerable: true, - get: function get() { - return _printSchema.printSchema; - } -}); -Object.defineProperty(exports, "printType", { - enumerable: true, - get: function get() { - return _printSchema.printType; - } -}); -Object.defineProperty(exports, "printIntrospectionSchema", { - enumerable: true, - get: function get() { - return _printSchema.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, "visitWithTypeInfo", { - enumerable: true, - get: function get() { - return _TypeInfo.visitWithTypeInfo; - } -}); -Object.defineProperty(exports, "coerceInputValue", { - enumerable: true, - get: function get() { - return _coerceInputValue.coerceInputValue; - } -}); -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 _getIntrospectionQuery = require("./getIntrospectionQuery.js"); - -var _getOperationAST = require("./getOperationAST.js"); - -var _getOperationRootType = require("./getOperationRootType.js"); - -var _introspectionFromSchema = require("./introspectionFromSchema.js"); - -var _buildClientSchema = require("./buildClientSchema.js"); - -var _buildASTSchema = require("./buildASTSchema.js"); - -var _extendSchema = require("./extendSchema.js"); - -var _lexicographicSortSchema = require("./lexicographicSortSchema.js"); - -var _printSchema = require("./printSchema.js"); - -var _typeFromAST = require("./typeFromAST.js"); - -var _valueFromAST = require("./valueFromAST.js"); - -var _valueFromASTUntyped = require("./valueFromASTUntyped.js"); - -var _astFromValue = require("./astFromValue.js"); - -var _TypeInfo = require("./TypeInfo.js"); - -var _coerceInputValue = require("./coerceInputValue.js"); - -var _concatAST = require("./concatAST.js"); - -var _separateOperations = require("./separateOperations.js"); - -var _stripIgnoredCharacters = require("./stripIgnoredCharacters.js"); - -var _typeComparators = require("./typeComparators.js"); - -var _assertValidName = require("./assertValidName.js"); - -var _findBreakingChanges = require("./findBreakingChanges.js"); - -var _findDeprecatedUsages = require("./findDeprecatedUsages.js"); diff --git a/JS/node_modules/graphql/utilities/index.js.flow b/JS/node_modules/graphql/utilities/index.js.flow deleted file mode 100644 index 96564b7..0000000 --- a/JS/node_modules/graphql/utilities/index.js.flow +++ /dev/null @@ -1,114 +0,0 @@ -// @flow strict -// Produce the GraphQL query recommended for a full schema introspection. -// Accepts optional IntrospectionOptions. -export { getIntrospectionQuery } from './getIntrospectionQuery'; - -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 './getIntrospectionQuery'; - -// 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 } from './buildASTSchema'; -export type { BuildSchemaOptions } from './buildASTSchema'; - -// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. -export { - extendSchema, - // @deprecated: Get the description from a schema AST node and supports legacy - // syntax for specifying descriptions - will be removed in v16. - getDescription, -} from './extendSchema'; - -// Sort a GraphQLSchema. -export { lexicographicSortSchema } from './lexicographicSortSchema'; - -// Print a GraphQLSchema to GraphQL Schema language. -export { - printSchema, - printType, - printIntrospectionSchema, -} from './printSchema'; - -// 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, visitWithTypeInfo } from './TypeInfo'; - -// Coerces a JavaScript value to a GraphQL type, or produces errors. -export { coerceInputValue } from './coerceInputValue'; - -// 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'; - -// @deprecated: Report all deprecated usage within a GraphQL document. -export { findDeprecatedUsages } from './findDeprecatedUsages'; diff --git a/JS/node_modules/graphql/utilities/index.mjs b/JS/node_modules/graphql/utilities/index.mjs deleted file mode 100644 index 68868fe..0000000 --- a/JS/node_modules/graphql/utilities/index.mjs +++ /dev/null @@ -1,49 +0,0 @@ -// Produce the GraphQL query recommended for a full schema introspection. -// Accepts optional IntrospectionOptions. -export { getIntrospectionQuery } from "./getIntrospectionQuery.mjs"; -// Gets the target Operation from a Document. -export { getOperationAST } from "./getOperationAST.mjs"; // Gets the Type for the target Operation AST. - -export { getOperationRootType } from "./getOperationRootType.mjs"; // Convert a GraphQLSchema to an IntrospectionQuery. - -export { introspectionFromSchema } from "./introspectionFromSchema.mjs"; // Build a GraphQLSchema from an introspection result. - -export { buildClientSchema } from "./buildClientSchema.mjs"; // Build a GraphQLSchema from GraphQL Schema language. - -export { buildASTSchema, buildSchema } from "./buildASTSchema.mjs"; -// Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. -export { extendSchema // @deprecated: Get the description from a schema AST node and supports legacy -// syntax for specifying descriptions - will be removed in v16. -, getDescription } from "./extendSchema.mjs"; // Sort a GraphQLSchema. - -export { lexicographicSortSchema } from "./lexicographicSortSchema.mjs"; // Print a GraphQLSchema to GraphQL Schema language. - -export { printSchema, printType, printIntrospectionSchema } from "./printSchema.mjs"; // Create a GraphQLType from a GraphQL language AST. - -export { typeFromAST } from "./typeFromAST.mjs"; // Create a JavaScript value from a GraphQL language AST with a type. - -export { valueFromAST } from "./valueFromAST.mjs"; // Create a JavaScript value from a GraphQL language AST without a type. - -export { valueFromASTUntyped } from "./valueFromASTUntyped.mjs"; // Create a GraphQL language AST from a JavaScript value. - -export { astFromValue } from "./astFromValue.mjs"; // A helper to use within recursive-descent visitors which need to be aware of -// the GraphQL type system. - -export { TypeInfo, visitWithTypeInfo } from "./TypeInfo.mjs"; // Coerces a JavaScript value to a GraphQL type, or produces errors. - -export { coerceInputValue } from "./coerceInputValue.mjs"; // Concatenates multiple AST together. - -export { concatAST } from "./concatAST.mjs"; // Separates an AST into an AST per Operation. - -export { separateOperations } from "./separateOperations.mjs"; // Strips characters that are not significant to the validity or execution -// of a GraphQL document. - -export { stripIgnoredCharacters } from "./stripIgnoredCharacters.mjs"; // Comparators for types - -export { isEqualType, isTypeSubTypeOf, doTypesOverlap } from "./typeComparators.mjs"; // Asserts that a string is a valid GraphQL name - -export { assertValidName, isValidNameError } from "./assertValidName.mjs"; // Compares two GraphQLSchemas and detects breaking changes. - -export { BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges } from "./findBreakingChanges.mjs"; -// @deprecated: Report all deprecated usage within a GraphQL document. -export { findDeprecatedUsages } from "./findDeprecatedUsages.mjs"; diff --git a/JS/node_modules/graphql/utilities/introspectionFromSchema.d.ts b/JS/node_modules/graphql/utilities/introspectionFromSchema.d.ts deleted file mode 100644 index ed9abf1..0000000 --- a/JS/node_modules/graphql/utilities/introspectionFromSchema.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { GraphQLSchema } from '../type/schema'; - -import { - IntrospectionQuery, - IntrospectionOptions, -} from './getIntrospectionQuery'; - -/** - * 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; diff --git a/JS/node_modules/graphql/utilities/introspectionFromSchema.js b/JS/node_modules/graphql/utilities/introspectionFromSchema.js deleted file mode 100644 index 3a1780e..0000000 --- a/JS/node_modules/graphql/utilities/introspectionFromSchema.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.introspectionFromSchema = introspectionFromSchema; - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _parser = require("../language/parser.js"); - -var _execute = require("../execution/execute.js"); - -var _getIntrospectionQuery = require("./getIntrospectionQuery.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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; } - -/** - * 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 optionsWithDefaults = _objectSpread({ - specifiedByUrl: true, - directiveIsRepeatable: true, - schemaDescription: true, - inputValueDeprecation: true - }, options); - - var document = (0, _parser.parse)((0, _getIntrospectionQuery.getIntrospectionQuery)(optionsWithDefaults)); - var result = (0, _execute.executeSync)({ - schema: schema, - document: document - }); - !result.errors && result.data || (0, _invariant.default)(0); - return result.data; -} diff --git a/JS/node_modules/graphql/utilities/introspectionFromSchema.js.flow b/JS/node_modules/graphql/utilities/introspectionFromSchema.js.flow deleted file mode 100644 index 0a73fe0..0000000 --- a/JS/node_modules/graphql/utilities/introspectionFromSchema.js.flow +++ /dev/null @@ -1,41 +0,0 @@ -// @flow strict -import invariant from '../jsutils/invariant'; - -import { parse } from '../language/parser'; - -import type { GraphQLSchema } from '../type/schema'; - -import { executeSync } from '../execution/execute'; - -import type { - IntrospectionQuery, - IntrospectionOptions, -} from './getIntrospectionQuery'; -import { getIntrospectionQuery } from './getIntrospectionQuery'; - -/** - * 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 optionsWithDefaults = { - specifiedByUrl: true, - directiveIsRepeatable: true, - schemaDescription: true, - inputValueDeprecation: true, - ...options, - }; - - const document = parse(getIntrospectionQuery(optionsWithDefaults)); - const result = executeSync({ schema, document }); - invariant(!result.errors && result.data); - return (result.data: any); -} diff --git a/JS/node_modules/graphql/utilities/introspectionFromSchema.mjs b/JS/node_modules/graphql/utilities/introspectionFromSchema.mjs deleted file mode 100644 index ad387eb..0000000 --- a/JS/node_modules/graphql/utilities/introspectionFromSchema.mjs +++ /dev/null @@ -1,36 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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 invariant from "../jsutils/invariant.mjs"; -import { parse } from "../language/parser.mjs"; -import { executeSync } from "../execution/execute.mjs"; -import { getIntrospectionQuery } from "./getIntrospectionQuery.mjs"; -/** - * 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 optionsWithDefaults = _objectSpread({ - specifiedByUrl: true, - directiveIsRepeatable: true, - schemaDescription: true, - inputValueDeprecation: true - }, options); - - var document = parse(getIntrospectionQuery(optionsWithDefaults)); - var result = executeSync({ - schema: schema, - document: document - }); - !result.errors && result.data || invariant(0); - return result.data; -} diff --git a/JS/node_modules/graphql/utilities/lexicographicSortSchema.d.ts b/JS/node_modules/graphql/utilities/lexicographicSortSchema.d.ts deleted file mode 100644 index 7dfde70..0000000 --- a/JS/node_modules/graphql/utilities/lexicographicSortSchema.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { GraphQLSchema } from '../type/schema'; - -/** - * Sort GraphQLSchema. - * - * This function returns a sorted copy of the given GraphQLSchema. - */ -export function lexicographicSortSchema(schema: GraphQLSchema): GraphQLSchema; diff --git a/JS/node_modules/graphql/utilities/lexicographicSortSchema.js b/JS/node_modules/graphql/utilities/lexicographicSortSchema.js deleted file mode 100644 index 174bca4..0000000 --- a/JS/node_modules/graphql/utilities/lexicographicSortSchema.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.lexicographicSortSchema = lexicographicSortSchema; - -var _objectValues = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap.js")); - -var _naturalCompare = _interopRequireDefault(require("../jsutils/naturalCompare.js")); - -var _schema = require("../type/schema.js"); - -var _directives = require("../type/directives.js"); - -var _introspection = require("../type/introspection.js"); - -var _definition = require("../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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. - * - * This function returns a sorted copy of the given 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(_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)) { - // $FlowFixMe[incompatible-return] - return new _definition.GraphQLList(replaceType(type.ofType)); - } else if ((0, _definition.isNonNullType)(type)) { - // $FlowFixMe[incompatible-return] - 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(_objectSpread({}, config), {}, { - locations: sortBy(config.locations, function (x) { - return x; - }), - args: sortArgs(config.args) - })); - } - - function sortArgs(args) { - return sortObjMap(args, function (arg) { - return _objectSpread(_objectSpread({}, arg), {}, { - type: replaceType(arg.type) - }); - }); - } - - function sortFields(fieldsMap) { - return sortObjMap(fieldsMap, function (field) { - return _objectSpread(_objectSpread({}, field), {}, { - type: replaceType(field.type), - args: sortArgs(field.args) - }); - }); - } - - function sortInputFields(fieldsMap) { - return sortObjMap(fieldsMap, function (field) { - return _objectSpread(_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; - } - - if ((0, _definition.isObjectType)(type)) { - var config = type.toConfig(); - return new _definition.GraphQLObjectType(_objectSpread(_objectSpread({}, config), {}, { - interfaces: function interfaces() { - return sortTypes(config.interfaces); - }, - fields: function fields() { - return sortFields(config.fields); - } - })); - } - - if ((0, _definition.isInterfaceType)(type)) { - var _config = type.toConfig(); - - return new _definition.GraphQLInterfaceType(_objectSpread(_objectSpread({}, _config), {}, { - interfaces: function interfaces() { - return sortTypes(_config.interfaces); - }, - fields: function fields() { - return sortFields(_config.fields); - } - })); - } - - if ((0, _definition.isUnionType)(type)) { - var _config2 = type.toConfig(); - - return new _definition.GraphQLUnionType(_objectSpread(_objectSpread({}, _config2), {}, { - types: function types() { - return sortTypes(_config2.types); - } - })); - } - - if ((0, _definition.isEnumType)(type)) { - var _config3 = type.toConfig(); - - return new _definition.GraphQLEnumType(_objectSpread(_objectSpread({}, _config3), {}, { - values: sortObjMap(_config3.values) - })); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isInputObjectType)(type)) { - var _config4 = type.toConfig(); - - return new _definition.GraphQLInputObjectType(_objectSpread(_objectSpread({}, _config4), {}, { - fields: function fields() { - return sortInputFields(_config4.fields); - } - })); - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected type: ' + (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 _i2 = 0; _i2 < sortedKeys.length; _i2++) { - var key = sortedKeys[_i2]; - 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 (0, _naturalCompare.default)(key1, key2); - }); -} diff --git a/JS/node_modules/graphql/utilities/lexicographicSortSchema.js.flow b/JS/node_modules/graphql/utilities/lexicographicSortSchema.js.flow deleted file mode 100644 index a6f2505..0000000 --- a/JS/node_modules/graphql/utilities/lexicographicSortSchema.js.flow +++ /dev/null @@ -1,187 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import type { ObjMap } from '../jsutils/ObjMap'; -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; -import keyValMap from '../jsutils/keyValMap'; -import naturalCompare from '../jsutils/naturalCompare'; - -import type { - GraphQLType, - GraphQLNamedType, - GraphQLFieldConfigMap, - GraphQLFieldConfigArgumentMap, - GraphQLInputFieldConfigMap, -} from '../type/definition'; -import { GraphQLSchema } from '../type/schema'; -import { GraphQLDirective } from '../type/directives'; -import { isIntrospectionType } from '../type/introspection'; -import { - GraphQLList, - GraphQLNonNull, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, - isListType, - isNonNullType, - isScalarType, - isObjectType, - isInterfaceType, - isUnionType, - isEnumType, - isInputObjectType, -} from '../type/definition'; - -/** - * Sort GraphQLSchema. - * - * This function returns a sorted copy of the given 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: T): T { - if (isListType(type)) { - // $FlowFixMe[incompatible-return] - return new GraphQLList(replaceType(type.ofType)); - } else if (isNonNullType(type)) { - // $FlowFixMe[incompatible-return] - return new GraphQLNonNull(replaceType(type.ofType)); - } - return replaceNamedType(type); - } - - function replaceNamedType(type: T): T { - return ((typeMap[type.name]: any): T); - } - - function replaceMaybeType(maybeType: T): T { - return maybeType && replaceNamedType(maybeType); - } - - function sortDirective(directive: GraphQLDirective) { - const config = directive.toConfig(); - return new GraphQLDirective({ - ...config, - locations: sortBy(config.locations, (x) => x), - args: sortArgs(config.args), - }); - } - - function sortArgs(args: GraphQLFieldConfigArgumentMap) { - return sortObjMap(args, (arg) => ({ - ...arg, - type: replaceType(arg.type), - })); - } - - function sortFields(fieldsMap: GraphQLFieldConfigMap) { - return sortObjMap(fieldsMap, (field) => ({ - ...field, - type: replaceType(field.type), - args: sortArgs(field.args), - })); - } - - function sortInputFields(fieldsMap: GraphQLInputFieldConfigMap) { - return sortObjMap(fieldsMap, (field) => ({ - ...field, - type: replaceType(field.type), - })); - } - - function sortTypes(arr: $ReadOnlyArray): Array { - return sortByName(arr).map(replaceNamedType); - } - - function sortNamedType(type: GraphQLNamedType): GraphQLNamedType { - if (isScalarType(type) || isIntrospectionType(type)) { - return type; - } - if (isObjectType(type)) { - const config = type.toConfig(); - return new GraphQLObjectType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields(config.fields), - }); - } - if (isInterfaceType(type)) { - const config = type.toConfig(); - return new GraphQLInterfaceType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields(config.fields), - }); - } - if (isUnionType(type)) { - const config = type.toConfig(); - return new GraphQLUnionType({ - ...config, - types: () => sortTypes(config.types), - }); - } - if (isEnumType(type)) { - const config = type.toConfig(); - return new GraphQLEnumType({ - ...config, - values: sortObjMap(config.values), - }); - } - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isInputObjectType(type)) { - const config = type.toConfig(); - return new GraphQLInputObjectType({ - ...config, - fields: () => sortInputFields(config.fields), - }); - } - - // istanbul ignore next (Not reachable. All possible types have been considered) - invariant(false, '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 naturalCompare(key1, key2); - }); -} diff --git a/JS/node_modules/graphql/utilities/lexicographicSortSchema.mjs b/JS/node_modules/graphql/utilities/lexicographicSortSchema.mjs deleted file mode 100644 index cc9643f..0000000 --- a/JS/node_modules/graphql/utilities/lexicographicSortSchema.mjs +++ /dev/null @@ -1,185 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import keyValMap from "../jsutils/keyValMap.mjs"; -import naturalCompare from "../jsutils/naturalCompare.mjs"; -import { GraphQLSchema } from "../type/schema.mjs"; -import { GraphQLDirective } from "../type/directives.mjs"; -import { isIntrospectionType } from "../type/introspection.mjs"; -import { GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, isListType, isNonNullType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from "../type/definition.mjs"; -/** - * Sort GraphQLSchema. - * - * This function returns a sorted copy of the given 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(_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)) { - // $FlowFixMe[incompatible-return] - return new GraphQLList(replaceType(type.ofType)); - } else if (isNonNullType(type)) { - // $FlowFixMe[incompatible-return] - 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(_objectSpread({}, config), {}, { - locations: sortBy(config.locations, function (x) { - return x; - }), - args: sortArgs(config.args) - })); - } - - function sortArgs(args) { - return sortObjMap(args, function (arg) { - return _objectSpread(_objectSpread({}, arg), {}, { - type: replaceType(arg.type) - }); - }); - } - - function sortFields(fieldsMap) { - return sortObjMap(fieldsMap, function (field) { - return _objectSpread(_objectSpread({}, field), {}, { - type: replaceType(field.type), - args: sortArgs(field.args) - }); - }); - } - - function sortInputFields(fieldsMap) { - return sortObjMap(fieldsMap, function (field) { - return _objectSpread(_objectSpread({}, field), {}, { - type: replaceType(field.type) - }); - }); - } - - function sortTypes(arr) { - return sortByName(arr).map(replaceNamedType); - } - - function sortNamedType(type) { - if (isScalarType(type) || isIntrospectionType(type)) { - return type; - } - - if (isObjectType(type)) { - var config = type.toConfig(); - return new GraphQLObjectType(_objectSpread(_objectSpread({}, config), {}, { - interfaces: function interfaces() { - return sortTypes(config.interfaces); - }, - fields: function fields() { - return sortFields(config.fields); - } - })); - } - - if (isInterfaceType(type)) { - var _config = type.toConfig(); - - return new GraphQLInterfaceType(_objectSpread(_objectSpread({}, _config), {}, { - interfaces: function interfaces() { - return sortTypes(_config.interfaces); - }, - fields: function fields() { - return sortFields(_config.fields); - } - })); - } - - if (isUnionType(type)) { - var _config2 = type.toConfig(); - - return new GraphQLUnionType(_objectSpread(_objectSpread({}, _config2), {}, { - types: function types() { - return sortTypes(_config2.types); - } - })); - } - - if (isEnumType(type)) { - var _config3 = type.toConfig(); - - return new GraphQLEnumType(_objectSpread(_objectSpread({}, _config3), {}, { - values: sortObjMap(_config3.values) - })); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isInputObjectType(type)) { - var _config4 = type.toConfig(); - - return new GraphQLInputObjectType(_objectSpread(_objectSpread({}, _config4), {}, { - fields: function fields() { - return sortInputFields(_config4.fields); - } - })); - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || invariant(0, 'Unexpected type: ' + inspect(type)); - } -} - -function sortObjMap(map, sortValueFn) { - var sortedMap = Object.create(null); - var sortedKeys = sortBy(Object.keys(map), function (x) { - return x; - }); - - for (var _i2 = 0; _i2 < sortedKeys.length; _i2++) { - var key = sortedKeys[_i2]; - 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 naturalCompare(key1, key2); - }); -} diff --git a/JS/node_modules/graphql/utilities/printSchema.d.ts b/JS/node_modules/graphql/utilities/printSchema.d.ts deleted file mode 100644 index 1417ee5..0000000 --- a/JS/node_modules/graphql/utilities/printSchema.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { GraphQLSchema } from '../type/schema'; -import { GraphQLNamedType } from '../type/definition'; - -export interface 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; - -export function printIntrospectionSchema( - schema: GraphQLSchema, - options?: Options, -): string; - -export function printType(type: GraphQLNamedType, options?: Options): string; diff --git a/JS/node_modules/graphql/utilities/printSchema.js b/JS/node_modules/graphql/utilities/printSchema.js deleted file mode 100644 index 3d6d618..0000000 --- a/JS/node_modules/graphql/utilities/printSchema.js +++ /dev/null @@ -1,289 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.printSchema = printSchema; -exports.printIntrospectionSchema = printIntrospectionSchema; -exports.printType = printType; - -var _objectValues = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _printer = require("../language/printer.js"); - -var _blockString = require("../language/blockString.js"); - -var _introspection = require("../type/introspection.js"); - -var _scalars = require("../type/scalars.js"); - -var _directives = require("../type/directives.js"); - -var _definition = require("../type/definition.js"); - -var _astFromValue = require("./astFromValue.js"); - -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 types = (0, _objectValues.default)(schema.getTypeMap()).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 (schema.description == null && 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 printDescription({}, schema) + "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); - } - - if ((0, _definition.isObjectType)(type)) { - return printObject(type, options); - } - - if ((0, _definition.isInterfaceType)(type)) { - return printInterface(type, options); - } - - if ((0, _definition.isUnionType)(type)) { - return printUnion(type, options); - } - - if ((0, _definition.isEnumType)(type)) { - return printEnum(type, options); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isInputObjectType)(type)) { - return printInputObject(type, options); - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected type: ' + (0, _inspect.default)(type)); -} - -function printScalar(type, options) { - return printDescription(options, type) + "scalar ".concat(type.name) + printSpecifiedByUrl(type); -} - -function printImplementedInterfaces(type) { - var interfaces = type.getInterfaces(); - return interfaces.length ? ' implements ' + interfaces.map(function (i) { - return i.name; - }).join(' & ') : ''; -} - -function printObject(type, options) { - return printDescription(options, type) + "type ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type); -} - -function printInterface(type, options) { - return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + 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.deprecationReason); - }); - 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.deprecationReason); - }); - 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 + printDeprecated(arg.deprecationReason); -} - -function printDirective(directive, options) { - return printDescription(options, directive) + 'directive @' + directive.name + printArgs(options, directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | '); -} - -function printDeprecated(reason) { - if (reason == null) { - return ''; - } - - var reasonAST = (0, _astFromValue.astFromValue)(reason, _scalars.GraphQLString); - - if (reasonAST && reason !== _directives.DEFAULT_DEPRECATION_REASON) { - return ' @deprecated(reason: ' + (0, _printer.print)(reasonAST) + ')'; - } - - return ' @deprecated'; -} - -function printSpecifiedByUrl(scalar) { - if (scalar.specifiedByUrl == null) { - return ''; - } - - var url = scalar.specifiedByUrl; - var urlAST = (0, _astFromValue.astFromValue)(url, _scalars.GraphQLString); - urlAST || (0, _invariant.default)(0, 'Unexpected null value returned from `astFromValue` for specifiedByUrl'); - return ' @specifiedBy(url: ' + (0, _printer.print)(urlAST) + ')'; -} - -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; - var description = def.description; - - if (description == null) { - return ''; - } - - if ((options === null || options === void 0 ? void 0 : options.commentDescriptions) === true) { - return printDescriptionWithComments(description, indentation, firstInBlock); - } - - var preferMultipleLines = description.length > 70; - var blockString = (0, _blockString.printBlockString)(description, '', preferMultipleLines); - var prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; - return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; -} - -function printDescriptionWithComments(description, indentation, firstInBlock) { - var prefix = indentation && !firstInBlock ? '\n' : ''; - var comment = description.split('\n').map(function (line) { - return indentation + (line !== '' ? '# ' + line : '#'); - }).join('\n'); - return prefix + comment + '\n'; -} diff --git a/JS/node_modules/graphql/utilities/printSchema.js.flow b/JS/node_modules/graphql/utilities/printSchema.js.flow deleted file mode 100644 index a240a3e..0000000 --- a/JS/node_modules/graphql/utilities/printSchema.js.flow +++ /dev/null @@ -1,382 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; - -import { print } from '../language/printer'; -import { printBlockString } from '../language/blockString'; - -import type { GraphQLSchema } from '../type/schema'; -import type { GraphQLDirective } from '../type/directives'; -import type { - GraphQLNamedType, - GraphQLArgument, - GraphQLInputField, - GraphQLScalarType, - GraphQLEnumType, - GraphQLObjectType, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLInputObjectType, -} from '../type/definition'; -import { isIntrospectionType } from '../type/introspection'; -import { GraphQLString, isSpecifiedScalarType } from '../type/scalars'; -import { - DEFAULT_DEPRECATION_REASON, - isSpecifiedDirective, -} from '../type/directives'; -import { - isScalarType, - isObjectType, - isInterfaceType, - isUnionType, - isEnumType, - isInputObjectType, -} from '../type/definition'; - -import { astFromValue } from './astFromValue'; - -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 types = objectValues(schema.getTypeMap()).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 (schema.description == null && 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 ( - printDescription({}, schema) + `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); - } - if (isObjectType(type)) { - return printObject(type, options); - } - if (isInterfaceType(type)) { - return printInterface(type, options); - } - if (isUnionType(type)) { - return printUnion(type, options); - } - if (isEnumType(type)) { - return printEnum(type, options); - } - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isInputObjectType(type)) { - return printInputObject(type, options); - } - - // istanbul ignore next (Not reachable. All possible types have been considered) - invariant(false, 'Unexpected type: ' + inspect((type: empty))); -} - -function printScalar(type: GraphQLScalarType, options): string { - return ( - printDescription(options, type) + - `scalar ${type.name}` + - printSpecifiedByUrl(type) - ); -} - -function printImplementedInterfaces( - type: GraphQLObjectType | GraphQLInterfaceType, -): string { - const interfaces = type.getInterfaces(); - return interfaces.length - ? ' implements ' + interfaces.map((i) => i.name).join(' & ') - : ''; -} - -function printObject(type: GraphQLObjectType, options): string { - return ( - printDescription(options, type) + - `type ${type.name}` + - printImplementedInterfaces(type) + - printFields(options, type) - ); -} - -function printInterface(type: GraphQLInterfaceType, options): string { - return ( - printDescription(options, type) + - `interface ${type.name}` + - printImplementedInterfaces(type) + - 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.deprecationReason), - ); - - 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: GraphQLObjectType | GraphQLInterfaceType, -): string { - const fields = objectValues(type.getFields()).map( - (f, i) => - printDescription(options, f, ' ', !i) + - ' ' + - f.name + - printArgs(options, f.args, ' ') + - ': ' + - String(f.type) + - printDeprecated(f.deprecationReason), - ); - return printBlock(fields); -} - -function printBlock(items: $ReadOnlyArray): string { - return items.length !== 0 ? ' {\n' + items.join('\n') + '\n}' : ''; -} - -function printArgs( - options, - args: Array, - indentation: string = '', -): string { - 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: GraphQLInputField): string { - const defaultAST = astFromValue(arg.defaultValue, arg.type); - let argDecl = arg.name + ': ' + String(arg.type); - if (defaultAST) { - argDecl += ` = ${print(defaultAST)}`; - } - return argDecl + printDeprecated(arg.deprecationReason); -} - -function printDirective(directive: GraphQLDirective, options): string { - return ( - printDescription(options, directive) + - 'directive @' + - directive.name + - printArgs(options, directive.args) + - (directive.isRepeatable ? ' repeatable' : '') + - ' on ' + - directive.locations.join(' | ') - ); -} - -function printDeprecated(reason: ?string): string { - if (reason == null) { - return ''; - } - const reasonAST = astFromValue(reason, GraphQLString); - if (reasonAST && reason !== DEFAULT_DEPRECATION_REASON) { - return ' @deprecated(reason: ' + print(reasonAST) + ')'; - } - return ' @deprecated'; -} - -function printSpecifiedByUrl(scalar: GraphQLScalarType): string { - if (scalar.specifiedByUrl == null) { - return ''; - } - const url = scalar.specifiedByUrl; - const urlAST = astFromValue(url, GraphQLString); - invariant( - urlAST, - 'Unexpected null value returned from `astFromValue` for specifiedByUrl', - ); - return ' @specifiedBy(url: ' + print(urlAST) + ')'; -} - -function printDescription( - options, - def: { +description: ?string, ... }, - indentation: string = '', - firstInBlock: boolean = true, -): string { - const { description } = def; - if (description == null) { - return ''; - } - - if (options?.commentDescriptions === true) { - return printDescriptionWithComments(description, indentation, firstInBlock); - } - - const preferMultipleLines = description.length > 70; - const blockString = printBlockString(description, '', preferMultipleLines); - const prefix = - indentation && !firstInBlock ? '\n' + indentation : indentation; - - return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; -} - -function printDescriptionWithComments(description, indentation, firstInBlock) { - const prefix = indentation && !firstInBlock ? '\n' : ''; - const comment = description - .split('\n') - .map((line) => indentation + (line !== '' ? '# ' + line : '#')) - .join('\n'); - - return prefix + comment + '\n'; -} diff --git a/JS/node_modules/graphql/utilities/printSchema.mjs b/JS/node_modules/graphql/utilities/printSchema.mjs deleted file mode 100644 index a34cec4..0000000 --- a/JS/node_modules/graphql/utilities/printSchema.mjs +++ /dev/null @@ -1,268 +0,0 @@ -import objectValues from "../polyfills/objectValues.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import { print } from "../language/printer.mjs"; -import { printBlockString } from "../language/blockString.mjs"; -import { isIntrospectionType } from "../type/introspection.mjs"; -import { GraphQLString, isSpecifiedScalarType } from "../type/scalars.mjs"; -import { DEFAULT_DEPRECATION_REASON, isSpecifiedDirective } from "../type/directives.mjs"; -import { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from "../type/definition.mjs"; -import { astFromValue } from "./astFromValue.mjs"; - -/** - * 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 types = objectValues(schema.getTypeMap()).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 (schema.description == null && 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 printDescription({}, schema) + "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); - } - - if (isObjectType(type)) { - return printObject(type, options); - } - - if (isInterfaceType(type)) { - return printInterface(type, options); - } - - if (isUnionType(type)) { - return printUnion(type, options); - } - - if (isEnumType(type)) { - return printEnum(type, options); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isInputObjectType(type)) { - return printInputObject(type, options); - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || invariant(0, 'Unexpected type: ' + inspect(type)); -} - -function printScalar(type, options) { - return printDescription(options, type) + "scalar ".concat(type.name) + printSpecifiedByUrl(type); -} - -function printImplementedInterfaces(type) { - var interfaces = type.getInterfaces(); - return interfaces.length ? ' implements ' + interfaces.map(function (i) { - return i.name; - }).join(' & ') : ''; -} - -function printObject(type, options) { - return printDescription(options, type) + "type ".concat(type.name) + printImplementedInterfaces(type) + printFields(options, type); -} - -function printInterface(type, options) { - return printDescription(options, type) + "interface ".concat(type.name) + printImplementedInterfaces(type) + 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.deprecationReason); - }); - 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.deprecationReason); - }); - 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 + printDeprecated(arg.deprecationReason); -} - -function printDirective(directive, options) { - return printDescription(options, directive) + 'directive @' + directive.name + printArgs(options, directive.args) + (directive.isRepeatable ? ' repeatable' : '') + ' on ' + directive.locations.join(' | '); -} - -function printDeprecated(reason) { - if (reason == null) { - return ''; - } - - var reasonAST = astFromValue(reason, GraphQLString); - - if (reasonAST && reason !== DEFAULT_DEPRECATION_REASON) { - return ' @deprecated(reason: ' + print(reasonAST) + ')'; - } - - return ' @deprecated'; -} - -function printSpecifiedByUrl(scalar) { - if (scalar.specifiedByUrl == null) { - return ''; - } - - var url = scalar.specifiedByUrl; - var urlAST = astFromValue(url, GraphQLString); - urlAST || invariant(0, 'Unexpected null value returned from `astFromValue` for specifiedByUrl'); - return ' @specifiedBy(url: ' + print(urlAST) + ')'; -} - -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; - var description = def.description; - - if (description == null) { - return ''; - } - - if ((options === null || options === void 0 ? void 0 : options.commentDescriptions) === true) { - return printDescriptionWithComments(description, indentation, firstInBlock); - } - - var preferMultipleLines = description.length > 70; - var blockString = printBlockString(description, '', preferMultipleLines); - var prefix = indentation && !firstInBlock ? '\n' + indentation : indentation; - return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; -} - -function printDescriptionWithComments(description, indentation, firstInBlock) { - var prefix = indentation && !firstInBlock ? '\n' : ''; - var comment = description.split('\n').map(function (line) { - return indentation + (line !== '' ? '# ' + line : '#'); - }).join('\n'); - return prefix + comment + '\n'; -} diff --git a/JS/node_modules/graphql/utilities/separateOperations.d.ts b/JS/node_modules/graphql/utilities/separateOperations.d.ts deleted file mode 100644 index 28654fd..0000000 --- a/JS/node_modules/graphql/utilities/separateOperations.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { DocumentNode } 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, -): { [key: string]: DocumentNode }; diff --git a/JS/node_modules/graphql/utilities/separateOperations.js b/JS/node_modules/graphql/utilities/separateOperations.js deleted file mode 100644 index de00bd7..0000000 --- a/JS/node_modules/graphql/utilities/separateOperations.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.separateOperations = separateOperations; - -var _kinds = require("../language/kinds.js"); - -var _visitor = require("../language/visitor.js"); - -/** - * 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 depGraph = Object.create(null); // Populate metadata and build a dependency graph. - - for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { - var definitionNode = _documentAST$definiti2[_i2]; - - switch (definitionNode.kind) { - case _kinds.Kind.OPERATION_DEFINITION: - operations.push(definitionNode); - break; - - case _kinds.Kind.FRAGMENT_DEFINITION: - depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet); - break; - } - } // For each operation, produce a new synthesized AST which includes only what - // is necessary for completing that operation. - - - var separatedDocumentASTs = Object.create(null); - - var _loop = function _loop(_i4) { - var operation = operations[_i4]; - var dependencies = new Set(); - - for (var _i6 = 0, _collectDependencies2 = collectDependencies(operation.selectionSet); _i6 < _collectDependencies2.length; _i6++) { - var fragmentName = _collectDependencies2[_i6]; - collectTransitiveDependencies(dependencies, depGraph, fragmentName); - } // Provides the empty string for anonymous operations. - - - var operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted - // to retain the same order as the original document. - - separatedDocumentASTs[operationName] = { - kind: _kinds.Kind.DOCUMENT, - definitions: documentAST.definitions.filter(function (node) { - return node === operation || node.kind === _kinds.Kind.FRAGMENT_DEFINITION && dependencies.has(node.name.value); - }) - }; - }; - - for (var _i4 = 0; _i4 < operations.length; _i4++) { - _loop(_i4); - } - - return separatedDocumentASTs; -} - -// From a dependency graph, collects a list of transitive dependencies by -// recursing through a dependency graph. -function collectTransitiveDependencies(collected, depGraph, fromName) { - if (!collected.has(fromName)) { - collected.add(fromName); - var immediateDeps = depGraph[fromName]; - - if (immediateDeps !== undefined) { - for (var _i8 = 0; _i8 < immediateDeps.length; _i8++) { - var toName = immediateDeps[_i8]; - collectTransitiveDependencies(collected, depGraph, toName); - } - } - } -} - -function collectDependencies(selectionSet) { - var dependencies = []; - (0, _visitor.visit)(selectionSet, { - FragmentSpread: function FragmentSpread(node) { - dependencies.push(node.name.value); - } - }); - return dependencies; -} diff --git a/JS/node_modules/graphql/utilities/separateOperations.js.flow b/JS/node_modules/graphql/utilities/separateOperations.js.flow deleted file mode 100644 index 320053e..0000000 --- a/JS/node_modules/graphql/utilities/separateOperations.js.flow +++ /dev/null @@ -1,97 +0,0 @@ -// @flow strict -import type { ObjMap } from '../jsutils/ObjMap'; - -import type { - DocumentNode, - OperationDefinitionNode, - SelectionSetNode, -} from '../language/ast'; -import { Kind } from '../language/kinds'; -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: DocumentNode, -): ObjMap { - const operations: Array = []; - const depGraph: DepGraph = Object.create(null); - - // Populate metadata and build a dependency graph. - for (const definitionNode of documentAST.definitions) { - switch (definitionNode.kind) { - case Kind.OPERATION_DEFINITION: - operations.push(definitionNode); - break; - case Kind.FRAGMENT_DEFINITION: - depGraph[definitionNode.name.value] = collectDependencies( - definitionNode.selectionSet, - ); - break; - } - } - - // 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 dependencies = new Set(); - - for (const fragmentName of collectDependencies(operation.selectionSet)) { - collectTransitiveDependencies(dependencies, depGraph, fragmentName); - } - - // Provides the empty string for anonymous operations. - const operationName = operation.name ? operation.name.value : ''; - - // The list of definition nodes to be included for this operation, sorted - // to retain the same order as the original document. - separatedDocumentASTs[operationName] = { - kind: Kind.DOCUMENT, - definitions: documentAST.definitions.filter( - (node) => - node === operation || - (node.kind === Kind.FRAGMENT_DEFINITION && - dependencies.has(node.name.value)), - ), - }; - } - - return separatedDocumentASTs; -} - -type DepGraph = ObjMap>; - -// From a dependency graph, collects a list of transitive dependencies by -// recursing through a dependency graph. -function collectTransitiveDependencies( - collected: Set, - depGraph: DepGraph, - fromName: string, -): void { - if (!collected.has(fromName)) { - collected.add(fromName); - - const immediateDeps = depGraph[fromName]; - if (immediateDeps !== undefined) { - for (const toName of immediateDeps) { - collectTransitiveDependencies(collected, depGraph, toName); - } - } - } -} - -function collectDependencies(selectionSet: SelectionSetNode): Array { - const dependencies = []; - - visit(selectionSet, { - FragmentSpread(node) { - dependencies.push(node.name.value); - }, - }); - return dependencies; -} diff --git a/JS/node_modules/graphql/utilities/separateOperations.mjs b/JS/node_modules/graphql/utilities/separateOperations.mjs deleted file mode 100644 index 69c75da..0000000 --- a/JS/node_modules/graphql/utilities/separateOperations.mjs +++ /dev/null @@ -1,84 +0,0 @@ -import { Kind } from "../language/kinds.mjs"; -import { visit } from "../language/visitor.mjs"; -/** - * 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 depGraph = Object.create(null); // Populate metadata and build a dependency graph. - - for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) { - var definitionNode = _documentAST$definiti2[_i2]; - - switch (definitionNode.kind) { - case Kind.OPERATION_DEFINITION: - operations.push(definitionNode); - break; - - case Kind.FRAGMENT_DEFINITION: - depGraph[definitionNode.name.value] = collectDependencies(definitionNode.selectionSet); - break; - } - } // For each operation, produce a new synthesized AST which includes only what - // is necessary for completing that operation. - - - var separatedDocumentASTs = Object.create(null); - - var _loop = function _loop(_i4) { - var operation = operations[_i4]; - var dependencies = new Set(); - - for (var _i6 = 0, _collectDependencies2 = collectDependencies(operation.selectionSet); _i6 < _collectDependencies2.length; _i6++) { - var fragmentName = _collectDependencies2[_i6]; - collectTransitiveDependencies(dependencies, depGraph, fragmentName); - } // Provides the empty string for anonymous operations. - - - var operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted - // to retain the same order as the original document. - - separatedDocumentASTs[operationName] = { - kind: Kind.DOCUMENT, - definitions: documentAST.definitions.filter(function (node) { - return node === operation || node.kind === Kind.FRAGMENT_DEFINITION && dependencies.has(node.name.value); - }) - }; - }; - - for (var _i4 = 0; _i4 < operations.length; _i4++) { - _loop(_i4); - } - - return separatedDocumentASTs; -} - -// From a dependency graph, collects a list of transitive dependencies by -// recursing through a dependency graph. -function collectTransitiveDependencies(collected, depGraph, fromName) { - if (!collected.has(fromName)) { - collected.add(fromName); - var immediateDeps = depGraph[fromName]; - - if (immediateDeps !== undefined) { - for (var _i8 = 0; _i8 < immediateDeps.length; _i8++) { - var toName = immediateDeps[_i8]; - collectTransitiveDependencies(collected, depGraph, toName); - } - } - } -} - -function collectDependencies(selectionSet) { - var dependencies = []; - visit(selectionSet, { - FragmentSpread: function FragmentSpread(node) { - dependencies.push(node.name.value); - } - }); - return dependencies; -} diff --git a/JS/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts b/JS/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts deleted file mode 100644 index a131af0..0000000 --- a/JS/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { Source } from '../language/source'; - -/** - * 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; diff --git a/JS/node_modules/graphql/utilities/stripIgnoredCharacters.js b/JS/node_modules/graphql/utilities/stripIgnoredCharacters.js deleted file mode 100644 index aac5ddc..0000000 --- a/JS/node_modules/graphql/utilities/stripIgnoredCharacters.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.stripIgnoredCharacters = stripIgnoredCharacters; - -var _source = require("../language/source.js"); - -var _tokenKind = require("../language/tokenKind.js"); - -var _lexer = require("../language/lexer.js"); - -var _blockString = require("../language/blockString.js"); - -/** - * 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 = (0, _source.isSource)(source) ? source : new _source.Source(source); - var body = sourceObj.body; - var lexer = new _lexer.Lexer(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.isPunctuatorTokenKind)(currentToken.kind); - - 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); - - if ((0, _blockString.getBlockStringIndentation)(body) > 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/JS/node_modules/graphql/utilities/stripIgnoredCharacters.js.flow b/JS/node_modules/graphql/utilities/stripIgnoredCharacters.js.flow deleted file mode 100644 index a5a6aa9..0000000 --- a/JS/node_modules/graphql/utilities/stripIgnoredCharacters.js.flow +++ /dev/null @@ -1,115 +0,0 @@ -// @flow strict -import { Source, isSource } from '../language/source'; -import { TokenKind } from '../language/tokenKind'; -import { Lexer, isPunctuatorTokenKind } 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 = isSource(source) ? source : new Source(source); - - const body = sourceObj.body; - const lexer = new Lexer(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 = !isPunctuatorTokenKind(currentToken.kind); - 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: string): string { - // skip leading and trailing triple quotations - const rawStr = blockStr.slice(3, -3); - let body = dedentBlockStringValue(rawStr); - - if (getBlockStringIndentation(body) > 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/JS/node_modules/graphql/utilities/stripIgnoredCharacters.mjs b/JS/node_modules/graphql/utilities/stripIgnoredCharacters.mjs deleted file mode 100644 index a0a0758..0000000 --- a/JS/node_modules/graphql/utilities/stripIgnoredCharacters.mjs +++ /dev/null @@ -1,113 +0,0 @@ -import { Source, isSource } from "../language/source.mjs"; -import { TokenKind } from "../language/tokenKind.mjs"; -import { Lexer, isPunctuatorTokenKind } from "../language/lexer.mjs"; -import { dedentBlockStringValue, getBlockStringIndentation } from "../language/blockString.mjs"; -/** - * 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 = isSource(source) ? source : new Source(source); - var body = sourceObj.body; - var lexer = new Lexer(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 = !isPunctuatorTokenKind(currentToken.kind); - - 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); - - if (getBlockStringIndentation(body) > 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/JS/node_modules/graphql/utilities/typeComparators.d.ts b/JS/node_modules/graphql/utilities/typeComparators.d.ts deleted file mode 100644 index 7de3e00..0000000 --- a/JS/node_modules/graphql/utilities/typeComparators.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { GraphQLSchema } from '../type/schema'; -import { GraphQLType, GraphQLCompositeType } from '../type/definition'; - -/** - * Provided two types, return true if the types are equal (invariant). - */ -export function isEqualType(typeA: GraphQLType, typeB: GraphQLType): boolean; - -/** - * 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; - -/** - * 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; diff --git a/JS/node_modules/graphql/utilities/typeComparators.js b/JS/node_modules/graphql/utilities/typeComparators.js deleted file mode 100644 index 42ad5fd..0000000 --- a/JS/node_modules/graphql/utilities/typeComparators.js +++ /dev/null @@ -1,115 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.isEqualType = isEqualType; -exports.isTypeSubTypeOf = isTypeSubTypeOf; -exports.doTypesOverlap = doTypesOverlap; - -var _definition = require("../type/definition.js"); - -/** - * 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, check if it is super type of maybeSubType. - // Otherwise, the child type is not a valid subtype of the parent type. - - - return (0, _definition.isAbstractType)(superType) && ((0, _definition.isInterfaceType)(maybeSubType) || (0, _definition.isObjectType)(maybeSubType)) && schema.isSubType(superType, maybeSubType); -} -/** - * 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.isSubType(typeB, type); - }); - } // Determine if the latter type is a possible concrete type of the former. - - - return schema.isSubType(typeA, typeB); - } - - if ((0, _definition.isAbstractType)(typeB)) { - // Determine if the former type is a possible concrete type of the latter. - return schema.isSubType(typeB, typeA); - } // Otherwise the types do not overlap. - - - return false; -} diff --git a/JS/node_modules/graphql/utilities/typeComparators.js.flow b/JS/node_modules/graphql/utilities/typeComparators.js.flow deleted file mode 100644 index c3b3af1..0000000 --- a/JS/node_modules/graphql/utilities/typeComparators.js.flow +++ /dev/null @@ -1,120 +0,0 @@ -// @flow strict -import type { GraphQLSchema } from '../type/schema'; -import type { GraphQLType, GraphQLCompositeType } from '../type/definition'; -import { - isInterfaceType, - isObjectType, - isListType, - isNonNullType, - isAbstractType, -} from '../type/definition'; - -/** - * 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, check if it is super type of maybeSubType. - // Otherwise, the child type is not a valid subtype of the parent type. - return ( - isAbstractType(superType) && - (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && - schema.isSubType(superType, maybeSubType) - ); -} - -/** - * 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.isSubType(typeB, type)); - } - // Determine if the latter type is a possible concrete type of the former. - return schema.isSubType(typeA, typeB); - } - - if (isAbstractType(typeB)) { - // Determine if the former type is a possible concrete type of the latter. - return schema.isSubType(typeB, typeA); - } - - // Otherwise the types do not overlap. - return false; -} diff --git a/JS/node_modules/graphql/utilities/typeComparators.mjs b/JS/node_modules/graphql/utilities/typeComparators.mjs deleted file mode 100644 index ad3288a..0000000 --- a/JS/node_modules/graphql/utilities/typeComparators.mjs +++ /dev/null @@ -1,104 +0,0 @@ -import { isInterfaceType, isObjectType, isListType, isNonNullType, isAbstractType } from "../type/definition.mjs"; -/** - * 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, check if it is super type of maybeSubType. - // Otherwise, the child type is not a valid subtype of the parent type. - - - return isAbstractType(superType) && (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && schema.isSubType(superType, maybeSubType); -} -/** - * 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.isSubType(typeB, type); - }); - } // Determine if the latter type is a possible concrete type of the former. - - - return schema.isSubType(typeA, typeB); - } - - if (isAbstractType(typeB)) { - // Determine if the former type is a possible concrete type of the latter. - return schema.isSubType(typeB, typeA); - } // Otherwise the types do not overlap. - - - return false; -} diff --git a/JS/node_modules/graphql/utilities/typeFromAST.d.ts b/JS/node_modules/graphql/utilities/typeFromAST.d.ts deleted file mode 100644 index cf32ac7..0000000 --- a/JS/node_modules/graphql/utilities/typeFromAST.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { NamedTypeNode, ListTypeNode, NonNullTypeNode } from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; -import { - GraphQLNamedType, - GraphQLList, - GraphQLNonNull, -} from '../type/definition'; - -/** - * 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. - */ -export function typeFromAST( - schema: GraphQLSchema, - typeNode: NamedTypeNode, -): GraphQLNamedType | undefined; - -export function typeFromAST( - schema: GraphQLSchema, - typeNode: ListTypeNode, -): GraphQLList | undefined; - -export function typeFromAST( - schema: GraphQLSchema, - typeNode: NonNullTypeNode, -): GraphQLNonNull | undefined; diff --git a/JS/node_modules/graphql/utilities/typeFromAST.js b/JS/node_modules/graphql/utilities/typeFromAST.js deleted file mode 100644 index 5e85944..0000000 --- a/JS/node_modules/graphql/utilities/typeFromAST.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.typeFromAST = typeFromAST; - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _kinds = require("../language/kinds.js"); - -var _definition = require("../type/definition.js"); - -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 && new _definition.GraphQLList(innerType); - } - - if (typeNode.kind === _kinds.Kind.NON_NULL_TYPE) { - innerType = typeFromAST(schema, typeNode.type); - return innerType && new _definition.GraphQLNonNull(innerType); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (typeNode.kind === _kinds.Kind.NAMED_TYPE) { - return schema.getType(typeNode.name.value); - } // istanbul ignore next (Not reachable. All possible type nodes have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected type node: ' + (0, _inspect.default)(typeNode)); -} diff --git a/JS/node_modules/graphql/utilities/typeFromAST.js.flow b/JS/node_modules/graphql/utilities/typeFromAST.js.flow deleted file mode 100644 index a8450d8..0000000 --- a/JS/node_modules/graphql/utilities/typeFromAST.js.flow +++ /dev/null @@ -1,55 +0,0 @@ -// @flow strict -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; - -import type { - NamedTypeNode, - ListTypeNode, - NonNullTypeNode, -} from '../language/ast'; - -import { Kind } from '../language/kinds'; - -import type { GraphQLSchema } from '../type/schema'; -import type { GraphQLNamedType } from '../type/definition'; -import { GraphQLList, GraphQLNonNull } from '../type/definition'; - -/** - * 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 && new GraphQLList(innerType); - } - if (typeNode.kind === Kind.NON_NULL_TYPE) { - innerType = typeFromAST(schema, typeNode.type); - return innerType && new GraphQLNonNull(innerType); - } - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (typeNode.kind === Kind.NAMED_TYPE) { - return schema.getType(typeNode.name.value); - } - - // istanbul ignore next (Not reachable. All possible type nodes have been considered) - invariant(false, 'Unexpected type node: ' + inspect((typeNode: empty))); -} diff --git a/JS/node_modules/graphql/utilities/typeFromAST.mjs b/JS/node_modules/graphql/utilities/typeFromAST.mjs deleted file mode 100644 index 740cfeb..0000000 --- a/JS/node_modules/graphql/utilities/typeFromAST.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { GraphQLList, GraphQLNonNull } from "../type/definition.mjs"; -/** - * 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 */ - -export function typeFromAST(schema, typeNode) { - /* eslint-enable no-redeclare */ - var innerType; - - if (typeNode.kind === Kind.LIST_TYPE) { - innerType = typeFromAST(schema, typeNode.type); - return innerType && new GraphQLList(innerType); - } - - if (typeNode.kind === Kind.NON_NULL_TYPE) { - innerType = typeFromAST(schema, typeNode.type); - return innerType && new GraphQLNonNull(innerType); - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (typeNode.kind === Kind.NAMED_TYPE) { - return schema.getType(typeNode.name.value); - } // istanbul ignore next (Not reachable. All possible type nodes have been considered) - - - false || invariant(0, 'Unexpected type node: ' + inspect(typeNode)); -} diff --git a/JS/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts b/JS/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts deleted file mode 100644 index 0d7b8de..0000000 --- a/JS/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { DocumentNode, ExecutableDefinitionNode } from '../language/ast'; - -/** - * Wrapper type that contains DocumentNode and types that can be deduced from it. - */ -export interface TypedQueryDocumentNode< - TResponseData = Record, - TRequestVariables = Record -> extends DocumentNode { - readonly definitions: ReadonlyArray; - // FIXME: remove once TS implements proper way to enforce nominal typing - /** - * This type is used to ensure that the variables you pass in to the query are assignable to Variables - * and that the Result is assignable to whatever you pass your result to. The method is never actually - * implemented, but the type is valid because we list it as optional - */ - __ensureTypesOfVariablesAndResultMatching?: ( - variables: TRequestVariables, - ) => TResponseData; -} diff --git a/JS/node_modules/graphql/utilities/valueFromAST.d.ts b/JS/node_modules/graphql/utilities/valueFromAST.d.ts deleted file mode 100644 index acde6ba..0000000 --- a/JS/node_modules/graphql/utilities/valueFromAST.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { ValueNode } from '../language/ast'; -import { GraphQLInputType } 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: Maybe, - type: GraphQLInputType, - variables?: Maybe<{ [key: string]: any }>, -): any; diff --git a/JS/node_modules/graphql/utilities/valueFromAST.js b/JS/node_modules/graphql/utilities/valueFromAST.js deleted file mode 100644 index 0b0230c..0000000 --- a/JS/node_modules/graphql/utilities/valueFromAST.js +++ /dev/null @@ -1,186 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.valueFromAST = valueFromAST; - -var _objectValues3 = _interopRequireDefault(require("../polyfills/objectValues.js")); - -var _keyMap = _interopRequireDefault(require("../jsutils/keyMap.js")); - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _kinds = require("../language/kinds.js"); - -var _definition = require("../type/definition.js"); - -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 (valueNode.kind === _kinds.Kind.VARIABLE) { - var variableName = valueNode.name.value; - - if (variables == null || variables[variableName] === undefined) { - // 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.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 ((0, _definition.isListType)(type)) { - var itemType = type.ofType; - - if (valueNode.kind === _kinds.Kind.LIST) { - var coercedValues = []; - - for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) { - var itemNode = _valueNode$values2[_i2]; - - 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 (itemValue === undefined) { - return; // Invalid: intentionally return no value. - } - - coercedValues.push(itemValue); - } - } - - return coercedValues; - } - - var coercedValue = valueFromAST(valueNode, itemType, variables); - - if (coercedValue === undefined) { - 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; - }); - - for (var _i4 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i4 < _objectValues2.length; _i4++) { - var field = _objectValues2[_i4]; - 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 (fieldValue === undefined) { - return; // Invalid: intentionally return no value. - } - - coercedObj[field.name] = fieldValue; - } - - return coercedObj; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isLeafType)(type)) { - // Scalars and Enums 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 (result === undefined) { - return; // Invalid: intentionally return no value. - } - - return result; - } // istanbul ignore next (Not reachable. All possible input types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected input type: ' + (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 == null || variables[valueNode.name.value] === undefined); -} diff --git a/JS/node_modules/graphql/utilities/valueFromAST.js.flow b/JS/node_modules/graphql/utilities/valueFromAST.js.flow deleted file mode 100644 index 23d5588..0000000 --- a/JS/node_modules/graphql/utilities/valueFromAST.js.flow +++ /dev/null @@ -1,164 +0,0 @@ -// @flow strict -import objectValues from '../polyfills/objectValues'; - -import type { ObjMap } from '../jsutils/ObjMap'; -import keyMap from '../jsutils/keyMap'; -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; - -import type { ValueNode } from '../language/ast'; -import { Kind } from '../language/kinds'; - -import type { GraphQLInputType } from '../type/definition'; -import { - isLeafType, - 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: ?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 (valueNode.kind === Kind.VARIABLE) { - const variableName = valueNode.name.value; - if (variables == null || variables[variableName] === undefined) { - // 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 (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 (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 (itemValue === undefined) { - return; // Invalid: intentionally return no value. - } - coercedValues.push(itemValue); - } - } - return coercedValues; - } - const coercedValue = valueFromAST(valueNode, itemType, variables); - if (coercedValue === undefined) { - 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 (fieldValue === undefined) { - return; // Invalid: intentionally return no value. - } - coercedObj[field.name] = fieldValue; - } - return coercedObj; - } - - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isLeafType(type)) { - // Scalars and Enums 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 (result === undefined) { - return; // Invalid: intentionally return no value. - } - return result; - } - - // istanbul ignore next (Not reachable. All possible input types have been considered) - invariant(false, '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: ValueNode, - variables: ?ObjMap, -): boolean { - return ( - valueNode.kind === Kind.VARIABLE && - (variables == null || variables[valueNode.name.value] === undefined) - ); -} diff --git a/JS/node_modules/graphql/utilities/valueFromAST.mjs b/JS/node_modules/graphql/utilities/valueFromAST.mjs deleted file mode 100644 index 5879ea7..0000000 --- a/JS/node_modules/graphql/utilities/valueFromAST.mjs +++ /dev/null @@ -1,171 +0,0 @@ -import objectValues from "../polyfills/objectValues.mjs"; -import keyMap from "../jsutils/keyMap.mjs"; -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import { Kind } from "../language/kinds.mjs"; -import { isLeafType, isInputObjectType, isListType, isNonNullType } from "../type/definition.mjs"; -/** - * 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 (valueNode.kind === Kind.VARIABLE) { - var variableName = valueNode.name.value; - - if (variables == null || variables[variableName] === undefined) { - // 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 (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 (isListType(type)) { - var itemType = type.ofType; - - if (valueNode.kind === Kind.LIST) { - var coercedValues = []; - - for (var _i2 = 0, _valueNode$values2 = valueNode.values; _i2 < _valueNode$values2.length; _i2++) { - var itemNode = _valueNode$values2[_i2]; - - 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 (itemValue === undefined) { - return; // Invalid: intentionally return no value. - } - - coercedValues.push(itemValue); - } - } - - return coercedValues; - } - - var coercedValue = valueFromAST(valueNode, itemType, variables); - - if (coercedValue === undefined) { - 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; - }); - - for (var _i4 = 0, _objectValues2 = objectValues(type.getFields()); _i4 < _objectValues2.length; _i4++) { - var field = _objectValues2[_i4]; - 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 (fieldValue === undefined) { - return; // Invalid: intentionally return no value. - } - - coercedObj[field.name] = fieldValue; - } - - return coercedObj; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isLeafType(type)) { - // Scalars and Enums 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 (result === undefined) { - return; // Invalid: intentionally return no value. - } - - return result; - } // istanbul ignore next (Not reachable. All possible input types have been considered) - - - false || invariant(0, 'Unexpected input type: ' + 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 == null || variables[valueNode.name.value] === undefined); -} diff --git a/JS/node_modules/graphql/utilities/valueFromASTUntyped.d.ts b/JS/node_modules/graphql/utilities/valueFromASTUntyped.d.ts deleted file mode 100644 index a44959d..0000000 --- a/JS/node_modules/graphql/utilities/valueFromASTUntyped.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { 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?: Maybe<{ [key: string]: any }>, -): any; diff --git a/JS/node_modules/graphql/utilities/valueFromASTUntyped.js b/JS/node_modules/graphql/utilities/valueFromASTUntyped.js deleted file mode 100644 index 5cdb413..0000000 --- a/JS/node_modules/graphql/utilities/valueFromASTUntyped.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.valueFromASTUntyped = valueFromASTUntyped; - -var _inspect = _interopRequireDefault(require("../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../jsutils/invariant.js")); - -var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap.js")); - -var _kinds = require("../language/kinds.js"); - -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: - return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value]; - } // istanbul ignore next (Not reachable. All possible value nodes have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected value node: ' + (0, _inspect.default)(valueNode)); -} diff --git a/JS/node_modules/graphql/utilities/valueFromASTUntyped.js.flow b/JS/node_modules/graphql/utilities/valueFromASTUntyped.js.flow deleted file mode 100644 index e98779d..0000000 --- a/JS/node_modules/graphql/utilities/valueFromASTUntyped.js.flow +++ /dev/null @@ -1,57 +0,0 @@ -// @flow strict -import type { ObjMap } from '../jsutils/ObjMap'; -import inspect from '../jsutils/inspect'; -import invariant from '../jsutils/invariant'; -import keyValMap from '../jsutils/keyValMap'; - -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: - return variables?.[valueNode.name.value]; - } - - // istanbul ignore next (Not reachable. All possible value nodes have been considered) - invariant(false, 'Unexpected value node: ' + inspect((valueNode: empty))); -} diff --git a/JS/node_modules/graphql/utilities/valueFromASTUntyped.mjs b/JS/node_modules/graphql/utilities/valueFromASTUntyped.mjs deleted file mode 100644 index e70622c..0000000 --- a/JS/node_modules/graphql/utilities/valueFromASTUntyped.mjs +++ /dev/null @@ -1,56 +0,0 @@ -import inspect from "../jsutils/inspect.mjs"; -import invariant from "../jsutils/invariant.mjs"; -import keyValMap from "../jsutils/keyValMap.mjs"; -import { Kind } from "../language/kinds.mjs"; - -/** - * 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: - return variables === null || variables === void 0 ? void 0 : variables[valueNode.name.value]; - } // istanbul ignore next (Not reachable. All possible value nodes have been considered) - - - false || invariant(0, 'Unexpected value node: ' + inspect(valueNode)); -} diff --git a/JS/node_modules/graphql/validation/ValidationContext.d.ts b/JS/node_modules/graphql/validation/ValidationContext.d.ts deleted file mode 100644 index e0ca546..0000000 --- a/JS/node_modules/graphql/validation/ValidationContext.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { GraphQLError } from '../error/GraphQLError'; -import { ASTVisitor } from '../language/visitor'; -import { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, -} from '../language/ast'; -import { GraphQLSchema } from '../type/schema'; -import { GraphQLDirective } from '../type/directives'; -import { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, - GraphQLEnumValue, -} from '../type/definition'; -import { TypeInfo } from '../utilities/TypeInfo'; - -type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode; -interface VariableUsage { - readonly node: VariableNode; - readonly type: Maybe; - readonly defaultValue: Maybe; -} - -/** - * 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 { - constructor(ast: DocumentNode, onError: (err: GraphQLError) => void); - - reportError(error: GraphQLError): undefined; - - getDocument(): DocumentNode; - - getFragment(name: string): Maybe; - - getFragmentSpreads(node: SelectionSetNode): ReadonlyArray; - - getRecursivelyReferencedFragments( - operation: OperationDefinitionNode, - ): ReadonlyArray; -} - -export class SDLValidationContext extends ASTValidationContext { - constructor( - ast: DocumentNode, - schema: Maybe, - onError: (err: GraphQLError) => void, - ); - - getSchema(): Maybe; -} - -export type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor; - -export class ValidationContext extends ASTValidationContext { - constructor( - schema: GraphQLSchema, - ast: DocumentNode, - typeInfo: TypeInfo, - onError: (err: GraphQLError) => void, - ); - - getSchema(): GraphQLSchema; - - getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray; - - getRecursivelyReferencedFragments( - operation: OperationDefinitionNode, - ): ReadonlyArray; - - getType(): Maybe; - - getParentType(): Maybe; - - getInputType(): Maybe; - - getParentInputType(): Maybe; - - getFieldDef(): Maybe>; - - getDirective(): Maybe; - - getArgument(): Maybe; - - getEnumValue(): Maybe; -} - -export type ValidationRule = (context: ValidationContext) => ASTVisitor; diff --git a/JS/node_modules/graphql/validation/ValidationContext.js b/JS/node_modules/graphql/validation/ValidationContext.js deleted file mode 100644 index c70da64..0000000 --- a/JS/node_modules/graphql/validation/ValidationContext.js +++ /dev/null @@ -1,241 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ValidationContext = exports.SDLValidationContext = exports.ASTValidationContext = void 0; - -var _kinds = require("../language/kinds.js"); - -var _visitor = require("../language/visitor.js"); - -var _TypeInfo = require("../utilities/TypeInfo.js"); - -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, onError) { - this._ast = ast; - this._fragments = undefined; - this._fragmentSpreads = new Map(); - this._recursivelyReferencedFragments = new Map(); - this._onError = onError; - } - - var _proto = ASTValidationContext.prototype; - - _proto.reportError = function reportError(error) { - this._onError(error); - }; - - _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(); - - for (var _i2 = 0, _set$selections2 = set.selections; _i2 < _set$selections2.length; _i2++) { - var selection = _set$selections2[_i2]; - - if (selection.kind === _kinds.Kind.FRAGMENT_SPREAD) { - spreads.push(selection); - } else if (selection.selectionSet) { - setsToVisit.push(selection.selectionSet); - } - } - } - - 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(); - - for (var _i4 = 0, _this$getFragmentSpre2 = this.getFragmentSpreads(node); _i4 < _this$getFragmentSpre2.length; _i4++) { - var spread = _this$getFragmentSpre2[_i4]; - 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); - } - } - } - } - - this._recursivelyReferencedFragments.set(operation, fragments); - } - - return fragments; - }; - - return ASTValidationContext; -}(); - -exports.ASTValidationContext = ASTValidationContext; - -var SDLValidationContext = /*#__PURE__*/function (_ASTValidationContext) { - _inheritsLoose(SDLValidationContext, _ASTValidationContext); - - function SDLValidationContext(ast, schema, onError) { - var _this; - - _this = _ASTValidationContext.call(this, ast, onError) || 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, onError) { - var _this2; - - _this2 = _ASTValidationContext2.call(this, ast, onError) || 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, _TypeInfo.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); - - for (var _i6 = 0, _this$getRecursivelyR2 = this.getRecursivelyReferencedFragments(operation); _i6 < _this$getRecursivelyR2.length; _i6++) { - var frag = _this$getRecursivelyR2[_i6]; - usages = usages.concat(this.getVariableUsages(frag)); - } - - 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(); - }; - - _proto3.getEnumValue = function getEnumValue() { - return this._typeInfo.getEnumValue(); - }; - - return ValidationContext; -}(ASTValidationContext); - -exports.ValidationContext = ValidationContext; diff --git a/JS/node_modules/graphql/validation/ValidationContext.js.flow b/JS/node_modules/graphql/validation/ValidationContext.js.flow deleted file mode 100644 index dabe4ba..0000000 --- a/JS/node_modules/graphql/validation/ValidationContext.js.flow +++ /dev/null @@ -1,254 +0,0 @@ -// @flow strict -import type { ObjMap } from '../jsutils/ObjMap'; - -import type { GraphQLError } from '../error/GraphQLError'; - -import type { ASTVisitor } from '../language/visitor'; -import type { - DocumentNode, - OperationDefinitionNode, - VariableNode, - SelectionSetNode, - FragmentSpreadNode, - FragmentDefinitionNode, -} from '../language/ast'; - -import { Kind } from '../language/kinds'; -import { visit } from '../language/visitor'; - -import type { GraphQLSchema } from '../type/schema'; -import type { GraphQLDirective } from '../type/directives'; -import type { - GraphQLInputType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, - GraphQLArgument, - GraphQLEnumValue, -} from '../type/definition'; - -import { TypeInfo, visitWithTypeInfo } 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; - _onError: (err: GraphQLError) => void; - _fragments: ?ObjMap; - _fragmentSpreads: Map>; - _recursivelyReferencedFragments: Map< - OperationDefinitionNode, - $ReadOnlyArray, - >; - - constructor(ast: DocumentNode, onError: (err: GraphQLError) => void) { - this._ast = ast; - this._fragments = undefined; - this._fragmentSpreads = new Map(); - this._recursivelyReferencedFragments = new Map(); - this._onError = onError; - } - - reportError(error: GraphQLError): void { - this._onError(error); - } - - 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, - onError: (err: GraphQLError) => void, - ) { - super(ast, onError); - 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, - onError: (err: GraphQLError) => void, - ) { - super(ast, onError); - 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(); - } - - getEnumValue(): ?GraphQLEnumValue { - return this._typeInfo.getEnumValue(); - } -} - -export type ValidationRule = (ValidationContext) => ASTVisitor; diff --git a/JS/node_modules/graphql/validation/ValidationContext.mjs b/JS/node_modules/graphql/validation/ValidationContext.mjs deleted file mode 100644 index 5572265..0000000 --- a/JS/node_modules/graphql/validation/ValidationContext.mjs +++ /dev/null @@ -1,224 +0,0 @@ -function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } - -import { Kind } from "../language/kinds.mjs"; -import { visit } from "../language/visitor.mjs"; -import { TypeInfo, visitWithTypeInfo } from "../utilities/TypeInfo.mjs"; - -/** - * 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, onError) { - this._ast = ast; - this._fragments = undefined; - this._fragmentSpreads = new Map(); - this._recursivelyReferencedFragments = new Map(); - this._onError = onError; - } - - var _proto = ASTValidationContext.prototype; - - _proto.reportError = function reportError(error) { - this._onError(error); - }; - - _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(); - - for (var _i2 = 0, _set$selections2 = set.selections; _i2 < _set$selections2.length; _i2++) { - var selection = _set$selections2[_i2]; - - if (selection.kind === Kind.FRAGMENT_SPREAD) { - spreads.push(selection); - } else if (selection.selectionSet) { - setsToVisit.push(selection.selectionSet); - } - } - } - - 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(); - - for (var _i4 = 0, _this$getFragmentSpre2 = this.getFragmentSpreads(node); _i4 < _this$getFragmentSpre2.length; _i4++) { - var spread = _this$getFragmentSpre2[_i4]; - 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); - } - } - } - } - - this._recursivelyReferencedFragments.set(operation, fragments); - } - - return fragments; - }; - - return ASTValidationContext; -}(); -export var SDLValidationContext = /*#__PURE__*/function (_ASTValidationContext) { - _inheritsLoose(SDLValidationContext, _ASTValidationContext); - - function SDLValidationContext(ast, schema, onError) { - var _this; - - _this = _ASTValidationContext.call(this, ast, onError) || 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, onError) { - var _this2; - - _this2 = _ASTValidationContext2.call(this, ast, onError) || 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); - - for (var _i6 = 0, _this$getRecursivelyR2 = this.getRecursivelyReferencedFragments(operation); _i6 < _this$getRecursivelyR2.length; _i6++) { - var frag = _this$getRecursivelyR2[_i6]; - usages = usages.concat(this.getVariableUsages(frag)); - } - - 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(); - }; - - _proto3.getEnumValue = function getEnumValue() { - return this._typeInfo.getEnumValue(); - }; - - return ValidationContext; -}(ASTValidationContext); diff --git a/JS/node_modules/graphql/validation/index.d.ts b/JS/node_modules/graphql/validation/index.d.ts deleted file mode 100644 index f049bf3..0000000 --- a/JS/node_modules/graphql/validation/index.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -export { validate } from './validate'; - -export { ValidationContext, ValidationRule } from './ValidationContext'; - -export { specifiedRules } from './specifiedRules'; - -// Spec Section: "Executable Definitions" -export { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule'; - -// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" -export { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule'; - -// Spec Section: "Fragments on Composite Types" -export { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule'; - -// Spec Section: "Argument Names" -export { KnownArgumentNamesRule } from './rules/KnownArgumentNamesRule'; - -// Spec Section: "Directives Are Defined" -export { KnownDirectivesRule } from './rules/KnownDirectivesRule'; - -// Spec Section: "Fragment spread target defined" -export { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule'; - -// Spec Section: "Fragment Spread Type Existence" -export { KnownTypeNamesRule } from './rules/KnownTypeNamesRule'; - -// Spec Section: "Lone Anonymous Operation" -export { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule'; - -// Spec Section: "Fragments must not form cycles" -export { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule'; - -// Spec Section: "All Variable Used Defined" -export { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule'; - -// Spec Section: "Fragments must be used" -export { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule'; - -// Spec Section: "All Variables Used" -export { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule'; - -// Spec Section: "Field Selection Merging" -export { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule'; - -// Spec Section: "Fragment spread is possible" -export { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule'; - -// Spec Section: "Argument Optionality" -export { ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArgumentsRule'; - -// Spec Section: "Leaf Field Selections" -export { ScalarLeafsRule } from './rules/ScalarLeafsRule'; - -// Spec Section: "Subscriptions with Single Root Field" -export { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule'; - -// Spec Section: "Argument Uniqueness" -export { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule'; - -// Spec Section: "Directives Are Unique Per Location" -export { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule'; - -// Spec Section: "Fragment Name Uniqueness" -export { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule'; - -// Spec Section: "Input Object Field Uniqueness" -export { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule'; - -// Spec Section: "Operation Name Uniqueness" -export { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule'; - -// Spec Section: "Variable Uniqueness" -export { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule'; - -// Spec Section: "Values Type Correctness" -export { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule'; - -// Spec Section: "Variables are Input Types" -export { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule'; - -// Spec Section: "All Variable Usages Are Allowed" -export { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule'; - -// SDL-specific validation rules -export { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule'; -export { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule'; -export { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule'; -export { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule'; -export { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule'; -export { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule'; -export { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule'; - -// Optional rules not defined by the GraphQL Specification -export { NoDeprecatedCustomRule } from './rules/custom/NoDeprecatedCustomRule'; -export { NoSchemaIntrospectionCustomRule } from './rules/custom/NoSchemaIntrospectionCustomRule'; diff --git a/JS/node_modules/graphql/validation/index.js b/JS/node_modules/graphql/validation/index.js deleted file mode 100644 index a36e4a9..0000000 --- a/JS/node_modules/graphql/validation/index.js +++ /dev/null @@ -1,309 +0,0 @@ -"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, "ExecutableDefinitionsRule", { - enumerable: true, - get: function get() { - return _ExecutableDefinitionsRule.ExecutableDefinitionsRule; - } -}); -Object.defineProperty(exports, "FieldsOnCorrectTypeRule", { - enumerable: true, - get: function get() { - return _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule; - } -}); -Object.defineProperty(exports, "FragmentsOnCompositeTypesRule", { - enumerable: true, - get: function get() { - return _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule; - } -}); -Object.defineProperty(exports, "KnownArgumentNamesRule", { - enumerable: true, - get: function get() { - return _KnownArgumentNamesRule.KnownArgumentNamesRule; - } -}); -Object.defineProperty(exports, "KnownDirectivesRule", { - enumerable: true, - get: function get() { - return _KnownDirectivesRule.KnownDirectivesRule; - } -}); -Object.defineProperty(exports, "KnownFragmentNamesRule", { - enumerable: true, - get: function get() { - return _KnownFragmentNamesRule.KnownFragmentNamesRule; - } -}); -Object.defineProperty(exports, "KnownTypeNamesRule", { - enumerable: true, - get: function get() { - return _KnownTypeNamesRule.KnownTypeNamesRule; - } -}); -Object.defineProperty(exports, "LoneAnonymousOperationRule", { - enumerable: true, - get: function get() { - return _LoneAnonymousOperationRule.LoneAnonymousOperationRule; - } -}); -Object.defineProperty(exports, "NoFragmentCyclesRule", { - enumerable: true, - get: function get() { - return _NoFragmentCyclesRule.NoFragmentCyclesRule; - } -}); -Object.defineProperty(exports, "NoUndefinedVariablesRule", { - enumerable: true, - get: function get() { - return _NoUndefinedVariablesRule.NoUndefinedVariablesRule; - } -}); -Object.defineProperty(exports, "NoUnusedFragmentsRule", { - enumerable: true, - get: function get() { - return _NoUnusedFragmentsRule.NoUnusedFragmentsRule; - } -}); -Object.defineProperty(exports, "NoUnusedVariablesRule", { - enumerable: true, - get: function get() { - return _NoUnusedVariablesRule.NoUnusedVariablesRule; - } -}); -Object.defineProperty(exports, "OverlappingFieldsCanBeMergedRule", { - enumerable: true, - get: function get() { - return _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule; - } -}); -Object.defineProperty(exports, "PossibleFragmentSpreadsRule", { - enumerable: true, - get: function get() { - return _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule; - } -}); -Object.defineProperty(exports, "ProvidedRequiredArgumentsRule", { - enumerable: true, - get: function get() { - return _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule; - } -}); -Object.defineProperty(exports, "ScalarLeafsRule", { - enumerable: true, - get: function get() { - return _ScalarLeafsRule.ScalarLeafsRule; - } -}); -Object.defineProperty(exports, "SingleFieldSubscriptionsRule", { - enumerable: true, - get: function get() { - return _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule; - } -}); -Object.defineProperty(exports, "UniqueArgumentNamesRule", { - enumerable: true, - get: function get() { - return _UniqueArgumentNamesRule.UniqueArgumentNamesRule; - } -}); -Object.defineProperty(exports, "UniqueDirectivesPerLocationRule", { - enumerable: true, - get: function get() { - return _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule; - } -}); -Object.defineProperty(exports, "UniqueFragmentNamesRule", { - enumerable: true, - get: function get() { - return _UniqueFragmentNamesRule.UniqueFragmentNamesRule; - } -}); -Object.defineProperty(exports, "UniqueInputFieldNamesRule", { - enumerable: true, - get: function get() { - return _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule; - } -}); -Object.defineProperty(exports, "UniqueOperationNamesRule", { - enumerable: true, - get: function get() { - return _UniqueOperationNamesRule.UniqueOperationNamesRule; - } -}); -Object.defineProperty(exports, "UniqueVariableNamesRule", { - enumerable: true, - get: function get() { - return _UniqueVariableNamesRule.UniqueVariableNamesRule; - } -}); -Object.defineProperty(exports, "ValuesOfCorrectTypeRule", { - enumerable: true, - get: function get() { - return _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule; - } -}); -Object.defineProperty(exports, "VariablesAreInputTypesRule", { - enumerable: true, - get: function get() { - return _VariablesAreInputTypesRule.VariablesAreInputTypesRule; - } -}); -Object.defineProperty(exports, "VariablesInAllowedPositionRule", { - enumerable: true, - get: function get() { - return _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule; - } -}); -Object.defineProperty(exports, "LoneSchemaDefinitionRule", { - enumerable: true, - get: function get() { - return _LoneSchemaDefinitionRule.LoneSchemaDefinitionRule; - } -}); -Object.defineProperty(exports, "UniqueOperationTypesRule", { - enumerable: true, - get: function get() { - return _UniqueOperationTypesRule.UniqueOperationTypesRule; - } -}); -Object.defineProperty(exports, "UniqueTypeNamesRule", { - enumerable: true, - get: function get() { - return _UniqueTypeNamesRule.UniqueTypeNamesRule; - } -}); -Object.defineProperty(exports, "UniqueEnumValueNamesRule", { - enumerable: true, - get: function get() { - return _UniqueEnumValueNamesRule.UniqueEnumValueNamesRule; - } -}); -Object.defineProperty(exports, "UniqueFieldDefinitionNamesRule", { - enumerable: true, - get: function get() { - return _UniqueFieldDefinitionNamesRule.UniqueFieldDefinitionNamesRule; - } -}); -Object.defineProperty(exports, "UniqueDirectiveNamesRule", { - enumerable: true, - get: function get() { - return _UniqueDirectiveNamesRule.UniqueDirectiveNamesRule; - } -}); -Object.defineProperty(exports, "PossibleTypeExtensionsRule", { - enumerable: true, - get: function get() { - return _PossibleTypeExtensionsRule.PossibleTypeExtensionsRule; - } -}); -Object.defineProperty(exports, "NoDeprecatedCustomRule", { - enumerable: true, - get: function get() { - return _NoDeprecatedCustomRule.NoDeprecatedCustomRule; - } -}); -Object.defineProperty(exports, "NoSchemaIntrospectionCustomRule", { - enumerable: true, - get: function get() { - return _NoSchemaIntrospectionCustomRule.NoSchemaIntrospectionCustomRule; - } -}); - -var _validate = require("./validate.js"); - -var _ValidationContext = require("./ValidationContext.js"); - -var _specifiedRules = require("./specifiedRules.js"); - -var _ExecutableDefinitionsRule = require("./rules/ExecutableDefinitionsRule.js"); - -var _FieldsOnCorrectTypeRule = require("./rules/FieldsOnCorrectTypeRule.js"); - -var _FragmentsOnCompositeTypesRule = require("./rules/FragmentsOnCompositeTypesRule.js"); - -var _KnownArgumentNamesRule = require("./rules/KnownArgumentNamesRule.js"); - -var _KnownDirectivesRule = require("./rules/KnownDirectivesRule.js"); - -var _KnownFragmentNamesRule = require("./rules/KnownFragmentNamesRule.js"); - -var _KnownTypeNamesRule = require("./rules/KnownTypeNamesRule.js"); - -var _LoneAnonymousOperationRule = require("./rules/LoneAnonymousOperationRule.js"); - -var _NoFragmentCyclesRule = require("./rules/NoFragmentCyclesRule.js"); - -var _NoUndefinedVariablesRule = require("./rules/NoUndefinedVariablesRule.js"); - -var _NoUnusedFragmentsRule = require("./rules/NoUnusedFragmentsRule.js"); - -var _NoUnusedVariablesRule = require("./rules/NoUnusedVariablesRule.js"); - -var _OverlappingFieldsCanBeMergedRule = require("./rules/OverlappingFieldsCanBeMergedRule.js"); - -var _PossibleFragmentSpreadsRule = require("./rules/PossibleFragmentSpreadsRule.js"); - -var _ProvidedRequiredArgumentsRule = require("./rules/ProvidedRequiredArgumentsRule.js"); - -var _ScalarLeafsRule = require("./rules/ScalarLeafsRule.js"); - -var _SingleFieldSubscriptionsRule = require("./rules/SingleFieldSubscriptionsRule.js"); - -var _UniqueArgumentNamesRule = require("./rules/UniqueArgumentNamesRule.js"); - -var _UniqueDirectivesPerLocationRule = require("./rules/UniqueDirectivesPerLocationRule.js"); - -var _UniqueFragmentNamesRule = require("./rules/UniqueFragmentNamesRule.js"); - -var _UniqueInputFieldNamesRule = require("./rules/UniqueInputFieldNamesRule.js"); - -var _UniqueOperationNamesRule = require("./rules/UniqueOperationNamesRule.js"); - -var _UniqueVariableNamesRule = require("./rules/UniqueVariableNamesRule.js"); - -var _ValuesOfCorrectTypeRule = require("./rules/ValuesOfCorrectTypeRule.js"); - -var _VariablesAreInputTypesRule = require("./rules/VariablesAreInputTypesRule.js"); - -var _VariablesInAllowedPositionRule = require("./rules/VariablesInAllowedPositionRule.js"); - -var _LoneSchemaDefinitionRule = require("./rules/LoneSchemaDefinitionRule.js"); - -var _UniqueOperationTypesRule = require("./rules/UniqueOperationTypesRule.js"); - -var _UniqueTypeNamesRule = require("./rules/UniqueTypeNamesRule.js"); - -var _UniqueEnumValueNamesRule = require("./rules/UniqueEnumValueNamesRule.js"); - -var _UniqueFieldDefinitionNamesRule = require("./rules/UniqueFieldDefinitionNamesRule.js"); - -var _UniqueDirectiveNamesRule = require("./rules/UniqueDirectiveNamesRule.js"); - -var _PossibleTypeExtensionsRule = require("./rules/PossibleTypeExtensionsRule.js"); - -var _NoDeprecatedCustomRule = require("./rules/custom/NoDeprecatedCustomRule.js"); - -var _NoSchemaIntrospectionCustomRule = require("./rules/custom/NoSchemaIntrospectionCustomRule.js"); diff --git a/JS/node_modules/graphql/validation/index.js.flow b/JS/node_modules/graphql/validation/index.js.flow deleted file mode 100644 index 3def649..0000000 --- a/JS/node_modules/graphql/validation/index.js.flow +++ /dev/null @@ -1,99 +0,0 @@ -// @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: "Executable Definitions" -export { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule'; - -// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" -export { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule'; - -// Spec Section: "Fragments on Composite Types" -export { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule'; - -// Spec Section: "Argument Names" -export { KnownArgumentNamesRule } from './rules/KnownArgumentNamesRule'; - -// Spec Section: "Directives Are Defined" -export { KnownDirectivesRule } from './rules/KnownDirectivesRule'; - -// Spec Section: "Fragment spread target defined" -export { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule'; - -// Spec Section: "Fragment Spread Type Existence" -export { KnownTypeNamesRule } from './rules/KnownTypeNamesRule'; - -// Spec Section: "Lone Anonymous Operation" -export { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule'; - -// Spec Section: "Fragments must not form cycles" -export { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule'; - -// Spec Section: "All Variable Used Defined" -export { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule'; - -// Spec Section: "Fragments must be used" -export { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule'; - -// Spec Section: "All Variables Used" -export { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule'; - -// Spec Section: "Field Selection Merging" -export { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule'; - -// Spec Section: "Fragment spread is possible" -export { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule'; - -// Spec Section: "Argument Optionality" -export { ProvidedRequiredArgumentsRule } from './rules/ProvidedRequiredArgumentsRule'; - -// Spec Section: "Leaf Field Selections" -export { ScalarLeafsRule } from './rules/ScalarLeafsRule'; - -// Spec Section: "Subscriptions with Single Root Field" -export { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule'; - -// Spec Section: "Argument Uniqueness" -export { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule'; - -// Spec Section: "Directives Are Unique Per Location" -export { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule'; - -// Spec Section: "Fragment Name Uniqueness" -export { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule'; - -// Spec Section: "Input Object Field Uniqueness" -export { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule'; - -// Spec Section: "Operation Name Uniqueness" -export { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule'; - -// Spec Section: "Variable Uniqueness" -export { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule'; - -// Spec Section: "Values Type Correctness" -export { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule'; - -// Spec Section: "Variables are Input Types" -export { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule'; - -// Spec Section: "All Variable Usages Are Allowed" -export { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule'; - -// SDL-specific validation rules -export { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule'; -export { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule'; -export { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule'; -export { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule'; -export { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule'; -export { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule'; -export { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule'; - -// Optional rules not defined by the GraphQL Specification -export { NoDeprecatedCustomRule } from './rules/custom/NoDeprecatedCustomRule'; -export { NoSchemaIntrospectionCustomRule } from './rules/custom/NoSchemaIntrospectionCustomRule'; diff --git a/JS/node_modules/graphql/validation/index.mjs b/JS/node_modules/graphql/validation/index.mjs deleted file mode 100644 index e6a0d98..0000000 --- a/JS/node_modules/graphql/validation/index.mjs +++ /dev/null @@ -1,67 +0,0 @@ -export { validate } from "./validate.mjs"; -export { ValidationContext } from "./ValidationContext.mjs"; -// All validation rules in the GraphQL Specification. -export { specifiedRules } from "./specifiedRules.mjs"; // Spec Section: "Executable Definitions" - -export { ExecutableDefinitionsRule } from "./rules/ExecutableDefinitionsRule.mjs"; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" - -export { FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectTypeRule.mjs"; // Spec Section: "Fragments on Composite Types" - -export { FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypesRule.mjs"; // Spec Section: "Argument Names" - -export { KnownArgumentNamesRule } from "./rules/KnownArgumentNamesRule.mjs"; // Spec Section: "Directives Are Defined" - -export { KnownDirectivesRule } from "./rules/KnownDirectivesRule.mjs"; // Spec Section: "Fragment spread target defined" - -export { KnownFragmentNamesRule } from "./rules/KnownFragmentNamesRule.mjs"; // Spec Section: "Fragment Spread Type Existence" - -export { KnownTypeNamesRule } from "./rules/KnownTypeNamesRule.mjs"; // Spec Section: "Lone Anonymous Operation" - -export { LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperationRule.mjs"; // Spec Section: "Fragments must not form cycles" - -export { NoFragmentCyclesRule } from "./rules/NoFragmentCyclesRule.mjs"; // Spec Section: "All Variable Used Defined" - -export { NoUndefinedVariablesRule } from "./rules/NoUndefinedVariablesRule.mjs"; // Spec Section: "Fragments must be used" - -export { NoUnusedFragmentsRule } from "./rules/NoUnusedFragmentsRule.mjs"; // Spec Section: "All Variables Used" - -export { NoUnusedVariablesRule } from "./rules/NoUnusedVariablesRule.mjs"; // Spec Section: "Field Selection Merging" - -export { OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMergedRule.mjs"; // Spec Section: "Fragment spread is possible" - -export { PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreadsRule.mjs"; // Spec Section: "Argument Optionality" - -export { ProvidedRequiredArgumentsRule } from "./rules/ProvidedRequiredArgumentsRule.mjs"; // Spec Section: "Leaf Field Selections" - -export { ScalarLeafsRule } from "./rules/ScalarLeafsRule.mjs"; // Spec Section: "Subscriptions with Single Root Field" - -export { SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptionsRule.mjs"; // Spec Section: "Argument Uniqueness" - -export { UniqueArgumentNamesRule } from "./rules/UniqueArgumentNamesRule.mjs"; // Spec Section: "Directives Are Unique Per Location" - -export { UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocationRule.mjs"; // Spec Section: "Fragment Name Uniqueness" - -export { UniqueFragmentNamesRule } from "./rules/UniqueFragmentNamesRule.mjs"; // Spec Section: "Input Object Field Uniqueness" - -export { UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNamesRule.mjs"; // Spec Section: "Operation Name Uniqueness" - -export { UniqueOperationNamesRule } from "./rules/UniqueOperationNamesRule.mjs"; // Spec Section: "Variable Uniqueness" - -export { UniqueVariableNamesRule } from "./rules/UniqueVariableNamesRule.mjs"; // Spec Section: "Values Type Correctness" - -export { ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectTypeRule.mjs"; // Spec Section: "Variables are Input Types" - -export { VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypesRule.mjs"; // Spec Section: "All Variable Usages Are Allowed" - -export { VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPositionRule.mjs"; // SDL-specific validation rules - -export { LoneSchemaDefinitionRule } from "./rules/LoneSchemaDefinitionRule.mjs"; -export { UniqueOperationTypesRule } from "./rules/UniqueOperationTypesRule.mjs"; -export { UniqueTypeNamesRule } from "./rules/UniqueTypeNamesRule.mjs"; -export { UniqueEnumValueNamesRule } from "./rules/UniqueEnumValueNamesRule.mjs"; -export { UniqueFieldDefinitionNamesRule } from "./rules/UniqueFieldDefinitionNamesRule.mjs"; -export { UniqueDirectiveNamesRule } from "./rules/UniqueDirectiveNamesRule.mjs"; -export { PossibleTypeExtensionsRule } from "./rules/PossibleTypeExtensionsRule.mjs"; // Optional rules not defined by the GraphQL Specification - -export { NoDeprecatedCustomRule } from "./rules/custom/NoDeprecatedCustomRule.mjs"; -export { NoSchemaIntrospectionCustomRule } from "./rules/custom/NoSchemaIntrospectionCustomRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.d.ts b/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.d.ts deleted file mode 100644 index 94557ad..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { ExecutableDefinitionsRule } from 'graphql' - * or - * import { ExecutableDefinitionsRule } from 'graphql/validation' - */ -export { ExecutableDefinitionsRule as ExecutableDefinitions } from './ExecutableDefinitionsRule'; diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.js b/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.js deleted file mode 100644 index ed8c46b..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "ExecutableDefinitions", { - enumerable: true, - get: function get() { - return _ExecutableDefinitionsRule.ExecutableDefinitionsRule; - } -}); - -var _ExecutableDefinitionsRule = require("./ExecutableDefinitionsRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.js.flow b/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.js.flow deleted file mode 100644 index aac4efb..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { ExecutableDefinitionsRule } from 'graphql' - * or - * import { ExecutableDefinitionsRule } from 'graphql/validation' - */ -export { ExecutableDefinitionsRule as ExecutableDefinitions } from './ExecutableDefinitionsRule'; diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.mjs b/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.mjs deleted file mode 100644 index 9dc914e..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitions.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { ExecutableDefinitionsRule } from 'graphql' - * or - * import { ExecutableDefinitionsRule } from 'graphql/validation' - */ -export { ExecutableDefinitionsRule as ExecutableDefinitions } from "./ExecutableDefinitionsRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts b/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts deleted file mode 100644 index 9709256..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Executable definitions - * - * A GraphQL document is only valid for execution if all definitions are either - * operation or fragment definitions. - */ -export function ExecutableDefinitionsRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js b/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js deleted file mode 100644 index 0c070a8..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ExecutableDefinitionsRule = ExecutableDefinitionsRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _predicates = require("../../language/predicates.js"); - -/** - * Executable definitions - * - * A GraphQL document is only valid for execution if all definitions are either - * operation or fragment definitions. - */ -function ExecutableDefinitionsRule(context) { - return { - Document: function Document(node) { - for (var _i2 = 0, _node$definitions2 = node.definitions; _i2 < _node$definitions2.length; _i2++) { - var definition = _node$definitions2[_i2]; - - if (!(0, _predicates.isExecutableDefinitionNode)(definition)) { - var defName = definition.kind === _kinds.Kind.SCHEMA_DEFINITION || definition.kind === _kinds.Kind.SCHEMA_EXTENSION ? 'schema' : '"' + definition.name.value + '"'; - context.reportError(new _GraphQLError.GraphQLError("The ".concat(defName, " definition is not executable."), definition)); - } - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.flow b/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.flow deleted file mode 100644 index 06c0d52..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import { Kind } from '../../language/kinds'; -import { isExecutableDefinitionNode } from '../../language/predicates'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * Executable definitions - * - * A GraphQL document is only valid for execution if all definitions are either - * operation or fragment definitions. - */ -export function ExecutableDefinitionsRule( - context: ASTValidationContext, -): ASTVisitor { - return { - Document(node) { - for (const definition of node.definitions) { - if (!isExecutableDefinitionNode(definition)) { - const defName = - definition.kind === Kind.SCHEMA_DEFINITION || - definition.kind === Kind.SCHEMA_EXTENSION - ? 'schema' - : '"' + definition.name.value + '"'; - context.reportError( - new GraphQLError( - `The ${defName} definition is not executable.`, - definition, - ), - ); - } - } - return false; - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs b/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs deleted file mode 100644 index c47b996..0000000 --- a/JS/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs +++ /dev/null @@ -1,26 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { isExecutableDefinitionNode } from "../../language/predicates.mjs"; - -/** - * Executable definitions - * - * A GraphQL document is only valid for execution if all definitions are either - * operation or fragment definitions. - */ -export function ExecutableDefinitionsRule(context) { - return { - Document: function Document(node) { - for (var _i2 = 0, _node$definitions2 = node.definitions; _i2 < _node$definitions2.length; _i2++) { - var definition = _node$definitions2[_i2]; - - if (!isExecutableDefinitionNode(definition)) { - var defName = definition.kind === Kind.SCHEMA_DEFINITION || definition.kind === Kind.SCHEMA_EXTENSION ? 'schema' : '"' + definition.name.value + '"'; - context.reportError(new GraphQLError("The ".concat(defName, " definition is not executable."), definition)); - } - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts b/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts deleted file mode 100644 index 6091c6c..0000000 --- a/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 FieldsOnCorrectTypeRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js b/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js deleted file mode 100644 index ddd25a0..0000000 --- a/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.FieldsOnCorrectTypeRule = FieldsOnCorrectTypeRule; - -var _arrayFrom = _interopRequireDefault(require("../../polyfills/arrayFrom.js")); - -var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean.js")); - -var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList.js")); - -var _naturalCompare = _interopRequireDefault(require("../../jsutils/naturalCompare.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _definition = require("../../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * 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 FieldsOnCorrectTypeRule(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 suggestion = (0, _didYouMean.default)('to use an inline fragment on', getSuggestedTypeNames(schema, type, fieldName)); // If there are no suggested types, then perhaps this was a typo? - - if (suggestion === '') { - suggestion = (0, _didYouMean.default)(getSuggestedFieldNames(type, fieldName)); - } // Report an error, including helpful suggestions. - - - context.reportError(new _GraphQLError.GraphQLError("Cannot query field \"".concat(fieldName, "\" on type \"").concat(type.name, "\".") + suggestion, 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. - */ - - -function getSuggestedTypeNames(schema, type, fieldName) { - if (!(0, _definition.isAbstractType)(type)) { - // Must be an Object type, which does not have possible fields. - return []; - } - - var suggestedTypes = new Set(); - var usageCount = Object.create(null); - - for (var _i2 = 0, _schema$getPossibleTy2 = schema.getPossibleTypes(type); _i2 < _schema$getPossibleTy2.length; _i2++) { - var possibleType = _schema$getPossibleTy2[_i2]; - - if (!possibleType.getFields()[fieldName]) { - continue; - } // This object type defines this field. - - - suggestedTypes.add(possibleType); - usageCount[possibleType.name] = 1; - - for (var _i4 = 0, _possibleType$getInte2 = possibleType.getInterfaces(); _i4 < _possibleType$getInte2.length; _i4++) { - var _usageCount$possibleI; - - var possibleInterface = _possibleType$getInte2[_i4]; - - if (!possibleInterface.getFields()[fieldName]) { - continue; - } // This interface type defines this field. - - - suggestedTypes.add(possibleInterface); - usageCount[possibleInterface.name] = ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== null && _usageCount$possibleI !== void 0 ? _usageCount$possibleI : 0) + 1; - } - } - - return (0, _arrayFrom.default)(suggestedTypes).sort(function (typeA, typeB) { - // Suggest both interface and object types based on how common they are. - var usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; - - if (usageCountDiff !== 0) { - return usageCountDiff; - } // Suggest super types first followed by subtypes - - - if ((0, _definition.isInterfaceType)(typeA) && schema.isSubType(typeA, typeB)) { - return -1; - } - - if ((0, _definition.isInterfaceType)(typeB) && schema.isSubType(typeB, typeA)) { - return 1; - } - - return (0, _naturalCompare.default)(typeA.name, typeB.name); - }).map(function (x) { - return x.name; - }); -} -/** - * For the field name provided, determine if there are any similar field names - * that may be the result of a typo. - */ - - -function getSuggestedFieldNames(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/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.flow b/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.flow deleted file mode 100644 index 2170606..0000000 --- a/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js.flow +++ /dev/null @@ -1,146 +0,0 @@ -// @flow strict -import arrayFrom from '../../polyfills/arrayFrom'; - -import didYouMean from '../../jsutils/didYouMean'; -import suggestionList from '../../jsutils/suggestionList'; -import naturalCompare from '../../jsutils/naturalCompare'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { FieldNode } from '../../language/ast'; -import type { ASTVisitor } from '../../language/visitor'; - -import type { GraphQLSchema } from '../../type/schema'; -import type { - GraphQLOutputType, - GraphQLObjectType, - GraphQLInterfaceType, -} from '../../type/definition'; -import { - isObjectType, - isInterfaceType, - isAbstractType, -} from '../../type/definition'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * 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 FieldsOnCorrectTypeRule( - 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. - let suggestion = didYouMean( - 'to use an inline fragment on', - getSuggestedTypeNames(schema, type, fieldName), - ); - - // If there are no suggested types, then perhaps this was a typo? - if (suggestion === '') { - suggestion = didYouMean(getSuggestedFieldNames(type, fieldName)); - } - - // Report an error, including helpful suggestions. - context.reportError( - new GraphQLError( - `Cannot query field "${fieldName}" on type "${type.name}".` + - suggestion, - 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. - */ -function getSuggestedTypeNames( - schema: GraphQLSchema, - type: GraphQLOutputType, - fieldName: string, -): Array { - if (!isAbstractType(type)) { - // Must be an Object type, which does not have possible fields. - return []; - } - - const suggestedTypes: Set< - GraphQLObjectType | GraphQLInterfaceType, - > = new Set(); - const usageCount = Object.create(null); - for (const possibleType of schema.getPossibleTypes(type)) { - if (!possibleType.getFields()[fieldName]) { - continue; - } - - // This object type defines this field. - suggestedTypes.add(possibleType); - usageCount[possibleType.name] = 1; - - for (const possibleInterface of possibleType.getInterfaces()) { - if (!possibleInterface.getFields()[fieldName]) { - continue; - } - - // This interface type defines this field. - suggestedTypes.add(possibleInterface); - usageCount[possibleInterface.name] = - (usageCount[possibleInterface.name] ?? 0) + 1; - } - } - - return arrayFrom(suggestedTypes) - .sort((typeA, typeB) => { - // Suggest both interface and object types based on how common they are. - const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; - if (usageCountDiff !== 0) { - return usageCountDiff; - } - - // Suggest super types first followed by subtypes - if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) { - return -1; - } - if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) { - return 1; - } - - return naturalCompare(typeA.name, typeB.name); - }) - .map((x) => x.name); -} - -/** - * For the field name provided, determine if there are any similar field names - * that may be the result of a typo. - */ -function getSuggestedFieldNames( - 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/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs b/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs deleted file mode 100644 index f10b21d..0000000 --- a/JS/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs +++ /dev/null @@ -1,117 +0,0 @@ -import arrayFrom from "../../polyfills/arrayFrom.mjs"; -import didYouMean from "../../jsutils/didYouMean.mjs"; -import suggestionList from "../../jsutils/suggestionList.mjs"; -import naturalCompare from "../../jsutils/naturalCompare.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { isObjectType, isInterfaceType, isAbstractType } from "../../type/definition.mjs"; - -/** - * 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 FieldsOnCorrectTypeRule(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 suggestion = didYouMean('to use an inline fragment on', getSuggestedTypeNames(schema, type, fieldName)); // If there are no suggested types, then perhaps this was a typo? - - if (suggestion === '') { - suggestion = didYouMean(getSuggestedFieldNames(type, fieldName)); - } // Report an error, including helpful suggestions. - - - context.reportError(new GraphQLError("Cannot query field \"".concat(fieldName, "\" on type \"").concat(type.name, "\".") + suggestion, 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. - */ - -function getSuggestedTypeNames(schema, type, fieldName) { - if (!isAbstractType(type)) { - // Must be an Object type, which does not have possible fields. - return []; - } - - var suggestedTypes = new Set(); - var usageCount = Object.create(null); - - for (var _i2 = 0, _schema$getPossibleTy2 = schema.getPossibleTypes(type); _i2 < _schema$getPossibleTy2.length; _i2++) { - var possibleType = _schema$getPossibleTy2[_i2]; - - if (!possibleType.getFields()[fieldName]) { - continue; - } // This object type defines this field. - - - suggestedTypes.add(possibleType); - usageCount[possibleType.name] = 1; - - for (var _i4 = 0, _possibleType$getInte2 = possibleType.getInterfaces(); _i4 < _possibleType$getInte2.length; _i4++) { - var _usageCount$possibleI; - - var possibleInterface = _possibleType$getInte2[_i4]; - - if (!possibleInterface.getFields()[fieldName]) { - continue; - } // This interface type defines this field. - - - suggestedTypes.add(possibleInterface); - usageCount[possibleInterface.name] = ((_usageCount$possibleI = usageCount[possibleInterface.name]) !== null && _usageCount$possibleI !== void 0 ? _usageCount$possibleI : 0) + 1; - } - } - - return arrayFrom(suggestedTypes).sort(function (typeA, typeB) { - // Suggest both interface and object types based on how common they are. - var usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; - - if (usageCountDiff !== 0) { - return usageCountDiff; - } // Suggest super types first followed by subtypes - - - if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) { - return -1; - } - - if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) { - return 1; - } - - return naturalCompare(typeA.name, typeB.name); - }).map(function (x) { - return x.name; - }); -} -/** - * For the field name provided, determine if there are any similar field names - * that may be the result of a typo. - */ - - -function getSuggestedFieldNames(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/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts b/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts deleted file mode 100644 index 70b9b14..0000000 --- a/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 FragmentsOnCompositeTypesRule( - context: ValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js b/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js deleted file mode 100644 index 423ffcc..0000000 --- a/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.FragmentsOnCompositeTypesRule = FragmentsOnCompositeTypesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _printer = require("../../language/printer.js"); - -var _definition = require("../../type/definition.js"); - -var _typeFromAST = require("../../utilities/typeFromAST.js"); - -/** - * 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 FragmentsOnCompositeTypesRule(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)) { - var typeStr = (0, _printer.print)(typeCondition); - context.reportError(new _GraphQLError.GraphQLError("Fragment cannot condition on non composite type \"".concat(typeStr, "\"."), typeCondition)); - } - } - }, - FragmentDefinition: function FragmentDefinition(node) { - var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.typeCondition); - - if (type && !(0, _definition.isCompositeType)(type)) { - var typeStr = (0, _printer.print)(node.typeCondition); - context.reportError(new _GraphQLError.GraphQLError("Fragment \"".concat(node.name.value, "\" cannot condition on non composite type \"").concat(typeStr, "\"."), node.typeCondition)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.flow b/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.flow deleted file mode 100644 index 53ed6b9..0000000 --- a/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js.flow +++ /dev/null @@ -1,52 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import { print } from '../../language/printer'; - -import { isCompositeType } from '../../type/definition'; - -import { typeFromAST } from '../../utilities/typeFromAST'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * 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 FragmentsOnCompositeTypesRule( - context: ValidationContext, -): ASTVisitor { - return { - InlineFragment(node) { - const typeCondition = node.typeCondition; - if (typeCondition) { - const type = typeFromAST(context.getSchema(), typeCondition); - if (type && !isCompositeType(type)) { - const typeStr = print(typeCondition); - context.reportError( - new GraphQLError( - `Fragment cannot condition on non composite type "${typeStr}".`, - typeCondition, - ), - ); - } - } - }, - FragmentDefinition(node) { - const type = typeFromAST(context.getSchema(), node.typeCondition); - if (type && !isCompositeType(type)) { - const typeStr = print(node.typeCondition); - context.reportError( - new GraphQLError( - `Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, - node.typeCondition, - ), - ); - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs b/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs deleted file mode 100644 index 44aaac6..0000000 --- a/JS/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { print } from "../../language/printer.mjs"; -import { isCompositeType } from "../../type/definition.mjs"; -import { typeFromAST } from "../../utilities/typeFromAST.mjs"; - -/** - * 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 FragmentsOnCompositeTypesRule(context) { - return { - InlineFragment: function InlineFragment(node) { - var typeCondition = node.typeCondition; - - if (typeCondition) { - var type = typeFromAST(context.getSchema(), typeCondition); - - if (type && !isCompositeType(type)) { - var typeStr = print(typeCondition); - context.reportError(new GraphQLError("Fragment cannot condition on non composite type \"".concat(typeStr, "\"."), typeCondition)); - } - } - }, - FragmentDefinition: function FragmentDefinition(node) { - var type = typeFromAST(context.getSchema(), node.typeCondition); - - if (type && !isCompositeType(type)) { - var typeStr = print(node.typeCondition); - context.reportError(new GraphQLError("Fragment \"".concat(node.name.value, "\" cannot condition on non composite type \"").concat(typeStr, "\"."), node.typeCondition)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts deleted file mode 100644 index 8c0f828..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ValidationContext, SDLValidationContext } from '../ValidationContext'; -import { ASTVisitor } from '../../language/visitor'; - -/** - * Known argument names - * - * A GraphQL field is only valid if all supplied arguments are defined by - * that field. - */ -export function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor; - -/** - * @internal - */ -export function KnownArgumentNamesOnDirectivesRule( - context: ValidationContext | SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js b/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js deleted file mode 100644 index 4742b84..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.KnownArgumentNamesRule = KnownArgumentNamesRule; -exports.KnownArgumentNamesOnDirectivesRule = KnownArgumentNamesOnDirectivesRule; - -var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean.js")); - -var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _directives = require("../../type/directives.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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; } - -/** - * Known argument names - * - * A GraphQL field is only valid if all supplied arguments are defined by - * that field. - */ -function KnownArgumentNamesRule(context) { - return _objectSpread(_objectSpread({}, KnownArgumentNamesOnDirectivesRule(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; - }); - var suggestions = (0, _suggestionList.default)(argName, knownArgsNames); - context.reportError(new _GraphQLError.GraphQLError("Unknown argument \"".concat(argName, "\" on field \"").concat(parentType.name, ".").concat(fieldDef.name, "\".") + (0, _didYouMean.default)(suggestions), argNode)); - } - } - }); -} -/** - * @internal - */ - - -function KnownArgumentNamesOnDirectivesRule(context) { - var directiveArgs = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; - - for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { - var directive = definedDirectives[_i2]; - directiveArgs[directive.name] = directive.args.map(function (arg) { - return arg.name; - }); - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { - var def = astDefinitions[_i4]; - - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var argsNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; - directiveArgs[def.name.value] = argsNodes.map(function (arg) { - return arg.name.value; - }); - } - } - - return { - Directive: function Directive(directiveNode) { - var directiveName = directiveNode.name.value; - var knownArgs = directiveArgs[directiveName]; - - if (directiveNode.arguments && knownArgs) { - for (var _i6 = 0, _directiveNode$argume2 = directiveNode.arguments; _i6 < _directiveNode$argume2.length; _i6++) { - var argNode = _directiveNode$argume2[_i6]; - var argName = argNode.name.value; - - if (knownArgs.indexOf(argName) === -1) { - var suggestions = (0, _suggestionList.default)(argName, knownArgs); - context.reportError(new _GraphQLError.GraphQLError("Unknown argument \"".concat(argName, "\" on directive \"@").concat(directiveName, "\".") + (0, _didYouMean.default)(suggestions), argNode)); - } - } - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.flow deleted file mode 100644 index a5f420b..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js.flow +++ /dev/null @@ -1,98 +0,0 @@ -// @flow strict -import didYouMean from '../../jsutils/didYouMean'; -import suggestionList from '../../jsutils/suggestionList'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import { Kind } from '../../language/kinds'; - -import { specifiedDirectives } from '../../type/directives'; - -import type { - ValidationContext, - SDLValidationContext, -} from '../ValidationContext'; - -/** - * Known argument names - * - * A GraphQL field is only valid if all supplied arguments are defined by - * that field. - */ -export function KnownArgumentNamesRule(context: ValidationContext): ASTVisitor { - return { - // eslint-disable-next-line new-cap - ...KnownArgumentNamesOnDirectivesRule(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); - const suggestions = suggestionList(argName, knownArgsNames); - context.reportError( - new GraphQLError( - `Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` + - didYouMean(suggestions), - argNode, - ), - ); - } - }, - }; -} - -/** - * @internal - */ -export function KnownArgumentNamesOnDirectivesRule( - 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) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const argsNodes = def.arguments ?? []; - - directiveArgs[def.name.value] = argsNodes.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( - `Unknown argument "${argName}" on directive "@${directiveName}".` + - didYouMean(suggestions), - argNode, - ), - ); - } - } - } - - return false; - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs b/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs deleted file mode 100644 index d21057e..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs +++ /dev/null @@ -1,89 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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 didYouMean from "../../jsutils/didYouMean.mjs"; -import suggestionList from "../../jsutils/suggestionList.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { specifiedDirectives } from "../../type/directives.mjs"; - -/** - * Known argument names - * - * A GraphQL field is only valid if all supplied arguments are defined by - * that field. - */ -export function KnownArgumentNamesRule(context) { - return _objectSpread(_objectSpread({}, KnownArgumentNamesOnDirectivesRule(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; - }); - var suggestions = suggestionList(argName, knownArgsNames); - context.reportError(new GraphQLError("Unknown argument \"".concat(argName, "\" on field \"").concat(parentType.name, ".").concat(fieldDef.name, "\".") + didYouMean(suggestions), argNode)); - } - } - }); -} -/** - * @internal - */ - -export function KnownArgumentNamesOnDirectivesRule(context) { - var directiveArgs = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; - - for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { - var directive = definedDirectives[_i2]; - directiveArgs[directive.name] = directive.args.map(function (arg) { - return arg.name; - }); - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { - var def = astDefinitions[_i4]; - - if (def.kind === Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var argsNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; - directiveArgs[def.name.value] = argsNodes.map(function (arg) { - return arg.name.value; - }); - } - } - - return { - Directive: function Directive(directiveNode) { - var directiveName = directiveNode.name.value; - var knownArgs = directiveArgs[directiveName]; - - if (directiveNode.arguments && knownArgs) { - for (var _i6 = 0, _directiveNode$argume2 = directiveNode.arguments; _i6 < _directiveNode$argume2.length; _i6++) { - var argNode = _directiveNode$argume2[_i6]; - var argName = argNode.name.value; - - if (knownArgs.indexOf(argName) === -1) { - var suggestions = suggestionList(argName, knownArgs); - context.reportError(new GraphQLError("Unknown argument \"".concat(argName, "\" on directive \"@").concat(directiveName, "\".") + didYouMean(suggestions), argNode)); - } - } - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts b/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts deleted file mode 100644 index dcb6af6..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext, SDLValidationContext } from '../ValidationContext'; - -/** - * Known directives - * - * A GraphQL document is only valid if all `@directives` are known by the - * schema and legally positioned. - */ -export function KnownDirectivesRule( - context: ValidationContext | SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.js b/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.js deleted file mode 100644 index ef2ab61..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.KnownDirectivesRule = KnownDirectivesRule; - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../../jsutils/invariant.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _directiveLocation = require("../../language/directiveLocation.js"); - -var _directives = require("../../type/directives.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Known directives - * - * A GraphQL document is only valid if all `@directives` are known by the - * schema and legally positioned. - */ -function KnownDirectivesRule(context) { - var locationsMap = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; - - for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { - var directive = definedDirectives[_i2]; - locationsMap[directive.name] = directive.locations; - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { - var def = astDefinitions[_i4]; - - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - locationsMap[def.name.value] = def.locations.map(function (name) { - return name.value; - }); - } - } - - 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("Unknown directive \"@".concat(name, "\"."), node)); - return; - } - - var candidateLocation = getDirectiveLocationForASTPath(ancestors); - - if (candidateLocation && locations.indexOf(candidateLocation) === -1) { - context.reportError(new _GraphQLError.GraphQLError("Directive \"@".concat(name, "\" may not be used on ").concat(candidateLocation, "."), node)); - } - } - }; -} - -function getDirectiveLocationForASTPath(ancestors) { - var appliedTo = ancestors[ancestors.length - 1]; - !Array.isArray(appliedTo) || (0, _invariant.default)(0); - - switch (appliedTo.kind) { - case _kinds.Kind.OPERATION_DEFINITION: - return getDirectiveLocationForOperation(appliedTo.operation); - - 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; - } - } -} - -function getDirectiveLocationForOperation(operation) { - switch (operation) { - case 'query': - return _directiveLocation.DirectiveLocation.QUERY; - - case 'mutation': - return _directiveLocation.DirectiveLocation.MUTATION; - - case 'subscription': - return _directiveLocation.DirectiveLocation.SUBSCRIPTION; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected operation: ' + (0, _inspect.default)(operation)); -} diff --git a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.js.flow b/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.js.flow deleted file mode 100644 index 79e047a..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.js.flow +++ /dev/null @@ -1,138 +0,0 @@ -// @flow strict -import inspect from '../../jsutils/inspect'; -import invariant from '../../jsutils/invariant'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { ASTNode, OperationTypeNode } from '../../language/ast'; -import type { DirectiveLocationEnum } from '../../language/directiveLocation'; -import { Kind } from '../../language/kinds'; -import { DirectiveLocation } from '../../language/directiveLocation'; - -import { specifiedDirectives } from '../../type/directives'; - -import type { - ValidationContext, - SDLValidationContext, -} from '../ValidationContext'; - -/** - * Known directives - * - * A GraphQL document is only valid if all `@directives` are known by the - * schema and legally positioned. - */ -export function KnownDirectivesRule( - 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(`Unknown directive "@${name}".`, node), - ); - return; - } - - const candidateLocation = getDirectiveLocationForASTPath(ancestors); - if (candidateLocation && locations.indexOf(candidateLocation) === -1) { - context.reportError( - new GraphQLError( - `Directive "@${name}" may not be used on ${candidateLocation}.`, - node, - ), - ); - } - }, - }; -} - -function getDirectiveLocationForASTPath( - ancestors: $ReadOnlyArray>, -): DirectiveLocationEnum | void { - const appliedTo = ancestors[ancestors.length - 1]; - invariant(!Array.isArray(appliedTo)); - - switch (appliedTo.kind) { - case Kind.OPERATION_DEFINITION: - return getDirectiveLocationForOperation(appliedTo.operation); - 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; - } - } -} - -function getDirectiveLocationForOperation( - operation: OperationTypeNode, -): DirectiveLocationEnum { - switch (operation) { - case 'query': - return DirectiveLocation.QUERY; - case 'mutation': - return DirectiveLocation.MUTATION; - case 'subscription': - return DirectiveLocation.SUBSCRIPTION; - } - - // istanbul ignore next (Not reachable. All possible types have been considered) - invariant(false, 'Unexpected operation: ' + inspect((operation: empty))); -} diff --git a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs b/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs deleted file mode 100644 index 8889bbb..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +++ /dev/null @@ -1,134 +0,0 @@ -import inspect from "../../jsutils/inspect.mjs"; -import invariant from "../../jsutils/invariant.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { DirectiveLocation } from "../../language/directiveLocation.mjs"; -import { specifiedDirectives } from "../../type/directives.mjs"; - -/** - * Known directives - * - * A GraphQL document is only valid if all `@directives` are known by the - * schema and legally positioned. - */ -export function KnownDirectivesRule(context) { - var locationsMap = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; - - for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { - var directive = definedDirectives[_i2]; - locationsMap[directive.name] = directive.locations; - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { - var def = astDefinitions[_i4]; - - if (def.kind === Kind.DIRECTIVE_DEFINITION) { - locationsMap[def.name.value] = def.locations.map(function (name) { - return name.value; - }); - } - } - - return { - Directive: function Directive(node, _key, _parent, _path, ancestors) { - var name = node.name.value; - var locations = locationsMap[name]; - - if (!locations) { - context.reportError(new GraphQLError("Unknown directive \"@".concat(name, "\"."), node)); - return; - } - - var candidateLocation = getDirectiveLocationForASTPath(ancestors); - - if (candidateLocation && locations.indexOf(candidateLocation) === -1) { - context.reportError(new GraphQLError("Directive \"@".concat(name, "\" may not be used on ").concat(candidateLocation, "."), node)); - } - } - }; -} - -function getDirectiveLocationForASTPath(ancestors) { - var appliedTo = ancestors[ancestors.length - 1]; - !Array.isArray(appliedTo) || invariant(0); - - switch (appliedTo.kind) { - case Kind.OPERATION_DEFINITION: - return getDirectiveLocationForOperation(appliedTo.operation); - - 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; - } - } -} - -function getDirectiveLocationForOperation(operation) { - switch (operation) { - case 'query': - return DirectiveLocation.QUERY; - - case 'mutation': - return DirectiveLocation.MUTATION; - - case 'subscription': - return DirectiveLocation.SUBSCRIPTION; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || invariant(0, 'Unexpected operation: ' + inspect(operation)); -} diff --git a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts deleted file mode 100644 index 7b594fd..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * Known fragment names - * - * A GraphQL document is only valid if all `...Fragment` fragment spreads refer - * to fragments defined in the same document. - */ -export function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js b/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js deleted file mode 100644 index 2902ef4..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.KnownFragmentNamesRule = KnownFragmentNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Known fragment names - * - * A GraphQL document is only valid if all `...Fragment` fragment spreads refer - * to fragments defined in the same document. - */ -function KnownFragmentNamesRule(context) { - return { - FragmentSpread: function FragmentSpread(node) { - var fragmentName = node.name.value; - var fragment = context.getFragment(fragmentName); - - if (!fragment) { - context.reportError(new _GraphQLError.GraphQLError("Unknown fragment \"".concat(fragmentName, "\"."), node.name)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.flow deleted file mode 100644 index 0c02736..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js.flow +++ /dev/null @@ -1,26 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * Known fragment names - * - * A GraphQL document is only valid if all `...Fragment` fragment spreads refer - * to fragments defined in the same document. - */ -export function KnownFragmentNamesRule(context: ValidationContext): ASTVisitor { - return { - FragmentSpread(node) { - const fragmentName = node.name.value; - const fragment = context.getFragment(fragmentName); - if (!fragment) { - context.reportError( - new GraphQLError(`Unknown fragment "${fragmentName}".`, node.name), - ); - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs b/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs deleted file mode 100644 index 72f935d..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Known fragment names - * - * A GraphQL document is only valid if all `...Fragment` fragment spreads refer - * to fragments defined in the same document. - */ -export function KnownFragmentNamesRule(context) { - return { - FragmentSpread: function FragmentSpread(node) { - var fragmentName = node.name.value; - var fragment = context.getFragment(fragmentName); - - if (!fragment) { - context.reportError(new GraphQLError("Unknown fragment \"".concat(fragmentName, "\"."), node.name)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts deleted file mode 100644 index b7cd75d..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext, SDLValidationContext } from '../ValidationContext'; - -/** - * 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 KnownTypeNamesRule( - context: ValidationContext | SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.js b/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.js deleted file mode 100644 index 249e3d6..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.KnownTypeNamesRule = KnownTypeNamesRule; - -var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean.js")); - -var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _predicates = require("../../language/predicates.js"); - -var _scalars = require("../../type/scalars.js"); - -var _introspection = require("../../type/introspection.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * 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 KnownTypeNamesRule(context) { - var schema = context.getSchema(); - var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); - var definedTypes = Object.create(null); - - for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) { - var def = _context$getDocument$2[_i2]; - - if ((0, _predicates.isTypeDefinitionNode)(def)) { - definedTypes[def.name.value] = true; - } - } - - 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 _ancestors$; - - var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent; - var isSDL = definitionNode != null && isSDLNode(definitionNode); - - if (isSDL && isStandardTypeName(typeName)) { - return; - } - - var suggestedTypes = (0, _suggestionList.default)(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames); - context.reportError(new _GraphQLError.GraphQLError("Unknown type \"".concat(typeName, "\".") + (0, _didYouMean.default)(suggestedTypes), node)); - } - } - }; -} - -var standardTypeNames = [].concat(_scalars.specifiedScalarTypes, _introspection.introspectionTypes).map(function (type) { - return type.name; -}); - -function isStandardTypeName(typeName) { - return standardTypeNames.indexOf(typeName) !== -1; -} - -function isSDLNode(value) { - return !Array.isArray(value) && ((0, _predicates.isTypeSystemDefinitionNode)(value) || (0, _predicates.isTypeSystemExtensionNode)(value)); -} diff --git a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.flow deleted file mode 100644 index b0120db..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.js.flow +++ /dev/null @@ -1,84 +0,0 @@ -// @flow strict -import didYouMean from '../../jsutils/didYouMean'; -import suggestionList from '../../jsutils/suggestionList'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTNode } from '../../language/ast'; -import type { ASTVisitor } from '../../language/visitor'; -import { - isTypeDefinitionNode, - isTypeSystemDefinitionNode, - isTypeSystemExtensionNode, -} from '../../language/predicates'; - -import { specifiedScalarTypes } from '../../type/scalars'; -import { introspectionTypes } from '../../type/introspection'; - -import type { - ValidationContext, - SDLValidationContext, -} from '../ValidationContext'; - -/** - * 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 KnownTypeNamesRule( - 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 = definitionNode != null && isSDLNode(definitionNode); - if (isSDL && isStandardTypeName(typeName)) { - return; - } - - const suggestedTypes = suggestionList( - typeName, - isSDL ? standardTypeNames.concat(typeNames) : typeNames, - ); - context.reportError( - new GraphQLError( - `Unknown type "${typeName}".` + didYouMean(suggestedTypes), - node, - ), - ); - } - }, - }; -} - -const standardTypeNames = [...specifiedScalarTypes, ...introspectionTypes].map( - (type) => type.name, -); - -function isStandardTypeName(typeName: string): boolean { - return standardTypeNames.indexOf(typeName) !== -1; -} - -function isSDLNode(value: ASTNode | $ReadOnlyArray): boolean { - return ( - !Array.isArray(value) && - (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value)) - ); -} diff --git a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs b/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs deleted file mode 100644 index 69116f5..0000000 --- a/JS/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs +++ /dev/null @@ -1,58 +0,0 @@ -import didYouMean from "../../jsutils/didYouMean.mjs"; -import suggestionList from "../../jsutils/suggestionList.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { isTypeDefinitionNode, isTypeSystemDefinitionNode, isTypeSystemExtensionNode } from "../../language/predicates.mjs"; -import { specifiedScalarTypes } from "../../type/scalars.mjs"; -import { introspectionTypes } from "../../type/introspection.mjs"; - -/** - * 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 KnownTypeNamesRule(context) { - var schema = context.getSchema(); - var existingTypesMap = schema ? schema.getTypeMap() : Object.create(null); - var definedTypes = Object.create(null); - - for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) { - var def = _context$getDocument$2[_i2]; - - if (isTypeDefinitionNode(def)) { - definedTypes[def.name.value] = true; - } - } - - 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 _ancestors$; - - var definitionNode = (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0 ? _ancestors$ : parent; - var isSDL = definitionNode != null && isSDLNode(definitionNode); - - if (isSDL && isStandardTypeName(typeName)) { - return; - } - - var suggestedTypes = suggestionList(typeName, isSDL ? standardTypeNames.concat(typeNames) : typeNames); - context.reportError(new GraphQLError("Unknown type \"".concat(typeName, "\".") + didYouMean(suggestedTypes), node)); - } - } - }; -} -var standardTypeNames = [].concat(specifiedScalarTypes, introspectionTypes).map(function (type) { - return type.name; -}); - -function isStandardTypeName(typeName) { - return standardTypeNames.indexOf(typeName) !== -1; -} - -function isSDLNode(value) { - return !Array.isArray(value) && (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value)); -} diff --git a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts b/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts deleted file mode 100644 index 1ac19ef..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * 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 LoneAnonymousOperationRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js b/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js deleted file mode 100644 index 116a9fb..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +++ /dev/null @@ -1,32 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.LoneAnonymousOperationRule = LoneAnonymousOperationRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -/** - * 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 LoneAnonymousOperationRule(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('This anonymous operation must be the only defined operation.', node)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.flow b/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.flow deleted file mode 100644 index e6370aa..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js.flow +++ /dev/null @@ -1,36 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import { Kind } from '../../language/kinds'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * 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 LoneAnonymousOperationRule( - 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( - 'This anonymous operation must be the only defined operation.', - node, - ), - ); - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs b/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs deleted file mode 100644 index 134322d..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; - -/** - * 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 LoneAnonymousOperationRule(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('This anonymous operation must be the only defined operation.', node)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.d.ts b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.d.ts deleted file mode 100644 index a38ad06..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { LoneSchemaDefinitionRule } from 'graphql' - * or - * import { LoneSchemaDefinitionRule } from 'graphql/validation' - */ -export { LoneSchemaDefinitionRule as LoneSchemaDefinition } from './LoneSchemaDefinitionRule'; diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.js b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.js deleted file mode 100644 index 55d0b20..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "LoneSchemaDefinition", { - enumerable: true, - get: function get() { - return _LoneSchemaDefinitionRule.LoneSchemaDefinitionRule; - } -}); - -var _LoneSchemaDefinitionRule = require("./LoneSchemaDefinitionRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.js.flow b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.js.flow deleted file mode 100644 index 6d0466a..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { LoneSchemaDefinitionRule } from 'graphql' - * or - * import { LoneSchemaDefinitionRule } from 'graphql/validation' - */ -export { LoneSchemaDefinitionRule as LoneSchemaDefinition } from './LoneSchemaDefinitionRule'; diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs deleted file mode 100644 index 5485db0..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinition.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { LoneSchemaDefinitionRule } from 'graphql' - * or - * import { LoneSchemaDefinitionRule } from 'graphql/validation' - */ -export { LoneSchemaDefinitionRule as LoneSchemaDefinition } from "./LoneSchemaDefinitionRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts deleted file mode 100644 index 5075e74..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { SDLValidationContext } from '../ValidationContext'; - -/** - * Lone Schema definition - * - * A GraphQL document is only valid if it contains only one schema definition. - */ -export function LoneSchemaDefinitionRule( - context: SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js deleted file mode 100644 index ca270c1..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.LoneSchemaDefinitionRule = LoneSchemaDefinitionRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Lone Schema definition - * - * A GraphQL document is only valid if it contains only one schema definition. - */ -function LoneSchemaDefinitionRule(context) { - var _ref, _ref2, _oldSchema$astNode; - - var oldSchema = context.getSchema(); - var alreadyDefined = (_ref = (_ref2 = (_oldSchema$astNode = oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0 ? _oldSchema$astNode : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getQueryType()) !== null && _ref2 !== void 0 ? _ref2 : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getMutationType()) !== null && _ref !== void 0 ? _ref : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getSubscriptionType(); - var schemaDefinitionsCount = 0; - return { - SchemaDefinition: function SchemaDefinition(node) { - if (alreadyDefined) { - context.reportError(new _GraphQLError.GraphQLError('Cannot define a new schema within a schema extension.', node)); - return; - } - - if (schemaDefinitionsCount > 0) { - context.reportError(new _GraphQLError.GraphQLError('Must provide only one schema definition.', node)); - } - - ++schemaDefinitionsCount; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.flow b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.flow deleted file mode 100644 index 420a2a0..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js.flow +++ /dev/null @@ -1,43 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; -import type { ASTVisitor } from '../../language/visitor'; - -import type { SDLValidationContext } from '../ValidationContext'; - -/** - * Lone Schema definition - * - * A GraphQL document is only valid if it contains only one schema definition. - */ -export function LoneSchemaDefinitionRule( - context: SDLValidationContext, -): ASTVisitor { - const oldSchema = context.getSchema(); - const alreadyDefined = - oldSchema?.astNode ?? - oldSchema?.getQueryType() ?? - oldSchema?.getMutationType() ?? - oldSchema?.getSubscriptionType(); - - let schemaDefinitionsCount = 0; - return { - SchemaDefinition(node) { - if (alreadyDefined) { - context.reportError( - new GraphQLError( - 'Cannot define a new schema within a schema extension.', - node, - ), - ); - return; - } - - if (schemaDefinitionsCount > 0) { - context.reportError( - new GraphQLError('Must provide only one schema definition.', node), - ); - } - ++schemaDefinitionsCount; - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs b/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs deleted file mode 100644 index ccc5493..0000000 --- a/JS/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Lone Schema definition - * - * A GraphQL document is only valid if it contains only one schema definition. - */ -export function LoneSchemaDefinitionRule(context) { - var _ref, _ref2, _oldSchema$astNode; - - var oldSchema = context.getSchema(); - var alreadyDefined = (_ref = (_ref2 = (_oldSchema$astNode = oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0 ? _oldSchema$astNode : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getQueryType()) !== null && _ref2 !== void 0 ? _ref2 : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getMutationType()) !== null && _ref !== void 0 ? _ref : oldSchema === null || oldSchema === void 0 ? void 0 : oldSchema.getSubscriptionType(); - var schemaDefinitionsCount = 0; - return { - SchemaDefinition: function SchemaDefinition(node) { - if (alreadyDefined) { - context.reportError(new GraphQLError('Cannot define a new schema within a schema extension.', node)); - return; - } - - if (schemaDefinitionsCount > 0) { - context.reportError(new GraphQLError('Must provide only one schema definition.', node)); - } - - ++schemaDefinitionsCount; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts b/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts deleted file mode 100644 index 85b2b10..0000000 --- a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -export function NoFragmentCyclesRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js b/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js deleted file mode 100644 index afabeb5..0000000 --- a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +++ /dev/null @@ -1,70 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoFragmentCyclesRule = NoFragmentCyclesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -function NoFragmentCyclesRule(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; - - for (var _i2 = 0; _i2 < spreadNodes.length; _i2++) { - var spreadNode = spreadNodes[_i2]; - 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 viaPath = cyclePath.slice(0, -1).map(function (s) { - return '"' + s.name.value + '"'; - }).join(', '); - context.reportError(new _GraphQLError.GraphQLError("Cannot spread fragment \"".concat(spreadName, "\" within itself") + (viaPath !== '' ? " via ".concat(viaPath, ".") : '.'), cyclePath)); - } - - spreadPath.pop(); - } - - spreadPathIndexByName[fragmentName] = undefined; - } -} diff --git a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.flow b/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.flow deleted file mode 100644 index 5687322..0000000 --- a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js.flow +++ /dev/null @@ -1,78 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { FragmentDefinitionNode } from '../../language/ast'; - -import type { ASTValidationContext } from '../ValidationContext'; - -export function NoFragmentCyclesRule( - 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): void { - 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 viaPath = cyclePath - .slice(0, -1) - .map((s) => '"' + s.name.value + '"') - .join(', '); - - context.reportError( - new GraphQLError( - `Cannot spread fragment "${spreadName}" within itself` + - (viaPath !== '' ? ` via ${viaPath}.` : '.'), - cyclePath, - ), - ); - } - spreadPath.pop(); - } - - spreadPathIndexByName[fragmentName] = undefined; - } -} diff --git a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs b/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs deleted file mode 100644 index 8d7618e..0000000 --- a/JS/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs +++ /dev/null @@ -1,62 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -export function NoFragmentCyclesRule(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; - - for (var _i2 = 0; _i2 < spreadNodes.length; _i2++) { - var spreadNode = spreadNodes[_i2]; - 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 viaPath = cyclePath.slice(0, -1).map(function (s) { - return '"' + s.name.value + '"'; - }).join(', '); - context.reportError(new GraphQLError("Cannot spread fragment \"".concat(spreadName, "\" within itself") + (viaPath !== '' ? " via ".concat(viaPath, ".") : '.'), cyclePath)); - } - - spreadPath.pop(); - } - - spreadPathIndexByName[fragmentName] = undefined; - } -} diff --git a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts b/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts deleted file mode 100644 index d1a0806..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 NoUndefinedVariablesRule( - context: ValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js b/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js deleted file mode 100644 index d3371ec..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoUndefinedVariablesRule = NoUndefinedVariablesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * 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 NoUndefinedVariablesRule(context) { - var variableNameDefined = Object.create(null); - return { - OperationDefinition: { - enter: function enter() { - variableNameDefined = Object.create(null); - }, - leave: function leave(operation) { - var usages = context.getRecursiveVariableUsages(operation); - - for (var _i2 = 0; _i2 < usages.length; _i2++) { - var _ref2 = usages[_i2]; - var node = _ref2.node; - var varName = node.name.value; - - if (variableNameDefined[varName] !== true) { - context.reportError(new _GraphQLError.GraphQLError(operation.name ? "Variable \"$".concat(varName, "\" is not defined by operation \"").concat(operation.name.value, "\".") : "Variable \"$".concat(varName, "\" is not defined."), [node, operation])); - } - } - } - }, - VariableDefinition: function VariableDefinition(node) { - variableNameDefined[node.variable.name.value] = true; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.flow b/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.flow deleted file mode 100644 index 1773ada..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js.flow +++ /dev/null @@ -1,46 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * 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 NoUndefinedVariablesRule( - 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( - operation.name - ? `Variable "$${varName}" is not defined by operation "${operation.name.value}".` - : `Variable "$${varName}" is not defined.`, - [node, operation], - ), - ); - } - } - }, - }, - VariableDefinition(node) { - variableNameDefined[node.variable.name.value] = true; - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs b/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs deleted file mode 100644 index 004059f..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs +++ /dev/null @@ -1,34 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * 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 NoUndefinedVariablesRule(context) { - var variableNameDefined = Object.create(null); - return { - OperationDefinition: { - enter: function enter() { - variableNameDefined = Object.create(null); - }, - leave: function leave(operation) { - var usages = context.getRecursiveVariableUsages(operation); - - for (var _i2 = 0; _i2 < usages.length; _i2++) { - var _ref2 = usages[_i2]; - var node = _ref2.node; - var varName = node.name.value; - - if (variableNameDefined[varName] !== true) { - context.reportError(new GraphQLError(operation.name ? "Variable \"$".concat(varName, "\" is not defined by operation \"").concat(operation.name.value, "\".") : "Variable \"$".concat(varName, "\" is not defined."), [node, operation])); - } - } - } - }, - VariableDefinition: function VariableDefinition(node) { - variableNameDefined[node.variable.name.value] = true; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts b/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts deleted file mode 100644 index 8435bab..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 NoUnusedFragmentsRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js b/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js deleted file mode 100644 index 2fa3ba2..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoUnusedFragmentsRule = NoUnusedFragmentsRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * 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 NoUnusedFragmentsRule(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 _i2 = 0; _i2 < operationDefs.length; _i2++) { - var operation = operationDefs[_i2]; - - for (var _i4 = 0, _context$getRecursive2 = context.getRecursivelyReferencedFragments(operation); _i4 < _context$getRecursive2.length; _i4++) { - var fragment = _context$getRecursive2[_i4]; - fragmentNameUsed[fragment.name.value] = true; - } - } - - for (var _i6 = 0; _i6 < fragmentDefs.length; _i6++) { - var fragmentDef = fragmentDefs[_i6]; - var fragName = fragmentDef.name.value; - - if (fragmentNameUsed[fragName] !== true) { - context.reportError(new _GraphQLError.GraphQLError("Fragment \"".concat(fragName, "\" is never used."), fragmentDef)); - } - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.flow b/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.flow deleted file mode 100644 index fd5801b..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js.flow +++ /dev/null @@ -1,54 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * 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 NoUnusedFragmentsRule( - 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( - `Fragment "${fragName}" is never used.`, - fragmentDef, - ), - ); - } - } - }, - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs b/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs deleted file mode 100644 index 1f5f816..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * 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 NoUnusedFragmentsRule(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 _i2 = 0; _i2 < operationDefs.length; _i2++) { - var operation = operationDefs[_i2]; - - for (var _i4 = 0, _context$getRecursive2 = context.getRecursivelyReferencedFragments(operation); _i4 < _context$getRecursive2.length; _i4++) { - var fragment = _context$getRecursive2[_i4]; - fragmentNameUsed[fragment.name.value] = true; - } - } - - for (var _i6 = 0; _i6 < fragmentDefs.length; _i6++) { - var fragmentDef = fragmentDefs[_i6]; - var fragName = fragmentDef.name.value; - - if (fragmentNameUsed[fragName] !== true) { - context.reportError(new GraphQLError("Fragment \"".concat(fragName, "\" is never used."), fragmentDef)); - } - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts b/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts deleted file mode 100644 index 351449d..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 NoUnusedVariablesRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js b/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js deleted file mode 100644 index 10fa8c8..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoUnusedVariablesRule = NoUnusedVariablesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * 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 NoUnusedVariablesRule(context) { - var variableDefs = []; - return { - OperationDefinition: { - enter: function enter() { - variableDefs = []; - }, - leave: function leave(operation) { - var variableNameUsed = Object.create(null); - var usages = context.getRecursiveVariableUsages(operation); - - for (var _i2 = 0; _i2 < usages.length; _i2++) { - var _ref2 = usages[_i2]; - var node = _ref2.node; - variableNameUsed[node.name.value] = true; - } - - for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) { - var variableDef = _variableDefs2[_i4]; - var variableName = variableDef.variable.name.value; - - if (variableNameUsed[variableName] !== true) { - context.reportError(new _GraphQLError.GraphQLError(operation.name ? "Variable \"$".concat(variableName, "\" is never used in operation \"").concat(operation.name.value, "\".") : "Variable \"$".concat(variableName, "\" is never used."), variableDef)); - } - } - } - }, - VariableDefinition: function VariableDefinition(def) { - variableDefs.push(def); - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.flow b/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.flow deleted file mode 100644 index ed284c8..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js.flow +++ /dev/null @@ -1,49 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * 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 NoUnusedVariablesRule(context: ValidationContext): ASTVisitor { - let variableDefs = []; - - return { - OperationDefinition: { - enter() { - variableDefs = []; - }, - leave(operation) { - const variableNameUsed = Object.create(null); - const usages = context.getRecursiveVariableUsages(operation); - - 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( - operation.name - ? `Variable "$${variableName}" is never used in operation "${operation.name.value}".` - : `Variable "$${variableName}" is never used.`, - variableDef, - ), - ); - } - } - }, - }, - VariableDefinition(def) { - variableDefs.push(def); - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs b/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs deleted file mode 100644 index df62472..0000000 --- a/JS/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs +++ /dev/null @@ -1,40 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * 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 NoUnusedVariablesRule(context) { - var variableDefs = []; - return { - OperationDefinition: { - enter: function enter() { - variableDefs = []; - }, - leave: function leave(operation) { - var variableNameUsed = Object.create(null); - var usages = context.getRecursiveVariableUsages(operation); - - for (var _i2 = 0; _i2 < usages.length; _i2++) { - var _ref2 = usages[_i2]; - var node = _ref2.node; - variableNameUsed[node.name.value] = true; - } - - for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) { - var variableDef = _variableDefs2[_i4]; - var variableName = variableDef.variable.name.value; - - if (variableNameUsed[variableName] !== true) { - context.reportError(new GraphQLError(operation.name ? "Variable \"$".concat(variableName, "\" is never used in operation \"").concat(operation.name.value, "\".") : "Variable \"$".concat(variableName, "\" is never used."), variableDef)); - } - } - } - }, - VariableDefinition: function VariableDefinition(def) { - variableDefs.push(def); - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts b/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts deleted file mode 100644 index c1671c2..0000000 --- a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 OverlappingFieldsCanBeMergedRule( - context: ValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js b/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js deleted file mode 100644 index 3fd1813..0000000 --- a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +++ /dev/null @@ -1,584 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.OverlappingFieldsCanBeMergedRule = OverlappingFieldsCanBeMergedRule; - -var _find = _interopRequireDefault(require("../../polyfills/find.js")); - -var _objectEntries3 = _interopRequireDefault(require("../../polyfills/objectEntries.js")); - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _printer = require("../../language/printer.js"); - -var _definition = require("../../type/definition.js"); - -var _typeFromAST = require("../../utilities/typeFromAST.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 ") + 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 OverlappingFieldsCanBeMergedRule(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 _i2 = 0; _i2 < conflicts.length; _i2++) { - var _ref3 = conflicts[_i2]; - var _ref2$ = _ref3[0]; - var responseName = _ref2$[0]; - var reason = _ref2$[1]; - var fields1 = _ref3[1]; - var fields2 = _ref3[2]; - var reasonMsg = reasonMessage(reason); - context.reportError(new _GraphQLError.GraphQLError("Fields \"".concat(responseName, "\" conflict because ").concat(reasonMsg, ". Use different aliases on the fields to fetch both if this was intentional."), 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. - for (var i = 0; i < fragmentNames.length; i++) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, 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, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { - 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, 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) { - for (var j = 0; j < fragmentNames2.length; j++) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, 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) { - for (var i = 0; i < fragmentNames1.length; i++) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, 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 _i3 = 0; _i3 < fragmentNames1.length; _i3++) { - for (var _j = 0; _j < fragmentNames2.length; _j++) { - collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[_i3], 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. - for (var _i5 = 0, _objectEntries2 = (0, _objectEntries3.default)(fieldMap); _i5 < _objectEntries2.length; _i5++) { - var _ref5 = _objectEntries2[_i5]; - 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); - } - } - } - } - } -} // 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 _i7 = 0, _Object$keys2 = Object.keys(fieldMap1); _i7 < _Object$keys2.length; _i7++) { - var responseName = _Object$keys2[_i7]; - 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); - - if (!areMutuallyExclusive) { - var _node1$arguments, _node2$arguments; - - // 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]]; - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var args1 = (_node1$arguments = node1.arguments) !== null && _node1$arguments !== void 0 ? _node1$arguments : []; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - var args2 = (_node2$arguments = node2.arguments) !== null && _node2$arguments !== void 0 ? _node2$arguments : []; // Two field calls must have the same arguments. - - if (!sameArguments(args1, args2)) { - return [[responseName, 'they have differing arguments'], [node1], [node2]]; - } - } // The return type for each field. - - - var type1 = def1 === null || def1 === void 0 ? void 0 : def1.type; - var type2 = def2 === null || def2 === void 0 ? void 0 : def2.type; - - 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 (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 _i9 = 0, _selectionSet$selecti2 = selectionSet.selections; _i9 < _selectionSet$selecti2.length; _i9++) { - var selection = _selectionSet$selecti2[_i9]; - - 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) { - this._pairSetAdd(a, b, areMutuallyExclusive); - - this._pairSetAdd(b, a, areMutuallyExclusive); - }; - - _proto._pairSetAdd = function _pairSetAdd(a, b, areMutuallyExclusive) { - var map = this._data[a]; - - if (!map) { - map = Object.create(null); - this._data[a] = map; - } - - map[b] = areMutuallyExclusive; - }; - - return PairSet; -}(); diff --git a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.flow b/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.flow deleted file mode 100644 index eea7e45..0000000 --- a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js.flow +++ /dev/null @@ -1,833 +0,0 @@ -// @flow strict -import find from '../../polyfills/find'; -import objectEntries from '../../polyfills/objectEntries'; - -import type { ObjMap } from '../../jsutils/ObjMap'; -import inspect from '../../jsutils/inspect'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { - SelectionSetNode, - ValueNode, - FieldNode, - ArgumentNode, - FragmentDefinitionNode, -} from '../../language/ast'; -import { Kind } from '../../language/kinds'; -import { print } from '../../language/printer'; - -import type { - GraphQLNamedType, - GraphQLOutputType, - GraphQLCompositeType, - GraphQLField, -} from '../../type/definition'; -import { - getNamedType, - isNonNullType, - isLeafType, - isObjectType, - isListType, - isInterfaceType, -} from '../../type/definition'; - -import { typeFromAST } from '../../utilities/typeFromAST'; - -import type { ValidationContext } from '../ValidationContext'; - -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 OverlappingFieldsCanBeMergedRule( - 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) { - const reasonMsg = reasonMessage(reason); - context.reportError( - new GraphQLError( - `Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, - 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. - for (let i = 0; i < fragmentNames.length; i++) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - 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, - comparedFragmentPairs: PairSet, - areMutuallyExclusive: boolean, - fieldMap: NodeAndDefCollection, - fragmentName: string, -): void { - 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, - 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) { - for (let j = 0; j < fragmentNames2.length; j++) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - 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) { - for (let i = 0; i < fragmentNames1.length; i++) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - 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)); - - 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], - ]; - } - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const args1 = node1.arguments ?? []; - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const args2 = node2.arguments ?? []; - // Two field calls must have the same arguments. - if (!sameArguments(args1, args2)) { - return [ - [responseName, 'they have differing arguments'], - [node1], - [node2], - ]; - } - } - - // The return type for each field. - const type1 = def1?.type; - const type2 = def2?.type; - - 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: ValueNode, value2: ValueNode): boolean { - return 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 (const selection of selectionSet.selections) { - 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() { - this._data = Object.create(null); - } - - has(a: string, b: string, areMutuallyExclusive: boolean): 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): void { - this._pairSetAdd(a, b, areMutuallyExclusive); - this._pairSetAdd(b, a, areMutuallyExclusive); - } - - _pairSetAdd(a: string, b: string, areMutuallyExclusive: boolean): void { - let map = this._data[a]; - if (!map) { - map = Object.create(null); - this._data[a] = map; - } - map[b] = areMutuallyExclusive; - } -} diff --git a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs b/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs deleted file mode 100644 index afc5243..0000000 --- a/JS/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +++ /dev/null @@ -1,568 +0,0 @@ -import find from "../../polyfills/find.mjs"; -import objectEntries from "../../polyfills/objectEntries.mjs"; -import inspect from "../../jsutils/inspect.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { print } from "../../language/printer.mjs"; -import { getNamedType, isNonNullType, isLeafType, isObjectType, isListType, isInterfaceType } from "../../type/definition.mjs"; -import { typeFromAST } from "../../utilities/typeFromAST.mjs"; - -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 ") + 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 OverlappingFieldsCanBeMergedRule(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 _i2 = 0; _i2 < conflicts.length; _i2++) { - var _ref3 = conflicts[_i2]; - var _ref2$ = _ref3[0]; - var responseName = _ref2$[0]; - var reason = _ref2$[1]; - var fields1 = _ref3[1]; - var fields2 = _ref3[2]; - var reasonMsg = reasonMessage(reason); - context.reportError(new GraphQLError("Fields \"".concat(responseName, "\" conflict because ").concat(reasonMsg, ". Use different aliases on the fields to fetch both if this was intentional."), 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. - for (var i = 0; i < fragmentNames.length; i++) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, 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, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { - 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, 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) { - for (var j = 0; j < fragmentNames2.length; j++) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, 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) { - for (var i = 0; i < fragmentNames1.length; i++) { - collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, 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 _i3 = 0; _i3 < fragmentNames1.length; _i3++) { - for (var _j = 0; _j < fragmentNames2.length; _j++) { - collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFragmentPairs, areMutuallyExclusive, fragmentNames1[_i3], 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. - for (var _i5 = 0, _objectEntries2 = objectEntries(fieldMap); _i5 < _objectEntries2.length; _i5++) { - var _ref5 = _objectEntries2[_i5]; - 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); - } - } - } - } - } -} // 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 _i7 = 0, _Object$keys2 = Object.keys(fieldMap1); _i7 < _Object$keys2.length; _i7++) { - var responseName = _Object$keys2[_i7]; - 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); - - if (!areMutuallyExclusive) { - var _node1$arguments, _node2$arguments; - - // 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]]; - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var args1 = (_node1$arguments = node1.arguments) !== null && _node1$arguments !== void 0 ? _node1$arguments : []; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - var args2 = (_node2$arguments = node2.arguments) !== null && _node2$arguments !== void 0 ? _node2$arguments : []; // Two field calls must have the same arguments. - - if (!sameArguments(args1, args2)) { - return [[responseName, 'they have differing arguments'], [node1], [node2]]; - } - } // The return type for each field. - - - var type1 = def1 === null || def1 === void 0 ? void 0 : def1.type; - var type2 = def2 === null || def2 === void 0 ? void 0 : def2.type; - - 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 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 _i9 = 0, _selectionSet$selecti2 = selectionSet.selections; _i9 < _selectionSet$selecti2.length; _i9++) { - var selection = _selectionSet$selecti2[_i9]; - - 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) { - this._pairSetAdd(a, b, areMutuallyExclusive); - - this._pairSetAdd(b, a, areMutuallyExclusive); - }; - - _proto._pairSetAdd = function _pairSetAdd(a, b, areMutuallyExclusive) { - var map = this._data[a]; - - if (!map) { - map = Object.create(null); - this._data[a] = map; - } - - map[b] = areMutuallyExclusive; - }; - - return PairSet; -}(); diff --git a/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts b/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts deleted file mode 100644 index 36f551d..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 PossibleFragmentSpreadsRule( - context: ValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js b/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js deleted file mode 100644 index 427905d..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PossibleFragmentSpreadsRule = PossibleFragmentSpreadsRule; - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _definition = require("../../type/definition.js"); - -var _typeFromAST = require("../../utilities/typeFromAST.js"); - -var _typeComparators = require("../../utilities/typeComparators.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * 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 PossibleFragmentSpreadsRule(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)) { - var parentTypeStr = (0, _inspect.default)(parentType); - var fragTypeStr = (0, _inspect.default)(fragType); - context.reportError(new _GraphQLError.GraphQLError("Fragment cannot be spread here as objects of type \"".concat(parentTypeStr, "\" can never be of type \"").concat(fragTypeStr, "\"."), 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)) { - var parentTypeStr = (0, _inspect.default)(parentType); - var fragTypeStr = (0, _inspect.default)(fragType); - context.reportError(new _GraphQLError.GraphQLError("Fragment \"".concat(fragName, "\" cannot be spread here as objects of type \"").concat(parentTypeStr, "\" can never be of type \"").concat(fragTypeStr, "\"."), 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/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.flow b/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.flow deleted file mode 100644 index 9c275bb..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js.flow +++ /dev/null @@ -1,78 +0,0 @@ -// @flow strict -import inspect from '../../jsutils/inspect'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { GraphQLCompositeType } from '../../type/definition'; -import { isCompositeType } from '../../type/definition'; - -import { typeFromAST } from '../../utilities/typeFromAST'; -import { doTypesOverlap } from '../../utilities/typeComparators'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * 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 PossibleFragmentSpreadsRule( - context: ValidationContext, -): ASTVisitor { - return { - InlineFragment(node) { - const fragType = context.getType(); - const parentType = context.getParentType(); - if ( - isCompositeType(fragType) && - isCompositeType(parentType) && - !doTypesOverlap(context.getSchema(), fragType, parentType) - ) { - const parentTypeStr = inspect(parentType); - const fragTypeStr = inspect(fragType); - context.reportError( - new GraphQLError( - `Fragment cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, - 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) - ) { - const parentTypeStr = inspect(parentType); - const fragTypeStr = inspect(fragType); - context.reportError( - new GraphQLError( - `Fragment "${fragName}" cannot be spread here as objects of type "${parentTypeStr}" can never be of type "${fragTypeStr}".`, - node, - ), - ); - } - }, - }; -} - -function getFragmentType( - context: ValidationContext, - name: string, -): ?GraphQLCompositeType { - const frag = context.getFragment(name); - if (frag) { - const type = typeFromAST(context.getSchema(), frag.typeCondition); - if (isCompositeType(type)) { - return type; - } - } -} diff --git a/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs b/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs deleted file mode 100644 index da45925..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import inspect from "../../jsutils/inspect.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { isCompositeType } from "../../type/definition.mjs"; -import { typeFromAST } from "../../utilities/typeFromAST.mjs"; -import { doTypesOverlap } from "../../utilities/typeComparators.mjs"; - -/** - * 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 PossibleFragmentSpreadsRule(context) { - return { - InlineFragment: function InlineFragment(node) { - var fragType = context.getType(); - var parentType = context.getParentType(); - - if (isCompositeType(fragType) && isCompositeType(parentType) && !doTypesOverlap(context.getSchema(), fragType, parentType)) { - var parentTypeStr = inspect(parentType); - var fragTypeStr = inspect(fragType); - context.reportError(new GraphQLError("Fragment cannot be spread here as objects of type \"".concat(parentTypeStr, "\" can never be of type \"").concat(fragTypeStr, "\"."), 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)) { - var parentTypeStr = inspect(parentType); - var fragTypeStr = inspect(fragType); - context.reportError(new GraphQLError("Fragment \"".concat(fragName, "\" cannot be spread here as objects of type \"").concat(parentTypeStr, "\" can never be of type \"").concat(fragTypeStr, "\"."), 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/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.d.ts b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.d.ts deleted file mode 100644 index 7573375..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { PossibleTypeExtensionsRule } from 'graphql' - * or - * import { PossibleTypeExtensionsRule } from 'graphql/validation' - */ -export { PossibleTypeExtensionsRule as PossibleTypeExtensions } from './PossibleTypeExtensionsRule'; diff --git a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.js b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.js deleted file mode 100644 index fc15d85..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "PossibleTypeExtensions", { - enumerable: true, - get: function get() { - return _PossibleTypeExtensionsRule.PossibleTypeExtensionsRule; - } -}); - -var _PossibleTypeExtensionsRule = require("./PossibleTypeExtensionsRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.js.flow b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.js.flow deleted file mode 100644 index ed223f1..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { PossibleTypeExtensionsRule } from 'graphql' - * or - * import { PossibleTypeExtensionsRule } from 'graphql/validation' - */ -export { PossibleTypeExtensionsRule as PossibleTypeExtensions } from './PossibleTypeExtensionsRule'; diff --git a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.mjs b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.mjs deleted file mode 100644 index 99796c8..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensions.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { PossibleTypeExtensionsRule } from 'graphql' - * or - * import { PossibleTypeExtensionsRule } from 'graphql/validation' - */ -export { PossibleTypeExtensionsRule as PossibleTypeExtensions } from "./PossibleTypeExtensionsRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts deleted file mode 100644 index 8337dc5..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { SDLValidationContext } from '../ValidationContext'; - -/** - * Possible type extension - * - * A type extension is only valid if the type is defined and has the same kind. - */ -export function PossibleTypeExtensionsRule( - context: SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js deleted file mode 100644 index 309b12b..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js +++ /dev/null @@ -1,141 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PossibleTypeExtensionsRule = PossibleTypeExtensionsRule; - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _invariant = _interopRequireDefault(require("../../jsutils/invariant.js")); - -var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean.js")); - -var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _predicates = require("../../language/predicates.js"); - -var _definition = require("../../type/definition.js"); - -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; } - -/** - * Possible type extension - * - * A type extension is only valid if the type is defined and has the same kind. - */ -function PossibleTypeExtensionsRule(context) { - var schema = context.getSchema(); - var definedTypes = Object.create(null); - - for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) { - var def = _context$getDocument$2[_i2]; - - if ((0, _predicates.isTypeDefinitionNode)(def)) { - definedTypes[def.name.value] = def; - } - } - - 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 === null || schema === void 0 ? void 0 : schema.getType(typeName); - var expectedKind; - - if (defNode) { - expectedKind = defKindToExtKind[defNode.kind]; - } else if (existingType) { - expectedKind = typeToExtKind(existingType); - } - - if (expectedKind) { - if (expectedKind !== node.kind) { - var kindStr = extensionKindToTypeName(node.kind); - context.reportError(new _GraphQLError.GraphQLError("Cannot extend non-".concat(kindStr, " type \"").concat(typeName, "\"."), defNode ? [defNode, node] : 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("Cannot extend type \"".concat(typeName, "\" because it is not defined.") + (0, _didYouMean.default)(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; - } - - if ((0, _definition.isObjectType)(type)) { - return _kinds.Kind.OBJECT_TYPE_EXTENSION; - } - - if ((0, _definition.isInterfaceType)(type)) { - return _kinds.Kind.INTERFACE_TYPE_EXTENSION; - } - - if ((0, _definition.isUnionType)(type)) { - return _kinds.Kind.UNION_TYPE_EXTENSION; - } - - if ((0, _definition.isEnumType)(type)) { - return _kinds.Kind.ENUM_TYPE_EXTENSION; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if ((0, _definition.isInputObjectType)(type)) { - return _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected type: ' + (0, _inspect.default)(type)); -} - -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'; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || (0, _invariant.default)(0, 'Unexpected kind: ' + (0, _inspect.default)(kind)); -} diff --git a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.flow b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.flow deleted file mode 100644 index 15ec1b4..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js.flow +++ /dev/null @@ -1,145 +0,0 @@ -// @flow strict -import inspect from '../../jsutils/inspect'; -import invariant from '../../jsutils/invariant'; -import didYouMean from '../../jsutils/didYouMean'; -import suggestionList from '../../jsutils/suggestionList'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { KindEnum } from '../../language/kinds'; -import type { ASTVisitor } from '../../language/visitor'; -import type { TypeExtensionNode } from '../../language/ast'; -import { Kind } from '../../language/kinds'; -import { isTypeDefinitionNode } from '../../language/predicates'; - -import type { GraphQLNamedType } from '../../type/definition'; -import { - isScalarType, - isObjectType, - isInterfaceType, - isUnionType, - isEnumType, - isInputObjectType, -} from '../../type/definition'; - -import type { SDLValidationContext } from '../ValidationContext'; - -/** - * Possible type extension - * - * A type extension is only valid if the type is defined and has the same kind. - */ -export function PossibleTypeExtensionsRule( - 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: TypeExtensionNode): void { - const typeName = node.name.value; - const defNode = definedTypes[typeName]; - const existingType = schema?.getType(typeName); - - let expectedKind; - if (defNode) { - expectedKind = defKindToExtKind[defNode.kind]; - } else if (existingType) { - expectedKind = typeToExtKind(existingType); - } - - if (expectedKind) { - if (expectedKind !== node.kind) { - const kindStr = extensionKindToTypeName(node.kind); - context.reportError( - new GraphQLError( - `Cannot extend non-${kindStr} type "${typeName}".`, - defNode ? [defNode, node] : 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( - `Cannot extend type "${typeName}" because it is not defined.` + - didYouMean(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: GraphQLNamedType): KindEnum { - if (isScalarType(type)) { - return Kind.SCALAR_TYPE_EXTENSION; - } - if (isObjectType(type)) { - return Kind.OBJECT_TYPE_EXTENSION; - } - if (isInterfaceType(type)) { - return Kind.INTERFACE_TYPE_EXTENSION; - } - if (isUnionType(type)) { - return Kind.UNION_TYPE_EXTENSION; - } - if (isEnumType(type)) { - return Kind.ENUM_TYPE_EXTENSION; - } - // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - if (isInputObjectType(type)) { - return Kind.INPUT_OBJECT_TYPE_EXTENSION; - } - - // istanbul ignore next (Not reachable. All possible types have been considered) - invariant(false, 'Unexpected type: ' + inspect((type: empty))); -} - -function extensionKindToTypeName(kind: KindEnum): string { - 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'; - } - - // istanbul ignore next (Not reachable. All possible types have been considered) - invariant(false, 'Unexpected kind: ' + inspect(kind)); -} diff --git a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs b/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs deleted file mode 100644 index b1066b5..0000000 --- a/JS/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs +++ /dev/null @@ -1,124 +0,0 @@ -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 inspect from "../../jsutils/inspect.mjs"; -import invariant from "../../jsutils/invariant.mjs"; -import didYouMean from "../../jsutils/didYouMean.mjs"; -import suggestionList from "../../jsutils/suggestionList.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { isTypeDefinitionNode } from "../../language/predicates.mjs"; -import { isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType } from "../../type/definition.mjs"; - -/** - * Possible type extension - * - * A type extension is only valid if the type is defined and has the same kind. - */ -export function PossibleTypeExtensionsRule(context) { - var schema = context.getSchema(); - var definedTypes = Object.create(null); - - for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) { - var def = _context$getDocument$2[_i2]; - - if (isTypeDefinitionNode(def)) { - definedTypes[def.name.value] = def; - } - } - - 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 === null || schema === void 0 ? void 0 : schema.getType(typeName); - var expectedKind; - - if (defNode) { - expectedKind = defKindToExtKind[defNode.kind]; - } else if (existingType) { - expectedKind = typeToExtKind(existingType); - } - - if (expectedKind) { - if (expectedKind !== node.kind) { - var kindStr = extensionKindToTypeName(node.kind); - context.reportError(new GraphQLError("Cannot extend non-".concat(kindStr, " type \"").concat(typeName, "\"."), defNode ? [defNode, node] : 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("Cannot extend type \"".concat(typeName, "\" because it is not defined.") + didYouMean(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; - } - - if (isObjectType(type)) { - return Kind.OBJECT_TYPE_EXTENSION; - } - - if (isInterfaceType(type)) { - return Kind.INTERFACE_TYPE_EXTENSION; - } - - if (isUnionType(type)) { - return Kind.UNION_TYPE_EXTENSION; - } - - if (isEnumType(type)) { - return Kind.ENUM_TYPE_EXTENSION; - } // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2618') - - - if (isInputObjectType(type)) { - return Kind.INPUT_OBJECT_TYPE_EXTENSION; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || invariant(0, 'Unexpected type: ' + inspect(type)); -} - -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'; - } // istanbul ignore next (Not reachable. All possible types have been considered) - - - false || invariant(0, 'Unexpected kind: ' + inspect(kind)); -} diff --git a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts b/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts deleted file mode 100644 index 116069c..0000000 --- a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext, SDLValidationContext } from '../ValidationContext'; - -/** - * 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 ProvidedRequiredArgumentsRule( - context: ValidationContext, -): ASTVisitor; - -/** - * @internal - */ -export function ProvidedRequiredArgumentsOnDirectivesRule( - context: ValidationContext | SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js b/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js deleted file mode 100644 index b4735cf..0000000 --- a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ProvidedRequiredArgumentsRule = ProvidedRequiredArgumentsRule; -exports.ProvidedRequiredArgumentsOnDirectivesRule = ProvidedRequiredArgumentsOnDirectivesRule; - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _keyMap = _interopRequireDefault(require("../../jsutils/keyMap.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _printer = require("../../language/printer.js"); - -var _directives = require("../../type/directives.js"); - -var _definition = require("../../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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; } - -/** - * 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 ProvidedRequiredArgumentsRule(context) { - return _objectSpread(_objectSpread({}, ProvidedRequiredArgumentsOnDirectivesRule(context)), {}, { - Field: { - // Validate on leave to allow for deeper errors to appear first. - leave: function leave(fieldNode) { - var _fieldNode$arguments; - - var fieldDef = context.getFieldDef(); - - if (!fieldDef) { - return false; - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var argNodes = (_fieldNode$arguments = fieldNode.arguments) !== null && _fieldNode$arguments !== void 0 ? _fieldNode$arguments : []; - var argNodeMap = (0, _keyMap.default)(argNodes, function (arg) { - return arg.name.value; - }); - - for (var _i2 = 0, _fieldDef$args2 = fieldDef.args; _i2 < _fieldDef$args2.length; _i2++) { - var argDef = _fieldDef$args2[_i2]; - var argNode = argNodeMap[argDef.name]; - - if (!argNode && (0, _definition.isRequiredArgument)(argDef)) { - var argTypeStr = (0, _inspect.default)(argDef.type); - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(fieldDef.name, "\" argument \"").concat(argDef.name, "\" of type \"").concat(argTypeStr, "\" is required, but it was not provided."), fieldNode)); - } - } - } - } - }); -} -/** - * @internal - */ - - -function ProvidedRequiredArgumentsOnDirectivesRule(context) { - var requiredArgsMap = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; - - for (var _i4 = 0; _i4 < definedDirectives.length; _i4++) { - var directive = definedDirectives[_i4]; - requiredArgsMap[directive.name] = (0, _keyMap.default)(directive.args.filter(_definition.isRequiredArgument), function (arg) { - return arg.name; - }); - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i6 = 0; _i6 < astDefinitions.length; _i6++) { - var def = astDefinitions[_i6]; - - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var argNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; - requiredArgsMap[def.name.value] = (0, _keyMap.default)(argNodes.filter(isRequiredArgumentNode), function (arg) { - return arg.name.value; - }); - } - } - - 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 _directiveNode$argume; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var _argNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : []; - - var argNodeMap = (0, _keyMap.default)(_argNodes, function (arg) { - return arg.name.value; - }); - - for (var _i8 = 0, _Object$keys2 = Object.keys(requiredArgs); _i8 < _Object$keys2.length; _i8++) { - var argName = _Object$keys2[_i8]; - - if (!argNodeMap[argName]) { - var argType = requiredArgs[argName].type; - var argTypeStr = (0, _definition.isType)(argType) ? (0, _inspect.default)(argType) : (0, _printer.print)(argType); - context.reportError(new _GraphQLError.GraphQLError("Directive \"@".concat(directiveName, "\" argument \"").concat(argName, "\" of type \"").concat(argTypeStr, "\" is required, but it was not provided."), directiveNode)); - } - } - } - } - } - }; -} - -function isRequiredArgumentNode(arg) { - return arg.type.kind === _kinds.Kind.NON_NULL_TYPE && arg.defaultValue == null; -} diff --git a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.flow b/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.flow deleted file mode 100644 index 11b9b3e..0000000 --- a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js.flow +++ /dev/null @@ -1,125 +0,0 @@ -// @flow strict -import inspect from '../../jsutils/inspect'; -import keyMap from '../../jsutils/keyMap'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { InputValueDefinitionNode } from '../../language/ast'; -import { Kind } from '../../language/kinds'; -import { print } from '../../language/printer'; - -import { specifiedDirectives } from '../../type/directives'; -import { isType, isRequiredArgument } from '../../type/definition'; - -import type { - ValidationContext, - SDLValidationContext, -} from '../ValidationContext'; - -/** - * 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 ProvidedRequiredArgumentsRule( - context: ValidationContext, -): ASTVisitor { - return { - // eslint-disable-next-line new-cap - ...ProvidedRequiredArgumentsOnDirectivesRule(context), - Field: { - // Validate on leave to allow for deeper errors to appear first. - leave(fieldNode) { - const fieldDef = context.getFieldDef(); - if (!fieldDef) { - return false; - } - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - 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)) { - const argTypeStr = inspect(argDef.type); - context.reportError( - new GraphQLError( - `Field "${fieldDef.name}" argument "${argDef.name}" of type "${argTypeStr}" is required, but it was not provided.`, - fieldNode, - ), - ); - } - } - }, - }, - }; -} - -/** - * @internal - */ -export function ProvidedRequiredArgumentsOnDirectivesRule( - 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) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const argNodes = def.arguments ?? []; - - requiredArgsMap[def.name.value] = keyMap( - argNodes.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) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - 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; - const argTypeStr = isType(argType) - ? inspect(argType) - : print(argType); - - context.reportError( - new GraphQLError( - `Directive "@${directiveName}" argument "${argName}" of type "${argTypeStr}" is required, but it was not provided.`, - directiveNode, - ), - ); - } - } - } - }, - }, - }; -} - -function isRequiredArgumentNode(arg: InputValueDefinitionNode): boolean { - return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null; -} diff --git a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs b/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs deleted file mode 100644 index dc476b4..0000000 --- a/JS/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs +++ /dev/null @@ -1,119 +0,0 @@ -function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } - -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(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 inspect from "../../jsutils/inspect.mjs"; -import keyMap from "../../jsutils/keyMap.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { print } from "../../language/printer.mjs"; -import { specifiedDirectives } from "../../type/directives.mjs"; -import { isType, isRequiredArgument } from "../../type/definition.mjs"; - -/** - * 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 ProvidedRequiredArgumentsRule(context) { - return _objectSpread(_objectSpread({}, ProvidedRequiredArgumentsOnDirectivesRule(context)), {}, { - Field: { - // Validate on leave to allow for deeper errors to appear first. - leave: function leave(fieldNode) { - var _fieldNode$arguments; - - var fieldDef = context.getFieldDef(); - - if (!fieldDef) { - return false; - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var argNodes = (_fieldNode$arguments = fieldNode.arguments) !== null && _fieldNode$arguments !== void 0 ? _fieldNode$arguments : []; - var argNodeMap = keyMap(argNodes, function (arg) { - return arg.name.value; - }); - - for (var _i2 = 0, _fieldDef$args2 = fieldDef.args; _i2 < _fieldDef$args2.length; _i2++) { - var argDef = _fieldDef$args2[_i2]; - var argNode = argNodeMap[argDef.name]; - - if (!argNode && isRequiredArgument(argDef)) { - var argTypeStr = inspect(argDef.type); - context.reportError(new GraphQLError("Field \"".concat(fieldDef.name, "\" argument \"").concat(argDef.name, "\" of type \"").concat(argTypeStr, "\" is required, but it was not provided."), fieldNode)); - } - } - } - } - }); -} -/** - * @internal - */ - -export function ProvidedRequiredArgumentsOnDirectivesRule(context) { - var requiredArgsMap = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; - - for (var _i4 = 0; _i4 < definedDirectives.length; _i4++) { - var directive = definedDirectives[_i4]; - requiredArgsMap[directive.name] = keyMap(directive.args.filter(isRequiredArgument), function (arg) { - return arg.name; - }); - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i6 = 0; _i6 < astDefinitions.length; _i6++) { - var def = astDefinitions[_i6]; - - if (def.kind === Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var argNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; - requiredArgsMap[def.name.value] = keyMap(argNodes.filter(isRequiredArgumentNode), function (arg) { - return arg.name.value; - }); - } - } - - 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 _directiveNode$argume; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var _argNodes = (_directiveNode$argume = directiveNode.arguments) !== null && _directiveNode$argume !== void 0 ? _directiveNode$argume : []; - - var argNodeMap = keyMap(_argNodes, function (arg) { - return arg.name.value; - }); - - for (var _i8 = 0, _Object$keys2 = Object.keys(requiredArgs); _i8 < _Object$keys2.length; _i8++) { - var argName = _Object$keys2[_i8]; - - if (!argNodeMap[argName]) { - var argType = requiredArgs[argName].type; - var argTypeStr = isType(argType) ? inspect(argType) : print(argType); - context.reportError(new GraphQLError("Directive \"@".concat(directiveName, "\" argument \"").concat(argName, "\" of type \"").concat(argTypeStr, "\" is required, but it was not provided."), directiveNode)); - } - } - } - } - } - }; -} - -function isRequiredArgumentNode(arg) { - return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null; -} diff --git a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts b/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts deleted file mode 100644 index ae956ef..0000000 --- a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * Scalar leafs - * - * A GraphQL document is valid only if all leaf fields (fields without - * sub selections) are of scalar or enum types. - */ -export function ScalarLeafsRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.js b/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.js deleted file mode 100644 index fc1d5de..0000000 --- a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ScalarLeafsRule = ScalarLeafsRule; - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _definition = require("../../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Scalar leafs - * - * A GraphQL document is valid only if all leaf fields (fields without - * sub selections) are of scalar or enum types. - */ -function ScalarLeafsRule(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) { - var fieldName = node.name.value; - var typeStr = (0, _inspect.default)(type); - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(fieldName, "\" must not have a selection since type \"").concat(typeStr, "\" has no subfields."), selectionSet)); - } - } else if (!selectionSet) { - var _fieldName = node.name.value; - - var _typeStr = (0, _inspect.default)(type); - - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(_fieldName, "\" of type \"").concat(_typeStr, "\" must have a selection of subfields. Did you mean \"").concat(_fieldName, " { ... }\"?"), node)); - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.js.flow b/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.js.flow deleted file mode 100644 index cac22c5..0000000 --- a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.js.flow +++ /dev/null @@ -1,49 +0,0 @@ -// @flow strict -import inspect from '../../jsutils/inspect'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { FieldNode } from '../../language/ast'; -import type { ASTVisitor } from '../../language/visitor'; - -import { getNamedType, isLeafType } from '../../type/definition'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * Scalar leafs - * - * A GraphQL document is valid only if all leaf fields (fields without - * sub selections) are of scalar or enum types. - */ -export function ScalarLeafsRule(context: ValidationContext): ASTVisitor { - return { - Field(node: FieldNode) { - const type = context.getType(); - const selectionSet = node.selectionSet; - if (type) { - if (isLeafType(getNamedType(type))) { - if (selectionSet) { - const fieldName = node.name.value; - const typeStr = inspect(type); - context.reportError( - new GraphQLError( - `Field "${fieldName}" must not have a selection since type "${typeStr}" has no subfields.`, - selectionSet, - ), - ); - } - } else if (!selectionSet) { - const fieldName = node.name.value; - const typeStr = inspect(type); - context.reportError( - new GraphQLError( - `Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, - node, - ), - ); - } - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs b/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs deleted file mode 100644 index 8a5111d..0000000 --- a/JS/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs +++ /dev/null @@ -1,34 +0,0 @@ -import inspect from "../../jsutils/inspect.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { getNamedType, isLeafType } from "../../type/definition.mjs"; - -/** - * Scalar leafs - * - * A GraphQL document is valid only if all leaf fields (fields without - * sub selections) are of scalar or enum types. - */ -export function ScalarLeafsRule(context) { - return { - Field: function Field(node) { - var type = context.getType(); - var selectionSet = node.selectionSet; - - if (type) { - if (isLeafType(getNamedType(type))) { - if (selectionSet) { - var fieldName = node.name.value; - var typeStr = inspect(type); - context.reportError(new GraphQLError("Field \"".concat(fieldName, "\" must not have a selection since type \"").concat(typeStr, "\" has no subfields."), selectionSet)); - } - } else if (!selectionSet) { - var _fieldName = node.name.value; - - var _typeStr = inspect(type); - - context.reportError(new GraphQLError("Field \"".concat(_fieldName, "\" of type \"").concat(_typeStr, "\" must have a selection of subfields. Did you mean \"").concat(_fieldName, " { ... }\"?"), node)); - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts b/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts deleted file mode 100644 index d56c4fd..0000000 --- a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Subscriptions must only include one field. - * - * A GraphQL subscription is valid only if it contains a single root field. - */ -export function SingleFieldSubscriptionsRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js b/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js deleted file mode 100644 index 80d199f..0000000 --- a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SingleFieldSubscriptionsRule = SingleFieldSubscriptionsRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Subscriptions must only include one field. - * - * A GraphQL subscription is valid only if it contains a single root field. - */ -function SingleFieldSubscriptionsRule(context) { - return { - OperationDefinition: function OperationDefinition(node) { - if (node.operation === 'subscription') { - if (node.selectionSet.selections.length !== 1) { - context.reportError(new _GraphQLError.GraphQLError(node.name ? "Subscription \"".concat(node.name.value, "\" must select only one top level field.") : 'Anonymous Subscription must select only one top level field.', node.selectionSet.selections.slice(1))); - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.flow b/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.flow deleted file mode 100644 index 290432f..0000000 --- a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js.flow +++ /dev/null @@ -1,33 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { OperationDefinitionNode } from '../../language/ast'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * Subscriptions must only include one field. - * - * A GraphQL subscription is valid only if it contains a single root field. - */ -export function SingleFieldSubscriptionsRule( - context: ASTValidationContext, -): ASTVisitor { - return { - OperationDefinition(node: OperationDefinitionNode) { - if (node.operation === 'subscription') { - if (node.selectionSet.selections.length !== 1) { - context.reportError( - new GraphQLError( - node.name - ? `Subscription "${node.name.value}" must select only one top level field.` - : 'Anonymous Subscription must select only one top level field.', - node.selectionSet.selections.slice(1), - ), - ); - } - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs b/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs deleted file mode 100644 index 0dd5351..0000000 --- a/JS/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs +++ /dev/null @@ -1,18 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Subscriptions must only include one field. - * - * A GraphQL subscription is valid only if it contains a single root field. - */ -export function SingleFieldSubscriptionsRule(context) { - return { - OperationDefinition: function OperationDefinition(node) { - if (node.operation === 'subscription') { - if (node.selectionSet.selections.length !== 1) { - context.reportError(new GraphQLError(node.name ? "Subscription \"".concat(node.name.value, "\" must select only one top level field.") : 'Anonymous Subscription must select only one top level field.', node.selectionSet.selections.slice(1))); - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts deleted file mode 100644 index 1d0d4f4..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique argument names - * - * A GraphQL field or directive is only valid if all supplied arguments are - * uniquely named. - */ -export function UniqueArgumentNamesRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js deleted file mode 100644 index f3fe599..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueArgumentNamesRule = UniqueArgumentNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique argument names - * - * A GraphQL field or directive is only valid if all supplied arguments are - * uniquely named. - */ -function UniqueArgumentNamesRule(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("There can be only one argument named \"".concat(argName, "\"."), [knownArgNames[argName], node.name])); - } else { - knownArgNames[argName] = node.name; - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.flow deleted file mode 100644 index 499e6ed..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js.flow +++ /dev/null @@ -1,39 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; -import type { ASTVisitor } from '../../language/visitor'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique argument names - * - * A GraphQL field or directive is only valid if all supplied arguments are - * uniquely named. - */ -export function UniqueArgumentNamesRule( - 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( - `There can be only one argument named "${argName}".`, - [knownArgNames[argName], node.name], - ), - ); - } else { - knownArgNames[argName] = node.name; - } - return false; - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs deleted file mode 100644 index 5359d08..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs +++ /dev/null @@ -1,30 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique argument names - * - * A GraphQL field or directive is only valid if all supplied arguments are - * uniquely named. - */ -export function UniqueArgumentNamesRule(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("There can be only one argument named \"".concat(argName, "\"."), [knownArgNames[argName], node.name])); - } else { - knownArgNames[argName] = node.name; - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.d.ts b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.d.ts deleted file mode 100644 index c197e87..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueDirectiveNamesRule } from 'graphql' - * or - * import { UniqueDirectiveNamesRule } from 'graphql/validation' - */ -export { UniqueDirectiveNamesRule as UniqueDirectiveNames } from './UniqueDirectiveNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.js b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.js deleted file mode 100644 index 0e94e14..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "UniqueDirectiveNames", { - enumerable: true, - get: function get() { - return _UniqueDirectiveNamesRule.UniqueDirectiveNamesRule; - } -}); - -var _UniqueDirectiveNamesRule = require("./UniqueDirectiveNamesRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.js.flow b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.js.flow deleted file mode 100644 index 0dc4598..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueDirectiveNamesRule } from 'graphql' - * or - * import { UniqueDirectiveNamesRule } from 'graphql/validation' - */ -export { UniqueDirectiveNamesRule as UniqueDirectiveNames } from './UniqueDirectiveNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.mjs b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.mjs deleted file mode 100644 index 24f4e39..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNames.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueDirectiveNamesRule } from 'graphql' - * or - * import { UniqueDirectiveNamesRule } from 'graphql/validation' - */ -export { UniqueDirectiveNamesRule as UniqueDirectiveNames } from "./UniqueDirectiveNamesRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts deleted file mode 100644 index a4dd841..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique directive names - * - * A GraphQL document is only valid if all defined directives have unique names. - */ -export function UniqueDirectiveNamesRule( - context: SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js deleted file mode 100644 index 15731e5..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueDirectiveNamesRule = UniqueDirectiveNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique directive names - * - * A GraphQL document is only valid if all defined directives have unique names. - */ -function UniqueDirectiveNamesRule(context) { - var knownDirectiveNames = Object.create(null); - var schema = context.getSchema(); - return { - DirectiveDefinition: function DirectiveDefinition(node) { - var directiveName = node.name.value; - - if (schema !== null && schema !== void 0 && schema.getDirective(directiveName)) { - context.reportError(new _GraphQLError.GraphQLError("Directive \"@".concat(directiveName, "\" already exists in the schema. It cannot be redefined."), node.name)); - return; - } - - if (knownDirectiveNames[directiveName]) { - context.reportError(new _GraphQLError.GraphQLError("There can be only one directive named \"@".concat(directiveName, "\"."), [knownDirectiveNames[directiveName], node.name])); - } else { - knownDirectiveNames[directiveName] = node.name; - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.flow deleted file mode 100644 index 688a2bb..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js.flow +++ /dev/null @@ -1,46 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; -import type { ASTVisitor } from '../../language/visitor'; - -import type { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique directive names - * - * A GraphQL document is only valid if all defined directives have unique names. - */ -export function UniqueDirectiveNamesRule( - context: SDLValidationContext, -): ASTVisitor { - const knownDirectiveNames = Object.create(null); - const schema = context.getSchema(); - - return { - DirectiveDefinition(node) { - const directiveName = node.name.value; - - if (schema?.getDirective(directiveName)) { - context.reportError( - new GraphQLError( - `Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, - node.name, - ), - ); - return; - } - - if (knownDirectiveNames[directiveName]) { - context.reportError( - new GraphQLError( - `There can be only one directive named "@${directiveName}".`, - [knownDirectiveNames[directiveName], node.name], - ), - ); - } else { - knownDirectiveNames[directiveName] = node.name; - } - - return false; - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs deleted file mode 100644 index 8d0f843..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs +++ /dev/null @@ -1,29 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique directive names - * - * A GraphQL document is only valid if all defined directives have unique names. - */ -export function UniqueDirectiveNamesRule(context) { - var knownDirectiveNames = Object.create(null); - var schema = context.getSchema(); - return { - DirectiveDefinition: function DirectiveDefinition(node) { - var directiveName = node.name.value; - - if (schema !== null && schema !== void 0 && schema.getDirective(directiveName)) { - context.reportError(new GraphQLError("Directive \"@".concat(directiveName, "\" already exists in the schema. It cannot be redefined."), node.name)); - return; - } - - if (knownDirectiveNames[directiveName]) { - context.reportError(new GraphQLError("There can be only one directive named \"@".concat(directiveName, "\"."), [knownDirectiveNames[directiveName], node.name])); - } else { - knownDirectiveNames[directiveName] = node.name; - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts deleted file mode 100644 index d059446..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique directive names per location - * - * A GraphQL document is only valid if all directives at a given location - * are uniquely named. - */ -export function UniqueDirectivesPerLocationRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js b/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js deleted file mode 100644 index 9505a37..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueDirectivesPerLocationRule = UniqueDirectivesPerLocationRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _predicates = require("../../language/predicates.js"); - -var _directives = require("../../type/directives.js"); - -/** - * Unique directive names per location - * - * A GraphQL document is only valid if all non-repeatable directives at - * a given location are uniquely named. - */ -function UniqueDirectivesPerLocationRule(context) { - var uniqueDirectiveMap = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives; - - for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { - var directive = definedDirectives[_i2]; - uniqueDirectiveMap[directive.name] = !directive.isRepeatable; - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { - var def = astDefinitions[_i4]; - - if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) { - uniqueDirectiveMap[def.name.value] = !def.repeatable; - } - } - - var schemaDirectives = Object.create(null); - var typeDirectivesMap = Object.create(null); - 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) { - if (node.directives == null) { - return; - } - - var seenDirectives; - - if (node.kind === _kinds.Kind.SCHEMA_DEFINITION || node.kind === _kinds.Kind.SCHEMA_EXTENSION) { - seenDirectives = schemaDirectives; - } else if ((0, _predicates.isTypeDefinitionNode)(node) || (0, _predicates.isTypeExtensionNode)(node)) { - var typeName = node.name.value; - seenDirectives = typeDirectivesMap[typeName]; - - if (seenDirectives === undefined) { - typeDirectivesMap[typeName] = seenDirectives = Object.create(null); - } - } else { - seenDirectives = Object.create(null); - } - - for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) { - var _directive = _node$directives2[_i6]; - var directiveName = _directive.name.value; - - if (uniqueDirectiveMap[directiveName]) { - if (seenDirectives[directiveName]) { - context.reportError(new _GraphQLError.GraphQLError("The directive \"@".concat(directiveName, "\" can only be used once at this location."), [seenDirectives[directiveName], _directive])); - } else { - seenDirectives[directiveName] = _directive; - } - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.flow deleted file mode 100644 index a753a84..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js.flow +++ /dev/null @@ -1,90 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import { Kind } from '../../language/kinds'; -import type { ASTVisitor } from '../../language/visitor'; -import { - isTypeDefinitionNode, - isTypeExtensionNode, -} from '../../language/predicates'; - -import { specifiedDirectives } from '../../type/directives'; - -import type { - SDLValidationContext, - ValidationContext, -} from '../ValidationContext'; - -/** - * 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 UniqueDirectivesPerLocationRule( - 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; - } - } - - const schemaDirectives = Object.create(null); - const typeDirectivesMap = Object.create(null); - - 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) { - if (node.directives == null) { - return; - } - - let seenDirectives; - if ( - node.kind === Kind.SCHEMA_DEFINITION || - node.kind === Kind.SCHEMA_EXTENSION - ) { - seenDirectives = schemaDirectives; - } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) { - const typeName = node.name.value; - seenDirectives = typeDirectivesMap[typeName]; - if (seenDirectives === undefined) { - typeDirectivesMap[typeName] = seenDirectives = Object.create(null); - } - } else { - seenDirectives = Object.create(null); - } - - for (const directive of node.directives) { - const directiveName = directive.name.value; - - if (uniqueDirectiveMap[directiveName]) { - if (seenDirectives[directiveName]) { - context.reportError( - new GraphQLError( - `The directive "@${directiveName}" can only be used once at this location.`, - [seenDirectives[directiveName], directive], - ), - ); - } else { - seenDirectives[directiveName] = directive; - } - } - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs deleted file mode 100644 index 9a3951a..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +++ /dev/null @@ -1,72 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { isTypeDefinitionNode, isTypeExtensionNode } from "../../language/predicates.mjs"; -import { specifiedDirectives } from "../../type/directives.mjs"; - -/** - * 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 UniqueDirectivesPerLocationRule(context) { - var uniqueDirectiveMap = Object.create(null); - var schema = context.getSchema(); - var definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; - - for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) { - var directive = definedDirectives[_i2]; - uniqueDirectiveMap[directive.name] = !directive.isRepeatable; - } - - var astDefinitions = context.getDocument().definitions; - - for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) { - var def = astDefinitions[_i4]; - - if (def.kind === Kind.DIRECTIVE_DEFINITION) { - uniqueDirectiveMap[def.name.value] = !def.repeatable; - } - } - - var schemaDirectives = Object.create(null); - var typeDirectivesMap = Object.create(null); - 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) { - if (node.directives == null) { - return; - } - - var seenDirectives; - - if (node.kind === Kind.SCHEMA_DEFINITION || node.kind === Kind.SCHEMA_EXTENSION) { - seenDirectives = schemaDirectives; - } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) { - var typeName = node.name.value; - seenDirectives = typeDirectivesMap[typeName]; - - if (seenDirectives === undefined) { - typeDirectivesMap[typeName] = seenDirectives = Object.create(null); - } - } else { - seenDirectives = Object.create(null); - } - - for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) { - var _directive = _node$directives2[_i6]; - var directiveName = _directive.name.value; - - if (uniqueDirectiveMap[directiveName]) { - if (seenDirectives[directiveName]) { - context.reportError(new GraphQLError("The directive \"@".concat(directiveName, "\" can only be used once at this location."), [seenDirectives[directiveName], _directive])); - } else { - seenDirectives[directiveName] = _directive; - } - } - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.d.ts b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.d.ts deleted file mode 100644 index 96d9b78..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueEnumValueNamesRule } from 'graphql' - * or - * import { UniqueEnumValueNamesRule } from 'graphql/validation' - */ -export { UniqueEnumValueNamesRule as UniqueEnumValueNames } from './UniqueEnumValueNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.js b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.js deleted file mode 100644 index 4a9b5e5..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "UniqueEnumValueNames", { - enumerable: true, - get: function get() { - return _UniqueEnumValueNamesRule.UniqueEnumValueNamesRule; - } -}); - -var _UniqueEnumValueNamesRule = require("./UniqueEnumValueNamesRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.js.flow b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.js.flow deleted file mode 100644 index 4c67b17..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueEnumValueNamesRule } from 'graphql' - * or - * import { UniqueEnumValueNamesRule } from 'graphql/validation' - */ -export { UniqueEnumValueNamesRule as UniqueEnumValueNames } from './UniqueEnumValueNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.mjs b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.mjs deleted file mode 100644 index 05f361a..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNames.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueEnumValueNamesRule } from 'graphql' - * or - * import { UniqueEnumValueNamesRule } from 'graphql/validation' - */ -export { UniqueEnumValueNamesRule as UniqueEnumValueNames } from "./UniqueEnumValueNamesRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts deleted file mode 100644 index 9c5ff50..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique enum value names - * - * A GraphQL enum type is only valid if all its values are uniquely named. - */ -export function UniqueEnumValueNamesRule( - context: SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js deleted file mode 100644 index 1fed87a..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueEnumValueNamesRule = UniqueEnumValueNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _definition = require("../../type/definition.js"); - -/** - * Unique enum value names - * - * A GraphQL enum type is only valid if all its values are uniquely named. - */ -function UniqueEnumValueNamesRule(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 _node$values; - - var typeName = node.name.value; - - if (!knownValueNames[typeName]) { - knownValueNames[typeName] = Object.create(null); - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var valueNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; - var valueNames = knownValueNames[typeName]; - - for (var _i2 = 0; _i2 < valueNodes.length; _i2++) { - var valueDef = valueNodes[_i2]; - var valueName = valueDef.name.value; - var existingType = existingTypeMap[typeName]; - - if ((0, _definition.isEnumType)(existingType) && existingType.getValue(valueName)) { - context.reportError(new _GraphQLError.GraphQLError("Enum value \"".concat(typeName, ".").concat(valueName, "\" already exists in the schema. It cannot also be defined in this type extension."), valueDef.name)); - } else if (valueNames[valueName]) { - context.reportError(new _GraphQLError.GraphQLError("Enum value \"".concat(typeName, ".").concat(valueName, "\" can only be defined once."), [valueNames[valueName], valueDef.name])); - } else { - valueNames[valueName] = valueDef.name; - } - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.flow deleted file mode 100644 index 09515e8..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js.flow +++ /dev/null @@ -1,69 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { - EnumTypeDefinitionNode, - EnumTypeExtensionNode, -} from '../../language/ast'; - -import { isEnumType } from '../../type/definition'; - -import type { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique enum value names - * - * A GraphQL enum type is only valid if all its values are uniquely named. - */ -export function UniqueEnumValueNamesRule( - 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: EnumTypeDefinitionNode | EnumTypeExtensionNode, - ) { - const typeName = node.name.value; - - if (!knownValueNames[typeName]) { - knownValueNames[typeName] = Object.create(null); - } - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const valueNodes = node.values ?? []; - const valueNames = knownValueNames[typeName]; - - for (const valueDef of valueNodes) { - const valueName = valueDef.name.value; - - const existingType = existingTypeMap[typeName]; - if (isEnumType(existingType) && existingType.getValue(valueName)) { - context.reportError( - new GraphQLError( - `Enum value "${typeName}.${valueName}" already exists in the schema. It cannot also be defined in this type extension.`, - valueDef.name, - ), - ); - } else if (valueNames[valueName]) { - context.reportError( - new GraphQLError( - `Enum value "${typeName}.${valueName}" can only be defined once.`, - [valueNames[valueName], valueDef.name], - ), - ); - } else { - valueNames[valueName] = valueDef.name; - } - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs deleted file mode 100644 index 4e821b8..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs +++ /dev/null @@ -1,47 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { isEnumType } from "../../type/definition.mjs"; - -/** - * Unique enum value names - * - * A GraphQL enum type is only valid if all its values are uniquely named. - */ -export function UniqueEnumValueNamesRule(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 _node$values; - - var typeName = node.name.value; - - if (!knownValueNames[typeName]) { - knownValueNames[typeName] = Object.create(null); - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var valueNodes = (_node$values = node.values) !== null && _node$values !== void 0 ? _node$values : []; - var valueNames = knownValueNames[typeName]; - - for (var _i2 = 0; _i2 < valueNodes.length; _i2++) { - var valueDef = valueNodes[_i2]; - var valueName = valueDef.name.value; - var existingType = existingTypeMap[typeName]; - - if (isEnumType(existingType) && existingType.getValue(valueName)) { - context.reportError(new GraphQLError("Enum value \"".concat(typeName, ".").concat(valueName, "\" already exists in the schema. It cannot also be defined in this type extension."), valueDef.name)); - } else if (valueNames[valueName]) { - context.reportError(new GraphQLError("Enum value \"".concat(typeName, ".").concat(valueName, "\" can only be defined once."), [valueNames[valueName], valueDef.name])); - } else { - valueNames[valueName] = valueDef.name; - } - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.d.ts b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.d.ts deleted file mode 100644 index 26ebb06..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueFieldDefinitionNamesRule } from 'graphql' - * or - * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation' - */ -export { UniqueFieldDefinitionNamesRule as UniqueFieldDefinitionNames } from './UniqueFieldDefinitionNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js deleted file mode 100644 index 7af0dca..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "UniqueFieldDefinitionNames", { - enumerable: true, - get: function get() { - return _UniqueFieldDefinitionNamesRule.UniqueFieldDefinitionNamesRule; - } -}); - -var _UniqueFieldDefinitionNamesRule = require("./UniqueFieldDefinitionNamesRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js.flow b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js.flow deleted file mode 100644 index dc54877..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueFieldDefinitionNamesRule } from 'graphql' - * or - * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation' - */ -export { UniqueFieldDefinitionNamesRule as UniqueFieldDefinitionNames } from './UniqueFieldDefinitionNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.mjs b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.mjs deleted file mode 100644 index c2a3add..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNames.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueFieldDefinitionNamesRule } from 'graphql' - * or - * import { UniqueFieldDefinitionNamesRule } from 'graphql/validation' - */ -export { UniqueFieldDefinitionNamesRule as UniqueFieldDefinitionNames } from "./UniqueFieldDefinitionNamesRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts deleted file mode 100644 index 6f356ed..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique field definition names - * - * A GraphQL complex type is only valid if all its fields are uniquely named. - */ -export function UniqueFieldDefinitionNamesRule( - context: SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js deleted file mode 100644 index 3cdaa71..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueFieldDefinitionNamesRule = UniqueFieldDefinitionNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _definition = require("../../type/definition.js"); - -/** - * Unique field definition names - * - * A GraphQL complex type is only valid if all its fields are uniquely named. - */ -function UniqueFieldDefinitionNamesRule(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 _node$fields; - - var typeName = node.name.value; - - if (!knownFieldNames[typeName]) { - knownFieldNames[typeName] = Object.create(null); - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var fieldNodes = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; - var fieldNames = knownFieldNames[typeName]; - - for (var _i2 = 0; _i2 < fieldNodes.length; _i2++) { - var fieldDef = fieldNodes[_i2]; - var fieldName = fieldDef.name.value; - - if (hasField(existingTypeMap[typeName], fieldName)) { - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(typeName, ".").concat(fieldName, "\" already exists in the schema. It cannot also be defined in this type extension."), fieldDef.name)); - } else if (fieldNames[fieldName]) { - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(typeName, ".").concat(fieldName, "\" can only be defined once."), [fieldNames[fieldName], fieldDef.name])); - } else { - fieldNames[fieldName] = fieldDef.name; - } - } - - return false; - } -} - -function hasField(type, fieldName) { - if ((0, _definition.isObjectType)(type) || (0, _definition.isInterfaceType)(type) || (0, _definition.isInputObjectType)(type)) { - return type.getFields()[fieldName] != null; - } - - return false; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.flow deleted file mode 100644 index 1193111..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js.flow +++ /dev/null @@ -1,87 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { - NameNode, - FieldDefinitionNode, - InputValueDefinitionNode, -} from '../../language/ast'; - -import type { GraphQLNamedType } from '../../type/definition'; -import { - isObjectType, - isInterfaceType, - isInputObjectType, -} from '../../type/definition'; - -import type { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique field definition names - * - * A GraphQL complex type is only valid if all its fields are uniquely named. - */ -export function UniqueFieldDefinitionNamesRule( - 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: { - +name: NameNode, - +fields?: $ReadOnlyArray, - ... - }) { - const typeName = node.name.value; - - if (!knownFieldNames[typeName]) { - knownFieldNames[typeName] = Object.create(null); - } - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const fieldNodes = node.fields ?? []; - const fieldNames = knownFieldNames[typeName]; - - for (const fieldDef of fieldNodes) { - const fieldName = fieldDef.name.value; - - if (hasField(existingTypeMap[typeName], fieldName)) { - context.reportError( - new GraphQLError( - `Field "${typeName}.${fieldName}" already exists in the schema. It cannot also be defined in this type extension.`, - fieldDef.name, - ), - ); - } else if (fieldNames[fieldName]) { - context.reportError( - new GraphQLError( - `Field "${typeName}.${fieldName}" can only be defined once.`, - [fieldNames[fieldName], fieldDef.name], - ), - ); - } else { - fieldNames[fieldName] = fieldDef.name; - } - } - - return false; - } -} - -function hasField(type: GraphQLNamedType, fieldName: string): boolean { - if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) { - return type.getFields()[fieldName] != null; - } - return false; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs deleted file mode 100644 index 176bb68..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs +++ /dev/null @@ -1,58 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { isObjectType, isInterfaceType, isInputObjectType } from "../../type/definition.mjs"; - -/** - * Unique field definition names - * - * A GraphQL complex type is only valid if all its fields are uniquely named. - */ -export function UniqueFieldDefinitionNamesRule(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 _node$fields; - - var typeName = node.name.value; - - if (!knownFieldNames[typeName]) { - knownFieldNames[typeName] = Object.create(null); - } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - - - var fieldNodes = (_node$fields = node.fields) !== null && _node$fields !== void 0 ? _node$fields : []; - var fieldNames = knownFieldNames[typeName]; - - for (var _i2 = 0; _i2 < fieldNodes.length; _i2++) { - var fieldDef = fieldNodes[_i2]; - var fieldName = fieldDef.name.value; - - if (hasField(existingTypeMap[typeName], fieldName)) { - context.reportError(new GraphQLError("Field \"".concat(typeName, ".").concat(fieldName, "\" already exists in the schema. It cannot also be defined in this type extension."), fieldDef.name)); - } else if (fieldNames[fieldName]) { - context.reportError(new GraphQLError("Field \"".concat(typeName, ".").concat(fieldName, "\" can only be defined once."), [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] != null; - } - - return false; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts deleted file mode 100644 index 6154158..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique fragment names - * - * A GraphQL document is only valid if all defined fragments have unique names. - */ -export function UniqueFragmentNamesRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js deleted file mode 100644 index d03a74e..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueFragmentNamesRule = UniqueFragmentNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique fragment names - * - * A GraphQL document is only valid if all defined fragments have unique names. - */ -function UniqueFragmentNamesRule(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("There can be only one fragment named \"".concat(fragmentName, "\"."), [knownFragmentNames[fragmentName], node.name])); - } else { - knownFragmentNames[fragmentName] = node.name; - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.flow deleted file mode 100644 index cb1b777..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js.flow +++ /dev/null @@ -1,34 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique fragment names - * - * A GraphQL document is only valid if all defined fragments have unique names. - */ -export function UniqueFragmentNamesRule( - 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( - `There can be only one fragment named "${fragmentName}".`, - [knownFragmentNames[fragmentName], node.name], - ), - ); - } else { - knownFragmentNames[fragmentName] = node.name; - } - return false; - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs deleted file mode 100644 index d9b0ef3..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs +++ /dev/null @@ -1,26 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique fragment names - * - * A GraphQL document is only valid if all defined fragments have unique names. - */ -export function UniqueFragmentNamesRule(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("There can be only one fragment named \"".concat(fragmentName, "\"."), [knownFragmentNames[fragmentName], node.name])); - } else { - knownFragmentNames[fragmentName] = node.name; - } - - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts deleted file mode 100644 index c66d65f..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique input field names - * - * A GraphQL input object value is only valid if all supplied fields are - * uniquely named. - */ -export function UniqueInputFieldNamesRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js deleted file mode 100644 index 4a7dfda..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueInputFieldNamesRule = UniqueInputFieldNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique input field names - * - * A GraphQL input object value is only valid if all supplied fields are - * uniquely named. - */ -function UniqueInputFieldNamesRule(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("There can be only one input field named \"".concat(fieldName, "\"."), [knownNames[fieldName], node.name])); - } else { - knownNames[fieldName] = node.name; - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.flow deleted file mode 100644 index e79cd7a..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js.flow +++ /dev/null @@ -1,44 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique input field names - * - * A GraphQL input object value is only valid if all supplied fields are - * uniquely named. - */ -export function UniqueInputFieldNamesRule( - 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( - `There can be only one input field named "${fieldName}".`, - [knownNames[fieldName], node.name], - ), - ); - } else { - knownNames[fieldName] = node.name; - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs deleted file mode 100644 index ae0c884..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique input field names - * - * A GraphQL input object value is only valid if all supplied fields are - * uniquely named. - */ -export function UniqueInputFieldNamesRule(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("There can be only one input field named \"".concat(fieldName, "\"."), [knownNames[fieldName], node.name])); - } else { - knownNames[fieldName] = node.name; - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts deleted file mode 100644 index aa2d06a..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique operation names - * - * A GraphQL document is only valid if all defined operations have unique names. - */ -export function UniqueOperationNamesRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js deleted file mode 100644 index 5c31464..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueOperationNamesRule = UniqueOperationNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique operation names - * - * A GraphQL document is only valid if all defined operations have unique names. - */ -function UniqueOperationNamesRule(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("There can be only one operation named \"".concat(operationName.value, "\"."), [knownOperationNames[operationName.value], operationName])); - } else { - knownOperationNames[operationName.value] = operationName; - } - } - - return false; - }, - FragmentDefinition: function FragmentDefinition() { - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.flow deleted file mode 100644 index 5e6afef..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js.flow +++ /dev/null @@ -1,36 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique operation names - * - * A GraphQL document is only valid if all defined operations have unique names. - */ -export function UniqueOperationNamesRule( - 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( - `There can be only one operation named "${operationName.value}".`, - [knownOperationNames[operationName.value], operationName], - ), - ); - } else { - knownOperationNames[operationName.value] = operationName; - } - } - return false; - }, - FragmentDefinition: () => false, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs deleted file mode 100644 index 28190c5..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique operation names - * - * A GraphQL document is only valid if all defined operations have unique names. - */ -export function UniqueOperationNamesRule(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("There can be only one operation named \"".concat(operationName.value, "\"."), [knownOperationNames[operationName.value], operationName])); - } else { - knownOperationNames[operationName.value] = operationName; - } - } - - return false; - }, - FragmentDefinition: function FragmentDefinition() { - return false; - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.d.ts b/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.d.ts deleted file mode 100644 index 423932d..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueOperationTypesRule } from 'graphql' - * or - * import { UniqueOperationTypesRule } from 'graphql/validation' - */ -export { UniqueOperationTypesRule as UniqueOperationTypes } from './UniqueOperationTypesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.js b/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.js deleted file mode 100644 index 814f2e2..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "UniqueOperationTypes", { - enumerable: true, - get: function get() { - return _UniqueOperationTypesRule.UniqueOperationTypesRule; - } -}); - -var _UniqueOperationTypesRule = require("./UniqueOperationTypesRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.js.flow b/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.js.flow deleted file mode 100644 index 8649852..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueOperationTypesRule } from 'graphql' - * or - * import { UniqueOperationTypesRule } from 'graphql/validation' - */ -export { UniqueOperationTypesRule as UniqueOperationTypes } from './UniqueOperationTypesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.mjs b/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.mjs deleted file mode 100644 index 4cd53b3..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypes.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueOperationTypesRule } from 'graphql' - * or - * import { UniqueOperationTypesRule } from 'graphql/validation' - */ -export { UniqueOperationTypesRule as UniqueOperationTypes } from "./UniqueOperationTypesRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts deleted file mode 100644 index a0d6441..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique operation types - * - * A GraphQL document is only valid if it has only one type per operation. - */ -export function UniqueOperationTypesRule( - context: SDLValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js b/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js deleted file mode 100644 index fa59189..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js +++ /dev/null @@ -1,50 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueOperationTypesRule = UniqueOperationTypesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique operation types - * - * A GraphQL document is only valid if it has only one type per operation. - */ -function UniqueOperationTypesRule(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) { - var _node$operationTypes; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; - - for (var _i2 = 0; _i2 < operationTypesNodes.length; _i2++) { - var operationType = operationTypesNodes[_i2]; - var operation = operationType.operation; - var alreadyDefinedOperationType = definedOperationTypes[operation]; - - if (existingOperationTypes[operation]) { - context.reportError(new _GraphQLError.GraphQLError("Type for ".concat(operation, " already defined in the schema. It cannot be redefined."), operationType)); - } else if (alreadyDefinedOperationType) { - context.reportError(new _GraphQLError.GraphQLError("There can be only one ".concat(operation, " type in schema."), [alreadyDefinedOperationType, operationType])); - } else { - definedOperationTypes[operation] = operationType; - } - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.flow deleted file mode 100644 index 8a9d4bd..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js.flow +++ /dev/null @@ -1,66 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { - SchemaDefinitionNode, - SchemaExtensionNode, -} from '../../language/ast'; - -import type { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique operation types - * - * A GraphQL document is only valid if it has only one type per operation. - */ -export function UniqueOperationTypesRule( - 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: SchemaDefinitionNode | SchemaExtensionNode, - ) { - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - const operationTypesNodes = node.operationTypes ?? []; - - for (const operationType of operationTypesNodes) { - const operation = operationType.operation; - const alreadyDefinedOperationType = definedOperationTypes[operation]; - - if (existingOperationTypes[operation]) { - context.reportError( - new GraphQLError( - `Type for ${operation} already defined in the schema. It cannot be redefined.`, - operationType, - ), - ); - } else if (alreadyDefinedOperationType) { - context.reportError( - new GraphQLError( - `There can be only one ${operation} type in schema.`, - [alreadyDefinedOperationType, operationType], - ), - ); - } else { - definedOperationTypes[operation] = operationType; - } - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs deleted file mode 100644 index e79b684..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs +++ /dev/null @@ -1,43 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique operation types - * - * A GraphQL document is only valid if it has only one type per operation. - */ -export function UniqueOperationTypesRule(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) { - var _node$operationTypes; - - // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2203') - var operationTypesNodes = (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : []; - - for (var _i2 = 0; _i2 < operationTypesNodes.length; _i2++) { - var operationType = operationTypesNodes[_i2]; - var operation = operationType.operation; - var alreadyDefinedOperationType = definedOperationTypes[operation]; - - if (existingOperationTypes[operation]) { - context.reportError(new GraphQLError("Type for ".concat(operation, " already defined in the schema. It cannot be redefined."), operationType)); - } else if (alreadyDefinedOperationType) { - context.reportError(new GraphQLError("There can be only one ".concat(operation, " type in schema."), [alreadyDefinedOperationType, operationType])); - } else { - definedOperationTypes[operation] = operationType; - } - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.d.ts b/JS/node_modules/graphql/validation/rules/UniqueTypeNames.d.ts deleted file mode 100644 index 1740eef..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueTypeNamesRule } from 'graphql' - * or - * import { UniqueTypeNamesRule } from 'graphql/validation' - */ -export { UniqueTypeNamesRule as UniqueTypeNames } from './UniqueTypeNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.js b/JS/node_modules/graphql/validation/rules/UniqueTypeNames.js deleted file mode 100644 index 82e72ce..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "UniqueTypeNames", { - enumerable: true, - get: function get() { - return _UniqueTypeNamesRule.UniqueTypeNamesRule; - } -}); - -var _UniqueTypeNamesRule = require("./UniqueTypeNamesRule.js"); diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.js.flow b/JS/node_modules/graphql/validation/rules/UniqueTypeNames.js.flow deleted file mode 100644 index 2b43e1c..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.js.flow +++ /dev/null @@ -1,9 +0,0 @@ -// @flow strict -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueTypeNamesRule } from 'graphql' - * or - * import { UniqueTypeNamesRule } from 'graphql/validation' - */ -export { UniqueTypeNamesRule as UniqueTypeNames } from './UniqueTypeNamesRule'; diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.mjs b/JS/node_modules/graphql/validation/rules/UniqueTypeNames.mjs deleted file mode 100644 index ea0c5bf..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNames.mjs +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @deprecated and will be removed in v16 - * Please use either: - * import { UniqueTypeNamesRule } from 'graphql' - * or - * import { UniqueTypeNamesRule } from 'graphql/validation' - */ -export { UniqueTypeNamesRule as UniqueTypeNames } from "./UniqueTypeNamesRule.mjs"; diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts deleted file mode 100644 index e2b3759..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique type names - * - * A GraphQL document is only valid if all defined types have unique names. - */ -export function UniqueTypeNamesRule(context: SDLValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js deleted file mode 100644 index afae028..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueTypeNamesRule = UniqueTypeNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique type names - * - * A GraphQL document is only valid if all defined types have unique names. - */ -function UniqueTypeNamesRule(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 !== null && schema !== void 0 && schema.getType(typeName)) { - context.reportError(new _GraphQLError.GraphQLError("Type \"".concat(typeName, "\" already exists in the schema. It cannot also be defined in this type definition."), node.name)); - return; - } - - if (knownTypeNames[typeName]) { - context.reportError(new _GraphQLError.GraphQLError("There can be only one type named \"".concat(typeName, "\"."), [knownTypeNames[typeName], node.name])); - } else { - knownTypeNames[typeName] = node.name; - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.flow deleted file mode 100644 index 3dd0e7c..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js.flow +++ /dev/null @@ -1,53 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { TypeDefinitionNode } from '../../language/ast'; - -import type { SDLValidationContext } from '../ValidationContext'; - -/** - * Unique type names - * - * A GraphQL document is only valid if all defined types have unique names. - */ -export function UniqueTypeNamesRule(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?.getType(typeName)) { - context.reportError( - new GraphQLError( - `Type "${typeName}" already exists in the schema. It cannot also be defined in this type definition.`, - node.name, - ), - ); - return; - } - - if (knownTypeNames[typeName]) { - context.reportError( - new GraphQLError(`There can be only one type named "${typeName}".`, [ - knownTypeNames[typeName], - node.name, - ]), - ); - } else { - knownTypeNames[typeName] = node.name; - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs deleted file mode 100644 index 55d2f95..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs +++ /dev/null @@ -1,36 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique type names - * - * A GraphQL document is only valid if all defined types have unique names. - */ -export function UniqueTypeNamesRule(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 !== null && schema !== void 0 && schema.getType(typeName)) { - context.reportError(new GraphQLError("Type \"".concat(typeName, "\" already exists in the schema. It cannot also be defined in this type definition."), node.name)); - return; - } - - if (knownTypeNames[typeName]) { - context.reportError(new GraphQLError("There can be only one type named \"".concat(typeName, "\"."), [knownTypeNames[typeName], node.name])); - } else { - knownTypeNames[typeName] = node.name; - } - - return false; - } -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts b/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts deleted file mode 100644 index 6f15764..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique variable names - * - * A GraphQL operation is only valid if all its variables are uniquely named. - */ -export function UniqueVariableNamesRule( - context: ASTValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js b/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js deleted file mode 100644 index d6cae4a..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.UniqueVariableNamesRule = UniqueVariableNamesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -/** - * Unique variable names - * - * A GraphQL operation is only valid if all its variables are uniquely named. - */ -function UniqueVariableNamesRule(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("There can be only one variable named \"$".concat(variableName, "\"."), [knownVariableNames[variableName], node.variable.name])); - } else { - knownVariableNames[variableName] = node.variable.name; - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.flow b/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.flow deleted file mode 100644 index 4865dc6..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js.flow +++ /dev/null @@ -1,36 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ASTVisitor } from '../../language/visitor'; -import type { VariableDefinitionNode } from '../../language/ast'; - -import type { ASTValidationContext } from '../ValidationContext'; - -/** - * Unique variable names - * - * A GraphQL operation is only valid if all its variables are uniquely named. - */ -export function UniqueVariableNamesRule( - 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( - `There can be only one variable named "$${variableName}".`, - [knownVariableNames[variableName], node.variable.name], - ), - ); - } else { - knownVariableNames[variableName] = node.variable.name; - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs b/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs deleted file mode 100644 index 3b650a4..0000000 --- a/JS/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; - -/** - * Unique variable names - * - * A GraphQL operation is only valid if all its variables are uniquely named. - */ -export function UniqueVariableNamesRule(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("There can be only one variable named \"$".concat(variableName, "\"."), [knownVariableNames[variableName], node.variable.name])); - } else { - knownVariableNames[variableName] = node.variable.name; - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts b/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts deleted file mode 100644 index 98ff7a7..0000000 --- a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 ValuesOfCorrectTypeRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js b/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js deleted file mode 100644 index d898200..0000000 --- a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +++ /dev/null @@ -1,143 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ValuesOfCorrectTypeRule = ValuesOfCorrectTypeRule; - -var _objectValues3 = _interopRequireDefault(require("../../polyfills/objectValues.js")); - -var _keyMap = _interopRequireDefault(require("../../jsutils/keyMap.js")); - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _didYouMean = _interopRequireDefault(require("../../jsutils/didYouMean.js")); - -var _suggestionList = _interopRequireDefault(require("../../jsutils/suggestionList.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _printer = require("../../language/printer.js"); - -var _definition = require("../../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Value literals of correct type - * - * A GraphQL document is only valid if all value literals are of the type - * expected at their position. - */ -function ValuesOfCorrectTypeRule(context) { - return { - 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)) { - isValidValueNode(context, node); - return false; // Don't traverse further. - } - }, - ObjectValue: function ObjectValue(node) { - var type = (0, _definition.getNamedType)(context.getInputType()); - - if (!(0, _definition.isInputObjectType)(type)) { - isValidValueNode(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; - }); - - for (var _i2 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i2 < _objectValues2.length; _i2++) { - var fieldDef = _objectValues2[_i2]; - var fieldNode = fieldNodeMap[fieldDef.name]; - - if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) { - var typeStr = (0, _inspect.default)(fieldDef.type); - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(type.name, ".").concat(fieldDef.name, "\" of required type \"").concat(typeStr, "\" was not provided."), node)); - } - } - }, - 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("Field \"".concat(node.name.value, "\" is not defined by type \"").concat(parentType.name, "\".") + (0, _didYouMean.default)(suggestions), node)); - } - }, - NullValue: function NullValue(node) { - var type = context.getInputType(); - - if ((0, _definition.isNonNullType)(type)) { - context.reportError(new _GraphQLError.GraphQLError("Expected value of type \"".concat((0, _inspect.default)(type), "\", found ").concat((0, _printer.print)(node), "."), node)); - } - }, - EnumValue: function EnumValue(node) { - return isValidValueNode(context, node); - }, - IntValue: function IntValue(node) { - return isValidValueNode(context, node); - }, - FloatValue: function FloatValue(node) { - return isValidValueNode(context, node); - }, - StringValue: function StringValue(node) { - return isValidValueNode(context, node); - }, - BooleanValue: function BooleanValue(node) { - return isValidValueNode(context, node); - } - }; -} -/** - * Any value literal may be a valid representation of a Scalar, depending on - * that scalar type. - */ - - -function isValidValueNode(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.isLeafType)(type)) { - var typeStr = (0, _inspect.default)(locationType); - context.reportError(new _GraphQLError.GraphQLError("Expected value of type \"".concat(typeStr, "\", found ").concat((0, _printer.print)(node), "."), node)); - return; - } // Scalars and Enums 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 (parseResult === undefined) { - var _typeStr = (0, _inspect.default)(locationType); - - context.reportError(new _GraphQLError.GraphQLError("Expected value of type \"".concat(_typeStr, "\", found ").concat((0, _printer.print)(node), "."), node)); - } - } catch (error) { - var _typeStr2 = (0, _inspect.default)(locationType); - - if (error instanceof _GraphQLError.GraphQLError) { - context.reportError(error); - } else { - context.reportError(new _GraphQLError.GraphQLError("Expected value of type \"".concat(_typeStr2, "\", found ").concat((0, _printer.print)(node), "; ") + error.message, node, undefined, undefined, undefined, error)); - } - } -} diff --git a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.flow b/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.flow deleted file mode 100644 index 09a922c..0000000 --- a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js.flow +++ /dev/null @@ -1,158 +0,0 @@ -// @flow strict -import objectValues from '../../polyfills/objectValues'; - -import keyMap from '../../jsutils/keyMap'; -import inspect from '../../jsutils/inspect'; -import didYouMean from '../../jsutils/didYouMean'; -import suggestionList from '../../jsutils/suggestionList'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import type { ValueNode } from '../../language/ast'; -import type { ASTVisitor } from '../../language/visitor'; -import { print } from '../../language/printer'; - -import { - isLeafType, - isInputObjectType, - isListType, - isNonNullType, - isRequiredInputField, - getNullableType, - getNamedType, -} from '../../type/definition'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * 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 ValuesOfCorrectTypeRule( - context: ValidationContext, -): ASTVisitor { - return { - 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)) { - isValidValueNode(context, node); - return false; // Don't traverse further. - } - }, - ObjectValue(node) { - const type = getNamedType(context.getInputType()); - if (!isInputObjectType(type)) { - isValidValueNode(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( - `Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`, - 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( - `Field "${node.name.value}" is not defined by type "${parentType.name}".` + - didYouMean(suggestions), - node, - ), - ); - } - }, - NullValue(node) { - const type = context.getInputType(); - if (isNonNullType(type)) { - context.reportError( - new GraphQLError( - `Expected value of type "${inspect(type)}", found ${print(node)}.`, - node, - ), - ); - } - }, - EnumValue: (node) => isValidValueNode(context, node), - IntValue: (node) => isValidValueNode(context, node), - FloatValue: (node) => isValidValueNode(context, node), - StringValue: (node) => isValidValueNode(context, node), - BooleanValue: (node) => isValidValueNode(context, node), - }; -} - -/** - * Any value literal may be a valid representation of a Scalar, depending on - * that scalar type. - */ -function isValidValueNode(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 (!isLeafType(type)) { - const typeStr = inspect(locationType); - context.reportError( - new GraphQLError( - `Expected value of type "${typeStr}", found ${print(node)}.`, - node, - ), - ); - return; - } - - // Scalars and Enums 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 (parseResult === undefined) { - const typeStr = inspect(locationType); - context.reportError( - new GraphQLError( - `Expected value of type "${typeStr}", found ${print(node)}.`, - node, - ), - ); - } - } catch (error) { - const typeStr = inspect(locationType); - if (error instanceof GraphQLError) { - context.reportError(error); - } else { - context.reportError( - new GraphQLError( - `Expected value of type "${typeStr}", found ${print(node)}; ` + - error.message, - node, - undefined, - undefined, - undefined, - error, // Ensure a reference to the original error is maintained. - ), - ); - } - } -} diff --git a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs b/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs deleted file mode 100644 index 01c8967..0000000 --- a/JS/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs +++ /dev/null @@ -1,126 +0,0 @@ -import objectValues from "../../polyfills/objectValues.mjs"; -import keyMap from "../../jsutils/keyMap.mjs"; -import inspect from "../../jsutils/inspect.mjs"; -import didYouMean from "../../jsutils/didYouMean.mjs"; -import suggestionList from "../../jsutils/suggestionList.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { print } from "../../language/printer.mjs"; -import { isLeafType, isInputObjectType, isListType, isNonNullType, isRequiredInputField, getNullableType, getNamedType } from "../../type/definition.mjs"; - -/** - * 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 ValuesOfCorrectTypeRule(context) { - return { - 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)) { - isValidValueNode(context, node); - return false; // Don't traverse further. - } - }, - ObjectValue: function ObjectValue(node) { - var type = getNamedType(context.getInputType()); - - if (!isInputObjectType(type)) { - isValidValueNode(context, node); - return false; // Don't traverse further. - } // Ensure every required field exists. - - - var fieldNodeMap = keyMap(node.fields, function (field) { - return field.name.value; - }); - - for (var _i2 = 0, _objectValues2 = objectValues(type.getFields()); _i2 < _objectValues2.length; _i2++) { - var fieldDef = _objectValues2[_i2]; - var fieldNode = fieldNodeMap[fieldDef.name]; - - if (!fieldNode && isRequiredInputField(fieldDef)) { - var typeStr = inspect(fieldDef.type); - context.reportError(new GraphQLError("Field \"".concat(type.name, ".").concat(fieldDef.name, "\" of required type \"").concat(typeStr, "\" was not provided."), node)); - } - } - }, - 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("Field \"".concat(node.name.value, "\" is not defined by type \"").concat(parentType.name, "\".") + didYouMean(suggestions), node)); - } - }, - NullValue: function NullValue(node) { - var type = context.getInputType(); - - if (isNonNullType(type)) { - context.reportError(new GraphQLError("Expected value of type \"".concat(inspect(type), "\", found ").concat(print(node), "."), node)); - } - }, - EnumValue: function EnumValue(node) { - return isValidValueNode(context, node); - }, - IntValue: function IntValue(node) { - return isValidValueNode(context, node); - }, - FloatValue: function FloatValue(node) { - return isValidValueNode(context, node); - }, - StringValue: function StringValue(node) { - return isValidValueNode(context, node); - }, - BooleanValue: function BooleanValue(node) { - return isValidValueNode(context, node); - } - }; -} -/** - * Any value literal may be a valid representation of a Scalar, depending on - * that scalar type. - */ - -function isValidValueNode(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 (!isLeafType(type)) { - var typeStr = inspect(locationType); - context.reportError(new GraphQLError("Expected value of type \"".concat(typeStr, "\", found ").concat(print(node), "."), node)); - return; - } // Scalars and Enums 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 (parseResult === undefined) { - var _typeStr = inspect(locationType); - - context.reportError(new GraphQLError("Expected value of type \"".concat(_typeStr, "\", found ").concat(print(node), "."), node)); - } - } catch (error) { - var _typeStr2 = inspect(locationType); - - if (error instanceof GraphQLError) { - context.reportError(error); - } else { - context.reportError(new GraphQLError("Expected value of type \"".concat(_typeStr2, "\", found ").concat(print(node), "; ") + error.message, node, undefined, undefined, undefined, error)); - } - } -} diff --git a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts b/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts deleted file mode 100644 index c82229c..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * 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 VariablesAreInputTypesRule( - context: ValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js b/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js deleted file mode 100644 index 885d309..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.VariablesAreInputTypesRule = VariablesAreInputTypesRule; - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _printer = require("../../language/printer.js"); - -var _definition = require("../../type/definition.js"); - -var _typeFromAST = require("../../utilities/typeFromAST.js"); - -/** - * 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 VariablesAreInputTypesRule(context) { - return { - VariableDefinition: function VariableDefinition(node) { - var type = (0, _typeFromAST.typeFromAST)(context.getSchema(), node.type); - - if (type && !(0, _definition.isInputType)(type)) { - var variableName = node.variable.name.value; - var typeName = (0, _printer.print)(node.type); - context.reportError(new _GraphQLError.GraphQLError("Variable \"$".concat(variableName, "\" cannot be non-input type \"").concat(typeName, "\"."), node.type)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.flow b/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.flow deleted file mode 100644 index 2de0819..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js.flow +++ /dev/null @@ -1,40 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../error/GraphQLError'; - -import { print } from '../../language/printer'; -import type { ASTVisitor } from '../../language/visitor'; -import type { VariableDefinitionNode } from '../../language/ast'; - -import { isInputType } from '../../type/definition'; - -import { typeFromAST } from '../../utilities/typeFromAST'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * 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 VariablesAreInputTypesRule( - context: ValidationContext, -): ASTVisitor { - return { - VariableDefinition(node: VariableDefinitionNode): ?GraphQLError { - const type = typeFromAST(context.getSchema(), node.type); - - if (type && !isInputType(type)) { - const variableName = node.variable.name.value; - const typeName = print(node.type); - - context.reportError( - new GraphQLError( - `Variable "$${variableName}" cannot be non-input type "${typeName}".`, - node.type, - ), - ); - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs b/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs deleted file mode 100644 index f6e5d11..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { print } from "../../language/printer.mjs"; -import { isInputType } from "../../type/definition.mjs"; -import { typeFromAST } from "../../utilities/typeFromAST.mjs"; - -/** - * 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 VariablesAreInputTypesRule(context) { - return { - VariableDefinition: function VariableDefinition(node) { - var type = typeFromAST(context.getSchema(), node.type); - - if (type && !isInputType(type)) { - var variableName = node.variable.name.value; - var typeName = print(node.type); - context.reportError(new GraphQLError("Variable \"$".concat(variableName, "\" cannot be non-input type \"").concat(typeName, "\"."), node.type)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts b/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts deleted file mode 100644 index 6ee5737..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ASTVisitor } from '../../language/visitor'; -import { ValidationContext } from '../ValidationContext'; - -/** - * Variables passed to field arguments conform to type - */ -export function VariablesInAllowedPositionRule( - context: ValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js b/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js deleted file mode 100644 index ad0ce8c..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.VariablesInAllowedPositionRule = VariablesInAllowedPositionRule; - -var _inspect = _interopRequireDefault(require("../../jsutils/inspect.js")); - -var _GraphQLError = require("../../error/GraphQLError.js"); - -var _kinds = require("../../language/kinds.js"); - -var _definition = require("../../type/definition.js"); - -var _typeFromAST = require("../../utilities/typeFromAST.js"); - -var _typeComparators = require("../../utilities/typeComparators.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Variables passed to field arguments conform to type - */ -function VariablesInAllowedPositionRule(context) { - var varDefMap = Object.create(null); - return { - OperationDefinition: { - enter: function enter() { - varDefMap = Object.create(null); - }, - leave: function leave(operation) { - var usages = context.getRecursiveVariableUsages(operation); - - for (var _i2 = 0; _i2 < usages.length; _i2++) { - var _ref2 = usages[_i2]; - 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)) { - var varTypeStr = (0, _inspect.default)(varType); - var typeStr = (0, _inspect.default)(type); - context.reportError(new _GraphQLError.GraphQLError("Variable \"$".concat(varName, "\" of type \"").concat(varTypeStr, "\" used in position expecting type \"").concat(typeStr, "\"."), [varDef, node])); - } - } - } - } - }, - 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/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.flow b/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.flow deleted file mode 100644 index 722ee99..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js.flow +++ /dev/null @@ -1,98 +0,0 @@ -// @flow strict -import inspect from '../../jsutils/inspect'; - -import { GraphQLError } from '../../error/GraphQLError'; - -import { Kind } from '../../language/kinds'; -import type { ValueNode } from '../../language/ast'; -import type { ASTVisitor } from '../../language/visitor'; - -import type { GraphQLSchema } from '../../type/schema'; -import type { GraphQLType } from '../../type/definition'; -import { isNonNullType } from '../../type/definition'; - -import { typeFromAST } from '../../utilities/typeFromAST'; -import { isTypeSubTypeOf } from '../../utilities/typeComparators'; - -import type { ValidationContext } from '../ValidationContext'; - -/** - * Variables passed to field arguments conform to type - */ -export function VariablesInAllowedPositionRule( - 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, - ) - ) { - const varTypeStr = inspect(varType); - const typeStr = inspect(type); - context.reportError( - new GraphQLError( - `Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`, - [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/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs b/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs deleted file mode 100644 index bdddb2f..0000000 --- a/JS/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs +++ /dev/null @@ -1,72 +0,0 @@ -import inspect from "../../jsutils/inspect.mjs"; -import { GraphQLError } from "../../error/GraphQLError.mjs"; -import { Kind } from "../../language/kinds.mjs"; -import { isNonNullType } from "../../type/definition.mjs"; -import { typeFromAST } from "../../utilities/typeFromAST.mjs"; -import { isTypeSubTypeOf } from "../../utilities/typeComparators.mjs"; - -/** - * Variables passed to field arguments conform to type - */ -export function VariablesInAllowedPositionRule(context) { - var varDefMap = Object.create(null); - return { - OperationDefinition: { - enter: function enter() { - varDefMap = Object.create(null); - }, - leave: function leave(operation) { - var usages = context.getRecursiveVariableUsages(operation); - - for (var _i2 = 0; _i2 < usages.length; _i2++) { - var _ref2 = usages[_i2]; - 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)) { - var varTypeStr = inspect(varType); - var typeStr = inspect(type); - context.reportError(new GraphQLError("Variable \"$".concat(varName, "\" of type \"").concat(varTypeStr, "\" used in position expecting type \"").concat(typeStr, "\"."), [varDef, node])); - } - } - } - } - }, - 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/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts b/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts deleted file mode 100644 index d376cf8..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ASTVisitor } from '../../../language/visitor'; -import { ValidationContext } from '../../ValidationContext'; - -/** - * No deprecated - * - * A GraphQL document is only valid if all selected fields and all used enum values have not been - * deprecated. - * - * Note: This rule is optional and is not part of the Validation section of the GraphQL - * Specification. The main purpose of this rule is detection of deprecated usages and not - * necessarily to forbid their use when querying a service. - */ -export function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js b/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js deleted file mode 100644 index 63ad4dc..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoDeprecatedCustomRule = NoDeprecatedCustomRule; - -var _invariant = _interopRequireDefault(require("../../../jsutils/invariant.js")); - -var _GraphQLError = require("../../../error/GraphQLError.js"); - -var _definition = require("../../../type/definition.js"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * No deprecated - * - * A GraphQL document is only valid if all selected fields and all used enum values have not been - * deprecated. - * - * Note: This rule is optional and is not part of the Validation section of the GraphQL - * Specification. The main purpose of this rule is detection of deprecated usages and not - * necessarily to forbid their use when querying a service. - */ -function NoDeprecatedCustomRule(context) { - return { - Field: function Field(node) { - var fieldDef = context.getFieldDef(); - var deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason; - - if (fieldDef && deprecationReason != null) { - var parentType = context.getParentType(); - parentType != null || (0, _invariant.default)(0); - context.reportError(new _GraphQLError.GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - }, - Argument: function Argument(node) { - var argDef = context.getArgument(); - var deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason; - - if (argDef && deprecationReason != null) { - var directiveDef = context.getDirective(); - - if (directiveDef != null) { - context.reportError(new _GraphQLError.GraphQLError("Directive \"@".concat(directiveDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } else { - var parentType = context.getParentType(); - var fieldDef = context.getFieldDef(); - parentType != null && fieldDef != null || (0, _invariant.default)(0); - context.reportError(new _GraphQLError.GraphQLError("Field \"".concat(parentType.name, ".").concat(fieldDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }, - ObjectField: function ObjectField(node) { - var inputObjectDef = (0, _definition.getNamedType)(context.getParentInputType()); - - if ((0, _definition.isInputObjectType)(inputObjectDef)) { - var inputFieldDef = inputObjectDef.getFields()[node.name.value]; // flowlint-next-line unnecessary-optional-chain:off - - var deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason; - - if (deprecationReason != null) { - context.reportError(new _GraphQLError.GraphQLError("The input field ".concat(inputObjectDef.name, ".").concat(inputFieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - } - }, - EnumValue: function EnumValue(node) { - var enumValueDef = context.getEnumValue(); - var deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason; - - if (enumValueDef && deprecationReason != null) { - var enumTypeDef = (0, _definition.getNamedType)(context.getInputType()); - enumTypeDef != null || (0, _invariant.default)(0); - context.reportError(new _GraphQLError.GraphQLError("The enum value \"".concat(enumTypeDef.name, ".").concat(enumValueDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.flow b/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.flow deleted file mode 100644 index 6b61065..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js.flow +++ /dev/null @@ -1,94 +0,0 @@ -// @flow strict -import invariant from '../../../jsutils/invariant'; - -import { GraphQLError } from '../../../error/GraphQLError'; - -import type { ASTVisitor } from '../../../language/visitor'; - -import { getNamedType, isInputObjectType } from '../../../type/definition'; - -import type { ValidationContext } from '../../ValidationContext'; - -/** - * No deprecated - * - * A GraphQL document is only valid if all selected fields and all used enum values have not been - * deprecated. - * - * Note: This rule is optional and is not part of the Validation section of the GraphQL - * Specification. The main purpose of this rule is detection of deprecated usages and not - * necessarily to forbid their use when querying a service. - */ -export function NoDeprecatedCustomRule(context: ValidationContext): ASTVisitor { - return { - Field(node) { - const fieldDef = context.getFieldDef(); - const deprecationReason = fieldDef?.deprecationReason; - if (fieldDef && deprecationReason != null) { - const parentType = context.getParentType(); - invariant(parentType != null); - context.reportError( - new GraphQLError( - `The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`, - node, - ), - ); - } - }, - Argument(node) { - const argDef = context.getArgument(); - const deprecationReason = argDef?.deprecationReason; - if (argDef && deprecationReason != null) { - const directiveDef = context.getDirective(); - if (directiveDef != null) { - context.reportError( - new GraphQLError( - `Directive "@${directiveDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, - node, - ), - ); - } else { - const parentType = context.getParentType(); - const fieldDef = context.getFieldDef(); - invariant(parentType != null && fieldDef != null); - context.reportError( - new GraphQLError( - `Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, - node, - ), - ); - } - } - }, - ObjectField(node) { - const inputObjectDef = getNamedType(context.getParentInputType()); - if (isInputObjectType(inputObjectDef)) { - const inputFieldDef = inputObjectDef.getFields()[node.name.value]; - // flowlint-next-line unnecessary-optional-chain:off - const deprecationReason = inputFieldDef?.deprecationReason; - if (deprecationReason != null) { - context.reportError( - new GraphQLError( - `The input field ${inputObjectDef.name}.${inputFieldDef.name} is deprecated. ${deprecationReason}`, - node, - ), - ); - } - } - }, - EnumValue(node) { - const enumValueDef = context.getEnumValue(); - const deprecationReason = enumValueDef?.deprecationReason; - if (enumValueDef && deprecationReason != null) { - const enumTypeDef = getNamedType(context.getInputType()); - invariant(enumTypeDef != null); - context.reportError( - new GraphQLError( - `The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`, - node, - ), - ); - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs b/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs deleted file mode 100644 index f0e0b36..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs +++ /dev/null @@ -1,68 +0,0 @@ -import invariant from "../../../jsutils/invariant.mjs"; -import { GraphQLError } from "../../../error/GraphQLError.mjs"; -import { getNamedType, isInputObjectType } from "../../../type/definition.mjs"; - -/** - * No deprecated - * - * A GraphQL document is only valid if all selected fields and all used enum values have not been - * deprecated. - * - * Note: This rule is optional and is not part of the Validation section of the GraphQL - * Specification. The main purpose of this rule is detection of deprecated usages and not - * necessarily to forbid their use when querying a service. - */ -export function NoDeprecatedCustomRule(context) { - return { - Field: function Field(node) { - var fieldDef = context.getFieldDef(); - var deprecationReason = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.deprecationReason; - - if (fieldDef && deprecationReason != null) { - var parentType = context.getParentType(); - parentType != null || invariant(0); - context.reportError(new GraphQLError("The field ".concat(parentType.name, ".").concat(fieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - }, - Argument: function Argument(node) { - var argDef = context.getArgument(); - var deprecationReason = argDef === null || argDef === void 0 ? void 0 : argDef.deprecationReason; - - if (argDef && deprecationReason != null) { - var directiveDef = context.getDirective(); - - if (directiveDef != null) { - context.reportError(new GraphQLError("Directive \"@".concat(directiveDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } else { - var parentType = context.getParentType(); - var fieldDef = context.getFieldDef(); - parentType != null && fieldDef != null || invariant(0); - context.reportError(new GraphQLError("Field \"".concat(parentType.name, ".").concat(fieldDef.name, "\" argument \"").concat(argDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }, - ObjectField: function ObjectField(node) { - var inputObjectDef = getNamedType(context.getParentInputType()); - - if (isInputObjectType(inputObjectDef)) { - var inputFieldDef = inputObjectDef.getFields()[node.name.value]; // flowlint-next-line unnecessary-optional-chain:off - - var deprecationReason = inputFieldDef === null || inputFieldDef === void 0 ? void 0 : inputFieldDef.deprecationReason; - - if (deprecationReason != null) { - context.reportError(new GraphQLError("The input field ".concat(inputObjectDef.name, ".").concat(inputFieldDef.name, " is deprecated. ").concat(deprecationReason), node)); - } - } - }, - EnumValue: function EnumValue(node) { - var enumValueDef = context.getEnumValue(); - var deprecationReason = enumValueDef === null || enumValueDef === void 0 ? void 0 : enumValueDef.deprecationReason; - - if (enumValueDef && deprecationReason != null) { - var enumTypeDef = getNamedType(context.getInputType()); - enumTypeDef != null || invariant(0); - context.reportError(new GraphQLError("The enum value \"".concat(enumTypeDef.name, ".").concat(enumValueDef.name, "\" is deprecated. ").concat(deprecationReason), node)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts b/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts deleted file mode 100644 index 3677fa1..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ASTVisitor } from '../../../language/visitor'; -import { ValidationContext } from '../../ValidationContext'; - -/** - * Prohibit introspection queries - * - * A GraphQL document is only valid if all fields selected are not fields that - * return an introspection type. - * - * Note: This rule is optional and is not part of the Validation section of the - * GraphQL Specification. This rule effectively disables introspection, which - * does not reflect best practices and should only be done if absolutely necessary. - */ -export function NoSchemaIntrospectionCustomRule( - context: ValidationContext, -): ASTVisitor; diff --git a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js b/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js deleted file mode 100644 index 6861bd4..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.NoSchemaIntrospectionCustomRule = NoSchemaIntrospectionCustomRule; - -var _GraphQLError = require("../../../error/GraphQLError.js"); - -var _definition = require("../../../type/definition.js"); - -var _introspection = require("../../../type/introspection.js"); - -/** - * Prohibit introspection queries - * - * A GraphQL document is only valid if all fields selected are not fields that - * return an introspection type. - * - * Note: This rule is optional and is not part of the Validation section of the - * GraphQL Specification. This rule effectively disables introspection, which - * does not reflect best practices and should only be done if absolutely necessary. - */ -function NoSchemaIntrospectionCustomRule(context) { - return { - Field: function Field(node) { - var type = (0, _definition.getNamedType)(context.getType()); - - if (type && (0, _introspection.isIntrospectionType)(type)) { - context.reportError(new _GraphQLError.GraphQLError("GraphQL introspection has been disabled, but the requested query contained the field \"".concat(node.name.value, "\"."), node)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow b/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow deleted file mode 100644 index 333ba41..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js.flow +++ /dev/null @@ -1,38 +0,0 @@ -// @flow strict -import { GraphQLError } from '../../../error/GraphQLError'; - -import type { FieldNode } from '../../../language/ast'; -import type { ASTVisitor } from '../../../language/visitor'; - -import { getNamedType } from '../../../type/definition'; -import { isIntrospectionType } from '../../../type/introspection'; - -import type { ValidationContext } from '../../ValidationContext'; - -/** - * Prohibit introspection queries - * - * A GraphQL document is only valid if all fields selected are not fields that - * return an introspection type. - * - * Note: This rule is optional and is not part of the Validation section of the - * GraphQL Specification. This rule effectively disables introspection, which - * does not reflect best practices and should only be done if absolutely necessary. - */ -export function NoSchemaIntrospectionCustomRule( - context: ValidationContext, -): ASTVisitor { - return { - Field(node: FieldNode) { - const type = getNamedType(context.getType()); - if (type && isIntrospectionType(type)) { - context.reportError( - new GraphQLError( - `GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, - node, - ), - ); - } - }, - }; -} diff --git a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs b/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs deleted file mode 100644 index 26f7d74..0000000 --- a/JS/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import { GraphQLError } from "../../../error/GraphQLError.mjs"; -import { getNamedType } from "../../../type/definition.mjs"; -import { isIntrospectionType } from "../../../type/introspection.mjs"; - -/** - * Prohibit introspection queries - * - * A GraphQL document is only valid if all fields selected are not fields that - * return an introspection type. - * - * Note: This rule is optional and is not part of the Validation section of the - * GraphQL Specification. This rule effectively disables introspection, which - * does not reflect best practices and should only be done if absolutely necessary. - */ -export function NoSchemaIntrospectionCustomRule(context) { - return { - Field: function Field(node) { - var type = getNamedType(context.getType()); - - if (type && isIntrospectionType(type)) { - context.reportError(new GraphQLError("GraphQL introspection has been disabled, but the requested query contained the field \"".concat(node.name.value, "\"."), node)); - } - } - }; -} diff --git a/JS/node_modules/graphql/validation/specifiedRules.d.ts b/JS/node_modules/graphql/validation/specifiedRules.d.ts deleted file mode 100644 index ffb5570..0000000 --- a/JS/node_modules/graphql/validation/specifiedRules.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ValidationRule, SDLValidationRule } from './ValidationContext'; - -/** - * 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: ReadonlyArray; - -/** - * @internal - */ -export const specifiedSDLRules: ReadonlyArray; diff --git a/JS/node_modules/graphql/validation/specifiedRules.js b/JS/node_modules/graphql/validation/specifiedRules.js deleted file mode 100644 index a204849..0000000 --- a/JS/node_modules/graphql/validation/specifiedRules.js +++ /dev/null @@ -1,115 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.specifiedSDLRules = exports.specifiedRules = void 0; - -var _ExecutableDefinitionsRule = require("./rules/ExecutableDefinitionsRule.js"); - -var _UniqueOperationNamesRule = require("./rules/UniqueOperationNamesRule.js"); - -var _LoneAnonymousOperationRule = require("./rules/LoneAnonymousOperationRule.js"); - -var _SingleFieldSubscriptionsRule = require("./rules/SingleFieldSubscriptionsRule.js"); - -var _KnownTypeNamesRule = require("./rules/KnownTypeNamesRule.js"); - -var _FragmentsOnCompositeTypesRule = require("./rules/FragmentsOnCompositeTypesRule.js"); - -var _VariablesAreInputTypesRule = require("./rules/VariablesAreInputTypesRule.js"); - -var _ScalarLeafsRule = require("./rules/ScalarLeafsRule.js"); - -var _FieldsOnCorrectTypeRule = require("./rules/FieldsOnCorrectTypeRule.js"); - -var _UniqueFragmentNamesRule = require("./rules/UniqueFragmentNamesRule.js"); - -var _KnownFragmentNamesRule = require("./rules/KnownFragmentNamesRule.js"); - -var _NoUnusedFragmentsRule = require("./rules/NoUnusedFragmentsRule.js"); - -var _PossibleFragmentSpreadsRule = require("./rules/PossibleFragmentSpreadsRule.js"); - -var _NoFragmentCyclesRule = require("./rules/NoFragmentCyclesRule.js"); - -var _UniqueVariableNamesRule = require("./rules/UniqueVariableNamesRule.js"); - -var _NoUndefinedVariablesRule = require("./rules/NoUndefinedVariablesRule.js"); - -var _NoUnusedVariablesRule = require("./rules/NoUnusedVariablesRule.js"); - -var _KnownDirectivesRule = require("./rules/KnownDirectivesRule.js"); - -var _UniqueDirectivesPerLocationRule = require("./rules/UniqueDirectivesPerLocationRule.js"); - -var _KnownArgumentNamesRule = require("./rules/KnownArgumentNamesRule.js"); - -var _UniqueArgumentNamesRule = require("./rules/UniqueArgumentNamesRule.js"); - -var _ValuesOfCorrectTypeRule = require("./rules/ValuesOfCorrectTypeRule.js"); - -var _ProvidedRequiredArgumentsRule = require("./rules/ProvidedRequiredArgumentsRule.js"); - -var _VariablesInAllowedPositionRule = require("./rules/VariablesInAllowedPositionRule.js"); - -var _OverlappingFieldsCanBeMergedRule = require("./rules/OverlappingFieldsCanBeMergedRule.js"); - -var _UniqueInputFieldNamesRule = require("./rules/UniqueInputFieldNamesRule.js"); - -var _LoneSchemaDefinitionRule = require("./rules/LoneSchemaDefinitionRule.js"); - -var _UniqueOperationTypesRule = require("./rules/UniqueOperationTypesRule.js"); - -var _UniqueTypeNamesRule = require("./rules/UniqueTypeNamesRule.js"); - -var _UniqueEnumValueNamesRule = require("./rules/UniqueEnumValueNamesRule.js"); - -var _UniqueFieldDefinitionNamesRule = require("./rules/UniqueFieldDefinitionNamesRule.js"); - -var _UniqueDirectiveNamesRule = require("./rules/UniqueDirectiveNamesRule.js"); - -var _PossibleTypeExtensionsRule = require("./rules/PossibleTypeExtensionsRule.js"); - -// 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" -// SDL-specific validation rules - -/** - * 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([_ExecutableDefinitionsRule.ExecutableDefinitionsRule, _UniqueOperationNamesRule.UniqueOperationNamesRule, _LoneAnonymousOperationRule.LoneAnonymousOperationRule, _SingleFieldSubscriptionsRule.SingleFieldSubscriptionsRule, _KnownTypeNamesRule.KnownTypeNamesRule, _FragmentsOnCompositeTypesRule.FragmentsOnCompositeTypesRule, _VariablesAreInputTypesRule.VariablesAreInputTypesRule, _ScalarLeafsRule.ScalarLeafsRule, _FieldsOnCorrectTypeRule.FieldsOnCorrectTypeRule, _UniqueFragmentNamesRule.UniqueFragmentNamesRule, _KnownFragmentNamesRule.KnownFragmentNamesRule, _NoUnusedFragmentsRule.NoUnusedFragmentsRule, _PossibleFragmentSpreadsRule.PossibleFragmentSpreadsRule, _NoFragmentCyclesRule.NoFragmentCyclesRule, _UniqueVariableNamesRule.UniqueVariableNamesRule, _NoUndefinedVariablesRule.NoUndefinedVariablesRule, _NoUnusedVariablesRule.NoUnusedVariablesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _KnownArgumentNamesRule.KnownArgumentNamesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _ValuesOfCorrectTypeRule.ValuesOfCorrectTypeRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsRule, _VariablesInAllowedPositionRule.VariablesInAllowedPositionRule, _OverlappingFieldsCanBeMergedRule.OverlappingFieldsCanBeMergedRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule]); -/** - * @internal - */ - -exports.specifiedRules = specifiedRules; -var specifiedSDLRules = Object.freeze([_LoneSchemaDefinitionRule.LoneSchemaDefinitionRule, _UniqueOperationTypesRule.UniqueOperationTypesRule, _UniqueTypeNamesRule.UniqueTypeNamesRule, _UniqueEnumValueNamesRule.UniqueEnumValueNamesRule, _UniqueFieldDefinitionNamesRule.UniqueFieldDefinitionNamesRule, _UniqueDirectiveNamesRule.UniqueDirectiveNamesRule, _KnownTypeNamesRule.KnownTypeNamesRule, _KnownDirectivesRule.KnownDirectivesRule, _UniqueDirectivesPerLocationRule.UniqueDirectivesPerLocationRule, _PossibleTypeExtensionsRule.PossibleTypeExtensionsRule, _KnownArgumentNamesRule.KnownArgumentNamesOnDirectivesRule, _UniqueArgumentNamesRule.UniqueArgumentNamesRule, _UniqueInputFieldNamesRule.UniqueInputFieldNamesRule, _ProvidedRequiredArgumentsRule.ProvidedRequiredArgumentsOnDirectivesRule]); -exports.specifiedSDLRules = specifiedSDLRules; diff --git a/JS/node_modules/graphql/validation/specifiedRules.js.flow b/JS/node_modules/graphql/validation/specifiedRules.js.flow deleted file mode 100644 index 179e9fb..0000000 --- a/JS/node_modules/graphql/validation/specifiedRules.js.flow +++ /dev/null @@ -1,148 +0,0 @@ -// @flow strict -// Spec Section: "Executable Definitions" -import { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule'; - -// Spec Section: "Operation Name Uniqueness" -import { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule'; - -// Spec Section: "Lone Anonymous Operation" -import { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule'; - -// Spec Section: "Subscriptions with Single Root Field" -import { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule'; - -// Spec Section: "Fragment Spread Type Existence" -import { KnownTypeNamesRule } from './rules/KnownTypeNamesRule'; - -// Spec Section: "Fragments on Composite Types" -import { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule'; - -// Spec Section: "Variables are Input Types" -import { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule'; - -// Spec Section: "Leaf Field Selections" -import { ScalarLeafsRule } from './rules/ScalarLeafsRule'; - -// Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" -import { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule'; - -// Spec Section: "Fragment Name Uniqueness" -import { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule'; - -// Spec Section: "Fragment spread target defined" -import { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule'; - -// Spec Section: "Fragments must be used" -import { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule'; - -// Spec Section: "Fragment spread is possible" -import { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule'; - -// Spec Section: "Fragments must not form cycles" -import { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule'; - -// Spec Section: "Variable Uniqueness" -import { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule'; - -// Spec Section: "All Variable Used Defined" -import { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule'; - -// Spec Section: "All Variables Used" -import { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule'; - -// Spec Section: "Directives Are Defined" -import { KnownDirectivesRule } from './rules/KnownDirectivesRule'; - -// Spec Section: "Directives Are Unique Per Location" -import { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule'; - -// Spec Section: "Argument Names" -import { - KnownArgumentNamesRule, - KnownArgumentNamesOnDirectivesRule, -} from './rules/KnownArgumentNamesRule'; - -// Spec Section: "Argument Uniqueness" -import { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule'; - -// Spec Section: "Value Type Correctness" -import { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule'; - -// Spec Section: "Argument Optionality" -import { - ProvidedRequiredArgumentsRule, - ProvidedRequiredArgumentsOnDirectivesRule, -} from './rules/ProvidedRequiredArgumentsRule'; - -// Spec Section: "All Variable Usages Are Allowed" -import { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule'; - -// Spec Section: "Field Selection Merging" -import { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule'; - -// Spec Section: "Input Object Field Uniqueness" -import { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule'; - -// SDL-specific validation rules -import { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule'; -import { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule'; -import { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule'; -import { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule'; -import { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule'; -import { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule'; -import { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule'; - -/** - * 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([ - ExecutableDefinitionsRule, - UniqueOperationNamesRule, - LoneAnonymousOperationRule, - SingleFieldSubscriptionsRule, - KnownTypeNamesRule, - FragmentsOnCompositeTypesRule, - VariablesAreInputTypesRule, - ScalarLeafsRule, - FieldsOnCorrectTypeRule, - UniqueFragmentNamesRule, - KnownFragmentNamesRule, - NoUnusedFragmentsRule, - PossibleFragmentSpreadsRule, - NoFragmentCyclesRule, - UniqueVariableNamesRule, - NoUndefinedVariablesRule, - NoUnusedVariablesRule, - KnownDirectivesRule, - UniqueDirectivesPerLocationRule, - KnownArgumentNamesRule, - UniqueArgumentNamesRule, - ValuesOfCorrectTypeRule, - ProvidedRequiredArgumentsRule, - VariablesInAllowedPositionRule, - OverlappingFieldsCanBeMergedRule, - UniqueInputFieldNamesRule, -]); - -/** - * @internal - */ -export const specifiedSDLRules = Object.freeze([ - LoneSchemaDefinitionRule, - UniqueOperationTypesRule, - UniqueTypeNamesRule, - UniqueEnumValueNamesRule, - UniqueFieldDefinitionNamesRule, - UniqueDirectiveNamesRule, - KnownTypeNamesRule, - KnownDirectivesRule, - UniqueDirectivesPerLocationRule, - PossibleTypeExtensionsRule, - KnownArgumentNamesOnDirectivesRule, - UniqueArgumentNamesRule, - UniqueInputFieldNamesRule, - ProvidedRequiredArgumentsOnDirectivesRule, -]); diff --git a/JS/node_modules/graphql/validation/specifiedRules.mjs b/JS/node_modules/graphql/validation/specifiedRules.mjs deleted file mode 100644 index 97f4664..0000000 --- a/JS/node_modules/graphql/validation/specifiedRules.mjs +++ /dev/null @@ -1,73 +0,0 @@ -// Spec Section: "Executable Definitions" -import { ExecutableDefinitionsRule } from "./rules/ExecutableDefinitionsRule.mjs"; // Spec Section: "Operation Name Uniqueness" - -import { UniqueOperationNamesRule } from "./rules/UniqueOperationNamesRule.mjs"; // Spec Section: "Lone Anonymous Operation" - -import { LoneAnonymousOperationRule } from "./rules/LoneAnonymousOperationRule.mjs"; // Spec Section: "Subscriptions with Single Root Field" - -import { SingleFieldSubscriptionsRule } from "./rules/SingleFieldSubscriptionsRule.mjs"; // Spec Section: "Fragment Spread Type Existence" - -import { KnownTypeNamesRule } from "./rules/KnownTypeNamesRule.mjs"; // Spec Section: "Fragments on Composite Types" - -import { FragmentsOnCompositeTypesRule } from "./rules/FragmentsOnCompositeTypesRule.mjs"; // Spec Section: "Variables are Input Types" - -import { VariablesAreInputTypesRule } from "./rules/VariablesAreInputTypesRule.mjs"; // Spec Section: "Leaf Field Selections" - -import { ScalarLeafsRule } from "./rules/ScalarLeafsRule.mjs"; // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types" - -import { FieldsOnCorrectTypeRule } from "./rules/FieldsOnCorrectTypeRule.mjs"; // Spec Section: "Fragment Name Uniqueness" - -import { UniqueFragmentNamesRule } from "./rules/UniqueFragmentNamesRule.mjs"; // Spec Section: "Fragment spread target defined" - -import { KnownFragmentNamesRule } from "./rules/KnownFragmentNamesRule.mjs"; // Spec Section: "Fragments must be used" - -import { NoUnusedFragmentsRule } from "./rules/NoUnusedFragmentsRule.mjs"; // Spec Section: "Fragment spread is possible" - -import { PossibleFragmentSpreadsRule } from "./rules/PossibleFragmentSpreadsRule.mjs"; // Spec Section: "Fragments must not form cycles" - -import { NoFragmentCyclesRule } from "./rules/NoFragmentCyclesRule.mjs"; // Spec Section: "Variable Uniqueness" - -import { UniqueVariableNamesRule } from "./rules/UniqueVariableNamesRule.mjs"; // Spec Section: "All Variable Used Defined" - -import { NoUndefinedVariablesRule } from "./rules/NoUndefinedVariablesRule.mjs"; // Spec Section: "All Variables Used" - -import { NoUnusedVariablesRule } from "./rules/NoUnusedVariablesRule.mjs"; // Spec Section: "Directives Are Defined" - -import { KnownDirectivesRule } from "./rules/KnownDirectivesRule.mjs"; // Spec Section: "Directives Are Unique Per Location" - -import { UniqueDirectivesPerLocationRule } from "./rules/UniqueDirectivesPerLocationRule.mjs"; // Spec Section: "Argument Names" - -import { KnownArgumentNamesRule, KnownArgumentNamesOnDirectivesRule } from "./rules/KnownArgumentNamesRule.mjs"; // Spec Section: "Argument Uniqueness" - -import { UniqueArgumentNamesRule } from "./rules/UniqueArgumentNamesRule.mjs"; // Spec Section: "Value Type Correctness" - -import { ValuesOfCorrectTypeRule } from "./rules/ValuesOfCorrectTypeRule.mjs"; // Spec Section: "Argument Optionality" - -import { ProvidedRequiredArgumentsRule, ProvidedRequiredArgumentsOnDirectivesRule } from "./rules/ProvidedRequiredArgumentsRule.mjs"; // Spec Section: "All Variable Usages Are Allowed" - -import { VariablesInAllowedPositionRule } from "./rules/VariablesInAllowedPositionRule.mjs"; // Spec Section: "Field Selection Merging" - -import { OverlappingFieldsCanBeMergedRule } from "./rules/OverlappingFieldsCanBeMergedRule.mjs"; // Spec Section: "Input Object Field Uniqueness" - -import { UniqueInputFieldNamesRule } from "./rules/UniqueInputFieldNamesRule.mjs"; // SDL-specific validation rules - -import { LoneSchemaDefinitionRule } from "./rules/LoneSchemaDefinitionRule.mjs"; -import { UniqueOperationTypesRule } from "./rules/UniqueOperationTypesRule.mjs"; -import { UniqueTypeNamesRule } from "./rules/UniqueTypeNamesRule.mjs"; -import { UniqueEnumValueNamesRule } from "./rules/UniqueEnumValueNamesRule.mjs"; -import { UniqueFieldDefinitionNamesRule } from "./rules/UniqueFieldDefinitionNamesRule.mjs"; -import { UniqueDirectiveNamesRule } from "./rules/UniqueDirectiveNamesRule.mjs"; -import { PossibleTypeExtensionsRule } from "./rules/PossibleTypeExtensionsRule.mjs"; -/** - * 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([ExecutableDefinitionsRule, UniqueOperationNamesRule, LoneAnonymousOperationRule, SingleFieldSubscriptionsRule, KnownTypeNamesRule, FragmentsOnCompositeTypesRule, VariablesAreInputTypesRule, ScalarLeafsRule, FieldsOnCorrectTypeRule, UniqueFragmentNamesRule, KnownFragmentNamesRule, NoUnusedFragmentsRule, PossibleFragmentSpreadsRule, NoFragmentCyclesRule, UniqueVariableNamesRule, NoUndefinedVariablesRule, NoUnusedVariablesRule, KnownDirectivesRule, UniqueDirectivesPerLocationRule, KnownArgumentNamesRule, UniqueArgumentNamesRule, ValuesOfCorrectTypeRule, ProvidedRequiredArgumentsRule, VariablesInAllowedPositionRule, OverlappingFieldsCanBeMergedRule, UniqueInputFieldNamesRule]); -/** - * @internal - */ - -export var specifiedSDLRules = Object.freeze([LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, KnownTypeNamesRule, KnownDirectivesRule, UniqueDirectivesPerLocationRule, PossibleTypeExtensionsRule, KnownArgumentNamesOnDirectivesRule, UniqueArgumentNamesRule, UniqueInputFieldNamesRule, ProvidedRequiredArgumentsOnDirectivesRule]); diff --git a/JS/node_modules/graphql/validation/validate.d.ts b/JS/node_modules/graphql/validation/validate.d.ts deleted file mode 100644 index 5e93a8c..0000000 --- a/JS/node_modules/graphql/validation/validate.d.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { Maybe } from '../jsutils/Maybe'; - -import { GraphQLError } from '../error/GraphQLError'; - -import { DocumentNode } from '../language/ast'; - -import { GraphQLSchema } from '../type/schema'; - -import { TypeInfo } from '../utilities/TypeInfo'; - -import { ValidationRule, SDLValidationRule } 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, - typeInfo?: TypeInfo, - options?: { maxErrors?: number }, -): ReadonlyArray; - -/** - * @internal - */ -export function validateSDL( - documentAST: DocumentNode, - schemaToExtend?: Maybe, - rules?: ReadonlyArray, -): Array; - -/** - * Utility function which asserts a SDL document is valid by throwing an error - * if it is invalid. - * - * @internal - */ -export function assertValidSDL(documentAST: DocumentNode): void; - -/** - * 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; diff --git a/JS/node_modules/graphql/validation/validate.js b/JS/node_modules/graphql/validation/validate.js deleted file mode 100644 index 04b823f..0000000 --- a/JS/node_modules/graphql/validation/validate.js +++ /dev/null @@ -1,128 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.validate = validate; -exports.validateSDL = validateSDL; -exports.assertValidSDL = assertValidSDL; -exports.assertValidSDLExtension = assertValidSDLExtension; - -var _devAssert = _interopRequireDefault(require("../jsutils/devAssert.js")); - -var _GraphQLError = require("../error/GraphQLError.js"); - -var _visitor = require("../language/visitor.js"); - -var _validate = require("../type/validate.js"); - -var _TypeInfo = require("../utilities/TypeInfo.js"); - -var _specifiedRules = require("./specifiedRules.js"); - -var _ValidationContext = require("./ValidationContext.js"); - -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); - var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { - maxErrors: undefined - }; - documentAST || (0, _devAssert.default)(0, 'Must provide document.'); // If the schema used for validation is invalid, throw an error. - - (0, _validate.assertValidSchema)(schema); - var abortObj = Object.freeze({}); - var errors = []; - var context = new _ValidationContext.ValidationContext(schema, documentAST, typeInfo, function (error) { - if (options.maxErrors != null && errors.length >= options.maxErrors) { - errors.push(new _GraphQLError.GraphQLError('Too many validation errors, error limit reached. Validation aborted.')); - throw abortObj; - } - - errors.push(error); - }); // 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. - - try { - (0, _visitor.visit)(documentAST, (0, _TypeInfo.visitWithTypeInfo)(typeInfo, visitor)); - } catch (e) { - if (e !== abortObj) { - throw e; - } - } - - return errors; -} -/** - * @internal - */ - - -function validateSDL(documentAST, schemaToExtend) { - var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _specifiedRules.specifiedSDLRules; - var errors = []; - var context = new _ValidationContext.SDLValidationContext(documentAST, schemaToExtend, function (error) { - errors.push(error); - }); - var visitors = rules.map(function (rule) { - return rule(context); - }); - (0, _visitor.visit)(documentAST, (0, _visitor.visitInParallel)(visitors)); - return errors; -} -/** - * 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/JS/node_modules/graphql/validation/validate.js.flow b/JS/node_modules/graphql/validation/validate.js.flow deleted file mode 100644 index 26dc0a5..0000000 --- a/JS/node_modules/graphql/validation/validate.js.flow +++ /dev/null @@ -1,128 +0,0 @@ -// @flow strict -import devAssert from '../jsutils/devAssert'; - -import { GraphQLError } from '../error/GraphQLError'; - -import type { DocumentNode } from '../language/ast'; -import { visit, visitInParallel } from '../language/visitor'; - -import type { GraphQLSchema } from '../type/schema'; -import { assertValidSchema } from '../type/validate'; - -import { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo'; - -import type { SDLValidationRule, ValidationRule } from './ValidationContext'; -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: GraphQLSchema, - documentAST: DocumentNode, - rules: $ReadOnlyArray = specifiedRules, - typeInfo: TypeInfo = new TypeInfo(schema), - options: {| maxErrors?: number |} = { maxErrors: undefined }, -): $ReadOnlyArray { - devAssert(documentAST, 'Must provide document.'); - // If the schema used for validation is invalid, throw an error. - assertValidSchema(schema); - - const abortObj = Object.freeze({}); - const errors = []; - const context = new ValidationContext( - schema, - documentAST, - typeInfo, - (error) => { - if (options.maxErrors != null && errors.length >= options.maxErrors) { - errors.push( - new GraphQLError( - 'Too many validation errors, error limit reached. Validation aborted.', - ), - ); - throw abortObj; - } - errors.push(error); - }, - ); - - // 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. - try { - visit(documentAST, visitWithTypeInfo(typeInfo, visitor)); - } catch (e) { - if (e !== abortObj) { - throw e; - } - } - return errors; -} - -/** - * @internal - */ -export function validateSDL( - documentAST: DocumentNode, - schemaToExtend?: ?GraphQLSchema, - rules: $ReadOnlyArray = specifiedSDLRules, -): $ReadOnlyArray { - const errors = []; - const context = new SDLValidationContext( - documentAST, - schemaToExtend, - (error) => { - errors.push(error); - }, - ); - - const visitors = rules.map((rule) => rule(context)); - visit(documentAST, visitInParallel(visitors)); - return errors; -} - -/** - * 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/JS/node_modules/graphql/validation/validate.mjs b/JS/node_modules/graphql/validation/validate.mjs deleted file mode 100644 index 2ae71e7..0000000 --- a/JS/node_modules/graphql/validation/validate.mjs +++ /dev/null @@ -1,107 +0,0 @@ -import devAssert from "../jsutils/devAssert.mjs"; -import { GraphQLError } from "../error/GraphQLError.mjs"; -import { visit, visitInParallel } from "../language/visitor.mjs"; -import { assertValidSchema } from "../type/validate.mjs"; -import { TypeInfo, visitWithTypeInfo } from "../utilities/TypeInfo.mjs"; -import { specifiedRules, specifiedSDLRules } from "./specifiedRules.mjs"; -import { SDLValidationContext, ValidationContext } from "./ValidationContext.mjs"; -/** - * 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); - var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : { - maxErrors: undefined - }; - documentAST || devAssert(0, 'Must provide document.'); // If the schema used for validation is invalid, throw an error. - - assertValidSchema(schema); - var abortObj = Object.freeze({}); - var errors = []; - var context = new ValidationContext(schema, documentAST, typeInfo, function (error) { - if (options.maxErrors != null && errors.length >= options.maxErrors) { - errors.push(new GraphQLError('Too many validation errors, error limit reached. Validation aborted.')); - throw abortObj; - } - - errors.push(error); - }); // 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. - - try { - visit(documentAST, visitWithTypeInfo(typeInfo, visitor)); - } catch (e) { - if (e !== abortObj) { - throw e; - } - } - - return errors; -} -/** - * @internal - */ - -export function validateSDL(documentAST, schemaToExtend) { - var rules = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : specifiedSDLRules; - var errors = []; - var context = new SDLValidationContext(documentAST, schemaToExtend, function (error) { - errors.push(error); - }); - var visitors = rules.map(function (rule) { - return rule(context); - }); - visit(documentAST, visitInParallel(visitors)); - return errors; -} -/** - * 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/JS/node_modules/graphql/version.d.ts b/JS/node_modules/graphql/version.d.ts deleted file mode 100644 index 765329b..0000000 --- a/JS/node_modules/graphql/version.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * A string containing the version of the GraphQL.js library - */ -export const version: string; - -/** - * An object containing the components of the GraphQL.js version string - */ -export const versionInfo: { - major: number; - minor: number; - patch: number; - preReleaseTag: number | null; -}; diff --git a/JS/node_modules/graphql/version.js b/JS/node_modules/graphql/version.js deleted file mode 100644 index 6fc1e91..0000000 --- a/JS/node_modules/graphql/version.js +++ /dev/null @@ -1,28 +0,0 @@ -"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 "npm version" command. - */ - -/** - * A string containing the version of the GraphQL.js library - */ -var version = '15.5.3'; -/** - * An object containing the components of the GraphQL.js version string - */ - -exports.version = version; -var versionInfo = Object.freeze({ - major: 15, - minor: 5, - patch: 3, - preReleaseTag: null -}); -exports.versionInfo = versionInfo; diff --git a/JS/node_modules/graphql/version.js.flow b/JS/node_modules/graphql/version.js.flow deleted file mode 100644 index bffcf5b..0000000 --- a/JS/node_modules/graphql/version.js.flow +++ /dev/null @@ -1,20 +0,0 @@ -// @flow strict -/** - * Note: This file is autogenerated using "resources/gen-version.js" script and - * automatically updated by "npm version" command. - */ - -/** - * A string containing the version of the GraphQL.js library - */ -export const version = '15.5.3'; - -/** - * An object containing the components of the GraphQL.js version string - */ -export const versionInfo = Object.freeze({ - major: 15, - minor: 5, - patch: 3, - preReleaseTag: null, -}); diff --git a/JS/node_modules/graphql/version.mjs b/JS/node_modules/graphql/version.mjs deleted file mode 100644 index e08695f..0000000 --- a/JS/node_modules/graphql/version.mjs +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Note: This file is autogenerated using "resources/gen-version.js" script and - * automatically updated by "npm version" command. - */ - -/** - * A string containing the version of the GraphQL.js library - */ -export var version = '15.5.3'; -/** - * An object containing the components of the GraphQL.js version string - */ - -export var versionInfo = Object.freeze({ - major: 15, - minor: 5, - patch: 3, - preReleaseTag: null -}); diff --git a/JS/node_modules/node-fetch/CHANGELOG.md b/JS/node_modules/node-fetch/CHANGELOG.md deleted file mode 100644 index 543d3d9..0000000 --- a/JS/node_modules/node-fetch/CHANGELOG.md +++ /dev/null @@ -1,272 +0,0 @@ - -Changelog -========= - - -# 2.x release - -## v2.6.1 - -**This is an important security release. It is strongly recommended to update as soon as possible.** - -- Fix: honor the `size` option after following a redirect. - -## v2.6.0 - -- Enhance: `options.agent`, it now accepts a function that returns custom http(s).Agent instance based on current URL, see readme for more information. -- Fix: incorrect `Content-Length` was returned for stream body in 2.5.0 release; note that `node-fetch` doesn't calculate content length for stream body. -- Fix: `Response.url` should return empty string instead of `null` by default. - -## v2.5.0 - -- Enhance: `Response` object now includes `redirected` property. -- Enhance: `fetch()` now accepts third-party `Blob` implementation as body. -- Other: disable `package-lock.json` generation as we never commit them. -- Other: dev dependency update. -- Other: readme update. - -## v2.4.1 - -- Fix: `Blob` import rule for node < 10, as `Readable` isn't a named export. - -## v2.4.0 - -- Enhance: added `Brotli` compression support (using node's zlib). -- Enhance: updated `Blob` implementation per spec. -- Fix: set content type automatically for `URLSearchParams`. -- Fix: `Headers` now reject empty header names. -- Fix: test cases, as node 12+ no longer accepts invalid header response. - -## v2.3.0 - -- Enhance: added `AbortSignal` support, with README example. -- Enhance: handle invalid `Location` header during redirect by rejecting them explicitly with `FetchError`. -- Fix: update `browser.js` to support react-native environment, where `self` isn't available globally. - -## v2.2.1 - -- Fix: `compress` flag shouldn't overwrite existing `Accept-Encoding` header. -- Fix: multiple `import` rules, where `PassThrough` etc. doesn't have a named export when using node <10 and `--exerimental-modules` flag. -- Other: Better README. - -## v2.2.0 - -- Enhance: Support all `ArrayBuffer` view types -- Enhance: Support Web Workers -- Enhance: Support Node.js' `--experimental-modules` mode; deprecate `.es.js` file -- Fix: Add `__esModule` property to the exports object -- Other: Better example in README for writing response to a file -- Other: More tests for Agent - -## v2.1.2 - -- Fix: allow `Body` methods to work on `ArrayBuffer`-backed `Body` objects -- Fix: reject promise returned by `Body` methods when the accumulated `Buffer` exceeds the maximum size -- Fix: support custom `Host` headers with any casing -- Fix: support importing `fetch()` from TypeScript in `browser.js` -- Fix: handle the redirect response body properly - -## v2.1.1 - -Fix packaging errors in v2.1.0. - -## v2.1.0 - -- Enhance: allow using ArrayBuffer as the `body` of a `fetch()` or `Request` -- Fix: store HTTP headers of a `Headers` object internally with the given case, for compatibility with older servers that incorrectly treated header names in a case-sensitive manner -- Fix: silently ignore invalid HTTP headers -- Fix: handle HTTP redirect responses without a `Location` header just like non-redirect responses -- Fix: include bodies when following a redirection when appropriate - -## v2.0.0 - -This is a major release. Check [our upgrade guide](https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md) for an overview on some key differences between v1 and v2. - -### General changes - -- Major: Node.js 0.10.x and 0.12.x support is dropped -- Major: `require('node-fetch/lib/response')` etc. is now unsupported; use `require('node-fetch').Response` or ES6 module imports -- Enhance: start testing on Node.js v4.x, v6.x, v8.x LTS, as well as v9.x stable -- Enhance: use Rollup to produce a distributed bundle (less memory overhead and faster startup) -- Enhance: make `Object.prototype.toString()` on Headers, Requests, and Responses return correct class strings -- Other: rewrite in ES2015 using Babel -- Other: use Codecov for code coverage tracking -- Other: update package.json script for npm 5 -- Other: `encoding` module is now optional (alpha.7) -- Other: expose browser.js through package.json, avoid bundling mishaps (alpha.9) -- Other: allow TypeScript to `import` node-fetch by exposing default (alpha.9) - -### HTTP requests - -- Major: overwrite user's `Content-Length` if we can be sure our information is correct (per spec) -- Fix: errors in a response are caught before the body is accessed -- Fix: support WHATWG URL objects, created by `whatwg-url` package or `require('url').URL` in Node.js 7+ - -### Response and Request classes - -- Major: `response.text()` no longer attempts to detect encoding, instead always opting for UTF-8 (per spec); use `response.textConverted()` for the v1 behavior -- Major: make `response.json()` throw error instead of returning an empty object on 204 no-content respose (per spec; reverts behavior changed in v1.6.2) -- Major: internal methods are no longer exposed -- Major: throw error when a `GET` or `HEAD` Request is constructed with a non-null body (per spec) -- Enhance: add `response.arrayBuffer()` (also applies to Requests) -- Enhance: add experimental `response.blob()` (also applies to Requests) -- Enhance: `URLSearchParams` is now accepted as a body -- Enhance: wrap `response.json()` json parsing error as `FetchError` -- Fix: fix Request and Response with `null` body - -### Headers class - -- Major: remove `headers.getAll()`; make `get()` return all headers delimited by commas (per spec) -- Enhance: make Headers iterable -- Enhance: make Headers constructor accept an array of tuples -- Enhance: make sure header names and values are valid in HTTP -- Fix: coerce Headers prototype function parameters to strings, where applicable - -### Documentation - -- Enhance: more comprehensive API docs -- Enhance: add a list of default headers in README - - -# 1.x release - -## backport releases (v1.7.0 and beyond) - -See [changelog on 1.x branch](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) for details. - -## v1.6.3 - -- Enhance: error handling document to explain `FetchError` design -- Fix: support `form-data` 2.x releases (requires `form-data` >= 2.1.0) - -## v1.6.2 - -- Enhance: minor document update -- Fix: response.json() returns empty object on 204 no-content response instead of throwing a syntax error - -## v1.6.1 - -- Fix: if `res.body` is a non-stream non-formdata object, we will call `body.toString` and send it as a string -- Fix: `counter` value is incorrectly set to `follow` value when wrapping Request instance -- Fix: documentation update - -## v1.6.0 - -- Enhance: added `res.buffer()` api for convenience, it returns body as a Node.js buffer -- Enhance: better old server support by handling raw deflate response -- Enhance: skip encoding detection for non-HTML/XML response -- Enhance: minor document update -- Fix: HEAD request doesn't need decompression, as body is empty -- Fix: `req.body` now accepts a Node.js buffer - -## v1.5.3 - -- Fix: handle 204 and 304 responses when body is empty but content-encoding is gzip/deflate -- Fix: allow resolving response and cloned response in any order -- Fix: avoid setting `content-length` when `form-data` body use streams -- Fix: send DELETE request with content-length when body is present -- Fix: allow any url when calling new Request, but still reject non-http(s) url in fetch - -## v1.5.2 - -- Fix: allow node.js core to handle keep-alive connection pool when passing a custom agent - -## v1.5.1 - -- Fix: redirect mode `manual` should work even when there is no redirection or broken redirection - -## v1.5.0 - -- Enhance: rejected promise now use custom `Error` (thx to @pekeler) -- Enhance: `FetchError` contains `err.type` and `err.code`, allows for better error handling (thx to @pekeler) -- Enhance: basic support for redirect mode `manual` and `error`, allows for location header extraction (thx to @jimmywarting for the initial PR) - -## v1.4.1 - -- Fix: wrapping Request instance with FormData body again should preserve the body as-is - -## v1.4.0 - -- Enhance: Request and Response now have `clone` method (thx to @kirill-konshin for the initial PR) -- Enhance: Request and Response now have proper string and buffer body support (thx to @kirill-konshin) -- Enhance: Body constructor has been refactored out (thx to @kirill-konshin) -- Enhance: Headers now has `forEach` method (thx to @tricoder42) -- Enhance: back to 100% code coverage -- Fix: better form-data support (thx to @item4) -- Fix: better character encoding detection under chunked encoding (thx to @dsuket for the initial PR) - -## v1.3.3 - -- Fix: make sure `Content-Length` header is set when body is string for POST/PUT/PATCH requests -- Fix: handle body stream error, for cases such as incorrect `Content-Encoding` header -- Fix: when following certain redirects, use `GET` on subsequent request per Fetch Spec -- Fix: `Request` and `Response` constructors now parse headers input using `Headers` - -## v1.3.2 - -- Enhance: allow auto detect of form-data input (no `FormData` spec on node.js, this is form-data specific feature) - -## v1.3.1 - -- Enhance: allow custom host header to be set (server-side only feature, as it's a forbidden header on client-side) - -## v1.3.0 - -- Enhance: now `fetch.Request` is exposed as well - -## v1.2.1 - -- Enhance: `Headers` now normalized `Number` value to `String`, prevent common mistakes - -## v1.2.0 - -- Enhance: now fetch.Headers and fetch.Response are exposed, making testing easier - -## v1.1.2 - -- Fix: `Headers` should only support `String` and `Array` properties, and ignore others - -## v1.1.1 - -- Enhance: now req.headers accept both plain object and `Headers` instance - -## v1.1.0 - -- Enhance: timeout now also applies to response body (in case of slow response) -- Fix: timeout is now cleared properly when fetch is done/has failed - -## v1.0.6 - -- Fix: less greedy content-type charset matching - -## v1.0.5 - -- Fix: when `follow = 0`, fetch should not follow redirect -- Enhance: update tests for better coverage -- Enhance: code formatting -- Enhance: clean up doc - -## v1.0.4 - -- Enhance: test iojs support -- Enhance: timeout attached to socket event only fire once per redirect - -## v1.0.3 - -- Fix: response size limit should reject large chunk -- Enhance: added character encoding detection for xml, such as rss/atom feed (encoding in DTD) - -## v1.0.2 - -- Fix: added res.ok per spec change - -## v1.0.0 - -- Enhance: better test coverage and doc - - -# 0.x release - -## v0.1 - -- Major: initial public release diff --git a/JS/node_modules/node-fetch/LICENSE.md b/JS/node_modules/node-fetch/LICENSE.md deleted file mode 100644 index 660ffec..0000000 --- a/JS/node_modules/node-fetch/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2016 David Frank - -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/JS/node_modules/node-fetch/README.md b/JS/node_modules/node-fetch/README.md deleted file mode 100644 index 2dde742..0000000 --- a/JS/node_modules/node-fetch/README.md +++ /dev/null @@ -1,590 +0,0 @@ -node-fetch -========== - -[![npm version][npm-image]][npm-url] -[![build status][travis-image]][travis-url] -[![coverage status][codecov-image]][codecov-url] -[![install size][install-size-image]][install-size-url] -[![Discord][discord-image]][discord-url] - -A light-weight module that brings `window.fetch` to Node.js - -(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567)) - -[![Backers][opencollective-image]][opencollective-url] - - - -- [Motivation](#motivation) -- [Features](#features) -- [Difference from client-side fetch](#difference-from-client-side-fetch) -- [Installation](#installation) -- [Loading and configuring the module](#loading-and-configuring-the-module) -- [Common Usage](#common-usage) - - [Plain text or HTML](#plain-text-or-html) - - [JSON](#json) - - [Simple Post](#simple-post) - - [Post with JSON](#post-with-json) - - [Post with form parameters](#post-with-form-parameters) - - [Handling exceptions](#handling-exceptions) - - [Handling client and server errors](#handling-client-and-server-errors) -- [Advanced Usage](#advanced-usage) - - [Streams](#streams) - - [Buffer](#buffer) - - [Accessing Headers and other Meta data](#accessing-headers-and-other-meta-data) - - [Extract Set-Cookie Header](#extract-set-cookie-header) - - [Post data using a file stream](#post-data-using-a-file-stream) - - [Post with form-data (detect multipart)](#post-with-form-data-detect-multipart) - - [Request cancellation with AbortSignal](#request-cancellation-with-abortsignal) -- [API](#api) - - [fetch(url[, options])](#fetchurl-options) - - [Options](#options) - - [Class: Request](#class-request) - - [Class: Response](#class-response) - - [Class: Headers](#class-headers) - - [Interface: Body](#interface-body) - - [Class: FetchError](#class-fetcherror) -- [License](#license) -- [Acknowledgement](#acknowledgement) - - - -## Motivation - -Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime. - -See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side). - -## Features - -- Stay consistent with `window.fetch` API. -- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences. -- Use native promise but allow substituting it with [insert your favorite promise library]. -- Use native Node streams for body on both request and response. -- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically. -- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting. - -## Difference from client-side fetch - -- See [Known Differences](LIMITS.md) for details. -- If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue. -- Pull requests are welcomed too! - -## Installation - -Current stable release (`2.x`) - -```sh -$ npm install node-fetch -``` - -## Loading and configuring the module -We suggest you load the module via `require` until the stabilization of ES modules in node: -```js -const fetch = require('node-fetch'); -``` - -If you are using a Promise library other than native, set it through `fetch.Promise`: -```js -const Bluebird = require('bluebird'); - -fetch.Promise = Bluebird; -``` - -## Common Usage - -NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences. - -#### Plain text or HTML -```js -fetch('https://github.com/') - .then(res => res.text()) - .then(body => console.log(body)); -``` - -#### JSON - -```js - -fetch('https://api.github.com/users/github') - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Simple Post -```js -fetch('https://httpbin.org/post', { method: 'POST', body: 'a=1' }) - .then(res => res.json()) // expecting a json response - .then(json => console.log(json)); -``` - -#### Post with JSON - -```js -const body = { a: 1 }; - -fetch('https://httpbin.org/post', { - method: 'post', - body: JSON.stringify(body), - headers: { 'Content-Type': 'application/json' }, - }) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Post with form parameters -`URLSearchParams` is available in Node.js as of v7.5.0. See [official documentation](https://nodejs.org/api/url.html#url_class_urlsearchparams) for more usage methods. - -NOTE: The `Content-Type` header is only set automatically to `x-www-form-urlencoded` when an instance of `URLSearchParams` is given as such: - -```js -const { URLSearchParams } = require('url'); - -const params = new URLSearchParams(); -params.append('a', 1); - -fetch('https://httpbin.org/post', { method: 'POST', body: params }) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Handling exceptions -NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information. - -Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details. - -```js -fetch('https://domain.invalid/') - .catch(err => console.error(err)); -``` - -#### Handling client and server errors -It is common to create a helper function to check that the response contains no client (4xx) or server (5xx) error responses: - -```js -function checkStatus(res) { - if (res.ok) { // res.status >= 200 && res.status < 300 - return res; - } else { - throw MyCustomError(res.statusText); - } -} - -fetch('https://httpbin.org/status/400') - .then(checkStatus) - .then(res => console.log('will not get here...')) -``` - -## Advanced Usage - -#### Streams -The "Node.js way" is to use streams when possible: - -```js -fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') - .then(res => { - const dest = fs.createWriteStream('./octocat.png'); - res.body.pipe(dest); - }); -``` - -#### Buffer -If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API) - -```js -const fileType = require('file-type'); - -fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png') - .then(res => res.buffer()) - .then(buffer => fileType(buffer)) - .then(type => { /* ... */ }); -``` - -#### Accessing Headers and other Meta data -```js -fetch('https://github.com/') - .then(res => { - console.log(res.ok); - console.log(res.status); - console.log(res.statusText); - console.log(res.headers.raw()); - console.log(res.headers.get('content-type')); - }); -``` - -#### Extract Set-Cookie Header - -Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API. - -```js -fetch(url).then(res => { - // returns an array of values, instead of a string of comma-separated values - console.log(res.headers.raw()['set-cookie']); -}); -``` - -#### Post data using a file stream - -```js -const { createReadStream } = require('fs'); - -const stream = createReadStream('input.txt'); - -fetch('https://httpbin.org/post', { method: 'POST', body: stream }) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Post with form-data (detect multipart) - -```js -const FormData = require('form-data'); - -const form = new FormData(); -form.append('a', 1); - -fetch('https://httpbin.org/post', { method: 'POST', body: form }) - .then(res => res.json()) - .then(json => console.log(json)); - -// OR, using custom headers -// NOTE: getHeaders() is non-standard API - -const form = new FormData(); -form.append('a', 1); - -const options = { - method: 'POST', - body: form, - headers: form.getHeaders() -} - -fetch('https://httpbin.org/post', options) - .then(res => res.json()) - .then(json => console.log(json)); -``` - -#### Request cancellation with AbortSignal - -> NOTE: You may cancel streamed requests only on Node >= v8.0.0 - -You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller). - -An example of timing out a request after 150ms could be achieved as the following: - -```js -import AbortController from 'abort-controller'; - -const controller = new AbortController(); -const timeout = setTimeout( - () => { controller.abort(); }, - 150, -); - -fetch(url, { signal: controller.signal }) - .then(res => res.json()) - .then( - data => { - useData(data) - }, - err => { - if (err.name === 'AbortError') { - // request was aborted - } - }, - ) - .finally(() => { - clearTimeout(timeout); - }); -``` - -See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js) for more examples. - - -## API - -### fetch(url[, options]) - -- `url` A string representing the URL for fetching -- `options` [Options](#fetch-options) for the HTTP(S) request -- Returns: Promise<[Response](#class-response)> - -Perform an HTTP(S) fetch. - -`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`. - - -### Options - -The default values are shown after each option key. - -```js -{ - // These properties are part of the Fetch Standard - method: 'GET', - headers: {}, // request headers. format is the identical to that accepted by the Headers constructor (see below) - body: null, // request body. can be null, a string, a Buffer, a Blob, or a Node.js Readable stream - redirect: 'follow', // set to `manual` to extract redirect headers, `error` to reject redirect - signal: null, // pass an instance of AbortSignal to optionally abort requests - - // The following properties are node-fetch extensions - follow: 20, // maximum redirect count. 0 to not follow redirect - timeout: 0, // req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies). Signal is recommended instead. - compress: true, // support gzip/deflate content encoding. false to disable - size: 0, // maximum response body size in bytes. 0 to disable - agent: null // http(s).Agent instance or function that returns an instance (see below) -} -``` - -##### Default Headers - -If no values are set, the following request headers will be sent automatically: - -Header | Value -------------------- | -------------------------------------------------------- -`Accept-Encoding` | `gzip,deflate` _(when `options.compress === true`)_ -`Accept` | `*/*` -`Connection` | `close` _(when no `options.agent` is present)_ -`Content-Length` | _(automatically calculated, if possible)_ -`Transfer-Encoding` | `chunked` _(when `req.body` is a stream)_ -`User-Agent` | `node-fetch/1.0 (+https://github.com/bitinn/node-fetch)` - -Note: when `body` is a `Stream`, `Content-Length` is not set automatically. - -##### Custom Agent - -The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following: - -- Support self-signed certificate -- Use only IPv4 or IPv6 -- Custom DNS Lookup - -See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information. - -In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol. - -```js -const httpAgent = new http.Agent({ - keepAlive: true -}); -const httpsAgent = new https.Agent({ - keepAlive: true -}); - -const options = { - agent: function (_parsedURL) { - if (_parsedURL.protocol == 'http:') { - return httpAgent; - } else { - return httpsAgent; - } - } -} -``` - - -### Class: Request - -An HTTP(S) request containing information about URL, method, headers, and the body. This class implements the [Body](#iface-body) interface. - -Due to the nature of Node.js, the following properties are not implemented at this moment: - -- `type` -- `destination` -- `referrer` -- `referrerPolicy` -- `mode` -- `credentials` -- `cache` -- `integrity` -- `keepalive` - -The following node-fetch extension properties are provided: - -- `follow` -- `compress` -- `counter` -- `agent` - -See [options](#fetch-options) for exact meaning of these extensions. - -#### new Request(input[, options]) - -*(spec-compliant)* - -- `input` A string representing a URL, or another `Request` (which will be cloned) -- `options` [Options][#fetch-options] for the HTTP(S) request - -Constructs a new `Request` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - -In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object. - - -### Class: Response - -An HTTP(S) response. This class implements the [Body](#iface-body) interface. - -The following properties are not implemented in node-fetch at this moment: - -- `Response.error()` -- `Response.redirect()` -- `type` -- `trailer` - -#### new Response([body[, options]]) - -*(spec-compliant)* - -- `body` A `String` or [`Readable` stream][node-readable] -- `options` A [`ResponseInit`][response-init] options dictionary - -Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response). - -Because Node.js does not implement service workers (for which this class was designed), one rarely has to construct a `Response` directly. - -#### response.ok - -*(spec-compliant)* - -Convenience property representing if the request ended normally. Will evaluate to true if the response status was greater than or equal to 200 but smaller than 300. - -#### response.redirected - -*(spec-compliant)* - -Convenience property representing if the request has been redirected at least once. Will evaluate to true if the internal redirect counter is greater than 0. - - -### Class: Headers - -This class allows manipulating and iterating over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are implemented. - -#### new Headers([init]) - -*(spec-compliant)* - -- `init` Optional argument to pre-fill the `Headers` object - -Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object. - -```js -// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class - -const meta = { - 'Content-Type': 'text/xml', - 'Breaking-Bad': '<3' -}; -const headers = new Headers(meta); - -// The above is equivalent to -const meta = [ - [ 'Content-Type', 'text/xml' ], - [ 'Breaking-Bad', '<3' ] -]; -const headers = new Headers(meta); - -// You can in fact use any iterable objects, like a Map or even another Headers -const meta = new Map(); -meta.set('Content-Type', 'text/xml'); -meta.set('Breaking-Bad', '<3'); -const headers = new Headers(meta); -const copyOfHeaders = new Headers(headers); -``` - - -### Interface: Body - -`Body` is an abstract interface with methods that are applicable to both `Request` and `Response` classes. - -The following methods are not yet implemented in node-fetch at this moment: - -- `formData()` - -#### body.body - -*(deviation from spec)* - -* Node.js [`Readable` stream][node-readable] - -Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable]. - -#### body.bodyUsed - -*(spec-compliant)* - -* `Boolean` - -A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again. - -#### body.arrayBuffer() -#### body.blob() -#### body.json() -#### body.text() - -*(spec-compliant)* - -* Returns: Promise - -Consume the body and return a promise that will resolve to one of these formats. - -#### body.buffer() - -*(node-fetch extension)* - -* Returns: Promise<Buffer> - -Consume the body and return a promise that will resolve to a Buffer. - -#### body.textConverted() - -*(node-fetch extension)* - -* Returns: Promise<String> - -Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible. - -(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.) - - -### Class: FetchError - -*(node-fetch extension)* - -An operational error in the fetching process. See [ERROR-HANDLING.md][] for more info. - - -### Class: AbortError - -*(node-fetch extension)* - -An Error thrown when the request is aborted in response to an `AbortSignal`'s `abort` event. It has a `name` property of `AbortError`. See [ERROR-HANDLING.MD][] for more info. - -## Acknowledgement - -Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation reference. - -`node-fetch` v1 was maintained by [@bitinn](https://github.com/bitinn); v2 was maintained by [@TimothyGu](https://github.com/timothygu), [@bitinn](https://github.com/bitinn) and [@jimmywarting](https://github.com/jimmywarting); v2 readme is written by [@jkantr](https://github.com/jkantr). - -## License - -MIT - -[npm-image]: https://flat.badgen.net/npm/v/node-fetch -[npm-url]: https://www.npmjs.com/package/node-fetch -[travis-image]: https://flat.badgen.net/travis/bitinn/node-fetch -[travis-url]: https://travis-ci.org/bitinn/node-fetch -[codecov-image]: https://flat.badgen.net/codecov/c/github/bitinn/node-fetch/master -[codecov-url]: https://codecov.io/gh/bitinn/node-fetch -[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch -[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch -[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square -[discord-url]: https://discord.gg/Zxbndcm -[opencollective-image]: https://opencollective.com/node-fetch/backers.svg -[opencollective-url]: https://opencollective.com/node-fetch -[whatwg-fetch]: https://fetch.spec.whatwg.org/ -[response-init]: https://fetch.spec.whatwg.org/#responseinit -[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams -[mdn-headers]: https://developer.mozilla.org/en-US/docs/Web/API/Headers -[LIMITS.md]: https://github.com/bitinn/node-fetch/blob/master/LIMITS.md -[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md -[UPGRADE-GUIDE.md]: https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md diff --git a/JS/node_modules/node-fetch/browser.js b/JS/node_modules/node-fetch/browser.js deleted file mode 100644 index 83c54c5..0000000 --- a/JS/node_modules/node-fetch/browser.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict"; - -// ref: https://github.com/tc39/proposal-global -var getGlobal = function () { - // the only reliable means to get the global object is - // `Function('return this')()` - // However, this causes CSP violations in Chrome apps. - if (typeof self !== 'undefined') { return self; } - if (typeof window !== 'undefined') { return window; } - if (typeof global !== 'undefined') { return global; } - throw new Error('unable to locate global object'); -} - -var global = getGlobal(); - -module.exports = exports = global.fetch; - -// Needed for TypeScript and Webpack. -if (global.fetch) { - exports.default = global.fetch.bind(global); -} - -exports.Headers = global.Headers; -exports.Request = global.Request; -exports.Response = global.Response; \ No newline at end of file diff --git a/JS/node_modules/node-fetch/lib/index.es.js b/JS/node_modules/node-fetch/lib/index.es.js deleted file mode 100644 index 61906c9..0000000 --- a/JS/node_modules/node-fetch/lib/index.es.js +++ /dev/null @@ -1,1640 +0,0 @@ -process.emitWarning("The .es.js file is deprecated. Use .mjs instead."); - -import Stream from 'stream'; -import http from 'http'; -import Url from 'url'; -import https from 'https'; -import zlib from 'zlib'; - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = require('encoding').convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parse_url(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parse_url(`${input}`); - } - input = {}; - } else { - parsedURL = parse_url(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; -const resolve_url = Url.resolve; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - const locationURL = location === null ? null : resolve_url(request.url, location); - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -export default fetch; -export { Headers, Request, Response, FetchError }; diff --git a/JS/node_modules/node-fetch/lib/index.js b/JS/node_modules/node-fetch/lib/index.js deleted file mode 100644 index 4b241bf..0000000 --- a/JS/node_modules/node-fetch/lib/index.js +++ /dev/null @@ -1,1649 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Stream = _interopDefault(require('stream')); -var http = _interopDefault(require('http')); -var Url = _interopDefault(require('url')); -var https = _interopDefault(require('https')); -var zlib = _interopDefault(require('zlib')); - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = require('encoding').convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parse_url(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parse_url(`${input}`); - } - input = {}; - } else { - parsedURL = parse_url(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; -const resolve_url = Url.resolve; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - const locationURL = location === null ? null : resolve_url(request.url, location); - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = exports; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports.FetchError = FetchError; diff --git a/JS/node_modules/node-fetch/lib/index.mjs b/JS/node_modules/node-fetch/lib/index.mjs deleted file mode 100644 index ecf59af..0000000 --- a/JS/node_modules/node-fetch/lib/index.mjs +++ /dev/null @@ -1,1638 +0,0 @@ -import Stream from 'stream'; -import http from 'http'; -import Url from 'url'; -import https from 'https'; -import zlib from 'zlib'; - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = require('encoding').convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parse_url(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parse_url(`${input}`); - } - input = {}; - } else { - parsedURL = parse_url(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; -const resolve_url = Url.resolve; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - const locationURL = location === null ? null : resolve_url(request.url, location); - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -export default fetch; -export { Headers, Request, Response, FetchError }; diff --git a/JS/node_modules/node-fetch/package.json b/JS/node_modules/node-fetch/package.json deleted file mode 100644 index 2160469..0000000 --- a/JS/node_modules/node-fetch/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "node-fetch", - "version": "2.6.1", - "description": "A light-weight module that brings window.fetch to node.js", - "main": "lib/index", - "browser": "./browser.js", - "module": "lib/index.mjs", - "files": [ - "lib/index.js", - "lib/index.mjs", - "lib/index.es.js", - "browser.js" - ], - "engines": { - "node": "4.x || >=6.0.0" - }, - "scripts": { - "build": "cross-env BABEL_ENV=rollup rollup -c", - "prepare": "npm run build", - "test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js", - "report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js", - "coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json" - }, - "repository": { - "type": "git", - "url": "https://github.com/bitinn/node-fetch.git" - }, - "keywords": [ - "fetch", - "http", - "promise" - ], - "author": "David Frank", - "license": "MIT", - "bugs": { - "url": "https://github.com/bitinn/node-fetch/issues" - }, - "homepage": "https://github.com/bitinn/node-fetch", - "devDependencies": { - "@ungap/url-search-params": "^0.1.2", - "abort-controller": "^1.1.0", - "abortcontroller-polyfill": "^1.3.0", - "babel-core": "^6.26.3", - "babel-plugin-istanbul": "^4.1.6", - "babel-preset-env": "^1.6.1", - "babel-register": "^6.16.3", - "chai": "^3.5.0", - "chai-as-promised": "^7.1.1", - "chai-iterator": "^1.1.1", - "chai-string": "~1.3.0", - "codecov": "^3.3.0", - "cross-env": "^5.2.0", - "form-data": "^2.3.3", - "is-builtin-module": "^1.0.0", - "mocha": "^5.0.0", - "nyc": "11.9.0", - "parted": "^0.1.1", - "promise": "^8.0.3", - "resumer": "0.0.0", - "rollup": "^0.63.4", - "rollup-plugin-babel": "^3.0.7", - "string-to-arraybuffer": "^1.0.2", - "whatwg-url": "^5.0.0" - }, - "dependencies": {} -} diff --git a/JS/node_modules/optimism/LICENSE b/JS/node_modules/optimism/LICENSE deleted file mode 100644 index d56df84..0000000 --- a/JS/node_modules/optimism/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/optimism/README.md b/JS/node_modules/optimism/README.md deleted file mode 100644 index 96a17f6..0000000 --- a/JS/node_modules/optimism/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# 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/JS/node_modules/optimism/lib/bundle.cjs.js b/JS/node_modules/optimism/lib/bundle.cjs.js deleted file mode 100644 index 50a51e9..0000000 --- a/JS/node_modules/optimism/lib/bundle.cjs.js +++ /dev/null @@ -1,508 +0,0 @@ -'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 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"); - } -} -function valueIs(a, b) { - var len = a.length; - return ( - // Unknown values are not equal to each other. - len > 0 && - // Both values must be ordinary (or both exceptional) to be equal. - len === b.length && - // The underlying value or exception must be the same. - a[len - 1] === b[len - 1]); -} -function valueGet(value) { - switch (value.length) { - case 0: throw new Error("unknown value"); - case 1: return value[0]; - case 2: throw value[1]; - } -} -function valueCopy(value) { - return value.slice(0); -} -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 = []; - ++Entry.count; - } - // This is the most important method of the Entry API, because it - // determines whether the cached this.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) valueGet(this.value) is usually returned without recomputation. - Entry.prototype.recompute = function () { - assert(!this.recomputing, "already recomputing"); - 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 mightBeDirty(this) - ? reallyRecompute(this) - : valueGet(this.value); - }; - Entry.prototype.setDirty = function () { - if (this.dirty) - return; - this.dirty = true; - this.value.length = 0; - 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, []); - } - if (mightBeDirty(child)) { - reportDirtyChild(parent, child); - } - else { - reportCleanChild(parent, child); - } - return parent; - } -} -function reallyRecompute(entry) { - // 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); - // Set entry as the parent entry while calling recomputeNewValue(entry). - parentEntrySlot.withValue(entry, recomputeNewValue, [entry]); - if (maybeSubscribe(entry)) { - // 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 valueGet(entry.value); -} -function recomputeNewValue(entry) { - entry.recomputing = true; - // Set entry.value as unknown. - entry.value.length = 0; - try { - // If entry.fn succeeds, entry.value will become a normal Value. - entry.value[0] = entry.fn.apply(null, entry.args); - } - catch (e) { - // If entry.fn throws, entry.value will become exceptional. - entry.value[1] = e; - } - // Either way, this line is always reached. - entry.recomputing = false; -} -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.length === 0) { - parent.childValues.set(child, valueCopy(child.value)); - } - else if (!valueIs(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); -} -var caches = new Set(); -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 === void 0) { - 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); - caches.add(cache); - // 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()) { - caches.forEach(function (cache) { return cache.clean(); }); - caches.clear(); - } - // 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 !== void 0 && 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/JS/node_modules/optimism/lib/bundle.cjs.js.map b/JS/node_modules/optimism/lib/bundle.cjs.js.map deleted file mode 100644 index 2fae899..0000000 --- a/JS/node_modules/optimism/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 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\n// Since exceptions are cached just like normal values, we need an efficient\n// way of representing unknown, ordinary, and exceptional values.\ntype Value =\n | [] // unknown\n | [T] // known value\n | [void, any]; // known exception\n\nfunction valueIs(a: Value, b: Value) {\n const len = a.length;\n return (\n // Unknown values are not equal to each other.\n len > 0 &&\n // Both values must be ordinary (or both exceptional) to be equal.\n len === b.length &&\n // The underlying value or exception must be the same.\n a[len - 1] === b[len - 1]\n );\n}\n\nfunction valueGet(value: Value): T {\n switch (value.length) {\n case 0: throw new Error(\"unknown value\");\n case 1: return value[0];\n case 2: throw value[1];\n }\n}\n\nfunction valueCopy(value: Value): Value {\n return value.slice(0) as Value;\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 readonly value: Value = [];\n\n constructor(\n public readonly fn: (...args: TArgs) => TValue,\n public args: TArgs,\n ) {\n ++Entry.count;\n }\n\n // This is the most important method of the Entry API, because it\n // determines whether the cached this.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) valueGet(this.value) is usually returned without recomputation.\n public recompute(): TValue {\n assert(! this.recomputing, \"already recomputing\");\n\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 mightBeDirty(this)\n ? reallyRecompute(this)\n : valueGet(this.value);\n }\n\n public setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value.length = 0;\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, []);\n }\n\n if (mightBeDirty(child)) {\n reportDirtyChild(parent, child);\n } else {\n reportCleanChild(parent, child);\n }\n\n return parent;\n }\n}\n\nfunction reallyRecompute(entry: AnyEntry) {\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 // Set entry as the parent entry while calling recomputeNewValue(entry).\n parentEntrySlot.withValue(entry, recomputeNewValue, [entry]);\n\n if (maybeSubscribe(entry)) {\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 // 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 valueGet(entry.value);\n}\n\nfunction recomputeNewValue(entry: AnyEntry) {\n entry.recomputing = true;\n // Set entry.value as unknown.\n entry.value.length = 0;\n try {\n // If entry.fn succeeds, entry.value will become a normal Value.\n entry.value[0] = entry.fn.apply(null, entry.args);\n } catch (e) {\n // If entry.fn throws, entry.value will become exceptional.\n entry.value[1] = e;\n }\n // Either way, this line is always reached.\n entry.recomputing = false;\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.length === 0) {\n parent.childValues.set(child, valueCopy(child.value));\n } else if (! valueIs(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, AnyEntry } 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\nconst caches = new Set>();\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 === void 0) {\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 caches.add(cache);\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 caches.forEach(cache => cache.clean());\n caches.clear();\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 !== void 0 && 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,C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G,EAAE,KAAK,CAAC,CAAC;QAEtB,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;;;;QAKlB,IAAI,CAAE,eAAe,CAAC,QAAQ,EAAE,EAAE;YAChC,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,KAAK,EAAE,GAAA,CAAC,CAAC;YACvC,MAAM,CAAC,KAAK,EAAE,CAAC;SAChB;;;;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,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/C,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/JS/node_modules/optimism/lib/bundle.esm.js b/JS/node_modules/optimism/lib/bundle.esm.js deleted file mode 100644 index cca7a04..0000000 --- a/JS/node_modules/optimism/lib/bundle.esm.js +++ /dev/null @@ -1,479 +0,0 @@ -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 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"); - } -} -function valueIs(a, b) { - var len = a.length; - return ( - // Unknown values are not equal to each other. - len > 0 && - // Both values must be ordinary (or both exceptional) to be equal. - len === b.length && - // The underlying value or exception must be the same. - a[len - 1] === b[len - 1]); -} -function valueGet(value) { - switch (value.length) { - case 0: throw new Error("unknown value"); - case 1: return value[0]; - case 2: throw value[1]; - } -} -function valueCopy(value) { - return value.slice(0); -} -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 = []; - ++Entry.count; - } - // This is the most important method of the Entry API, because it - // determines whether the cached this.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) valueGet(this.value) is usually returned without recomputation. - Entry.prototype.recompute = function () { - assert(!this.recomputing, "already recomputing"); - 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 mightBeDirty(this) - ? reallyRecompute(this) - : valueGet(this.value); - }; - Entry.prototype.setDirty = function () { - if (this.dirty) - return; - this.dirty = true; - this.value.length = 0; - 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, []); - } - if (mightBeDirty(child)) { - reportDirtyChild(parent, child); - } - else { - reportCleanChild(parent, child); - } - return parent; - } -} -function reallyRecompute(entry) { - // 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); - // Set entry as the parent entry while calling recomputeNewValue(entry). - parentEntrySlot.withValue(entry, recomputeNewValue, [entry]); - if (maybeSubscribe(entry)) { - // 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 valueGet(entry.value); -} -function recomputeNewValue(entry) { - entry.recomputing = true; - // Set entry.value as unknown. - entry.value.length = 0; - try { - // If entry.fn succeeds, entry.value will become a normal Value. - entry.value[0] = entry.fn.apply(null, entry.args); - } - catch (e) { - // If entry.fn throws, entry.value will become exceptional. - entry.value[1] = e; - } - // Either way, this line is always reached. - entry.recomputing = false; -} -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.length === 0) { - parent.childValues.set(child, valueCopy(child.value)); - } - else if (!valueIs(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); -} -var caches = new Set(); -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 === void 0) { - 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); - caches.add(cache); - // 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()) { - caches.forEach(function (cache) { return cache.clean(); }); - caches.clear(); - } - // 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 !== void 0 && cache.get(key); - if (child) { - child.setDirty(); - } - }; - return optimistic; -} - -export { KeyTrie, defaultMakeCacheKey, wrap }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/JS/node_modules/optimism/lib/bundle.esm.js.map b/JS/node_modules/optimism/lib/bundle.esm.js.map deleted file mode 100644 index 5705095..0000000 --- a/JS/node_modules/optimism/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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 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\n// Since exceptions are cached just like normal values, we need an efficient\n// way of representing unknown, ordinary, and exceptional values.\ntype Value =\n | [] // unknown\n | [T] // known value\n | [void, any]; // known exception\n\nfunction valueIs(a: Value, b: Value) {\n const len = a.length;\n return (\n // Unknown values are not equal to each other.\n len > 0 &&\n // Both values must be ordinary (or both exceptional) to be equal.\n len === b.length &&\n // The underlying value or exception must be the same.\n a[len - 1] === b[len - 1]\n );\n}\n\nfunction valueGet(value: Value): T {\n switch (value.length) {\n case 0: throw new Error(\"unknown value\");\n case 1: return value[0];\n case 2: throw value[1];\n }\n}\n\nfunction valueCopy(value: Value): Value {\n return value.slice(0) as Value;\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 readonly value: Value = [];\n\n constructor(\n public readonly fn: (...args: TArgs) => TValue,\n public args: TArgs,\n ) {\n ++Entry.count;\n }\n\n // This is the most important method of the Entry API, because it\n // determines whether the cached this.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) valueGet(this.value) is usually returned without recomputation.\n public recompute(): TValue {\n assert(! this.recomputing, \"already recomputing\");\n\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 mightBeDirty(this)\n ? reallyRecompute(this)\n : valueGet(this.value);\n }\n\n public setDirty() {\n if (this.dirty) return;\n this.dirty = true;\n this.value.length = 0;\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, []);\n }\n\n if (mightBeDirty(child)) {\n reportDirtyChild(parent, child);\n } else {\n reportCleanChild(parent, child);\n }\n\n return parent;\n }\n}\n\nfunction reallyRecompute(entry: AnyEntry) {\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 // Set entry as the parent entry while calling recomputeNewValue(entry).\n parentEntrySlot.withValue(entry, recomputeNewValue, [entry]);\n\n if (maybeSubscribe(entry)) {\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 // 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 valueGet(entry.value);\n}\n\nfunction recomputeNewValue(entry: AnyEntry) {\n entry.recomputing = true;\n // Set entry.value as unknown.\n entry.value.length = 0;\n try {\n // If entry.fn succeeds, entry.value will become a normal Value.\n entry.value[0] = entry.fn.apply(null, entry.args);\n } catch (e) {\n // If entry.fn throws, entry.value will become exceptional.\n entry.value[1] = e;\n }\n // Either way, this line is always reached.\n entry.recomputing = false;\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.length === 0) {\n parent.childValues.set(child, valueCopy(child.value));\n } else if (! valueIs(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, AnyEntry } 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\nconst caches = new Set>();\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 === void 0) {\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 caches.add(cache);\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 caches.forEach(cache => cache.clean());\n caches.clear();\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 !== void 0 && 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,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;YAC1B,IAAA,mBAAK,EAAE,mBAAK,CAAW;YAE/B,IAAI,KAAK,EAAE;gBACT,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;aACrB;YAED,IAAI,KAAK,EAAE;gBACT,KAAK,CAAC,KAAK,GAAG,KAAK,CAA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,KAAK,EAAE,CAAC;SAChB;;;;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,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/C,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/JS/node_modules/optimism/lib/cache.d.ts b/JS/node_modules/optimism/lib/cache.d.ts deleted file mode 100644 index 5de8612..0000000 --- a/JS/node_modules/optimism/lib/cache.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -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/JS/node_modules/optimism/lib/context.d.ts b/JS/node_modules/optimism/lib/context.d.ts deleted file mode 100644 index f41db1d..0000000 --- a/JS/node_modules/optimism/lib/context.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -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/JS/node_modules/optimism/lib/entry.d.ts b/JS/node_modules/optimism/lib/entry.d.ts deleted file mode 100644 index b647422..0000000 --- a/JS/node_modules/optimism/lib/entry.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { OptimisticWrapOptions } from "./index"; -declare type Value = [] | [T] | [void, any]; -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, Value>; - dirtyChildren: Set | null; - dirty: boolean; - recomputing: boolean; - readonly value: Value; - constructor(fn: (...args: TArgs) => TValue, args: TArgs); - recompute(): TValue; - setDirty(): void; - dispose(): void; -} -export {}; diff --git a/JS/node_modules/optimism/lib/index.d.ts b/JS/node_modules/optimism/lib/index.d.ts deleted file mode 100644 index a821538..0000000 --- a/JS/node_modules/optimism/lib/index.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -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/JS/node_modules/optimism/lib/key-trie.d.ts b/JS/node_modules/optimism/lib/key-trie.d.ts deleted file mode 100644 index ffe171b..0000000 --- a/JS/node_modules/optimism/lib/key-trie.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -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/JS/node_modules/optimism/package.json b/JS/node_modules/optimism/package.json deleted file mode 100644 index cc2e19c..0000000 --- a/JS/node_modules/optimism/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "optimism", - "version": "0.10.3", - "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.7.5", - "fibers": "4.0.1", - "mocha": "6.2.0", - "reify": "0.20.12", - "rimraf": "3.0.0", - "rollup": "1.21.2", - "rollup-plugin-typescript2": "0.24.2", - "source-map-support": "0.5.13", - "tslib": "1.10.0", - "typescript": "3.5.2" - }, - "dependencies": { - "@wry/context": "^0.4.0" - } -} diff --git a/JS/node_modules/optimism/test.js b/JS/node_modules/optimism/test.js deleted file mode 100644 index 6c909ce..0000000 --- a/JS/node_modules/optimism/test.js +++ /dev/null @@ -1,8 +0,0 @@ -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/JS/node_modules/symbol-observable/CHANGELOG.md b/JS/node_modules/symbol-observable/CHANGELOG.md deleted file mode 100644 index d6f13d8..0000000 --- a/JS/node_modules/symbol-observable/CHANGELOG.md +++ /dev/null @@ -1,136 +0,0 @@ - -# [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/JS/node_modules/symbol-observable/es/index.js b/JS/node_modules/symbol-observable/es/index.js deleted file mode 100644 index 4ed892d..0000000 --- a/JS/node_modules/symbol-observable/es/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/* 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/JS/node_modules/symbol-observable/es/ponyfill.js b/JS/node_modules/symbol-observable/es/ponyfill.js deleted file mode 100644 index 95dedc2..0000000 --- a/JS/node_modules/symbol-observable/es/ponyfill.js +++ /dev/null @@ -1,17 +0,0 @@ -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/JS/node_modules/symbol-observable/index.d.ts b/JS/node_modules/symbol-observable/index.d.ts deleted file mode 100644 index 7426c52..0000000 --- a/JS/node_modules/symbol-observable/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -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/JS/node_modules/symbol-observable/index.js b/JS/node_modules/symbol-observable/index.js deleted file mode 100644 index b58e228..0000000 --- a/JS/node_modules/symbol-observable/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/index'); diff --git a/JS/node_modules/symbol-observable/lib/index.js b/JS/node_modules/symbol-observable/lib/index.js deleted file mode 100644 index de74e78..0000000 --- a/JS/node_modules/symbol-observable/lib/index.js +++ /dev/null @@ -1,29 +0,0 @@ -'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/JS/node_modules/symbol-observable/lib/ponyfill.js b/JS/node_modules/symbol-observable/lib/ponyfill.js deleted file mode 100644 index be68aca..0000000 --- a/JS/node_modules/symbol-observable/lib/ponyfill.js +++ /dev/null @@ -1,23 +0,0 @@ -'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/JS/node_modules/symbol-observable/license b/JS/node_modules/symbol-observable/license deleted file mode 100644 index 0239f47..0000000 --- a/JS/node_modules/symbol-observable/license +++ /dev/null @@ -1,22 +0,0 @@ -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/JS/node_modules/symbol-observable/package.json b/JS/node_modules/symbol-observable/package.json deleted file mode 100644 index 0e14c55..0000000 --- a/JS/node_modules/symbol-observable/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "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/JS/node_modules/symbol-observable/readme.md b/JS/node_modules/symbol-observable/readme.md deleted file mode 100644 index 153a1ca..0000000 --- a/JS/node_modules/symbol-observable/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# 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/JS/node_modules/ts-invariant/LICENSE b/JS/node_modules/ts-invariant/LICENSE deleted file mode 100644 index 3033d00..0000000 --- a/JS/node_modules/ts-invariant/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/ts-invariant/README.md b/JS/node_modules/ts-invariant/README.md deleted file mode 100644 index b4c1c9b..0000000 --- a/JS/node_modules/ts-invariant/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# ts-invariant - -[TypeScript](https://www.typescriptlang.org) implementation of -[`invariant(condition, message)`](https://www.npmjs.com/package/invariant). diff --git a/JS/node_modules/ts-invariant/lib/invariant.d.ts b/JS/node_modules/ts-invariant/lib/invariant.d.ts deleted file mode 100644 index d2f7349..0000000 --- a/JS/node_modules/ts-invariant/lib/invariant.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -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/JS/node_modules/ts-invariant/lib/invariant.esm.js b/JS/node_modules/ts-invariant/lib/invariant.esm.js deleted file mode 100644 index d31600a..0000000 --- a/JS/node_modules/ts-invariant/lib/invariant.esm.js +++ /dev/null @@ -1,62 +0,0 @@ -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/JS/node_modules/ts-invariant/lib/invariant.esm.js.map b/JS/node_modules/ts-invariant/lib/invariant.esm.js.map deleted file mode 100644 index a1931f2..0000000 --- a/JS/node_modules/ts-invariant/lib/invariant.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/ts-invariant/lib/invariant.js b/JS/node_modules/ts-invariant/lib/invariant.js deleted file mode 100644 index a76217f..0000000 --- a/JS/node_modules/ts-invariant/lib/invariant.js +++ /dev/null @@ -1,67 +0,0 @@ -'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/JS/node_modules/ts-invariant/lib/invariant.js.map b/JS/node_modules/ts-invariant/lib/invariant.js.map deleted file mode 100644 index 4f45152..0000000 --- a/JS/node_modules/ts-invariant/lib/invariant.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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,CA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AM,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/JS/node_modules/ts-invariant/package.json b/JS/node_modules/ts-invariant/package.json deleted file mode 100644 index 9b072f0..0000000 --- a/JS/node_modules/ts-invariant/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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/JS/node_modules/ts-invariant/rollup.config.js b/JS/node_modules/ts-invariant/rollup.config.js deleted file mode 100644 index 97f09f4..0000000 --- a/JS/node_modules/ts-invariant/rollup.config.js +++ /dev/null @@ -1,40 +0,0 @@ -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/JS/node_modules/ts-invariant/tsconfig.json b/JS/node_modules/ts-invariant/tsconfig.json deleted file mode 100644 index 1a79ad1..0000000 --- a/JS/node_modules/ts-invariant/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./lib" - } -} diff --git a/JS/node_modules/ts-invariant/tsconfig.rollup.json b/JS/node_modules/ts-invariant/tsconfig.rollup.json deleted file mode 100644 index 02085be..0000000 --- a/JS/node_modules/ts-invariant/tsconfig.rollup.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "es2015", - }, -} diff --git a/JS/node_modules/tslib/CopyrightNotice.txt b/JS/node_modules/tslib/CopyrightNotice.txt deleted file mode 100644 index 3d4c823..0000000 --- a/JS/node_modules/tslib/CopyrightNotice.txt +++ /dev/null @@ -1,15 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - diff --git a/JS/node_modules/tslib/LICENSE.txt b/JS/node_modules/tslib/LICENSE.txt deleted file mode 100644 index bfe6430..0000000 --- a/JS/node_modules/tslib/LICENSE.txt +++ /dev/null @@ -1,12 +0,0 @@ -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/JS/node_modules/tslib/README.md b/JS/node_modules/tslib/README.md deleted file mode 100644 index a5b2692..0000000 --- a/JS/node_modules/tslib/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# 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 tslib - -# TypeScript 2.3.2 or earlier -npm install tslib@1.6.1 -``` - -## yarn - -```sh -# TypeScript 2.3.3 or later -yarn add tslib - -# TypeScript 2.3.2 or earlier -yarn add 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.[version].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). - -# Documentation - -* [Quick tutorial](http://www.typescriptlang.org/Tutorial) -* [Programming handbook](http://www.typescriptlang.org/Handbook) -* [Homepage](http://www.typescriptlang.org/) diff --git a/JS/node_modules/tslib/modules/index.js b/JS/node_modules/tslib/modules/index.js deleted file mode 100644 index d241d04..0000000 --- a/JS/node_modules/tslib/modules/index.js +++ /dev/null @@ -1,51 +0,0 @@ -import tslib from '../tslib.js'; -const { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, -} = tslib; -export { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, -}; diff --git a/JS/node_modules/tslib/modules/package.json b/JS/node_modules/tslib/modules/package.json deleted file mode 100644 index aafa0e4..0000000 --- a/JS/node_modules/tslib/modules/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} \ No newline at end of file diff --git a/JS/node_modules/tslib/package.json b/JS/node_modules/tslib/package.json deleted file mode 100644 index f8c2a53..0000000 --- a/JS/node_modules/tslib/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "tslib", - "author": "Microsoft Corp.", - "homepage": "https://www.typescriptlang.org/", - "version": "1.14.1", - "license": "0BSD", - "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", - "sideEffects": false, - "exports": { - ".": { - "module": "./tslib.es6.js", - "import": "./modules/index.js", - "default": "./tslib.js" - }, - "./": "./" - } -} diff --git a/JS/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js b/JS/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js deleted file mode 100644 index 0c1b613..0000000 --- a/JS/node_modules/tslib/test/validateModuleExportsMatchCommonJS/index.js +++ /dev/null @@ -1,23 +0,0 @@ -// When on node 14, it validates that all of the commonjs exports -// are correctly re-exported for es modules importers. - -const nodeMajor = Number(process.version.split(".")[0].slice(1)) -if (nodeMajor < 14) { - console.log("Skipping because node does not support module exports.") - process.exit(0) -} - -// ES Modules import via the ./modules folder -import * as esTSLib from "../../modules/index.js" - -// Force a commonjs resolve -import { createRequire } from "module"; -const commonJSTSLib = createRequire(import.meta.url)("../../tslib.js"); - -for (const key in commonJSTSLib) { - if (commonJSTSLib.hasOwnProperty(key)) { - if(!esTSLib[key]) throw new Error(`ESModules is missing ${key} - it needs to be re-exported in ./modules/index.js`) - } -} - -console.log("All exports in commonjs are available for es module consumers.") diff --git a/JS/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json b/JS/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json deleted file mode 100644 index 166e509..0000000 --- a/JS/node_modules/tslib/test/validateModuleExportsMatchCommonJS/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "module", - "scripts": { - "test": "node index.js" - } -} diff --git a/JS/node_modules/tslib/tslib.d.ts b/JS/node_modules/tslib/tslib.d.ts deleted file mode 100644 index 0756b28..0000000 --- a/JS/node_modules/tslib/tslib.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -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 }; -export declare function __classPrivateFieldGet(receiver: T, privateMap: { has(o: T): boolean, get(o: T): V | undefined }): V; -export declare function __classPrivateFieldSet(receiver: T, privateMap: { has(o: T): boolean, set(o: T, value: V): any }, value: V): V; -export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void; \ No newline at end of file diff --git a/JS/node_modules/tslib/tslib.es6.html b/JS/node_modules/tslib/tslib.es6.html deleted file mode 100644 index b122e41..0000000 --- a/JS/node_modules/tslib/tslib.es6.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/JS/node_modules/tslib/tslib.es6.js b/JS/node_modules/tslib/tslib.es6.js deleted file mode 100644 index 0e0d8d0..0000000 --- a/JS/node_modules/tslib/tslib.es6.js +++ /dev/null @@ -1,218 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* 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) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - 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) : adopt(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 __createBinding(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -} - -export function __exportStar(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -export function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -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 }; -} - -export function __classPrivateFieldGet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); -} - -export function __classPrivateFieldSet(receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; -} diff --git a/JS/node_modules/tslib/tslib.html b/JS/node_modules/tslib/tslib.html deleted file mode 100644 index 44c9ba5..0000000 --- a/JS/node_modules/tslib/tslib.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/JS/node_modules/tslib/tslib.js b/JS/node_modules/tslib/tslib.js deleted file mode 100644 index e5b7c9b..0000000 --- a/JS/node_modules/tslib/tslib.js +++ /dev/null @@ -1,284 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - -/* 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; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __createBinding; -(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) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - 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) : adopt(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 }; - } - }; - - __createBinding = function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }; - - __exportStar = function (m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; - }; - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __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 }; - }; - - __classPrivateFieldGet = function (receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; - }; - - 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("__createBinding", __createBinding); - 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); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); -}); diff --git a/JS/node_modules/zen-observable-ts/CHANGELOG.md b/JS/node_modules/zen-observable-ts/CHANGELOG.md deleted file mode 100644 index 116b7d9..0000000 --- a/JS/node_modules/zen-observable-ts/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ -# 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/JS/node_modules/zen-observable-ts/LICENSE b/JS/node_modules/zen-observable-ts/LICENSE deleted file mode 100644 index 84df905..0000000 --- a/JS/node_modules/zen-observable-ts/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/zen-observable-ts/lib/bundle.cjs.js b/JS/node_modules/zen-observable-ts/lib/bundle.cjs.js deleted file mode 100644 index 4edc07a..0000000 --- a/JS/node_modules/zen-observable-ts/lib/bundle.cjs.js +++ /dev/null @@ -1,13 +0,0 @@ -'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/JS/node_modules/zen-observable-ts/lib/bundle.cjs.js.map b/JS/node_modules/zen-observable-ts/lib/bundle.cjs.js.map deleted file mode 100644 index cb4d0b7..0000000 --- a/JS/node_modules/zen-observable-ts/lib/bundle.cjs.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/zen-observable-ts/lib/bundle.esm.js b/JS/node_modules/zen-observable-ts/lib/bundle.esm.js deleted file mode 100644 index b00615b..0000000 --- a/JS/node_modules/zen-observable-ts/lib/bundle.esm.js +++ /dev/null @@ -1,7 +0,0 @@ -import zenObservable from 'zen-observable'; - -var Observable = zenObservable; - -export default Observable; -export { Observable }; -//# sourceMappingURL=bundle.esm.js.map diff --git a/JS/node_modules/zen-observable-ts/lib/bundle.esm.js.map b/JS/node_modules/zen-observable-ts/lib/bundle.esm.js.map deleted file mode 100644 index f3af6e2..0000000 --- a/JS/node_modules/zen-observable-ts/lib/bundle.esm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/zen-observable-ts/lib/bundle.umd.js b/JS/node_modules/zen-observable-ts/lib/bundle.umd.js deleted file mode 100644 index 6697a28..0000000 --- a/JS/node_modules/zen-observable-ts/lib/bundle.umd.js +++ /dev/null @@ -1,17 +0,0 @@ -(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/JS/node_modules/zen-observable-ts/lib/bundle.umd.js.map b/JS/node_modules/zen-observable-ts/lib/bundle.umd.js.map deleted file mode 100644 index 0226762..0000000 --- a/JS/node_modules/zen-observable-ts/lib/bundle.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/JS/node_modules/zen-observable-ts/lib/index.d.ts b/JS/node_modules/zen-observable-ts/lib/index.d.ts deleted file mode 100644 index 116de2f..0000000 --- a/JS/node_modules/zen-observable-ts/lib/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Observable } from './zenObservable'; -export * from './zenObservable'; -export default Observable; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/JS/node_modules/zen-observable-ts/lib/index.d.ts.map b/JS/node_modules/zen-observable-ts/lib/index.d.ts.map deleted file mode 100644 index 7f79172..0000000 --- a/JS/node_modules/zen-observable-ts/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/zen-observable-ts/lib/index.js b/JS/node_modules/zen-observable-ts/lib/index.js deleted file mode 100644 index 86761b0..0000000 --- a/JS/node_modules/zen-observable-ts/lib/index.js +++ /dev/null @@ -1,7 +0,0 @@ -"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/JS/node_modules/zen-observable-ts/lib/index.js.map b/JS/node_modules/zen-observable-ts/lib/index.js.map deleted file mode 100644 index c2112a7..0000000 --- a/JS/node_modules/zen-observable-ts/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/zen-observable-ts/lib/types.d.ts b/JS/node_modules/zen-observable-ts/lib/types.d.ts deleted file mode 100644 index 989d8fc..0000000 --- a/JS/node_modules/zen-observable-ts/lib/types.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -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/JS/node_modules/zen-observable-ts/lib/types.d.ts.map b/JS/node_modules/zen-observable-ts/lib/types.d.ts.map deleted file mode 100644 index 1494bc5..0000000 --- a/JS/node_modules/zen-observable-ts/lib/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/zen-observable-ts/lib/types.js b/JS/node_modules/zen-observable-ts/lib/types.js deleted file mode 100644 index 11e638d..0000000 --- a/JS/node_modules/zen-observable-ts/lib/types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/JS/node_modules/zen-observable-ts/lib/types.js.map b/JS/node_modules/zen-observable-ts/lib/types.js.map deleted file mode 100644 index c768b79..0000000 --- a/JS/node_modules/zen-observable-ts/lib/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/JS/node_modules/zen-observable-ts/lib/zenObservable.d.ts b/JS/node_modules/zen-observable-ts/lib/zenObservable.d.ts deleted file mode 100644 index bc7abf3..0000000 --- a/JS/node_modules/zen-observable-ts/lib/zenObservable.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/zen-observable-ts/lib/zenObservable.d.ts.map b/JS/node_modules/zen-observable-ts/lib/zenObservable.d.ts.map deleted file mode 100644 index 54855d1..0000000 --- a/JS/node_modules/zen-observable-ts/lib/zenObservable.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"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,C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AAE,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/JS/node_modules/zen-observable-ts/lib/zenObservable.js b/JS/node_modules/zen-observable-ts/lib/zenObservable.js deleted file mode 100644 index 747d83d..0000000 --- a/JS/node_modules/zen-observable-ts/lib/zenObservable.js +++ /dev/null @@ -1,6 +0,0 @@ -"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/JS/node_modules/zen-observable-ts/lib/zenObservable.js.map b/JS/node_modules/zen-observable-ts/lib/zenObservable.js.map deleted file mode 100644 index 86e8589..0000000 --- a/JS/node_modules/zen-observable-ts/lib/zenObservable.js.map +++ /dev/null @@ -1 +0,0 @@ -{"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/JS/node_modules/zen-observable-ts/package.json b/JS/node_modules/zen-observable-ts/package.json deleted file mode 100644 index 85d417d..0000000 --- a/JS/node_modules/zen-observable-ts/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "zen-observable-ts", - "version": "0.8.21", - "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.9.0", - "jest": "24.9.0", - "rimraf": "2.7.1", - "rollup": "1.29.1", - "ts-jest": "22.4.6", - "tslint": "5.20.1", - "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": "1012934b4fd9ab436c4fdcd5e9b1bb1e4c1b0d98" -} diff --git a/JS/node_modules/zen-observable/.editorconfig b/JS/node_modules/zen-observable/.editorconfig deleted file mode 100644 index d4eed84..0000000 --- a/JS/node_modules/zen-observable/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -root = true - -[*] -end_of_line = lf -insert_final_newline = false -indent_style = space -indent_size = 2 diff --git a/JS/node_modules/zen-observable/.eslintrc.js b/JS/node_modules/zen-observable/.eslintrc.js deleted file mode 100644 index 3def7dc..0000000 --- a/JS/node_modules/zen-observable/.eslintrc.js +++ /dev/null @@ -1,47 +0,0 @@ -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/JS/node_modules/zen-observable/LICENSE b/JS/node_modules/zen-observable/LICENSE deleted file mode 100644 index d850f52..0000000 --- a/JS/node_modules/zen-observable/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -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/JS/node_modules/zen-observable/README.md b/JS/node_modules/zen-observable/README.md deleted file mode 100644 index eff7a5c..0000000 --- a/JS/node_modules/zen-observable/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# 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/JS/node_modules/zen-observable/esm.js b/JS/node_modules/zen-observable/esm.js deleted file mode 100644 index a6bef71..0000000 --- a/JS/node_modules/zen-observable/esm.js +++ /dev/null @@ -1,5 +0,0 @@ -import { Observable } from './src/Observable.js'; - -export default Observable; -export { Observable }; -export * from './src/extras.js'; diff --git a/JS/node_modules/zen-observable/extras.js b/JS/node_modules/zen-observable/extras.js deleted file mode 100644 index ab87de3..0000000 --- a/JS/node_modules/zen-observable/extras.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/extras.js'); diff --git a/JS/node_modules/zen-observable/index.js b/JS/node_modules/zen-observable/index.js deleted file mode 100644 index 25c8a63..0000000 --- a/JS/node_modules/zen-observable/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/Observable.js').Observable; diff --git a/JS/node_modules/zen-observable/lib/Observable.js b/JS/node_modules/zen-observable/lib/Observable.js deleted file mode 100644 index 4cad821..0000000 --- a/JS/node_modules/zen-observable/lib/Observable.js +++ /dev/null @@ -1,617 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Observable = void 0; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - -// === 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 = -/*#__PURE__*/ -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 = -/*#__PURE__*/ -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 = -/*#__PURE__*/ -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 = new Array(_len), _key = 0; _key < _len; _key++) { - sources[_key] = arguments[_key]; - } - - var C = getSpecies(this); - return new C(function (observer) { - var subscription; - 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 != null) { - _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 = new 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; -}(); - -exports.Observable = Observable; - -if (hasSymbols()) { - Object.defineProperty(Observable, Symbol('extensions'), { - value: { - symbol: SymbolObservable, - hostReportError: hostReportError - }, - configurable: true - }); -} \ No newline at end of file diff --git a/JS/node_modules/zen-observable/lib/extras.js b/JS/node_modules/zen-observable/lib/extras.js deleted file mode 100644 index 58f06d0..0000000 --- a/JS/node_modules/zen-observable/lib/extras.js +++ /dev/null @@ -1,132 +0,0 @@ -"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 = new 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 = new 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 = new 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/JS/node_modules/zen-observable/package.json b/JS/node_modules/zen-observable/package.json deleted file mode 100644 index ffee431..0000000 --- a/JS/node_modules/zen-observable/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "zen-observable", - "version": "0.8.15", - "repository": "zenparsing/zen-observable", - "description": "An Implementation of ES Observables", - "homepage": "https://github.com/zenparsing/zen-observable", - "license": "MIT", - "devDependencies": { - "@babel/cli": "^7.6.0", - "@babel/core": "^7.6.0", - "@babel/preset-env": "^7.6.0", - "@babel/register": "^7.6.0", - "eslint": "^6.5.0", - "mocha": "^6.2.0" - }, - "dependencies": {}, - "scripts": { - "test": "mocha --recursive --require ./scripts/mocha-require", - "lint": "eslint src/*", - "build": "git clean -dfX ./lib && node ./scripts/build", - "prepublishOnly": "npm run lint && npm test && npm run build" - } -} diff --git a/JS/node_modules/zen-observable/scripts/babel-plugins.js b/JS/node_modules/zen-observable/scripts/babel-plugins.js deleted file mode 100644 index 885fa84..0000000 --- a/JS/node_modules/zen-observable/scripts/babel-plugins.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = [ - '@babel/plugin-transform-arrow-functions', - '@babel/plugin-transform-block-scoped-functions', - '@babel/plugin-transform-block-scoping', - '@babel/plugin-transform-classes', - '@babel/plugin-transform-computed-properties', - '@babel/plugin-transform-destructuring', - '@babel/plugin-transform-duplicate-keys', - '@babel/plugin-transform-for-of', - '@babel/plugin-transform-literals', - '@babel/plugin-transform-modules-commonjs', - '@babel/plugin-transform-parameters', - '@babel/plugin-transform-shorthand-properties', - '@babel/plugin-transform-spread', - '@babel/plugin-transform-template-literals', -]; diff --git a/JS/node_modules/zen-observable/scripts/build.js b/JS/node_modules/zen-observable/scripts/build.js deleted file mode 100644 index f4c8fa6..0000000 --- a/JS/node_modules/zen-observable/scripts/build.js +++ /dev/null @@ -1,7 +0,0 @@ -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/JS/node_modules/zen-observable/scripts/mocha-require.js b/JS/node_modules/zen-observable/scripts/mocha-require.js deleted file mode 100644 index f375ae1..0000000 --- a/JS/node_modules/zen-observable/scripts/mocha-require.js +++ /dev/null @@ -1,3 +0,0 @@ -require('@babel/register')({ - plugins: require('./babel-plugins'), -}); diff --git a/JS/node_modules/zen-observable/src/Observable.js b/JS/node_modules/zen-observable/src/Observable.js deleted file mode 100644 index 9364bc0..0000000 --- a/JS/node_modules/zen-observable/src/Observable.js +++ /dev/null @@ -1,476 +0,0 @@ -// === 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/JS/node_modules/zen-observable/src/extras.js b/JS/node_modules/zen-observable/src/extras.js deleted file mode 100644 index ca6b6f7..0000000 --- a/JS/node_modules/zen-observable/src/extras.js +++ /dev/null @@ -1,99 +0,0 @@ -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/JS/node_modules/zen-observable/test/concat.js b/JS/node_modules/zen-observable/test/concat.js deleted file mode 100644 index 30079d4..0000000 --- a/JS/node_modules/zen-observable/test/concat.js +++ /dev/null @@ -1,30 +0,0 @@ -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/JS/node_modules/zen-observable/test/constructor.js b/JS/node_modules/zen-observable/test/constructor.js deleted file mode 100644 index 4d93b7f..0000000 --- a/JS/node_modules/zen-observable/test/constructor.js +++ /dev/null @@ -1,36 +0,0 @@ -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/JS/node_modules/zen-observable/test/extras/combine-latest.js b/JS/node_modules/zen-observable/test/extras/combine-latest.js deleted file mode 100644 index ec2c920..0000000 --- a/JS/node_modules/zen-observable/test/extras/combine-latest.js +++ /dev/null @@ -1,43 +0,0 @@ -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/JS/node_modules/zen-observable/test/extras/merge.js b/JS/node_modules/zen-observable/test/extras/merge.js deleted file mode 100644 index 4b637ca..0000000 --- a/JS/node_modules/zen-observable/test/extras/merge.js +++ /dev/null @@ -1,16 +0,0 @@ -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/JS/node_modules/zen-observable/test/extras/parse.js b/JS/node_modules/zen-observable/test/extras/parse.js deleted file mode 100644 index f22de31..0000000 --- a/JS/node_modules/zen-observable/test/extras/parse.js +++ /dev/null @@ -1,11 +0,0 @@ -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/JS/node_modules/zen-observable/test/extras/zip.js b/JS/node_modules/zen-observable/test/extras/zip.js deleted file mode 100644 index 94225d2..0000000 --- a/JS/node_modules/zen-observable/test/extras/zip.js +++ /dev/null @@ -1,21 +0,0 @@ -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/JS/node_modules/zen-observable/test/filter.js b/JS/node_modules/zen-observable/test/filter.js deleted file mode 100644 index 36ad88f..0000000 --- a/JS/node_modules/zen-observable/test/filter.js +++ /dev/null @@ -1,14 +0,0 @@ -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/JS/node_modules/zen-observable/test/flat-map.js b/JS/node_modules/zen-observable/test/flat-map.js deleted file mode 100644 index 64cca89..0000000 --- a/JS/node_modules/zen-observable/test/flat-map.js +++ /dev/null @@ -1,23 +0,0 @@ -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/JS/node_modules/zen-observable/test/for-each.js b/JS/node_modules/zen-observable/test/for-each.js deleted file mode 100644 index 69c5590..0000000 --- a/JS/node_modules/zen-observable/test/for-each.js +++ /dev/null @@ -1,70 +0,0 @@ -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/JS/node_modules/zen-observable/test/from.js b/JS/node_modules/zen-observable/test/from.js deleted file mode 100644 index cc7378e..0000000 --- a/JS/node_modules/zen-observable/test/from.js +++ /dev/null @@ -1,95 +0,0 @@ -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/JS/node_modules/zen-observable/test/map.js b/JS/node_modules/zen-observable/test/map.js deleted file mode 100644 index 22d25d8..0000000 --- a/JS/node_modules/zen-observable/test/map.js +++ /dev/null @@ -1,13 +0,0 @@ -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/JS/node_modules/zen-observable/test/observer-closed.js b/JS/node_modules/zen-observable/test/observer-closed.js deleted file mode 100644 index b39db54..0000000 --- a/JS/node_modules/zen-observable/test/observer-closed.js +++ /dev/null @@ -1,35 +0,0 @@ -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/JS/node_modules/zen-observable/test/observer-complete.js b/JS/node_modules/zen-observable/test/observer-complete.js deleted file mode 100644 index 77ff824..0000000 --- a/JS/node_modules/zen-observable/test/observer-complete.js +++ /dev/null @@ -1,143 +0,0 @@ -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/JS/node_modules/zen-observable/test/observer-error.js b/JS/node_modules/zen-observable/test/observer-error.js deleted file mode 100644 index 0a1d9f1..0000000 --- a/JS/node_modules/zen-observable/test/observer-error.js +++ /dev/null @@ -1,145 +0,0 @@ -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/JS/node_modules/zen-observable/test/observer-next.js b/JS/node_modules/zen-observable/test/observer-next.js deleted file mode 100644 index abe1b85..0000000 --- a/JS/node_modules/zen-observable/test/observer-next.js +++ /dev/null @@ -1,137 +0,0 @@ -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/JS/node_modules/zen-observable/test/of.js b/JS/node_modules/zen-observable/test/of.js deleted file mode 100644 index 6e4558c..0000000 --- a/JS/node_modules/zen-observable/test/of.js +++ /dev/null @@ -1,32 +0,0 @@ -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/JS/node_modules/zen-observable/test/properties.js b/JS/node_modules/zen-observable/test/properties.js deleted file mode 100644 index 5c53022..0000000 --- a/JS/node_modules/zen-observable/test/properties.js +++ /dev/null @@ -1,31 +0,0 @@ -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/JS/node_modules/zen-observable/test/reduce.js b/JS/node_modules/zen-observable/test/reduce.js deleted file mode 100644 index a40023a..0000000 --- a/JS/node_modules/zen-observable/test/reduce.js +++ /dev/null @@ -1,38 +0,0 @@ -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/JS/node_modules/zen-observable/test/setup.js b/JS/node_modules/zen-observable/test/setup.js deleted file mode 100644 index 1cb7332..0000000 --- a/JS/node_modules/zen-observable/test/setup.js +++ /dev/null @@ -1,9 +0,0 @@ -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/JS/node_modules/zen-observable/test/species.js b/JS/node_modules/zen-observable/test/species.js deleted file mode 100644 index 3774029..0000000 --- a/JS/node_modules/zen-observable/test/species.js +++ /dev/null @@ -1,28 +0,0 @@ -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/JS/node_modules/zen-observable/test/subscribe.js b/JS/node_modules/zen-observable/test/subscribe.js deleted file mode 100644 index 4ed4aa3..0000000 --- a/JS/node_modules/zen-observable/test/subscribe.js +++ /dev/null @@ -1,137 +0,0 @@ -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/JS/node_modules/zen-observable/test/subscription.js b/JS/node_modules/zen-observable/test/subscription.js deleted file mode 100644 index 5d3f41f..0000000 --- a/JS/node_modules/zen-observable/test/subscription.js +++ /dev/null @@ -1,41 +0,0 @@ -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/JS/package-lock.json b/JS/package-lock.json deleted file mode 100644 index 1b4c554..0000000 --- a/JS/package-lock.json +++ /dev/null @@ -1,479 +0,0 @@ -{ - "name": "test", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "test", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "apollo-boost": "^0.4.9", - "apollo-cache-inmemory": "^1.6.6", - "apollo-link-http": "^1.5.17", - "cross-fetch": "^3.1.4", - "graphql-tag": "^2.12.5" - } - }, - "node_modules/@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" - }, - "node_modules/@types/zen-observable": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz", - "integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==" - }, - "node_modules/@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", - "dependencies": { - "@types/node": ">=6", - "tslib": "^1.9.3" - } - }, - "node_modules/@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-boost": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/apollo-boost/-/apollo-boost-0.4.9.tgz", - "integrity": "sha512-05y5BKcDaa8w47f8d81UVwKqrAjn8uKLv6QM9fNdldoNzQ+rnOHgFlnrySUZRz9QIT3vPftQkEz2UEASp1Mi5g==", - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "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.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "dependencies": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "integrity": "sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A==", - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "integrity": "sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA==", - "dependencies": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.3.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", - "dependencies": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - }, - "peerDependencies": { - "graphql": "^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "dependencies": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "integrity": "sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig==", - "dependencies": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - }, - "peerDependencies": { - "graphql": "^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", - "dependencies": { - "node-fetch": "2.6.1" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "node_modules/graphql": { - "version": "15.5.3", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.5.3.tgz", - "integrity": "sha512-sM+jXaO5KinTui6lbK/7b7H/Knj9BpjGxZ+Ki35v7YbUJxxdBCUqNM0h3CRVU1ZF9t5lNiBzvBCSYPvIwxPOQA==", - "peer": true, - "engines": { - "node": ">= 10.x" - } - }, - "node_modules/graphql-tag": { - "version": "2.12.5", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.5.tgz", - "integrity": "sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ==", - "dependencies": { - "tslib": "^2.1.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0" - } - }, - "node_modules/graphql-tag/node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "dependencies": { - "@wry/context": "^0.4.0" - } - }, - "node_modules/symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/zen-observable": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" - }, - "node_modules/zen-observable-ts": { - "version": "0.8.21", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz", - "integrity": "sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg==", - "dependencies": { - "tslib": "^1.9.3", - "zen-observable": "^0.8.0" - } - } - }, - "dependencies": { - "@types/node": { - "version": "16.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", - "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" - }, - "@types/zen-observable": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz", - "integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw==" - }, - "@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", - "requires": { - "@types/node": ">=6", - "tslib": "^1.9.3" - } - }, - "@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", - "requires": { - "tslib": "^1.9.3" - } - }, - "apollo-boost": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/apollo-boost/-/apollo-boost-0.4.9.tgz", - "integrity": "sha512-05y5BKcDaa8w47f8d81UVwKqrAjn8uKLv6QM9fNdldoNzQ+rnOHgFlnrySUZRz9QIT3vPftQkEz2UEASp1Mi5g==", - "requires": { - "apollo-cache": "^1.3.5", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "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.10.0" - } - }, - "apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "requires": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - } - }, - "apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "integrity": "sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A==", - "requires": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, - "apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "integrity": "sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA==", - "requires": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.3.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - } - }, - "apollo-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", - "requires": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - } - }, - "apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "requires": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "requires": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "requires": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - } - }, - "apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "integrity": "sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig==", - "requires": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, - "cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", - "requires": { - "node-fetch": "2.6.1" - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" - }, - "graphql": { - "version": "15.5.3", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.5.3.tgz", - "integrity": "sha512-sM+jXaO5KinTui6lbK/7b7H/Knj9BpjGxZ+Ki35v7YbUJxxdBCUqNM0h3CRVU1ZF9t5lNiBzvBCSYPvIwxPOQA==", - "peer": true - }, - "graphql-tag": { - "version": "2.12.5", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.5.tgz", - "integrity": "sha512-5xNhP4063d16Pz3HBtKprutsPrmHZi5IdUGOWRxA2B6VF7BIRGOHZ5WQvDmJXZuPcBg7rYwaFxvQYjqkSdR3TQ==", - "requires": { - "tslib": "^2.1.0" - }, - "dependencies": { - "tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - } - } - }, - "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" - }, - "optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "requires": { - "@wry/context": "^0.4.0" - } - }, - "symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" - }, - "ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "requires": { - "tslib": "^1.9.3" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "zen-observable": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" - }, - "zen-observable-ts": { - "version": "0.8.21", - "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.21.tgz", - "integrity": "sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg==", - "requires": { - "tslib": "^1.9.3", - "zen-observable": "^0.8.0" - } - } - } -} diff --git a/coprocessorjs.c b/coprocessorjs.c index 71a9cf0..ad40fba 100644 --- a/coprocessorjs.c +++ b/coprocessorjs.c @@ -90,7 +90,7 @@ void setupPBControlForSerialPort(short serialPortShort) { char errMessage[100]; sprintf(errMessage, "err:%d\n", err); - printf(errMessage); + writeSerialPortDebug(boutRefNum, errMessage); #endif if (err < 0) { @@ -134,7 +134,7 @@ void setupSerialPort(const char *name) { char errMessage[100]; sprintf(errMessage, "err:%d\n", err); - printf(errMessage); + writeSerialPortDebug(boutRefNum, errMessage); #endif if (err < 0) { @@ -148,7 +148,7 @@ void setupSerialPort(const char *name) { char errMessage[100]; sprintf(errMessage, "err:%d\n", err); - printf(errMessage); + writeSerialPortDebug(boutRefNum, errMessage); #endif if (err < 0) { @@ -220,8 +220,7 @@ void readSerialPort(char* output) { #endif #ifdef DEBUGGING - - printf("readSerialPort\n"); + writeSerialPortDebug(boutRefNum, "readSerialPort"); #endif // make sure output variable is clear @@ -232,6 +231,10 @@ void readSerialPort(char* output) { incomingSerialPortReference.ioReqCount = 0; int loopCounter = 0; + #ifdef DEBUGGING + writeSerialPortDebug(boutRefNum, "readSerialPort, enter loop"); + #endif + while (!done) { if (loopCounter++ > MAX_RECIEVE_LOOP_ITERATIONS) { @@ -259,10 +262,9 @@ void readSerialPort(char* output) { while (!doByteCountsMatch || byteCount == 0) { #ifdef DEBUGGING - char debugMessage[100]; sprintf(debugMessage, "receive loop: byteCount: %ld, lastByteCount: %ld\n", byteCount, lastByteCount); - printf(debugMessage); + writeSerialPortDebug(boutRefNum, debugMessage); #endif lastByteCount = (long int)byteCount; @@ -274,10 +276,10 @@ void readSerialPort(char* output) { if (serGetBufStatus != 0) { - printf("potential problem with serGetBufStatus:\n"); + writeSerialPortDebug(boutRefNum, "potential problem with serGetBufStatus:\n"); char debugMessage[100]; sprintf(debugMessage, "serGetBufStatus: %d\n", serGetBufStatus); - printf(debugMessage); + writeSerialPortDebug(boutRefNum, debugMessage); } #else SerGetBuf(incomingSerialPortReference.ioRefNum, &byteCount); @@ -288,10 +290,9 @@ void readSerialPort(char* output) { if (byteCount == lastByteCount && byteCount != 0 && lastByteCount != 0) { #ifdef DEBUGGING - char debugMessage[100]; sprintf(debugMessage, "receive loop setting last doByteCountsMatch to true: byteCount: %ld, lastByteCount: %ld\n", byteCount, lastByteCount); - printf(debugMessage); + writeSerialPortDebug(boutRefNum, debugMessage); #endif doByteCountsMatch = true; @@ -299,10 +300,9 @@ void readSerialPort(char* output) { } #ifdef DEBUGGING - char debugMessage[100]; - sprintf(debugMessage, "receive loop complete: byteCount: %ld, lastByteCount: %ld\n", byteCount, lastByteCount); - printf(debugMessage); + sprintf(debugMessage, "receive loop complete: byteCount: %ld, lastByteCount: %ld", byteCount, lastByteCount); + writeSerialPortDebug(boutRefNum, debugMessage); #endif incomingSerialPortReference.ioReqCount = byteCount; @@ -311,8 +311,8 @@ void readSerialPort(char* output) { OSErr err = PBRead((ParmBlkPtr)&incomingSerialPortReference, 0); char errMessage[100]; - sprintf(errMessage, "err:%d\n", err); - printf(errMessage); + sprintf(errMessage, "err:%d", err); + writeSerialPortDebug(boutRefNum, errMessage); #else PBRead((ParmBlkPtr)&incomingSerialPortReference, 0); @@ -326,16 +326,16 @@ void readSerialPort(char* output) { #ifdef DEBUGGING - printf("done building temp output\n"); - printf(tempOutput); + writeSerialPortDebug(boutRefNum, "done building temp output\n"); + writeSerialPortDebug(boutRefNum, tempOutput); - char *debugOutput; - char tempString[MAX_RECEIVE_SIZE]; - strncat(tempString, tempOutput, totalByteCount); - sprintf(debugOutput, "\n'%ld'\n", strlen(tempString)); - printf(debugOutput); - printf("\ndone with output\n"); - printf("\n"); + // char debugOutput[255]; + // char tempString[MAX_RECEIVE_SIZE]; + // strncat(tempString, tempOutput, totalByteCount); + // sprintf(debugOutput, "\n'%ld'\n", strlen(tempString)); + // writeSerialPortDebug(boutRefNum, debugOutput); + // writeSerialPortDebug(boutRefNum, "\ndone with output\n"); + // writeSerialPortDebug(boutRefNum, "\n"); #endif done = true; @@ -365,7 +365,7 @@ OSErr writeSerialPort(const char* stringToWrite) { #ifdef DEBUGGING - printf("writeSerialPort\n"); + writeSerialPortDebug(boutRefNum, "writeSerialPort"); #endif outgoingSerialPortReference.ioBuffer = (Ptr)stringToWrite; @@ -373,9 +373,8 @@ OSErr writeSerialPort(const char* stringToWrite) { #ifdef DEBUGGING - printf("attempting to write string to serial port\n"); - printf(stringToWrite); - printf("\n"); + writeSerialPortDebug(boutRefNum, "attempting to write string to serial port"); + // writeSerialPortDebug(boutRefNum, stringToWrite); #endif // PBWrite Definition From Inside Macintosh Volume II-185: @@ -387,7 +386,7 @@ OSErr writeSerialPort(const char* stringToWrite) { char errMessage[100]; sprintf(errMessage, "err:%d\n", err); - printf(errMessage); + writeSerialPortDebug(boutRefNum, errMessage); #endif return err; @@ -422,7 +421,7 @@ OSErr closeSerialPort() { char errMessage[100]; sprintf(errMessage, "err:%d\n", err); - printf(errMessage); + writeSerialPortDebug(boutRefNum, errMessage); #endif return err; @@ -437,9 +436,9 @@ char* _getReturnValueFromResponse(char* response, char* application_id, char* ca #ifdef DEBUGGING - printf("_getReturnValueFromResponse\n"); - printf(response); - printf("\n"); + writeSerialPortDebug(boutRefNum, "_getReturnValueFromResponse\n"); + writeSerialPortDebug(boutRefNum, response); + writeSerialPortDebug(boutRefNum, "\n"); #endif // get the first token in to memory @@ -459,9 +458,9 @@ char* _getReturnValueFromResponse(char* response, char* application_id, char* ca #ifdef DEBUGGING - char *debugOutput; + char debugOutput[MAX_RECEIVE_SIZE]; sprintf(debugOutput, "inspect token %d: %s\n", tokenCounter, token); - printf(debugOutput); + writeSerialPortDebug(boutRefNum, debugOutput); #endif switch (tokenCounter) { @@ -502,12 +501,12 @@ char* _getReturnValueFromResponse(char* response, char* application_id, char* ca #ifdef DEBUGGING - printf("setting output to token:\n"); - printf(token); - char *debugOutput; + writeSerialPortDebug(boutRefNum, "setting output to token:\n"); + writeSerialPortDebug(boutRefNum, token); + char debugOutput[255]; sprintf(debugOutput, "\n'%ld'\n", strlen(token)); - printf(debugOutput); - printf("\ndone with output\n"); + writeSerialPortDebug(boutRefNum, debugOutput); + writeSerialPortDebug(boutRefNum, "\ndone with output\n"); #endif int lengthWithoutControlChars = strlen(token) - 6; @@ -546,7 +545,7 @@ void writeToCoprocessor(char* operation, char* operand) { #ifdef DEBUGGING - printf("writeToCoprocessor\n"); + writeSerialPortDebug(boutRefNum, "writeToCoprocessor\n"); #endif const char* messageTemplate = "%s;;;%s;;;%s;;;%s;;@@&&"; // see: https://github.com/CamHenlin/coprocessor.js/blob/main/index.js#L25 @@ -567,7 +566,7 @@ void writeToCoprocessor(char* operation, char* operand) { char errMessage[100]; sprintf(errMessage, "writeToCoprocessor err:%d\n", err); - printf(errMessage); + writeSerialPortDebug(boutRefNum, errMessage); #else writeSerialPort(messageToSend); #endif @@ -582,10 +581,9 @@ void getReturnValueFromResponse(char *response, char *operation, char *output) { #ifdef DEBUG_FUNCTION_CALLS writeSerialPortDebug(boutRefNum, "DEBUG_FUNCTION_CALLS: getReturnValueFromResponse"); #endif - + #ifdef DEBUGGING - - printf("getReturnValueFromResponse\n"); + writeSerialPortDebug(boutRefNum, "getReturnValueFromResponse"); #endif char call_id[32]; @@ -596,9 +594,8 @@ void getReturnValueFromResponse(char *response, char *operation, char *output) { if (err != NULL) { - printf("error getting return value from response:\n"); - printf(err); - printf("\n"); + writeSerialPortDebug(boutRefNum, "error getting return value from response:"); + writeSerialPortDebug(boutRefNum, err); } #else _getReturnValueFromResponse(response, application_id, call_id, operation, output); @@ -613,8 +610,7 @@ void sendProgramToCoprocessor(char* program, char *output) { #endif #ifdef DEBUGGING - - printf("sendProgramToCoprocessor\n"); + writeSerialPortDebug(boutRefNum, "sendProgramToCoprocessor"); #endif SetCursor(*GetCursor(watchCursor)); @@ -639,7 +635,7 @@ void callFunctionOnCoprocessor(char* functionName, char* parameters, char* outpu #ifdef DEBUGGING - printf("callFunctionOnCoprocessor\n"); + writeSerialPortDebug(boutRefNum, "callFunctionOnCoprocessor\n"); #endif const char* functionTemplate = "%s&&&%s"; @@ -687,7 +683,7 @@ void callEvalOnCoprocessor(char* toEval, char* output) { #endif #ifdef DEBUGGING - printf("callEvalOnCoprocessor\n"); + writeSerialPortDebug(boutRefNum, "callEvalOnCoprocessor\n"); #endif writeToCoprocessor("EVAL", toEval);