├── .github └── workflows │ └── nodejs.yml ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── graphql-transformer-test.js ├── index.ts ├── package-lock.json ├── package.json ├── spec ├── remove-unused-types.spec.ts ├── schema-transformer.spec.ts ├── schema-utils.spec.ts └── support │ ├── bootstrap.js │ └── jasmine.json ├── src ├── native-symbols.ts ├── remove-unused-types.ts ├── schema-transformer.ts ├── schema-utils.ts └── utils.ts └── tsconfig.json /.github/workflows/nodejs.yml: -------------------------------------------------------------------------------- 1 | name: Node CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | test: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | strategy: 11 | matrix: 12 | node-version: [12.x, 14.x] 13 | 14 | steps: 15 | - uses: actions/checkout@v1 16 | - name: Use Node.js ${{ matrix.node-version }} 17 | uses: actions/setup-node@v1 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - name: npm install, build, and test 21 | run: | 22 | npm install 23 | npm run build --if-present 24 | npm test 25 | env: 26 | CI: true 27 | deploy: 28 | if: startsWith(github.ref, 'refs/tags/v') 29 | runs-on: ubuntu-latest 30 | needs: test 31 | steps: 32 | - uses: actions/checkout@v2 33 | - uses: actions/setup-node@v1 34 | with: 35 | node-version: 12 36 | registry-url: https://registry.npmjs.org/ 37 | - run: npm ci 38 | - run: npm publish --tag next 39 | env: 40 | NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} 41 | 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Windows ### 2 | # Windows image file caches 3 | Thumbs.db 4 | ehthumbs.db 5 | # Folder config file 6 | Desktop.ini 7 | # Recycle Bin used on file shares 8 | $RECYCLE.BIN/ 9 | # Windows Installer files 10 | *.cab 11 | *.msi 12 | *.msm 13 | *.msp 14 | # Windows shortcuts 15 | *.lnk 16 | ### Linux ### 17 | *~ 18 | # temporary files which can be created if a process still has a handle open of a deleted file 19 | .fuse_hidden* 20 | # KDE directory preferences 21 | .directory 22 | # Linux trash folder which might appear on any partition or disk 23 | .Trash-* 24 | ### Intellij ### 25 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 26 | .idea/ 27 | ## File-based project format: 28 | *.iws 29 | ## Plugin-specific files: 30 | # IntelliJ 31 | /out/ 32 | # mpeltonen/sbt-idea plugin 33 | .idea_modules/ 34 | # JIRA plugin 35 | atlassian-ide-plugin.xml 36 | *.iml 37 | ### Visual Studio Code ### 38 | ### .vscode/ 39 | ### Node ### 40 | # Logs 41 | logs 42 | *.log 43 | npm-debug.log* 44 | # Runtime data 45 | pids 46 | *.pid 47 | *.seed 48 | # node-waf configuration 49 | .lock-wscript 50 | # Dependency directories 51 | node_modules 52 | # Optional npm cache directory 53 | .npm 54 | # Optional REPL history 55 | .node_repl_history 56 | # Dist 57 | dist/ 58 | reports/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | ### Windows ### 2 | # Windows image file caches 3 | Thumbs.db 4 | ehthumbs.db 5 | # Folder config file 6 | Desktop.ini 7 | # Recycle Bin used on file shares 8 | $RECYCLE.BIN/ 9 | # Windows Installer files 10 | *.cab 11 | *.msi 12 | *.msm 13 | *.msp 14 | # Windows shortcuts 15 | *.lnk 16 | ### Linux ### 17 | *~ 18 | # temporary files which can be created if a process still has a handle open of a deleted file 19 | .fuse_hidden* 20 | # KDE directory preferences 21 | .directory 22 | # Linux trash folder which might appear on any partition or disk 23 | .Trash-* 24 | ### Intellij ### 25 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 26 | .idea/ 27 | ## File-based project format: 28 | *.iws 29 | ## Plugin-specific files: 30 | # IntelliJ 31 | /out/ 32 | # mpeltonen/sbt-idea plugin 33 | .idea_modules/ 34 | # JIRA plugin 35 | atlassian-ide-plugin.xml 36 | *.iml 37 | ### Visual Studio Code ### 38 | ### .vscode/ 39 | ### Node ### 40 | # Logs 41 | logs 42 | *.log 43 | npm-debug.log* 44 | # Runtime data 45 | pids 46 | *.pid 47 | *.seed 48 | # node-waf configuration 49 | .lock-wscript 50 | # Dependency directories 51 | node_modules 52 | # Optional npm cache directory 53 | .npm 54 | # Optional REPL history 55 | .node_repl_history 56 | # Dist 57 | # dist/ 58 | reports/ 59 | 60 | 61 | # .npmignore specifics 62 | spec/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 AEB SE 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NO LONGER MAINTAINED 2 | 3 | We no longer use this library at AEB, so unfortunately, we are not able to maintain it properly. The repository is therefore archived. 4 | 5 | # graphql-transformer 6 | 7 | [![npm version](https://badge.fury.io/js/graphql-transformer.svg)](https://npmjs.org/graphql-transformer) [![Build Status](https://github.com/AEB-labs/graphql-transformer/workflows/Node%20CI/badge.svg 8 | )](https://github.com/AEB-labs/graphql-transformer/actions?workflow=Node+CI) 9 | 10 | A tool to transform GraphQL schemas via simple functions 11 | 12 | ## How to use 13 | 14 | ```bash 15 | npm install --save graphql-transformer 16 | ``` 17 | 18 | Basic usage: 19 | 20 | ```typescript 21 | const transformedSchema = transformSchema(originalSchema, { 22 | transformField(field: GraphQLNamedFieldConfig, context) { 23 | // Rename a field in a type 24 | if (context.oldOuterType.name == 'MyType') { 25 | return { 26 | ...field, 27 | name: field.name + 'ButCooler' 28 | } 29 | } 30 | return field; 31 | }, 32 | 33 | transformObjectType(type: GraphQLObjectTypeConfig) { 34 | if (type.name == 'MyType') { 35 | return { 36 | ...type, 37 | name: 'MyCoolType' 38 | }; 39 | } 40 | return type; 41 | }, 42 | 43 | transformFields(fields: GraphQLFieldConfigMap, context) { 44 | // You can even copy types on the fly and transform the copies 45 | const type2 = context.copyType(context.oldOuterType, { 46 | transformObjectType(typeConfig: GraphQLObjectTypeConfig) { 47 | return { 48 | ...typeConfig, 49 | name: typeConfig.name + '2' 50 | }; 51 | } 52 | }); 53 | 54 | // This just adds a reflexive field "self" to all types, but its type does not have 55 | // the "self" field (because it is a copy from the original type, see above) 56 | // it also won't have the "cool" rename applied because the top-level transformers are not applied 57 | return { 58 | ...fields, 59 | self: { 60 | type: type2, 61 | resolve: (source: any) => source 62 | } 63 | } 64 | } 65 | }); 66 | ``` 67 | 68 | [This test case](spec/schema-transformer.spec.ts) demonstrates that and how it works. 69 | 70 | ## Contributing 71 | 72 | After cloning the repository, run 73 | 74 | ```bash 75 | npm install 76 | npm start 77 | ``` 78 | 79 | To run the test suite, run 80 | 81 | ```bash 82 | npm test 83 | ``` 84 | 85 | To debug the tests in WebStorm, right-click on `graphql-transformer-test.js` and choose *Debug*. 86 | 87 | -------------------------------------------------------------------------------- /graphql-transformer-test.js: -------------------------------------------------------------------------------- 1 | // Same as just running jasmine. Is used to be able to pass arguments to node 2 | 3 | var Jasmine = require('jasmine'); 4 | var SpecReporter = require('jasmine-spec-reporter').SpecReporter; 5 | var jasmine = new Jasmine(); 6 | jasmine.loadConfigFile('./spec/support/jasmine.json'); 7 | jasmine.addReporter(new SpecReporter()); 8 | jasmine.execute(); 9 | -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | SchemaTransformer, transformSchema, FieldsTransformationContext, DirectiveTransformationContext, 3 | FieldTransformationContext, GraphQLNamedFieldConfig, GraphQLNamedInputFieldConfig, InputFieldTransformationContext, 4 | TypeTransformationContext, SchemaTransformationContext 5 | } from './src/schema-transformer'; 6 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graphql-transformer", 3 | "version": "0.3.1", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@mrmlnc/readdir-enhanced": { 8 | "version": "2.2.1", 9 | "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", 10 | "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", 11 | "dev": true, 12 | "requires": { 13 | "call-me-maybe": "^1.0.1", 14 | "glob-to-regexp": "^0.3.0" 15 | } 16 | }, 17 | "@nodelib/fs.stat": { 18 | "version": "1.1.3", 19 | "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz", 20 | "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==", 21 | "dev": true 22 | }, 23 | "@tsconfig/node10": { 24 | "version": "1.0.8", 25 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", 26 | "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", 27 | "dev": true 28 | }, 29 | "@tsconfig/node12": { 30 | "version": "1.0.8", 31 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.8.tgz", 32 | "integrity": "sha512-LM6XwBhjZRls1qJGpiM/It09SntEwe9M0riXRfQ9s6XlJQG0JPGl92ET18LtGeYh/GuOtafIXqwZeqLOd0FNFQ==", 33 | "dev": true 34 | }, 35 | "@tsconfig/node14": { 36 | "version": "1.0.1", 37 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", 38 | "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", 39 | "dev": true 40 | }, 41 | "@tsconfig/node16": { 42 | "version": "1.0.1", 43 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.1.tgz", 44 | "integrity": "sha512-FTgBI767POY/lKNDNbIzgAX6miIDBs6NTCbdlDb8TrWovHsSvaVIZDlTqym29C6UqhzwcJx4CYr+AlrMywA0cA==", 45 | "dev": true 46 | }, 47 | "@types/glob": { 48 | "version": "7.1.3", 49 | "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.3.tgz", 50 | "integrity": "sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==", 51 | "dev": true, 52 | "requires": { 53 | "@types/minimatch": "*", 54 | "@types/node": "*" 55 | } 56 | }, 57 | "@types/jasmine": { 58 | "version": "3.7.7", 59 | "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-3.7.7.tgz", 60 | "integrity": "sha512-yZzGe1d1T0y+imXDZ79F030nn8qbmiwpWKCZKvKN0KbTzwXAVYShUxkIxu1ba+vhIdabTGVGCfbtZC0oOam8TQ==", 61 | "dev": true 62 | }, 63 | "@types/minimatch": { 64 | "version": "3.0.4", 65 | "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.4.tgz", 66 | "integrity": "sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA==", 67 | "dev": true 68 | }, 69 | "@types/node": { 70 | "version": "12.20.15", 71 | "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.15.tgz", 72 | "integrity": "sha512-F6S4Chv4JicJmyrwlDkxUdGNSplsQdGwp1A0AJloEVDirWdZOAiRHhovDlsFkKUrquUXhz1imJhXHsf59auyAg==", 73 | "dev": true 74 | }, 75 | "acorn": { 76 | "version": "7.4.1", 77 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", 78 | "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", 79 | "dev": true 80 | }, 81 | "acorn-node": { 82 | "version": "1.8.2", 83 | "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz", 84 | "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==", 85 | "dev": true, 86 | "requires": { 87 | "acorn": "^7.0.0", 88 | "acorn-walk": "^7.0.0", 89 | "xtend": "^4.0.2" 90 | } 91 | }, 92 | "acorn-walk": { 93 | "version": "7.2.0", 94 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", 95 | "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", 96 | "dev": true 97 | }, 98 | "arg": { 99 | "version": "4.1.3", 100 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 101 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 102 | "dev": true 103 | }, 104 | "arr-diff": { 105 | "version": "4.0.0", 106 | "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", 107 | "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", 108 | "dev": true 109 | }, 110 | "arr-flatten": { 111 | "version": "1.1.0", 112 | "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", 113 | "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", 114 | "dev": true 115 | }, 116 | "arr-union": { 117 | "version": "3.1.0", 118 | "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", 119 | "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", 120 | "dev": true 121 | }, 122 | "array-union": { 123 | "version": "1.0.2", 124 | "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", 125 | "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", 126 | "dev": true, 127 | "requires": { 128 | "array-uniq": "^1.0.1" 129 | } 130 | }, 131 | "array-uniq": { 132 | "version": "1.0.3", 133 | "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", 134 | "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", 135 | "dev": true 136 | }, 137 | "array-unique": { 138 | "version": "0.3.2", 139 | "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", 140 | "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", 141 | "dev": true 142 | }, 143 | "assign-symbols": { 144 | "version": "1.0.0", 145 | "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", 146 | "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", 147 | "dev": true 148 | }, 149 | "atob": { 150 | "version": "2.1.2", 151 | "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", 152 | "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", 153 | "dev": true 154 | }, 155 | "balanced-match": { 156 | "version": "1.0.2", 157 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 158 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 159 | "dev": true 160 | }, 161 | "base": { 162 | "version": "0.11.2", 163 | "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", 164 | "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", 165 | "dev": true, 166 | "requires": { 167 | "cache-base": "^1.0.1", 168 | "class-utils": "^0.3.5", 169 | "component-emitter": "^1.2.1", 170 | "define-property": "^1.0.0", 171 | "isobject": "^3.0.1", 172 | "mixin-deep": "^1.2.0", 173 | "pascalcase": "^0.1.1" 174 | }, 175 | "dependencies": { 176 | "define-property": { 177 | "version": "1.0.0", 178 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", 179 | "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", 180 | "dev": true, 181 | "requires": { 182 | "is-descriptor": "^1.0.0" 183 | } 184 | }, 185 | "is-accessor-descriptor": { 186 | "version": "1.0.0", 187 | "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", 188 | "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", 189 | "dev": true, 190 | "requires": { 191 | "kind-of": "^6.0.0" 192 | } 193 | }, 194 | "is-data-descriptor": { 195 | "version": "1.0.0", 196 | "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", 197 | "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", 198 | "dev": true, 199 | "requires": { 200 | "kind-of": "^6.0.0" 201 | } 202 | }, 203 | "is-descriptor": { 204 | "version": "1.0.2", 205 | "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", 206 | "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", 207 | "dev": true, 208 | "requires": { 209 | "is-accessor-descriptor": "^1.0.0", 210 | "is-data-descriptor": "^1.0.0", 211 | "kind-of": "^6.0.2" 212 | } 213 | } 214 | } 215 | }, 216 | "brace-expansion": { 217 | "version": "1.1.11", 218 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 219 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 220 | "dev": true, 221 | "requires": { 222 | "balanced-match": "^1.0.0", 223 | "concat-map": "0.0.1" 224 | } 225 | }, 226 | "braces": { 227 | "version": "2.3.2", 228 | "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", 229 | "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", 230 | "dev": true, 231 | "requires": { 232 | "arr-flatten": "^1.1.0", 233 | "array-unique": "^0.3.2", 234 | "extend-shallow": "^2.0.1", 235 | "fill-range": "^4.0.0", 236 | "isobject": "^3.0.1", 237 | "repeat-element": "^1.1.2", 238 | "snapdragon": "^0.8.1", 239 | "snapdragon-node": "^2.0.1", 240 | "split-string": "^3.0.2", 241 | "to-regex": "^3.0.1" 242 | }, 243 | "dependencies": { 244 | "extend-shallow": { 245 | "version": "2.0.1", 246 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 247 | "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 248 | "dev": true, 249 | "requires": { 250 | "is-extendable": "^0.1.0" 251 | } 252 | } 253 | } 254 | }, 255 | "buffer-from": { 256 | "version": "1.1.1", 257 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/buffer-from/-/buffer-from-1.1.1.tgz", 258 | "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", 259 | "dev": true 260 | }, 261 | "builtins": { 262 | "version": "2.0.1", 263 | "resolved": "https://registry.npmjs.org/builtins/-/builtins-2.0.1.tgz", 264 | "integrity": "sha512-XkkVe5QAb6guWPXTzpSrYpSlN3nqEmrrE2TkAr/tp7idSF6+MONh9WvKrAuR3HiKLvoSgmbs8l1U9IPmMrIoLw==", 265 | "dev": true, 266 | "requires": { 267 | "semver": "^6.0.0" 268 | } 269 | }, 270 | "cache-base": { 271 | "version": "1.0.1", 272 | "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", 273 | "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", 274 | "dev": true, 275 | "requires": { 276 | "collection-visit": "^1.0.0", 277 | "component-emitter": "^1.2.1", 278 | "get-value": "^2.0.6", 279 | "has-value": "^1.0.0", 280 | "isobject": "^3.0.1", 281 | "set-value": "^2.0.0", 282 | "to-object-path": "^0.3.0", 283 | "union-value": "^1.0.0", 284 | "unset-value": "^1.0.0" 285 | } 286 | }, 287 | "call-me-maybe": { 288 | "version": "1.0.1", 289 | "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", 290 | "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", 291 | "dev": true 292 | }, 293 | "class-utils": { 294 | "version": "0.3.6", 295 | "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", 296 | "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", 297 | "dev": true, 298 | "requires": { 299 | "arr-union": "^3.1.0", 300 | "define-property": "^0.2.5", 301 | "isobject": "^3.0.0", 302 | "static-extend": "^0.1.1" 303 | }, 304 | "dependencies": { 305 | "define-property": { 306 | "version": "0.2.5", 307 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", 308 | "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", 309 | "dev": true, 310 | "requires": { 311 | "is-descriptor": "^0.1.0" 312 | } 313 | } 314 | } 315 | }, 316 | "collection-visit": { 317 | "version": "1.0.0", 318 | "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", 319 | "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", 320 | "dev": true, 321 | "requires": { 322 | "map-visit": "^1.0.0", 323 | "object-visit": "^1.0.0" 324 | } 325 | }, 326 | "colors": { 327 | "version": "1.4.0", 328 | "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", 329 | "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", 330 | "dev": true 331 | }, 332 | "component-emitter": { 333 | "version": "1.3.0", 334 | "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", 335 | "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", 336 | "dev": true 337 | }, 338 | "concat-map": { 339 | "version": "0.0.1", 340 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/concat-map/-/concat-map-0.0.1.tgz", 341 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 342 | "dev": true 343 | }, 344 | "copy-descriptor": { 345 | "version": "0.1.1", 346 | "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", 347 | "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", 348 | "dev": true 349 | }, 350 | "create-require": { 351 | "version": "1.1.1", 352 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 353 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", 354 | "dev": true 355 | }, 356 | "debug": { 357 | "version": "4.3.1", 358 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", 359 | "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", 360 | "dev": true, 361 | "requires": { 362 | "ms": "2.1.2" 363 | } 364 | }, 365 | "decode-uri-component": { 366 | "version": "0.2.0", 367 | "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", 368 | "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", 369 | "dev": true 370 | }, 371 | "define-property": { 372 | "version": "2.0.2", 373 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", 374 | "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", 375 | "dev": true, 376 | "requires": { 377 | "is-descriptor": "^1.0.2", 378 | "isobject": "^3.0.1" 379 | }, 380 | "dependencies": { 381 | "is-accessor-descriptor": { 382 | "version": "1.0.0", 383 | "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", 384 | "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", 385 | "dev": true, 386 | "requires": { 387 | "kind-of": "^6.0.0" 388 | } 389 | }, 390 | "is-data-descriptor": { 391 | "version": "1.0.0", 392 | "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", 393 | "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", 394 | "dev": true, 395 | "requires": { 396 | "kind-of": "^6.0.0" 397 | } 398 | }, 399 | "is-descriptor": { 400 | "version": "1.0.2", 401 | "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", 402 | "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", 403 | "dev": true, 404 | "requires": { 405 | "is-accessor-descriptor": "^1.0.0", 406 | "is-data-descriptor": "^1.0.0", 407 | "kind-of": "^6.0.2" 408 | } 409 | } 410 | } 411 | }, 412 | "defined": { 413 | "version": "1.0.0", 414 | "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", 415 | "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", 416 | "dev": true 417 | }, 418 | "dependency-check": { 419 | "version": "3.4.1", 420 | "resolved": "https://registry.npmjs.org/dependency-check/-/dependency-check-3.4.1.tgz", 421 | "integrity": "sha512-YMTTpvHX1wP2FwEMWWFaD2WoiH261iRiXZQPqkUxeBb+5FfZ2XjTN1BJbi2zx/8Y23hzUCTpRlvnyB8tBK2bMg==", 422 | "dev": true, 423 | "requires": { 424 | "builtins": "^2.0.0", 425 | "debug": "^4.0.0", 426 | "detective": "^5.0.2", 427 | "globby": "^9.2.0", 428 | "is-relative": "^1.0.0", 429 | "micromatch": "^3.0.0", 430 | "minimist": "^1.2.0", 431 | "read-package-json": "^2.0.10", 432 | "resolve": "^1.1.7" 433 | } 434 | }, 435 | "detective": { 436 | "version": "5.2.0", 437 | "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.0.tgz", 438 | "integrity": "sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg==", 439 | "dev": true, 440 | "requires": { 441 | "acorn-node": "^1.6.1", 442 | "defined": "^1.0.0", 443 | "minimist": "^1.1.1" 444 | } 445 | }, 446 | "diff": { 447 | "version": "4.0.2", 448 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 449 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 450 | "dev": true 451 | }, 452 | "dir-glob": { 453 | "version": "2.2.2", 454 | "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", 455 | "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", 456 | "dev": true, 457 | "requires": { 458 | "path-type": "^3.0.0" 459 | } 460 | }, 461 | "expand-brackets": { 462 | "version": "2.1.4", 463 | "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", 464 | "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", 465 | "dev": true, 466 | "requires": { 467 | "debug": "^2.3.3", 468 | "define-property": "^0.2.5", 469 | "extend-shallow": "^2.0.1", 470 | "posix-character-classes": "^0.1.0", 471 | "regex-not": "^1.0.0", 472 | "snapdragon": "^0.8.1", 473 | "to-regex": "^3.0.1" 474 | }, 475 | "dependencies": { 476 | "debug": { 477 | "version": "2.6.9", 478 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 479 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 480 | "dev": true, 481 | "requires": { 482 | "ms": "2.0.0" 483 | } 484 | }, 485 | "define-property": { 486 | "version": "0.2.5", 487 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", 488 | "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", 489 | "dev": true, 490 | "requires": { 491 | "is-descriptor": "^0.1.0" 492 | } 493 | }, 494 | "extend-shallow": { 495 | "version": "2.0.1", 496 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 497 | "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 498 | "dev": true, 499 | "requires": { 500 | "is-extendable": "^0.1.0" 501 | } 502 | }, 503 | "ms": { 504 | "version": "2.0.0", 505 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 506 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 507 | "dev": true 508 | } 509 | } 510 | }, 511 | "extend-shallow": { 512 | "version": "3.0.2", 513 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", 514 | "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", 515 | "dev": true, 516 | "requires": { 517 | "assign-symbols": "^1.0.0", 518 | "is-extendable": "^1.0.1" 519 | }, 520 | "dependencies": { 521 | "is-extendable": { 522 | "version": "1.0.1", 523 | "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", 524 | "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", 525 | "dev": true, 526 | "requires": { 527 | "is-plain-object": "^2.0.4" 528 | } 529 | } 530 | } 531 | }, 532 | "extglob": { 533 | "version": "2.0.4", 534 | "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", 535 | "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", 536 | "dev": true, 537 | "requires": { 538 | "array-unique": "^0.3.2", 539 | "define-property": "^1.0.0", 540 | "expand-brackets": "^2.1.4", 541 | "extend-shallow": "^2.0.1", 542 | "fragment-cache": "^0.2.1", 543 | "regex-not": "^1.0.0", 544 | "snapdragon": "^0.8.1", 545 | "to-regex": "^3.0.1" 546 | }, 547 | "dependencies": { 548 | "define-property": { 549 | "version": "1.0.0", 550 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", 551 | "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", 552 | "dev": true, 553 | "requires": { 554 | "is-descriptor": "^1.0.0" 555 | } 556 | }, 557 | "extend-shallow": { 558 | "version": "2.0.1", 559 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 560 | "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 561 | "dev": true, 562 | "requires": { 563 | "is-extendable": "^0.1.0" 564 | } 565 | }, 566 | "is-accessor-descriptor": { 567 | "version": "1.0.0", 568 | "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", 569 | "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", 570 | "dev": true, 571 | "requires": { 572 | "kind-of": "^6.0.0" 573 | } 574 | }, 575 | "is-data-descriptor": { 576 | "version": "1.0.0", 577 | "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", 578 | "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", 579 | "dev": true, 580 | "requires": { 581 | "kind-of": "^6.0.0" 582 | } 583 | }, 584 | "is-descriptor": { 585 | "version": "1.0.2", 586 | "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", 587 | "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", 588 | "dev": true, 589 | "requires": { 590 | "is-accessor-descriptor": "^1.0.0", 591 | "is-data-descriptor": "^1.0.0", 592 | "kind-of": "^6.0.2" 593 | } 594 | } 595 | } 596 | }, 597 | "fast-glob": { 598 | "version": "2.2.7", 599 | "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", 600 | "integrity": "sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw==", 601 | "dev": true, 602 | "requires": { 603 | "@mrmlnc/readdir-enhanced": "^2.2.1", 604 | "@nodelib/fs.stat": "^1.1.2", 605 | "glob-parent": "^3.1.0", 606 | "is-glob": "^4.0.0", 607 | "merge2": "^1.2.3", 608 | "micromatch": "^3.1.10" 609 | } 610 | }, 611 | "fill-range": { 612 | "version": "4.0.0", 613 | "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", 614 | "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", 615 | "dev": true, 616 | "requires": { 617 | "extend-shallow": "^2.0.1", 618 | "is-number": "^3.0.0", 619 | "repeat-string": "^1.6.1", 620 | "to-regex-range": "^2.1.0" 621 | }, 622 | "dependencies": { 623 | "extend-shallow": { 624 | "version": "2.0.1", 625 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 626 | "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 627 | "dev": true, 628 | "requires": { 629 | "is-extendable": "^0.1.0" 630 | } 631 | } 632 | } 633 | }, 634 | "for-in": { 635 | "version": "1.0.2", 636 | "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", 637 | "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", 638 | "dev": true 639 | }, 640 | "fragment-cache": { 641 | "version": "0.2.1", 642 | "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", 643 | "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", 644 | "dev": true, 645 | "requires": { 646 | "map-cache": "^0.2.2" 647 | } 648 | }, 649 | "fs.realpath": { 650 | "version": "1.0.0", 651 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/fs.realpath/-/fs.realpath-1.0.0.tgz", 652 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 653 | "dev": true 654 | }, 655 | "function-bind": { 656 | "version": "1.1.1", 657 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 658 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", 659 | "dev": true 660 | }, 661 | "get-value": { 662 | "version": "2.0.6", 663 | "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", 664 | "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", 665 | "dev": true 666 | }, 667 | "glob": { 668 | "version": "7.1.7", 669 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", 670 | "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", 671 | "dev": true, 672 | "requires": { 673 | "fs.realpath": "^1.0.0", 674 | "inflight": "^1.0.4", 675 | "inherits": "2", 676 | "minimatch": "^3.0.4", 677 | "once": "^1.3.0", 678 | "path-is-absolute": "^1.0.0" 679 | } 680 | }, 681 | "glob-parent": { 682 | "version": "3.1.0", 683 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", 684 | "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", 685 | "dev": true, 686 | "requires": { 687 | "is-glob": "^3.1.0", 688 | "path-dirname": "^1.0.0" 689 | }, 690 | "dependencies": { 691 | "is-glob": { 692 | "version": "3.1.0", 693 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", 694 | "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", 695 | "dev": true, 696 | "requires": { 697 | "is-extglob": "^2.1.0" 698 | } 699 | } 700 | } 701 | }, 702 | "glob-to-regexp": { 703 | "version": "0.3.0", 704 | "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", 705 | "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", 706 | "dev": true 707 | }, 708 | "globby": { 709 | "version": "9.2.0", 710 | "resolved": "https://registry.npmjs.org/globby/-/globby-9.2.0.tgz", 711 | "integrity": "sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg==", 712 | "dev": true, 713 | "requires": { 714 | "@types/glob": "^7.1.1", 715 | "array-union": "^1.0.2", 716 | "dir-glob": "^2.2.2", 717 | "fast-glob": "^2.2.6", 718 | "glob": "^7.1.3", 719 | "ignore": "^4.0.3", 720 | "pify": "^4.0.1", 721 | "slash": "^2.0.0" 722 | } 723 | }, 724 | "graphql": { 725 | "version": "15.5.0", 726 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.5.0.tgz", 727 | "integrity": "sha512-OmaM7y0kaK31NKG31q4YbD2beNYa6jBBKtMFT6gLYJljHLJr42IqJ8KX08u3Li/0ifzTU5HjmoOOrwa5BRLeDA==", 728 | "dev": true 729 | }, 730 | "graphql-tag": { 731 | "version": "2.12.4", 732 | "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.4.tgz", 733 | "integrity": "sha512-VV1U4O+9x99EkNpNmCUV5RZwq6MnK4+pGbRYWG+lA/m3uo7TSqJF81OkcOP148gFP6fzdl7JWYBrwWVTS9jXww==", 734 | "dev": true, 735 | "requires": { 736 | "tslib": "^2.1.0" 737 | } 738 | }, 739 | "has": { 740 | "version": "1.0.3", 741 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 742 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 743 | "dev": true, 744 | "requires": { 745 | "function-bind": "^1.1.1" 746 | } 747 | }, 748 | "has-value": { 749 | "version": "1.0.0", 750 | "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", 751 | "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", 752 | "dev": true, 753 | "requires": { 754 | "get-value": "^2.0.6", 755 | "has-values": "^1.0.0", 756 | "isobject": "^3.0.0" 757 | } 758 | }, 759 | "has-values": { 760 | "version": "1.0.0", 761 | "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", 762 | "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", 763 | "dev": true, 764 | "requires": { 765 | "is-number": "^3.0.0", 766 | "kind-of": "^4.0.0" 767 | }, 768 | "dependencies": { 769 | "kind-of": { 770 | "version": "4.0.0", 771 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", 772 | "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", 773 | "dev": true, 774 | "requires": { 775 | "is-buffer": "^1.1.5" 776 | } 777 | } 778 | } 779 | }, 780 | "hosted-git-info": { 781 | "version": "2.8.9", 782 | "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", 783 | "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", 784 | "dev": true 785 | }, 786 | "ignore": { 787 | "version": "4.0.6", 788 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", 789 | "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", 790 | "dev": true 791 | }, 792 | "inflight": { 793 | "version": "1.0.6", 794 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/inflight/-/inflight-1.0.6.tgz", 795 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 796 | "dev": true, 797 | "requires": { 798 | "once": "^1.3.0", 799 | "wrappy": "1" 800 | } 801 | }, 802 | "inherits": { 803 | "version": "2.0.4", 804 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 805 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 806 | "dev": true 807 | }, 808 | "is-accessor-descriptor": { 809 | "version": "0.1.6", 810 | "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", 811 | "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", 812 | "dev": true, 813 | "requires": { 814 | "kind-of": "^3.0.2" 815 | }, 816 | "dependencies": { 817 | "kind-of": { 818 | "version": "3.2.2", 819 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 820 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 821 | "dev": true, 822 | "requires": { 823 | "is-buffer": "^1.1.5" 824 | } 825 | } 826 | } 827 | }, 828 | "is-buffer": { 829 | "version": "1.1.6", 830 | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", 831 | "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", 832 | "dev": true 833 | }, 834 | "is-core-module": { 835 | "version": "2.4.0", 836 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", 837 | "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", 838 | "dev": true, 839 | "requires": { 840 | "has": "^1.0.3" 841 | } 842 | }, 843 | "is-data-descriptor": { 844 | "version": "0.1.4", 845 | "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", 846 | "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", 847 | "dev": true, 848 | "requires": { 849 | "kind-of": "^3.0.2" 850 | }, 851 | "dependencies": { 852 | "kind-of": { 853 | "version": "3.2.2", 854 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 855 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 856 | "dev": true, 857 | "requires": { 858 | "is-buffer": "^1.1.5" 859 | } 860 | } 861 | } 862 | }, 863 | "is-descriptor": { 864 | "version": "0.1.6", 865 | "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", 866 | "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", 867 | "dev": true, 868 | "requires": { 869 | "is-accessor-descriptor": "^0.1.6", 870 | "is-data-descriptor": "^0.1.4", 871 | "kind-of": "^5.0.0" 872 | }, 873 | "dependencies": { 874 | "kind-of": { 875 | "version": "5.1.0", 876 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", 877 | "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", 878 | "dev": true 879 | } 880 | } 881 | }, 882 | "is-extendable": { 883 | "version": "0.1.1", 884 | "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", 885 | "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", 886 | "dev": true 887 | }, 888 | "is-extglob": { 889 | "version": "2.1.1", 890 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 891 | "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", 892 | "dev": true 893 | }, 894 | "is-glob": { 895 | "version": "4.0.1", 896 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", 897 | "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", 898 | "dev": true, 899 | "requires": { 900 | "is-extglob": "^2.1.1" 901 | } 902 | }, 903 | "is-number": { 904 | "version": "3.0.0", 905 | "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", 906 | "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", 907 | "dev": true, 908 | "requires": { 909 | "kind-of": "^3.0.2" 910 | }, 911 | "dependencies": { 912 | "kind-of": { 913 | "version": "3.2.2", 914 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 915 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 916 | "dev": true, 917 | "requires": { 918 | "is-buffer": "^1.1.5" 919 | } 920 | } 921 | } 922 | }, 923 | "is-plain-object": { 924 | "version": "2.0.4", 925 | "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", 926 | "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", 927 | "dev": true, 928 | "requires": { 929 | "isobject": "^3.0.1" 930 | } 931 | }, 932 | "is-relative": { 933 | "version": "1.0.0", 934 | "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", 935 | "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", 936 | "dev": true, 937 | "requires": { 938 | "is-unc-path": "^1.0.0" 939 | } 940 | }, 941 | "is-unc-path": { 942 | "version": "1.0.0", 943 | "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", 944 | "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", 945 | "dev": true, 946 | "requires": { 947 | "unc-path-regex": "^0.1.2" 948 | } 949 | }, 950 | "is-windows": { 951 | "version": "1.0.2", 952 | "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", 953 | "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", 954 | "dev": true 955 | }, 956 | "isarray": { 957 | "version": "1.0.0", 958 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 959 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 960 | "dev": true 961 | }, 962 | "isobject": { 963 | "version": "3.0.1", 964 | "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", 965 | "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", 966 | "dev": true 967 | }, 968 | "jasmine": { 969 | "version": "3.7.0", 970 | "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.7.0.tgz", 971 | "integrity": "sha512-wlzGQ+cIFzMEsI+wDqmOwvnjTvolLFwlcpYLCqSPPH0prOQaW3P+IzMhHYn934l1imNvw07oCyX+vGUv3wmtSQ==", 972 | "dev": true, 973 | "requires": { 974 | "glob": "^7.1.6", 975 | "jasmine-core": "~3.7.0" 976 | } 977 | }, 978 | "jasmine-core": { 979 | "version": "3.7.1", 980 | "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-3.7.1.tgz", 981 | "integrity": "sha512-DH3oYDS/AUvvr22+xUBW62m1Xoy7tUlY1tsxKEJvl5JeJ7q8zd1K5bUwiOxdH+erj6l2vAMM3hV25Xs9/WrmuQ==", 982 | "dev": true 983 | }, 984 | "jasmine-promises": { 985 | "version": "0.4.1", 986 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/jasmine-promises/-/jasmine-promises-0.4.1.tgz", 987 | "integrity": "sha1-OGtj4scU0z2bG3ra5Qd3M2bb8Ks=", 988 | "dev": true 989 | }, 990 | "jasmine-spec-reporter": { 991 | "version": "7.0.0", 992 | "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-7.0.0.tgz", 993 | "integrity": "sha512-OtC7JRasiTcjsaCBPtMO0Tl8glCejM4J4/dNuOJdA8lBjz4PmWjYQ6pzb0uzpBNAWJMDudYuj9OdXJWqM2QTJg==", 994 | "dev": true, 995 | "requires": { 996 | "colors": "1.4.0" 997 | } 998 | }, 999 | "json-parse-even-better-errors": { 1000 | "version": "2.3.1", 1001 | "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", 1002 | "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", 1003 | "dev": true 1004 | }, 1005 | "kind-of": { 1006 | "version": "6.0.3", 1007 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", 1008 | "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", 1009 | "dev": true 1010 | }, 1011 | "make-error": { 1012 | "version": "1.3.6", 1013 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 1014 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", 1015 | "dev": true 1016 | }, 1017 | "map-cache": { 1018 | "version": "0.2.2", 1019 | "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", 1020 | "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", 1021 | "dev": true 1022 | }, 1023 | "map-visit": { 1024 | "version": "1.0.0", 1025 | "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", 1026 | "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", 1027 | "dev": true, 1028 | "requires": { 1029 | "object-visit": "^1.0.0" 1030 | } 1031 | }, 1032 | "merge2": { 1033 | "version": "1.4.1", 1034 | "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", 1035 | "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", 1036 | "dev": true 1037 | }, 1038 | "micromatch": { 1039 | "version": "3.1.10", 1040 | "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", 1041 | "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", 1042 | "dev": true, 1043 | "requires": { 1044 | "arr-diff": "^4.0.0", 1045 | "array-unique": "^0.3.2", 1046 | "braces": "^2.3.1", 1047 | "define-property": "^2.0.2", 1048 | "extend-shallow": "^3.0.2", 1049 | "extglob": "^2.0.4", 1050 | "fragment-cache": "^0.2.1", 1051 | "kind-of": "^6.0.2", 1052 | "nanomatch": "^1.2.9", 1053 | "object.pick": "^1.3.0", 1054 | "regex-not": "^1.0.0", 1055 | "snapdragon": "^0.8.1", 1056 | "to-regex": "^3.0.2" 1057 | } 1058 | }, 1059 | "minimatch": { 1060 | "version": "3.0.4", 1061 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/minimatch/-/minimatch-3.0.4.tgz", 1062 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 1063 | "dev": true, 1064 | "requires": { 1065 | "brace-expansion": "^1.1.7" 1066 | } 1067 | }, 1068 | "minimist": { 1069 | "version": "1.2.5", 1070 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 1071 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", 1072 | "dev": true 1073 | }, 1074 | "mixin-deep": { 1075 | "version": "1.3.2", 1076 | "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", 1077 | "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", 1078 | "dev": true, 1079 | "requires": { 1080 | "for-in": "^1.0.2", 1081 | "is-extendable": "^1.0.1" 1082 | }, 1083 | "dependencies": { 1084 | "is-extendable": { 1085 | "version": "1.0.1", 1086 | "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", 1087 | "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", 1088 | "dev": true, 1089 | "requires": { 1090 | "is-plain-object": "^2.0.4" 1091 | } 1092 | } 1093 | } 1094 | }, 1095 | "ms": { 1096 | "version": "2.1.2", 1097 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 1098 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 1099 | "dev": true 1100 | }, 1101 | "nanomatch": { 1102 | "version": "1.2.13", 1103 | "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", 1104 | "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", 1105 | "dev": true, 1106 | "requires": { 1107 | "arr-diff": "^4.0.0", 1108 | "array-unique": "^0.3.2", 1109 | "define-property": "^2.0.2", 1110 | "extend-shallow": "^3.0.2", 1111 | "fragment-cache": "^0.2.1", 1112 | "is-windows": "^1.0.2", 1113 | "kind-of": "^6.0.2", 1114 | "object.pick": "^1.3.0", 1115 | "regex-not": "^1.0.0", 1116 | "snapdragon": "^0.8.1", 1117 | "to-regex": "^3.0.1" 1118 | } 1119 | }, 1120 | "normalize-package-data": { 1121 | "version": "2.5.0", 1122 | "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", 1123 | "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", 1124 | "dev": true, 1125 | "requires": { 1126 | "hosted-git-info": "^2.1.4", 1127 | "resolve": "^1.10.0", 1128 | "semver": "2 || 3 || 4 || 5", 1129 | "validate-npm-package-license": "^3.0.1" 1130 | }, 1131 | "dependencies": { 1132 | "semver": { 1133 | "version": "5.7.1", 1134 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 1135 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 1136 | "dev": true 1137 | } 1138 | } 1139 | }, 1140 | "npm-normalize-package-bin": { 1141 | "version": "1.0.1", 1142 | "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", 1143 | "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", 1144 | "dev": true 1145 | }, 1146 | "object-copy": { 1147 | "version": "0.1.0", 1148 | "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", 1149 | "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", 1150 | "dev": true, 1151 | "requires": { 1152 | "copy-descriptor": "^0.1.0", 1153 | "define-property": "^0.2.5", 1154 | "kind-of": "^3.0.3" 1155 | }, 1156 | "dependencies": { 1157 | "define-property": { 1158 | "version": "0.2.5", 1159 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", 1160 | "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", 1161 | "dev": true, 1162 | "requires": { 1163 | "is-descriptor": "^0.1.0" 1164 | } 1165 | }, 1166 | "kind-of": { 1167 | "version": "3.2.2", 1168 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 1169 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 1170 | "dev": true, 1171 | "requires": { 1172 | "is-buffer": "^1.1.5" 1173 | } 1174 | } 1175 | } 1176 | }, 1177 | "object-visit": { 1178 | "version": "1.0.1", 1179 | "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", 1180 | "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", 1181 | "dev": true, 1182 | "requires": { 1183 | "isobject": "^3.0.0" 1184 | } 1185 | }, 1186 | "object.pick": { 1187 | "version": "1.3.0", 1188 | "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", 1189 | "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", 1190 | "dev": true, 1191 | "requires": { 1192 | "isobject": "^3.0.1" 1193 | } 1194 | }, 1195 | "once": { 1196 | "version": "1.4.0", 1197 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/once/-/once-1.4.0.tgz", 1198 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 1199 | "dev": true, 1200 | "requires": { 1201 | "wrappy": "1" 1202 | } 1203 | }, 1204 | "pascalcase": { 1205 | "version": "0.1.1", 1206 | "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", 1207 | "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", 1208 | "dev": true 1209 | }, 1210 | "path-dirname": { 1211 | "version": "1.0.2", 1212 | "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", 1213 | "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", 1214 | "dev": true 1215 | }, 1216 | "path-is-absolute": { 1217 | "version": "1.0.1", 1218 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1219 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 1220 | "dev": true 1221 | }, 1222 | "path-parse": { 1223 | "version": "1.0.7", 1224 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 1225 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", 1226 | "dev": true 1227 | }, 1228 | "path-type": { 1229 | "version": "3.0.0", 1230 | "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", 1231 | "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", 1232 | "dev": true, 1233 | "requires": { 1234 | "pify": "^3.0.0" 1235 | }, 1236 | "dependencies": { 1237 | "pify": { 1238 | "version": "3.0.0", 1239 | "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", 1240 | "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", 1241 | "dev": true 1242 | } 1243 | } 1244 | }, 1245 | "pify": { 1246 | "version": "4.0.1", 1247 | "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", 1248 | "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", 1249 | "dev": true 1250 | }, 1251 | "posix-character-classes": { 1252 | "version": "0.1.1", 1253 | "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", 1254 | "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", 1255 | "dev": true 1256 | }, 1257 | "read-package-json": { 1258 | "version": "2.1.2", 1259 | "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", 1260 | "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", 1261 | "dev": true, 1262 | "requires": { 1263 | "glob": "^7.1.1", 1264 | "json-parse-even-better-errors": "^2.3.0", 1265 | "normalize-package-data": "^2.0.0", 1266 | "npm-normalize-package-bin": "^1.0.0" 1267 | } 1268 | }, 1269 | "regex-not": { 1270 | "version": "1.0.2", 1271 | "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", 1272 | "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", 1273 | "dev": true, 1274 | "requires": { 1275 | "extend-shallow": "^3.0.2", 1276 | "safe-regex": "^1.1.0" 1277 | } 1278 | }, 1279 | "repeat-element": { 1280 | "version": "1.1.4", 1281 | "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", 1282 | "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", 1283 | "dev": true 1284 | }, 1285 | "repeat-string": { 1286 | "version": "1.6.1", 1287 | "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", 1288 | "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", 1289 | "dev": true 1290 | }, 1291 | "resolve": { 1292 | "version": "1.20.0", 1293 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", 1294 | "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", 1295 | "dev": true, 1296 | "requires": { 1297 | "is-core-module": "^2.2.0", 1298 | "path-parse": "^1.0.6" 1299 | } 1300 | }, 1301 | "resolve-url": { 1302 | "version": "0.2.1", 1303 | "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", 1304 | "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", 1305 | "dev": true 1306 | }, 1307 | "ret": { 1308 | "version": "0.1.15", 1309 | "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", 1310 | "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", 1311 | "dev": true 1312 | }, 1313 | "rimraf": { 1314 | "version": "3.0.2", 1315 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 1316 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 1317 | "dev": true, 1318 | "requires": { 1319 | "glob": "^7.1.3" 1320 | } 1321 | }, 1322 | "safe-regex": { 1323 | "version": "1.1.0", 1324 | "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", 1325 | "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", 1326 | "dev": true, 1327 | "requires": { 1328 | "ret": "~0.1.10" 1329 | } 1330 | }, 1331 | "semver": { 1332 | "version": "6.3.0", 1333 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 1334 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 1335 | "dev": true 1336 | }, 1337 | "set-value": { 1338 | "version": "2.0.1", 1339 | "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", 1340 | "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", 1341 | "dev": true, 1342 | "requires": { 1343 | "extend-shallow": "^2.0.1", 1344 | "is-extendable": "^0.1.1", 1345 | "is-plain-object": "^2.0.3", 1346 | "split-string": "^3.0.1" 1347 | }, 1348 | "dependencies": { 1349 | "extend-shallow": { 1350 | "version": "2.0.1", 1351 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 1352 | "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 1353 | "dev": true, 1354 | "requires": { 1355 | "is-extendable": "^0.1.0" 1356 | } 1357 | } 1358 | } 1359 | }, 1360 | "slash": { 1361 | "version": "2.0.0", 1362 | "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", 1363 | "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", 1364 | "dev": true 1365 | }, 1366 | "snapdragon": { 1367 | "version": "0.8.2", 1368 | "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", 1369 | "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", 1370 | "dev": true, 1371 | "requires": { 1372 | "base": "^0.11.1", 1373 | "debug": "^2.2.0", 1374 | "define-property": "^0.2.5", 1375 | "extend-shallow": "^2.0.1", 1376 | "map-cache": "^0.2.2", 1377 | "source-map": "^0.5.6", 1378 | "source-map-resolve": "^0.5.0", 1379 | "use": "^3.1.0" 1380 | }, 1381 | "dependencies": { 1382 | "debug": { 1383 | "version": "2.6.9", 1384 | "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", 1385 | "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", 1386 | "dev": true, 1387 | "requires": { 1388 | "ms": "2.0.0" 1389 | } 1390 | }, 1391 | "define-property": { 1392 | "version": "0.2.5", 1393 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", 1394 | "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", 1395 | "dev": true, 1396 | "requires": { 1397 | "is-descriptor": "^0.1.0" 1398 | } 1399 | }, 1400 | "extend-shallow": { 1401 | "version": "2.0.1", 1402 | "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", 1403 | "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", 1404 | "dev": true, 1405 | "requires": { 1406 | "is-extendable": "^0.1.0" 1407 | } 1408 | }, 1409 | "ms": { 1410 | "version": "2.0.0", 1411 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 1412 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", 1413 | "dev": true 1414 | }, 1415 | "source-map": { 1416 | "version": "0.5.7", 1417 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 1418 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", 1419 | "dev": true 1420 | } 1421 | } 1422 | }, 1423 | "snapdragon-node": { 1424 | "version": "2.1.1", 1425 | "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", 1426 | "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", 1427 | "dev": true, 1428 | "requires": { 1429 | "define-property": "^1.0.0", 1430 | "isobject": "^3.0.0", 1431 | "snapdragon-util": "^3.0.1" 1432 | }, 1433 | "dependencies": { 1434 | "define-property": { 1435 | "version": "1.0.0", 1436 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", 1437 | "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", 1438 | "dev": true, 1439 | "requires": { 1440 | "is-descriptor": "^1.0.0" 1441 | } 1442 | }, 1443 | "is-accessor-descriptor": { 1444 | "version": "1.0.0", 1445 | "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", 1446 | "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", 1447 | "dev": true, 1448 | "requires": { 1449 | "kind-of": "^6.0.0" 1450 | } 1451 | }, 1452 | "is-data-descriptor": { 1453 | "version": "1.0.0", 1454 | "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", 1455 | "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", 1456 | "dev": true, 1457 | "requires": { 1458 | "kind-of": "^6.0.0" 1459 | } 1460 | }, 1461 | "is-descriptor": { 1462 | "version": "1.0.2", 1463 | "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", 1464 | "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", 1465 | "dev": true, 1466 | "requires": { 1467 | "is-accessor-descriptor": "^1.0.0", 1468 | "is-data-descriptor": "^1.0.0", 1469 | "kind-of": "^6.0.2" 1470 | } 1471 | } 1472 | } 1473 | }, 1474 | "snapdragon-util": { 1475 | "version": "3.0.1", 1476 | "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", 1477 | "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", 1478 | "dev": true, 1479 | "requires": { 1480 | "kind-of": "^3.2.0" 1481 | }, 1482 | "dependencies": { 1483 | "kind-of": { 1484 | "version": "3.2.2", 1485 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 1486 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 1487 | "dev": true, 1488 | "requires": { 1489 | "is-buffer": "^1.1.5" 1490 | } 1491 | } 1492 | } 1493 | }, 1494 | "source-map": { 1495 | "version": "0.6.1", 1496 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/source-map/-/source-map-0.6.1.tgz", 1497 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 1498 | "dev": true 1499 | }, 1500 | "source-map-resolve": { 1501 | "version": "0.5.3", 1502 | "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", 1503 | "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", 1504 | "dev": true, 1505 | "requires": { 1506 | "atob": "^2.1.2", 1507 | "decode-uri-component": "^0.2.0", 1508 | "resolve-url": "^0.2.1", 1509 | "source-map-url": "^0.4.0", 1510 | "urix": "^0.1.0" 1511 | } 1512 | }, 1513 | "source-map-support": { 1514 | "version": "0.5.19", 1515 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", 1516 | "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", 1517 | "dev": true, 1518 | "requires": { 1519 | "buffer-from": "^1.0.0", 1520 | "source-map": "^0.6.0" 1521 | } 1522 | }, 1523 | "source-map-url": { 1524 | "version": "0.4.1", 1525 | "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", 1526 | "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", 1527 | "dev": true 1528 | }, 1529 | "spdx-correct": { 1530 | "version": "3.1.1", 1531 | "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", 1532 | "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", 1533 | "dev": true, 1534 | "requires": { 1535 | "spdx-expression-parse": "^3.0.0", 1536 | "spdx-license-ids": "^3.0.0" 1537 | } 1538 | }, 1539 | "spdx-exceptions": { 1540 | "version": "2.3.0", 1541 | "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", 1542 | "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", 1543 | "dev": true 1544 | }, 1545 | "spdx-expression-parse": { 1546 | "version": "3.0.1", 1547 | "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", 1548 | "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", 1549 | "dev": true, 1550 | "requires": { 1551 | "spdx-exceptions": "^2.1.0", 1552 | "spdx-license-ids": "^3.0.0" 1553 | } 1554 | }, 1555 | "spdx-license-ids": { 1556 | "version": "3.0.9", 1557 | "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", 1558 | "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", 1559 | "dev": true 1560 | }, 1561 | "split-string": { 1562 | "version": "3.1.0", 1563 | "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", 1564 | "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", 1565 | "dev": true, 1566 | "requires": { 1567 | "extend-shallow": "^3.0.0" 1568 | } 1569 | }, 1570 | "static-extend": { 1571 | "version": "0.1.2", 1572 | "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", 1573 | "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", 1574 | "dev": true, 1575 | "requires": { 1576 | "define-property": "^0.2.5", 1577 | "object-copy": "^0.1.0" 1578 | }, 1579 | "dependencies": { 1580 | "define-property": { 1581 | "version": "0.2.5", 1582 | "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", 1583 | "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", 1584 | "dev": true, 1585 | "requires": { 1586 | "is-descriptor": "^0.1.0" 1587 | } 1588 | } 1589 | } 1590 | }, 1591 | "to-object-path": { 1592 | "version": "0.3.0", 1593 | "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", 1594 | "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", 1595 | "dev": true, 1596 | "requires": { 1597 | "kind-of": "^3.0.2" 1598 | }, 1599 | "dependencies": { 1600 | "kind-of": { 1601 | "version": "3.2.2", 1602 | "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", 1603 | "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", 1604 | "dev": true, 1605 | "requires": { 1606 | "is-buffer": "^1.1.5" 1607 | } 1608 | } 1609 | } 1610 | }, 1611 | "to-regex": { 1612 | "version": "3.0.2", 1613 | "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", 1614 | "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", 1615 | "dev": true, 1616 | "requires": { 1617 | "define-property": "^2.0.2", 1618 | "extend-shallow": "^3.0.2", 1619 | "regex-not": "^1.0.2", 1620 | "safe-regex": "^1.1.0" 1621 | } 1622 | }, 1623 | "to-regex-range": { 1624 | "version": "2.1.1", 1625 | "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", 1626 | "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", 1627 | "dev": true, 1628 | "requires": { 1629 | "is-number": "^3.0.0", 1630 | "repeat-string": "^1.6.1" 1631 | } 1632 | }, 1633 | "ts-node": { 1634 | "version": "10.0.0", 1635 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.0.0.tgz", 1636 | "integrity": "sha512-ROWeOIUvfFbPZkoDis0L/55Fk+6gFQNZwwKPLinacRl6tsxstTF1DbAcLKkovwnpKMVvOMHP1TIbnwXwtLg1gg==", 1637 | "dev": true, 1638 | "requires": { 1639 | "@tsconfig/node10": "^1.0.7", 1640 | "@tsconfig/node12": "^1.0.7", 1641 | "@tsconfig/node14": "^1.0.0", 1642 | "@tsconfig/node16": "^1.0.1", 1643 | "arg": "^4.1.0", 1644 | "create-require": "^1.1.0", 1645 | "diff": "^4.0.1", 1646 | "make-error": "^1.1.1", 1647 | "source-map-support": "^0.5.17", 1648 | "yn": "3.1.1" 1649 | } 1650 | }, 1651 | "tslib": { 1652 | "version": "2.3.0", 1653 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", 1654 | "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", 1655 | "dev": true 1656 | }, 1657 | "typescript": { 1658 | "version": "4.2.4", 1659 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", 1660 | "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", 1661 | "dev": true 1662 | }, 1663 | "unc-path-regex": { 1664 | "version": "0.1.2", 1665 | "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", 1666 | "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", 1667 | "dev": true 1668 | }, 1669 | "union-value": { 1670 | "version": "1.0.1", 1671 | "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", 1672 | "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", 1673 | "dev": true, 1674 | "requires": { 1675 | "arr-union": "^3.1.0", 1676 | "get-value": "^2.0.6", 1677 | "is-extendable": "^0.1.1", 1678 | "set-value": "^2.0.1" 1679 | } 1680 | }, 1681 | "unset-value": { 1682 | "version": "1.0.0", 1683 | "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", 1684 | "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", 1685 | "dev": true, 1686 | "requires": { 1687 | "has-value": "^0.3.1", 1688 | "isobject": "^3.0.0" 1689 | }, 1690 | "dependencies": { 1691 | "has-value": { 1692 | "version": "0.3.1", 1693 | "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", 1694 | "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", 1695 | "dev": true, 1696 | "requires": { 1697 | "get-value": "^2.0.3", 1698 | "has-values": "^0.1.4", 1699 | "isobject": "^2.0.0" 1700 | }, 1701 | "dependencies": { 1702 | "isobject": { 1703 | "version": "2.1.0", 1704 | "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", 1705 | "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", 1706 | "dev": true, 1707 | "requires": { 1708 | "isarray": "1.0.0" 1709 | } 1710 | } 1711 | } 1712 | }, 1713 | "has-values": { 1714 | "version": "0.1.4", 1715 | "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", 1716 | "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", 1717 | "dev": true 1718 | } 1719 | } 1720 | }, 1721 | "urix": { 1722 | "version": "0.1.0", 1723 | "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", 1724 | "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", 1725 | "dev": true 1726 | }, 1727 | "use": { 1728 | "version": "3.1.1", 1729 | "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", 1730 | "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", 1731 | "dev": true 1732 | }, 1733 | "validate-npm-package-license": { 1734 | "version": "3.0.4", 1735 | "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", 1736 | "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", 1737 | "dev": true, 1738 | "requires": { 1739 | "spdx-correct": "^3.0.0", 1740 | "spdx-expression-parse": "^3.0.0" 1741 | } 1742 | }, 1743 | "wrappy": { 1744 | "version": "1.0.2", 1745 | "resolved": "https://registry.next.labs.aeb.com/repository/next.npm.group/wrappy/-/wrappy-1.0.2.tgz", 1746 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 1747 | "dev": true 1748 | }, 1749 | "xtend": { 1750 | "version": "4.0.2", 1751 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", 1752 | "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", 1753 | "dev": true 1754 | }, 1755 | "yn": { 1756 | "version": "3.1.1", 1757 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 1758 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 1759 | "dev": true 1760 | } 1761 | } 1762 | } 1763 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graphql-transformer", 3 | "version": "0.3.1", 4 | "description": "transform GraphQL schemas with simple mapping functions", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "build": "rimraf dist && tsc --skipLibCheck && dependency-check ./package.json", 8 | "prepublishOnly": "npm run build", 9 | "typecheck": "tsc --noEmit --skipLibCheck", 10 | "test": "npm run typecheck && node graphql-transformer-test.js" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/AEB-labs/graphql-transformer.git" 15 | }, 16 | "publishConfig": { 17 | "registry": "https://registry.npmjs.org/" 18 | }, 19 | "keywords": [ 20 | "graphql" 21 | ], 22 | "author": "AEB GmbH", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/AEB-labs/graphql-transformer/issues" 26 | }, 27 | "homepage": "https://github.com/AEB-labs/graphql-transformer#readme", 28 | "devDependencies": { 29 | "@types/jasmine": "^3.7.7", 30 | "@types/node": "^12.20.15", 31 | "dependency-check": "^3.4.1", 32 | "graphql": "^15.5.0", 33 | "graphql-tag": "^2.12.4", 34 | "jasmine": "^3.7.0", 35 | "jasmine-promises": "^0.4.1", 36 | "jasmine-spec-reporter": "^7.0.0", 37 | "rimraf": "^3.0.2", 38 | "ts-node": "^10.0.0", 39 | "typescript": "~4.2.4" 40 | }, 41 | "peerDependencies": { 42 | "graphql": "^15.0.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spec/remove-unused-types.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | buildASTSchema, GraphQLDirective, GraphQLID, GraphQLInputObjectType, GraphQLObjectType, GraphQLSchema, GraphQLString 3 | } from 'graphql'; 4 | import { removeUnusedTypesFromSchema } from '../src/remove-unused-types'; 5 | import gql from 'graphql-tag'; 6 | 7 | describe('remove-unused-types', () => { 8 | it('removes unused types', () => { 9 | const schema = buildASTSchema(gql` 10 | schema { 11 | query: Query 12 | } 13 | interface Interface { 14 | test: ID 15 | } 16 | type Query { 17 | hello: String 18 | } 19 | type Impl implements Interface { 20 | test: ID 21 | } 22 | `); 23 | 24 | expect(schema.getTypeMap()['Impl']).toBeDefined(); // sanity check that GraphQL does not remove this 25 | const condensedSchema = removeUnusedTypesFromSchema(schema); 26 | expect(condensedSchema.getTypeMap()['Impl']).toBeUndefined(); 27 | }); 28 | 29 | it('keeps interface implementations if they are still in use', () => { 30 | const schema = buildASTSchema(gql` 31 | schema { 32 | query: Query 33 | } 34 | interface Interface { 35 | test: ID 36 | } 37 | type Query { 38 | hello: Interface 39 | } 40 | type Impl implements Interface { 41 | test: ID 42 | } 43 | `); 44 | 45 | const condensedSchema = removeUnusedTypesFromSchema(schema); 46 | expect(condensedSchema.getTypeMap()['Impl']).toBeDefined(); 47 | }); 48 | 49 | it('keeps interface implementations if they are still in use in list types', () => { 50 | const schema = buildASTSchema(gql` 51 | schema { 52 | query: Query 53 | } 54 | interface Interface { 55 | test: ID 56 | } 57 | type Query { 58 | hello: [Interface] 59 | } 60 | type Impl implements Interface { 61 | test: ID 62 | } 63 | `); 64 | 65 | const condensedSchema = removeUnusedTypesFromSchema(schema); 66 | expect(condensedSchema.getTypeMap()['Impl']).toBeDefined(); 67 | }); 68 | 69 | it('keeps interface implementations if they are still in use in non-null types', () => { 70 | const schema = buildASTSchema(gql` 71 | schema { 72 | query: Query 73 | } 74 | interface Interface { 75 | test: ID 76 | } 77 | type Query { 78 | hello: Interface! 79 | } 80 | type Impl implements Interface { 81 | test: ID 82 | } 83 | `); 84 | 85 | const condensedSchema = removeUnusedTypesFromSchema(schema); 86 | expect(condensedSchema.getTypeMap()['Impl']).toBeDefined(); 87 | }); 88 | 89 | it('keeps interface implementations if they are still used indirectly', () => { 90 | const schema = buildASTSchema(gql` 91 | schema { 92 | query: Query 93 | } 94 | interface Interface { 95 | test: ID 96 | } 97 | interface WrappingInterface { 98 | test: Interface 99 | } 100 | type Query { 101 | hello: WrappingInterface 102 | } 103 | type Impl implements Interface { 104 | test: ID 105 | } 106 | `); 107 | 108 | const condensedSchema = removeUnusedTypesFromSchema(schema); 109 | expect(condensedSchema.getTypeMap()['Impl']).toBeDefined(); 110 | }); 111 | 112 | it('keeps interface implementations if they are still used indirectly through impl fields', () => { 113 | const schema = buildASTSchema(gql` 114 | schema { 115 | query: Query 116 | } 117 | interface Interface1 { 118 | test: ID 119 | } 120 | interface Interface2 { 121 | test: ID 122 | } 123 | type Query { 124 | hello: Interface1 125 | } 126 | type Impl1 implements Interface1 { 127 | test: ID 128 | otherField: Interface2 129 | } 130 | type Impl2 implements Interface2 { 131 | test: ID 132 | } 133 | `); 134 | 135 | const condensedSchema = removeUnusedTypesFromSchema(schema); 136 | expect(condensedSchema.getTypeMap()['Impl2']).toBeDefined(); 137 | }) 138 | 139 | it('keeps interface implementations if they are still used indirectly through impl fields', () => { 140 | const schema = buildASTSchema(gql` 141 | schema { 142 | query: Query 143 | } 144 | interface Interface1 { 145 | test: ID 146 | } 147 | interface Interface2 { 148 | test: ID 149 | } 150 | type Query { 151 | hello: Interface1 152 | } 153 | type Impl1 implements Interface1 { 154 | test: ID 155 | otherField: Interface2 156 | } 157 | type Impl2 implements Interface2 { 158 | test: ID 159 | } 160 | `); 161 | 162 | const condensedSchema = removeUnusedTypesFromSchema(schema); 163 | expect(condensedSchema.getTypeMap()['Impl2']).toBeDefined(); 164 | }); 165 | 166 | it('keeps directives and their input types', () => { 167 | const schema = buildASTSchema(gql` 168 | schema { 169 | query: Query 170 | } 171 | type Query { 172 | hello: ID 173 | } 174 | input DirInput { 175 | field: String 176 | } 177 | directive @dir(arg: DirInput) on OBJECT 178 | `); 179 | 180 | const condensedSchema = removeUnusedTypesFromSchema(schema); 181 | expect(condensedSchema.getDirective('dir')).toBeDefined('@dir'); 182 | const type = condensedSchema.getDirective('dir')!.args[0].type; 183 | expect(type).toBeDefined('@dir.arg[[type]]'); 184 | expect(condensedSchema.getTypeMap()['DirInput']).toBeDefined('DirInput'); 185 | }); 186 | }); 187 | -------------------------------------------------------------------------------- /spec/schema-transformer.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | buildASTSchema, 3 | GraphQLFieldConfigMap, GraphQLID, GraphQLInt, GraphQLInterfaceType, GraphQLObjectType, GraphQLObjectTypeConfig, 4 | GraphQLScalarType, 5 | GraphQLSchema, 6 | GraphQLString, 7 | GraphQLUnionType, parse 8 | } from 'graphql'; 9 | import { 10 | FieldsTransformationContext, GraphQLNamedFieldConfig, transformSchema 11 | } from '../src/schema-transformer'; 12 | import { walkFields } from '../src/schema-utils'; 13 | import gql from 'graphql-tag'; 14 | import { removeUnusedTypesFromSchema } from '../src/remove-unused-types'; 15 | 16 | describe('schema-transformer', () => { 17 | it('can copy types', () => { 18 | const type1 = new GraphQLObjectType({ 19 | name: 'Type1', 20 | fields: { 21 | scalar: { 22 | type: GraphQLString 23 | } 24 | } 25 | }); 26 | 27 | const schema = new GraphQLSchema({ 28 | query: new GraphQLObjectType({ 29 | name: 'Query', 30 | fields: { 31 | field1: { 32 | type: type1 33 | } 34 | } 35 | }) 36 | }); 37 | 38 | const newSchema = transformSchema(schema, { 39 | transformFields(config: GraphQLFieldConfigMap, context: FieldsTransformationContext) { 40 | if (context.oldOuterType.name == 'Query') { 41 | const field1 = config['field1']; 42 | 43 | const type2 = context.copyType(field1.type, { 44 | transformObjectType(typeConfig: GraphQLObjectTypeConfig) { 45 | return { 46 | ...typeConfig, 47 | name: 'Type2' 48 | }; 49 | }, 50 | 51 | transformFields(fieldConfig: GraphQLFieldConfigMap) { 52 | return { 53 | ...fieldConfig, 54 | clone: { 55 | type: GraphQLInt, 56 | resolve: () => 42 57 | } 58 | }; 59 | } 60 | }); 61 | 62 | return { 63 | ...config, 64 | field2: { 65 | type: type2 66 | } 67 | }; 68 | } 69 | 70 | return config; 71 | } 72 | }); 73 | 74 | expect(walkFields(newSchema.getQueryType()!, ['field1', 'scalar'])).toBeDefined('type1.scalar is missing'); 75 | expect(walkFields(newSchema.getQueryType()!, ['field2', 'scalar'])).toBeDefined('type2.scalar is missing'); 76 | expect(walkFields(newSchema.getQueryType()!, ['field1', 'clone'])).toBeUndefined('type2.clone should not be there'); 77 | expect(walkFields(newSchema.getQueryType()!, ['field2', 'clone'])).toBeDefined('type2.clone is missing'); 78 | }); 79 | 80 | it('supports union types', () => { 81 | const option1 = new GraphQLObjectType({ 82 | name: 'Option1', 83 | fields: {option1: {type: GraphQLInt}}, 84 | isTypeOf: (obj) => { return 'option1' in obj; } 85 | }); 86 | const option2 = new GraphQLObjectType({ 87 | name: 'Option2', 88 | fields: {option2: {type: GraphQLInt}}, 89 | isTypeOf: (obj) => { return 'option1' in obj; } 90 | }); 91 | 92 | const schema = new GraphQLSchema({ 93 | query: new GraphQLObjectType({ 94 | name: 'Query', 95 | fields: { 96 | union: { 97 | type: new GraphQLUnionType({ 98 | name: 'Union', 99 | types: [ option1, option2 ] 100 | }) 101 | } 102 | } 103 | }) 104 | }); 105 | 106 | const newSchema = transformSchema(schema, { 107 | transformField(config: GraphQLNamedFieldConfig) { 108 | return { 109 | ...config, 110 | name: config.name + '_' 111 | }; 112 | } 113 | }); 114 | const unionType = newSchema.getQueryType()!.getFields()['union_'].type; 115 | expect(unionType instanceof GraphQLUnionType).toBeTruthy(); 116 | expect((unionType as GraphQLUnionType).getTypes().length).toBe(2); 117 | }); 118 | 119 | it('supports the README case', () => { 120 | const myType = new GraphQLObjectType({ 121 | name: 'MyType', 122 | fields: { 123 | name: { 124 | type: GraphQLString 125 | } 126 | } 127 | }); 128 | 129 | const originalSchema = new GraphQLSchema({ 130 | query: new GraphQLObjectType({ 131 | name: 'Query', 132 | fields: { 133 | myField: { 134 | type: myType 135 | } 136 | } 137 | }) 138 | }); 139 | 140 | const transformedSchema = transformSchema(originalSchema, { 141 | transformField(field: GraphQLNamedFieldConfig, context) { 142 | // Rename a field in a type 143 | if (context.oldOuterType.name == 'MyType') { 144 | return { 145 | ...field, 146 | name: field.name + 'ButCooler' 147 | } 148 | } 149 | return field; 150 | }, 151 | 152 | transformObjectType(type: GraphQLObjectTypeConfig) { 153 | if (type.name == 'MyType') { 154 | return { 155 | ...type, 156 | name: 'MyCoolType' 157 | }; 158 | } 159 | return type; 160 | }, 161 | 162 | transformFields(fields: GraphQLFieldConfigMap, context) { 163 | // You can even copy types on the fly and transform the copies 164 | const type2 = context.copyType(context.oldOuterType, { 165 | transformObjectType(typeConfig: GraphQLObjectTypeConfig) { 166 | return { 167 | ...typeConfig, 168 | name: typeConfig.name + '2' 169 | }; 170 | } 171 | }); 172 | 173 | // This just adds a reflexive field "self" to all types, but its type does not have 174 | // the "self" field (because it is a copy from the original type, see above) 175 | // it also won't have the "cool" rename applied because the top-level transformers are not applied 176 | return { 177 | ...fields, 178 | self: { 179 | type: type2, 180 | resolve: (source: any) => source 181 | } 182 | } 183 | } 184 | }); 185 | 186 | const myTypeRes = transformedSchema.getQueryType()!.getFields()['myField'].type as GraphQLObjectType; 187 | expect(myTypeRes).toBeDefined(); 188 | expect(myTypeRes.getFields()['nameButCooler']).toBeDefined(); 189 | expect(myTypeRes.getFields()['self']).toBeDefined(); 190 | const reflexiveTypeRes = myTypeRes.getFields()['self'].type as GraphQLObjectType; 191 | expect(reflexiveTypeRes.name).toBe('MyType2'); 192 | expect(reflexiveTypeRes.getFields()['self']).not.toBeDefined(); 193 | expect(reflexiveTypeRes.getFields()['name']).toBeDefined(); 194 | }); 195 | 196 | it('keeps ast nodes', () => { 197 | const schema = buildASTSchema(parse(`schema { query: Query } type Query { echo(in: String): String }`)); 198 | expect((schema.getType('Query') as any).getFields()['echo'].astNode).toBeDefined(); 199 | const transformed = transformSchema(schema, { 200 | transformField(config) { 201 | if (config.name == 'echo') { 202 | return { 203 | ...config, 204 | name: 'echo2' 205 | } 206 | } 207 | return config; 208 | } 209 | }); 210 | expect((transformed.getType('Query') as any).getFields()['echo2'].astNode).toBeDefined(); 211 | }); 212 | 213 | it('removes type that were used and now are unused', () => { 214 | const iface = new GraphQLInterfaceType({ 215 | name: 'Interface', 216 | fields: { 217 | test: { 218 | type: GraphQLID 219 | } 220 | }, 221 | resolveType: () => '' 222 | }); 223 | 224 | const schema = new GraphQLSchema({ 225 | query: new GraphQLObjectType({ 226 | name: 'Query', 227 | fields: { 228 | hello: { 229 | type: iface 230 | } 231 | } 232 | }), 233 | types: [new GraphQLObjectType({ 234 | name: 'Unused', 235 | interfaces: [ iface ], 236 | fields: { 237 | test: { 238 | type: GraphQLID 239 | } 240 | } 241 | })] 242 | }); 243 | 244 | expect(schema.getTypeMap()['Unused']).toBeDefined(); // sanity check that GraphQL does not remove this 245 | // now remove the only reference to the interface 246 | const transformedSchema = transformSchema(schema, { 247 | transformField(config) { 248 | if (config.name == 'hello') { 249 | return { 250 | ...config, 251 | type: GraphQLString 252 | } 253 | } 254 | return config; 255 | } 256 | }); 257 | expect(transformedSchema.getTypeMap()['Unused']).toBeUndefined(); 258 | }); 259 | 260 | it('removes unused types without causing collisions with new types of same name', () => { 261 | const myType = new GraphQLObjectType({ 262 | name: 'MyType', 263 | fields: { 264 | field: { 265 | type: GraphQLInt 266 | } 267 | } 268 | }); 269 | 270 | const myTypeReplacement = new GraphQLObjectType({ 271 | name: 'MyType', 272 | fields: { 273 | field: { 274 | type: GraphQLInt 275 | } 276 | } 277 | }); 278 | 279 | const schema = new GraphQLSchema({ 280 | query: new GraphQLObjectType({ 281 | name: 'Query', 282 | fields: { 283 | hello: { 284 | type: myType 285 | } 286 | } 287 | }) 288 | }); 289 | 290 | const transformedSchema = transformSchema(schema, { 291 | transformField(config) { 292 | if (config.name == 'hello') { 293 | return { 294 | ...config, 295 | type: myTypeReplacement 296 | } 297 | } 298 | return config; 299 | } 300 | }); 301 | expect(transformedSchema.getTypeMap()['MyType']).toBe(myTypeReplacement); 302 | }); 303 | 304 | it('keeps interface implementations if they are still used indirectly', () => { 305 | const schema = buildASTSchema(gql` 306 | schema { 307 | query: Query 308 | } 309 | interface Interface { 310 | test: ID 311 | } 312 | interface WrappingInterface { 313 | test: Interface 314 | } 315 | type Query { 316 | hello: WrappingInterface 317 | } 318 | type Impl implements Interface { 319 | test: ID 320 | } 321 | `); 322 | 323 | const condensedSchema = transformSchema(schema, { 324 | transformFields(config, context) { 325 | if (context.oldOuterType.name == 'Query') { 326 | return { 327 | ...config, 328 | newField: { 329 | type: GraphQLInt 330 | } 331 | } 332 | } 333 | return config; 334 | } 335 | }); 336 | expect(condensedSchema.getTypeMap()['Impl']).toBeDefined(); 337 | }); 338 | }); 339 | -------------------------------------------------------------------------------- /spec/schema-utils.spec.ts: -------------------------------------------------------------------------------- 1 | import { GraphQLObjectType, GraphQLString } from 'graphql'; 2 | import { walkFields } from '../src/schema-utils'; 3 | 4 | describe('schema-utils', () => { 5 | describe('walkFields', () => { 6 | const type = new GraphQLObjectType({ 7 | name: 'Type', 8 | fields: { 9 | scalar: { 10 | type: GraphQLString 11 | } 12 | } 13 | }); 14 | 15 | const type2 = new GraphQLObjectType({ 16 | name: 'Type2', 17 | fields: { 18 | inner: { 19 | type 20 | } 21 | } 22 | }); 23 | 24 | it('finds single field', () => { 25 | const result = walkFields(type, ['scalar']); 26 | expect(result).toBeDefined('field not found'); 27 | expect(result!.name).toBe('scalar'); 28 | }); 29 | 30 | it('finds nested field', () => { 31 | const result = walkFields(type2, ['inner', 'scalar']); 32 | expect(result).toBeDefined('field not found'); 33 | expect(result!.name).toBe('scalar'); 34 | }); 35 | 36 | it('returns undefined when not found', () => { 37 | const result = walkFields(type2, ['inner', 'not-found']); 38 | expect(result).toBeUndefined('field found but should not exist'); 39 | }); 40 | 41 | it('returns undefined when inner type is scalar type', () => { 42 | const result = walkFields(type, ['scalar', 'some-field']); 43 | expect(result).toBeUndefined('field found but should not exist'); 44 | }); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /spec/support/bootstrap.js: -------------------------------------------------------------------------------- 1 | // This file is executed before all specs and before all other handlers 2 | 3 | // Enable typescript compilation for .ts files 4 | require('ts-node/register'); 5 | 6 | // Patch jasmine so that async tests can just return promises (or use the async keyword) and do not need to call done() 7 | global.jasmineRequire = {}; // jasmine-promise expects this be there and patches it, but it is not required 8 | require('jasmine-promises'); 9 | 10 | // to get through firewall 11 | process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; 12 | -------------------------------------------------------------------------------- /spec/support/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "spec", 3 | "spec_files": [ 4 | "**/*[sS]pec.ts" 5 | ], 6 | "helpers": [ 7 | "support/bootstrap.js", 8 | "helpers/**/*.js", 9 | "helpers/**/*.ts" 10 | ], 11 | "stopSpecOnExpectationFailure": false, 12 | "random": false 13 | } 14 | -------------------------------------------------------------------------------- /src/native-symbols.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLBoolean, GraphQLDirective, GraphQLFloat, GraphQLID, GraphQLInt, GraphQLNamedType, GraphQLString, 3 | specifiedDirectives 4 | } from 'graphql'; 5 | 6 | const nativeTypes = [ GraphQLInt, GraphQLString, GraphQLBoolean, GraphQLFloat, GraphQLID ]; 7 | 8 | const nativeTypeMap: {[name: string]: GraphQLNamedType} = {}; 9 | for (const type of nativeTypes) { 10 | nativeTypeMap[type.name] = type; 11 | } 12 | 13 | /** 14 | * Determines if the given type is natively included in any GraphQL schema (and it is not an introspection type) 15 | * @param type a GraphQLType or a a type name 16 | * @returns true for native types, false for other types and for introspection types 17 | */ 18 | export function isNativeGraphQLType(type: string|GraphQLNamedType) { 19 | const name = typeof type === 'string' ? type : type.name; 20 | return name in nativeTypeMap; 21 | } 22 | 23 | const nativeDirectiveMap: {[name: string]: GraphQLDirective} = {}; 24 | for (const directive of specifiedDirectives) { 25 | nativeDirectiveMap[directive.name] = directive; 26 | } 27 | 28 | /** 29 | * Determines if the given directive is natively included in any GraphQL schema 30 | * 31 | * This function uses name equality to compare directives, not referential equality. Thus, directives generated from an 32 | * introspection query with the correct name will be identified as native directives. However, it also means that 33 | * non-standard directives with native names will be treated as if they were native directives. 34 | * 35 | * @param directive a GraphQLDirective or a a directive name 36 | * @returns true for native directives, false otherwise 37 | */ 38 | export function isNativeDirective(directive: string|GraphQLDirective) { 39 | const name = typeof directive === 'string' ? directive : directive.name; 40 | return name in nativeDirectiveMap; 41 | } 42 | -------------------------------------------------------------------------------- /src/remove-unused-types.ts: -------------------------------------------------------------------------------- 1 | import { 2 | getNamedType, GraphQLInterfaceType, GraphQLObjectType, GraphQLSchema, GraphQLType, GraphQLUnionType 3 | } from 'graphql'; 4 | import { compact, objectValues } from './utils'; 5 | 6 | export function removeUnusedTypesFromSchema(schema: GraphQLSchema): GraphQLSchema { 7 | const rootTypes = compact([ schema.getQueryType(), schema.getMutationType(), schema.getSubscriptionType()]); 8 | const objectTypes = objectValues(schema.getTypeMap()).filter(type => type instanceof GraphQLObjectType) as GraphQLObjectType[]; 9 | return new GraphQLSchema({ 10 | query: schema.getQueryType(), 11 | mutation: schema.getMutationType() || undefined, 12 | subscription: schema.getSubscriptionType() || undefined, 13 | directives: Array.from(schema.getDirectives()), // @types/graphql messed up - input requires [], but getDirectives() gets a ReadonlyArray. 14 | types: filterUsableInterfaceImplementations(objectTypes, rootTypes) 15 | }); 16 | } 17 | 18 | /** 19 | * Finds all interface types that are reachable through any of the given types 20 | */ 21 | function findAllReachableInterfaces(types: GraphQLObjectType[]): Set { 22 | const visitedTypes = new Set(); 23 | const interfaces = new Set(); 24 | 25 | function visitType(type: GraphQLType) { 26 | type = getNamedType(type); 27 | 28 | if (visitedTypes.has(type)) { 29 | return; 30 | } 31 | visitedTypes.add(type); 32 | 33 | if (type instanceof GraphQLUnionType) { 34 | for (const option of type.getTypes()) { 35 | visitType(option); 36 | } 37 | } else if (type instanceof GraphQLInterfaceType || type instanceof GraphQLObjectType) { 38 | if (type instanceof GraphQLInterfaceType) { 39 | interfaces.add(type); 40 | } 41 | for (const field of objectValues(type.getFields())) { 42 | visitType(field.type); 43 | } 44 | } 45 | } 46 | 47 | for (const type of types) { 48 | visitType(type); 49 | } 50 | 51 | return interfaces; 52 | } 53 | 54 | /** 55 | * Finds all object types that implement any of the interfaces reachable from any of the rootTypes 56 | * @param rootTypes types that are used fo reachability test 57 | * @param candidates the types which are filtered 58 | * @return the object types that are usable 59 | */ 60 | export function filterUsableInterfaceImplementations(candidates: GraphQLObjectType[], rootTypes: GraphQLObjectType[]): GraphQLObjectType[] { 61 | const reachableInterfaces = findAllReachableInterfaces(rootTypes); 62 | const implementations = new Set(); 63 | let hasFoundNewInterfaces = false; 64 | do { 65 | const newImplementations = candidates 66 | .filter(objectType => objectType.getInterfaces().some(implementedInterface => reachableInterfaces.has(implementedInterface))); 67 | for (const impl of newImplementations) { 68 | implementations.add(impl); 69 | } 70 | // we might have introduced some new fields that make use of interfaces which need to be added to reachableInterfaces 71 | const newInterfaces = findAllReachableInterfaces(newImplementations); 72 | hasFoundNewInterfaces = false; 73 | for (const newlyFoundInterface of Array.from(newInterfaces)) { 74 | if (!reachableInterfaces.has(newlyFoundInterface)) { 75 | // found some new interfaces, so trigger a new round 76 | hasFoundNewInterfaces = true; 77 | reachableInterfaces.add(newlyFoundInterface); 78 | } 79 | } 80 | } while (hasFoundNewInterfaces); 81 | return Array.from(implementations); 82 | } 83 | -------------------------------------------------------------------------------- /src/schema-transformer.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLAbstractType, 3 | GraphQLArgument, GraphQLDirective, GraphQLEnumType, GraphQLEnumTypeConfig, GraphQLEnumValueConfigMap, GraphQLField, 4 | GraphQLFieldConfig, GraphQLFieldConfigArgumentMap, GraphQLFieldConfigMap, GraphQLFieldMap, GraphQLInputField, 5 | GraphQLInputFieldConfig, GraphQLInputFieldConfigMap, GraphQLInputObjectType, GraphQLInputObjectTypeConfig, 6 | GraphQLInterfaceType, GraphQLInterfaceTypeConfig, GraphQLList, GraphQLNamedType, GraphQLNonNull, GraphQLObjectType, 7 | GraphQLObjectTypeConfig, GraphQLResolveInfo, GraphQLScalarType, GraphQLScalarTypeConfig, GraphQLSchema, GraphQLType, 8 | GraphQLTypeResolver, GraphQLUnionType, GraphQLUnionTypeConfig, isListType, isNonNullType 9 | } from 'graphql'; 10 | import { GraphQLDirectiveConfig } from 'graphql/type/directives'; 11 | import { isNativeDirective, isNativeGraphQLType } from './native-symbols'; 12 | import { filterUsableInterfaceImplementations } from './remove-unused-types'; 13 | import { orderTypesTopologically } from './schema-utils'; 14 | import { bindNullable, compact, objectValues } from './utils'; 15 | 16 | export type TransformationFunction 17 | = (config: TConfig, context: TContext) => TConfig; 18 | 19 | /** 20 | * An set of transformation functions that can alter parts of a schema 21 | */ 22 | export interface SchemaTransformer { 23 | transformScalarType?: TransformationFunction, TypeTransformationContext>; 24 | transformEnumType?: TransformationFunction>; 25 | transformInterfaceType?: TransformationFunction, TypeTransformationContext>; 26 | transformInputObjectType?: TransformationFunction>; 27 | transformUnionType?: TransformationFunction, TypeTransformationContext>; 28 | transformObjectType?: TransformationFunction, TypeTransformationContext>; 29 | transformDirective?: TransformationFunction; 30 | 31 | transformField?: TransformationFunction, FieldTransformationContext>; 32 | transformFields?: TransformationFunction, FieldsTransformationContext>; 33 | transformInputField?: TransformationFunction; 34 | } 35 | 36 | export interface SchemaTransformationContext { 37 | /** 38 | * Finds a type of the new schema that corresponds to the given type in the old schema 39 | * @param type 40 | */ 41 | mapType(type: T): T; 42 | 43 | /** 44 | * Finds a type of the new schema given its name in the old schema 45 | * @param name 46 | */ 47 | findType(name: string): GraphQLNamedType | undefined; 48 | 49 | /** 50 | * Creates a new GraphQLType for a given type and passes it through custom transformer functions. The regular 51 | * transformer functions passed to transformSchema() are ignored. 52 | */ 53 | copyType(type: T, transformer: SchemaTransformer): T; 54 | 55 | readonly oldSchema: GraphQLSchema; 56 | } 57 | 58 | export interface TypeTransformationContext extends SchemaTransformationContext { 59 | /** 60 | * The original version of the type 61 | */ 62 | readonly oldType: T; 63 | } 64 | 65 | export interface DirectiveTransformationContext extends SchemaTransformationContext { 66 | /** 67 | * The original version of the directive 68 | */ 69 | readonly oldDirective: GraphQLDirective; 70 | } 71 | 72 | export interface FieldTransformationContext extends SchemaTransformationContext { 73 | /** 74 | * The original version of the field 75 | */ 76 | readonly oldField: GraphQLField; 77 | 78 | /** 79 | * Gets the type (in the new schema) that defined the field being transformed 80 | */ 81 | readonly newOuterType: GraphQLObjectType | GraphQLInterfaceType; 82 | 83 | /** 84 | * Gets the type (in the old schema) that defined the field being transformed 85 | */ 86 | readonly oldOuterType: GraphQLObjectType | GraphQLInterfaceType; 87 | } 88 | 89 | export interface FieldsTransformationContext extends SchemaTransformationContext { 90 | /** 91 | * The original version of the fields 92 | */ 93 | readonly oldFields: GraphQLFieldMap; 94 | 95 | /** 96 | * Gets the type (in the new schema) that defined the field being transformed 97 | */ 98 | readonly newOuterType: GraphQLObjectType | GraphQLInterfaceType; 99 | 100 | /** 101 | * Gets the type (in the old schema) that defined the field being transformed 102 | */ 103 | readonly oldOuterType: GraphQLObjectType | GraphQLInterfaceType; 104 | } 105 | 106 | export interface InputFieldTransformationContext extends SchemaTransformationContext { 107 | /** 108 | * The original version of the field 109 | */ 110 | readonly oldField: GraphQLInputField; 111 | 112 | /** 113 | * Gets the type (in the new schema) that defined the field being transformed 114 | */ 115 | readonly newOuterType: GraphQLInputObjectType; 116 | 117 | /** 118 | * Gets the type (in the old schema) that defined the field being transformed 119 | */ 120 | readonly oldOuterType: GraphQLInputObjectType; 121 | } 122 | 123 | export interface GraphQLNamedFieldConfig extends GraphQLFieldConfig { 124 | name: string; 125 | } 126 | 127 | export interface GraphQLNamedInputFieldConfig extends GraphQLInputFieldConfig { 128 | name: string; 129 | } 130 | 131 | function combineTransformationFunctions 132 | (fns: (TransformationFunction | undefined)[]): TransformationFunction | undefined { 133 | const definedFns = compact(fns); 134 | if (!definedFns.length) { 135 | return undefined; 136 | } 137 | return (config, context) => definedFns.reduce((config, fn) => fn(config, context), config); 138 | } 139 | 140 | /** 141 | * Binds all SchemaTransformer methods to the SchemaTransformer itself, effectively converting a class to a function tuple 142 | * @param {SchemaTransformer[]} t 143 | * @returns {SchemaTransformer} 144 | */ 145 | export function bindTransformerFunctions(t: SchemaTransformer): SchemaTransformer { 146 | return { 147 | transformScalarType: bindNullable(t.transformScalarType, t), 148 | transformEnumType: bindNullable(t.transformEnumType, t), 149 | transformInterfaceType: bindNullable(t.transformInterfaceType, t), 150 | transformInputObjectType: bindNullable(t.transformInputObjectType, t), 151 | transformUnionType: bindNullable(t.transformUnionType, t), 152 | transformObjectType: bindNullable(t.transformObjectType, t), 153 | transformDirective: bindNullable(t.transformDirective, t), 154 | transformField: bindNullable(t.transformField, t), 155 | transformInputField: bindNullable(t.transformInputField, t) 156 | }; 157 | } 158 | 159 | /** 160 | * Combines multiple transformers that into one that executes the transformation functions in the given order 161 | */ 162 | export function combineTransformers(...transformers: SchemaTransformer[]): SchemaTransformer { 163 | const boundTransformers = transformers.map(t => bindTransformerFunctions(t)); 164 | 165 | return { 166 | transformScalarType: combineTransformationFunctions(boundTransformers.map(t => t.transformScalarType)), 167 | transformEnumType: combineTransformationFunctions(boundTransformers.map(t => t.transformEnumType)), 168 | transformInterfaceType: combineTransformationFunctions(boundTransformers.map(t => t.transformInterfaceType)), 169 | transformInputObjectType: combineTransformationFunctions(boundTransformers.map(t => t.transformInputObjectType)), 170 | transformUnionType: combineTransformationFunctions(boundTransformers.map(t => t.transformUnionType)), 171 | transformObjectType: combineTransformationFunctions(boundTransformers.map(t => t.transformObjectType)), 172 | transformDirective: combineTransformationFunctions(boundTransformers.map(t => t.transformDirective)), 173 | transformField: combineTransformationFunctions(boundTransformers.map(t => t.transformField)), 174 | transformInputField: combineTransformationFunctions(boundTransformers.map(t => t.transformInputField)) 175 | }; 176 | } 177 | 178 | /** 179 | * Clones a GraphQLSchema by destructuring it into GraphQL's config objects and executes custom transformers 180 | * on these config objects 181 | * 182 | * @param schema 183 | * @param transformers 184 | */ 185 | export function transformSchema(schema: GraphQLSchema, transformers: SchemaTransformer) { 186 | const transformer = new Transformer(transformers, schema); 187 | return transformer.transform(); 188 | } 189 | 190 | // this is not really an OOP class but it is useful to keep track of state. It is not exported, so this is fine 191 | class Transformer { 192 | private typeMap: { [typeName: string]: GraphQLNamedType } = {}; 193 | 194 | constructor(private readonly transformers: SchemaTransformer, private readonly schema: GraphQLSchema) { 195 | } 196 | 197 | /** 198 | * only call once 199 | */ 200 | public transform(): GraphQLSchema { 201 | const schema = this.schema; 202 | 203 | // Dependencies between fields and their are broken up via GraphQL's thunk approach (fields are only requested when 204 | // needed, which is after all types have been converted). However, an object's reference to its implemented 205 | // interfaces and a union's reference to its option types do not support the thunk approach, so we need to make 206 | // sure they are transformed first 207 | // -> interfaces first, then objects, then unions 208 | const originalTypes = orderTypesTopologically(objectValues(schema.getTypeMap())); 209 | for (const type of originalTypes) { 210 | this.processType(type); 211 | } 212 | 213 | const directives = schema.getDirectives() 214 | .map(directive => isNativeDirective(directive) ? directive : this.transformDirective(directive, this.transformers)); 215 | 216 | const findNewTypeMaybe = (type: GraphQLObjectType | null | undefined) => { 217 | if (!type) { 218 | return undefined; 219 | } 220 | const newType = this.findType(type.name); 221 | return newType; 222 | }; 223 | 224 | const query = findNewTypeMaybe(schema.getQueryType())!; 225 | const mutation = findNewTypeMaybe(schema.getMutationType()); 226 | const subscription = findNewTypeMaybe(schema.getSubscriptionType()); 227 | const rootTypes = compact([ query, mutation, subscription ]); 228 | const objectTypes = objectValues(this.typeMap).filter(type => type instanceof GraphQLObjectType) as GraphQLObjectType[]; 229 | // filter unused types before GraphQLSchema construction to avoid type collisions with unused types 230 | const requiredObjectTypes = filterUsableInterfaceImplementations(objectTypes, rootTypes); 231 | 232 | return new GraphQLSchema({ 233 | directives, 234 | query, 235 | mutation, 236 | subscription, 237 | types: requiredObjectTypes 238 | }); 239 | } 240 | 241 | /** 242 | * Finds the type in the new schema by its name in the old schema 243 | * @param oldName the old type name 244 | * @returns {GraphQLNamedType} 245 | */ 246 | private findType(oldName: string) { 247 | if (!(oldName in this.typeMap)) { 248 | throw new Error(`Unexpected reference to type ${oldName}`); 249 | } 250 | return this.typeMap[oldName]; 251 | } 252 | 253 | /** 254 | * Maps a type in the old schema to a type in the new schema, supporting list and optional types. 255 | */ 256 | private mapType(type: T): T { 257 | if (isListType(type)) { 258 | return new GraphQLList(this.mapType(type.ofType)); 259 | } 260 | if (isNonNullType(type)) { 261 | return new GraphQLNonNull(this.mapType(type.ofType)); 262 | } 263 | const namedType = type; // generics seem to throw off type guard logic 264 | if (isNativeGraphQLType(namedType)) { 265 | // do not rename native types but keep the reference to singleton objects like GraphQLString 266 | return type; 267 | } 268 | return this.findType(namedType.name); 269 | } 270 | 271 | private get transformationContext(): SchemaTransformationContext { 272 | return { 273 | mapType: this.mapType.bind(this), 274 | findType: this.findType.bind(this), 275 | oldSchema: this.schema, 276 | copyType: this.copyType.bind(this) 277 | }; 278 | } 279 | 280 | /** 281 | * Creates a new type for the given old type and stores it in the type map 282 | * @param type 283 | */ 284 | private processType(type: GraphQLNamedType) { 285 | if (type.name.substring(0, 2) === '__' || isNativeGraphQLType(type)) { 286 | // do not touch native types or introspection types like __Schema 287 | return; 288 | } 289 | this.typeMap[type.name] = this.transformType(type); 290 | } 291 | 292 | /** 293 | * Creates a new type for the given old type. Interfaces are expected to be already present; fields are resolved lazily 294 | */ 295 | private transformType(type: T): T { 296 | return this.copyType(type, this.transformers); 297 | } 298 | 299 | 300 | private copyType(type: T, transformer: SchemaTransformer): T { 301 | if (type instanceof GraphQLScalarType) { 302 | return this.transformScalarType(type, transformer) as T; 303 | } 304 | if (type instanceof GraphQLObjectType) { 305 | return this.transformObjectType(type, transformer) as T; 306 | } 307 | if (type instanceof GraphQLInputObjectType) { 308 | return this.transformInputObjectType(type, transformer) as T; 309 | } 310 | if (type instanceof GraphQLInterfaceType) { 311 | return this.transformInterfaceType(type, transformer) as T; 312 | } 313 | if (type instanceof GraphQLUnionType) { 314 | return this.transformUnionType(type, transformer) as T; 315 | } 316 | if (type instanceof GraphQLEnumType) { 317 | return this.transformEnumType(type, transformer) as T; 318 | } 319 | throw new Error(`Unsupported type: ${type}`); 320 | } 321 | 322 | private transformScalarType(type: GraphQLScalarType, transformer: SchemaTransformer) { 323 | let config: GraphQLScalarTypeConfig = { 324 | name: type.name, 325 | description: type.description, 326 | serialize: type.serialize.bind(type), 327 | parseLiteral: type.parseLiteral.bind(type), 328 | parseValue: type.parseValue.bind(type), 329 | astNode: type.astNode 330 | }; 331 | if (transformer.transformScalarType) { 332 | config = transformer.transformScalarType(config, {...this.transformationContext, oldType: type}); 333 | } 334 | return new GraphQLScalarType(config); 335 | } 336 | 337 | private transformObjectType(type: GraphQLObjectType, transformer: SchemaTransformer) { 338 | let config: GraphQLObjectTypeConfig = { 339 | name: type.name, 340 | description: type.description, 341 | fields: () => this.transformFields(type.getFields(), <{ oldOuterType: GraphQLObjectType | GraphQLInterfaceType, newOuterType: GraphQLObjectType | GraphQLInterfaceType}>{ 342 | ...this.transformationContext, 343 | oldOuterType: type, 344 | newOuterType: this.mapType(type) 345 | }, transformer), 346 | interfaces: type.getInterfaces().map(iface => this.mapType(iface)), 347 | isTypeOf: type.isTypeOf, 348 | astNode: type.astNode 349 | }; 350 | if (transformer.transformObjectType) { 351 | config = transformer.transformObjectType(config, {...this.transformationContext, oldType: type}); 352 | } 353 | return new GraphQLObjectType(config); 354 | } 355 | 356 | private transformInterfaceType(type: GraphQLInterfaceType, transformer: SchemaTransformer) { 357 | let config: GraphQLInterfaceTypeConfig = { 358 | name: type.name, 359 | description: type.description, 360 | resolveType: this.transformTypeResolver(type.resolveType, transformer), 361 | fields: () => this.transformFields(type.getFields(), { 362 | oldOuterType: type, 363 | newOuterType: this.mapType(type) 364 | }, transformer), 365 | astNode: type.astNode 366 | }; 367 | if (transformer.transformInterfaceType) { 368 | config = transformer.transformInterfaceType(config, {...this.transformationContext, oldType: type}); 369 | } 370 | return new GraphQLInterfaceType(config); 371 | } 372 | 373 | /** 374 | * Creates field configs for all provided fields, but with remapped types and argument types. All named 375 | * types are sent through the typeResolver with their old name to determine the new type. 376 | */ 377 | private transformFields(originalFields: GraphQLFieldMap, context: { oldOuterType: GraphQLObjectType | GraphQLInterfaceType, newOuterType: GraphQLObjectType | GraphQLInterfaceType}, transformer: SchemaTransformer): GraphQLFieldConfigMap { 378 | let fields: GraphQLFieldConfigMap = {}; 379 | for (const fieldName in originalFields) { 380 | const originalField = originalFields[fieldName]; 381 | let fieldConfig: GraphQLNamedFieldConfig = { 382 | name: fieldName, 383 | description: originalField.description, 384 | deprecationReason: originalField.deprecationReason, 385 | type: this.mapType(originalField.type), 386 | args: this.transformArguments(originalField.args), 387 | resolve: originalField.resolve, 388 | astNode: originalField.astNode 389 | }; 390 | if (transformer.transformField) { 391 | fieldConfig = transformer.transformField(fieldConfig, { 392 | ...this.transformationContext, 393 | oldField: originalField, 394 | oldOuterType: context.oldOuterType, 395 | newOuterType: context.newOuterType 396 | }); 397 | } 398 | if (fieldConfig.name in fields) { 399 | throw new Error(`Duplicate field name ${fieldConfig} in ${context.oldOuterType.name}`); 400 | } 401 | fields[fieldConfig.name] = fieldConfig; 402 | } 403 | if (transformer.transformFields) { 404 | fields = transformer.transformFields(fields, { 405 | ...this.transformationContext, 406 | oldFields: originalFields, 407 | oldOuterType: context.oldOuterType, 408 | newOuterType: context.newOuterType 409 | }); 410 | } 411 | return fields; 412 | } 413 | 414 | private transformArguments(originalArgs: GraphQLArgument[]): GraphQLFieldConfigArgumentMap { 415 | const args: GraphQLFieldConfigArgumentMap = {}; 416 | for (const arg of originalArgs) { 417 | args[arg.name] = { 418 | description: arg.description, 419 | type: this.mapType(arg.type), 420 | defaultValue: arg.defaultValue, 421 | deprecationReason: arg.deprecationReason, 422 | extensions: arg.extensions, 423 | astNode: arg.astNode 424 | }; 425 | } 426 | return args; 427 | } 428 | 429 | private transformInputObjectType(type: GraphQLInputObjectType, transformer: SchemaTransformer) { 430 | const getFields = () => { 431 | const originalFields = type.getFields(); 432 | const fields: GraphQLInputFieldConfigMap = {}; 433 | for (const fieldName in originalFields) { 434 | const originalField = originalFields[fieldName]; 435 | let fieldConfig: GraphQLNamedInputFieldConfig = { 436 | name: fieldName, 437 | description: originalField.description, 438 | defaultValue: originalField.defaultValue, 439 | type: this.mapType(originalField.type), 440 | deprecationReason: originalField.deprecationReason, 441 | extensions: originalField.extensions, 442 | astNode: originalField.astNode 443 | }; 444 | if (transformer.transformInputField) { 445 | fieldConfig = transformer.transformInputField(fieldConfig, { 446 | ...this.transformationContext, 447 | oldField: originalField, 448 | oldOuterType: type, 449 | newOuterType: this.mapType(type) 450 | }); 451 | } 452 | if (fieldConfig.name in fields) { 453 | throw new Error(`Duplicate field name ${fieldConfig} in input type ${type.name}`); 454 | } 455 | fields[fieldConfig.name] = fieldConfig; 456 | } 457 | return fields; 458 | }; 459 | 460 | let config: GraphQLInputObjectTypeConfig = { 461 | name: type.name, 462 | description: type.description, 463 | fields: getFields, 464 | astNode: type.astNode 465 | }; 466 | if (transformer.transformInputObjectType) { 467 | config = transformer.transformInputObjectType(config, {...this.transformationContext, oldType: type}); 468 | } 469 | return new GraphQLInputObjectType(config); 470 | } 471 | 472 | private transformEnumType(type: GraphQLEnumType, transformer: SchemaTransformer) { 473 | const values: GraphQLEnumValueConfigMap = {}; 474 | for (const originalValue of type.getValues()) { 475 | values[originalValue.name] = { 476 | description: originalValue.description, 477 | value: originalValue.value, 478 | deprecationReason: originalValue.deprecationReason, 479 | astNode: originalValue.astNode 480 | }; 481 | } 482 | 483 | let config: GraphQLEnumTypeConfig = { 484 | name: type.name, 485 | description: type.description, 486 | values, 487 | astNode: type.astNode 488 | }; 489 | if (transformer.transformEnumType) { 490 | config = transformer.transformEnumType(config, {...this.transformationContext, oldType: type}); 491 | } 492 | return new GraphQLEnumType(config); 493 | } 494 | 495 | private transformUnionType(type: GraphQLUnionType, transformer: SchemaTransformer) { 496 | let config: GraphQLUnionTypeConfig = { 497 | name: type.name, 498 | description: type.description, 499 | types: type.getTypes().map(optionType => this.mapType(optionType)), 500 | resolveType: this.transformTypeResolver(type.resolveType, transformer), 501 | astNode: type.astNode 502 | }; 503 | if (transformer.transformUnionType) { 504 | config = transformer.transformUnionType(config, {...this.transformationContext, oldType: type}); 505 | } 506 | return new GraphQLUnionType(config); 507 | } 508 | 509 | private transformDirective(directive: GraphQLDirective, transformer: SchemaTransformer) { 510 | let config: GraphQLDirectiveConfig = { 511 | name: directive.name, 512 | description: directive.description, 513 | locations: directive.locations, 514 | args: this.transformArguments(directive.args), 515 | astNode: directive.astNode 516 | }; 517 | if (transformer.transformDirective) { 518 | config = transformer.transformDirective(config, {...this.transformationContext, oldDirective: directive}); 519 | } 520 | return new GraphQLDirective(config); 521 | } 522 | 523 | private transformTypeResolver(typeResolver: GraphQLTypeResolver|null|undefined, transformer: SchemaTransformer): GraphQLTypeResolver|null|undefined { 524 | if (typeResolver == undefined) { 525 | return typeResolver; 526 | } 527 | 528 | return (...args) => { 529 | const result = typeResolver(...args); 530 | if (result == undefined) { 531 | return result; 532 | } 533 | if (typeof result == 'string') { 534 | return this.findType(result) as GraphQLObjectType; 535 | } 536 | if (result instanceof GraphQLObjectType) { 537 | return this.mapType(result); 538 | } 539 | return result.then(r => { 540 | if (r == undefined) { 541 | return r; 542 | } 543 | if (typeof r == 'string') { 544 | return this.findType(r) as GraphQLObjectType; 545 | } 546 | return this.mapType(r) as GraphQLObjectType; 547 | }); 548 | }; 549 | } 550 | } 551 | -------------------------------------------------------------------------------- /src/schema-utils.ts: -------------------------------------------------------------------------------- 1 | import { 2 | GraphQLField, GraphQLFieldMap, GraphQLInterfaceType, GraphQLObjectType, GraphQLType, GraphQLUnionType 3 | } from 'graphql'; 4 | 5 | /** 6 | * Orders the given types so that no forward references occur when traversing the type hierarchy 7 | * Note that only interface implementations and union option types are respected, fields are not included 8 | */ 9 | export function orderTypesTopologically(types: T[]): T[] { 10 | function order(t: GraphQLType) { 11 | if (t instanceof GraphQLInterfaceType) { 12 | return 0; 13 | } 14 | if (t instanceof GraphQLUnionType) { 15 | return 2; 16 | } 17 | return 1; 18 | } 19 | return [...types].sort((a, b) => order(a) - order(b)); 20 | } 21 | 22 | /** 23 | * Finds a field by traversing a schema from field to field 24 | * @param type the type where to start 25 | * @param fieldNames an array of field names to traverse 26 | * @return the field, or undefined if not found 27 | */ 28 | export function walkFields(type: GraphQLObjectType|GraphQLInterfaceType, fieldNames: string[]): GraphQLField|undefined { 29 | let field: GraphQLField|undefined; 30 | let currentType: GraphQLType = type; 31 | for (const fieldName of fieldNames) { 32 | if (!(currentType instanceof GraphQLObjectType) && !(currentType instanceof GraphQLInterfaceType)) { 33 | return undefined; 34 | } 35 | 36 | const fields: GraphQLFieldMap = currentType.getFields(); 37 | if (!(fieldName in fields)) { 38 | return undefined; 39 | } 40 | 41 | field = fields[fieldName]; 42 | currentType = field.type; 43 | } 44 | return field; 45 | } 46 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | export function objectValues(obj: { [name: string]: T }): T[] { 2 | return Object.keys(obj).map(i => obj[i]); 3 | } 4 | 5 | export function mapValues(obj: { [key: string]: TIn }, fn: (value: TIn, key: string) => TOut): { [key: string]: TOut } { 6 | const result: { [key: string]: TOut } = {}; 7 | for (const key in obj) { 8 | result[key] = fn(obj[key], key); 9 | } 10 | return result; 11 | } 12 | 13 | export function filterValues(obj: { [key: string]: TValue }, predicate: (value: TValue, key: string) => boolean): { [key: string]: TValue } { 14 | const result: { [key: string]: TValue } = {}; 15 | for (const key in obj) { 16 | const value = obj[key]; 17 | if (predicate(value, key)) { 18 | result[key] = value; 19 | } 20 | } 21 | return result; 22 | } 23 | 24 | /** 25 | * Removes object properties and array values that do not match a predicate 26 | */ 27 | export function filterValuesDeep(obj: any, predicate: (value: any) => boolean): any { 28 | if (obj instanceof Array) { 29 | return obj 30 | .filter(predicate) 31 | .map(val => filterValuesDeep(val, predicate)); 32 | } 33 | if (typeof obj === 'object' && obj !== null) { 34 | const filtered = filterValues(obj, predicate); 35 | return mapValues(filtered, val => filterValuesDeep(val, predicate)); 36 | } 37 | return obj; 38 | } 39 | 40 | export function flatten(input: T[][]): T[] { 41 | const arr: T[] = []; 42 | return arr.concat(...input); 43 | } 44 | 45 | export function flatMap(input: TIn[], fn: (input: TIn) => TOut[]): TOut[] { 46 | return flatten(input.map(fn)); 47 | } 48 | 49 | export function compact(arr: (T | undefined | null)[]): T[] { 50 | return arr.filter(a => a != undefined) as T[]; 51 | } 52 | 53 | /** 54 | * Binds a function, to an object, or returns undefined if the function is undefined 55 | * @param fn the function to bind 56 | * @param obj the object to bind the function to 57 | * @returns the bound function, or undefined 58 | */ 59 | export function bindNullable(fn: (T & Function) | undefined, obj: any): (T & Function) | undefined { 60 | return fn ? fn.bind(obj) : fn; 61 | } 62 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "declaration": true, 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "removeComments": false, 11 | "strict": true, 12 | "alwaysStrict": true, 13 | "noImplicitAny": true, 14 | "noImplicitThis": true, 15 | "strictNullChecks": true, 16 | "forceConsistentCasingInFileNames": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "noImplicitReturns": true, 19 | "lib": [ 20 | "es2016", 21 | "esnext.asynciterable" 22 | ], 23 | "outDir": "dist", 24 | "typeRoots": [ 25 | "node_modules/@types" 26 | ] 27 | }, 28 | "exclude": [ 29 | "spec", 30 | "node_modules", 31 | "dist" 32 | ] 33 | } 34 | --------------------------------------------------------------------------------