├── .commit-msg ├── .github └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── fixtures ├── directiveSchemas │ ├── baseTypes.graphql │ ├── directives.graphql │ └── extendedTypes.graphql ├── expectedOutput │ ├── directiveSchemas │ │ ├── printedDefault.graphql │ │ └── printedWithDirectives.graphql │ ├── helloWorld │ │ └── expectedOutput.graphql │ └── inputObjectInDirective │ │ └── printedInputObject.graphql ├── helloWorld │ ├── mutations.graphql │ ├── queries.graphql │ └── subscriptions.graphql ├── inputObjectInDirective │ ├── directiveWithObject.graphql │ └── directiveWithoutObject.graphql ├── invalidSchemas │ ├── dataTypes │ │ ├── characters │ │ │ ├── people.graphql │ │ │ └── species.graphql │ │ ├── film.graphql │ │ ├── planet.graphql │ │ └── ships │ │ │ ├── starship.graphql │ │ │ └── vehicle.graphql │ ├── rootQuery.graphql │ └── schema.graphql ├── queries │ ├── allFilms.graphql │ ├── allPeople.graphql │ └── invalid │ │ └── allFilms.graphql └── schema │ ├── dataTypes │ ├── characters │ │ ├── people.graphql │ │ └── species.graphql │ ├── film.graphql │ ├── planet.graphql │ └── ships │ │ ├── starship.graphql │ │ └── vehicle.graphql │ ├── rootQuery.graphql │ └── schema.graphql ├── package-lock.json ├── package.json ├── src ├── cli-launcher.ts ├── cli.ts ├── index.ts ├── logger.ts ├── printers.ts ├── test │ ├── cli.test.ts │ ├── index.test.ts │ └── printers.test.ts ├── types.ts ├── utilities.ts └── validate-schema.ts ├── tsconfig.json └── tslint.json /.commit-msg: -------------------------------------------------------------------------------- 1 | [FEATURE | BUG | DOCS | CHORE] One liner succinctly describing the change (this line should be 60 characters or less total) 2 | 3 | # Describe the issue you are facing and how you solved it with the proposed changes. 4 | 5 | [TESTING] 6 | 7 | # How you tested this change. Please be specific! 8 | 9 | issue 10 | 11 | 12 | 13 | # 14 | ##################################################################### 15 | # 16 | # EXAMPLE: 17 | # 18 | ##################################################################### 19 | # 20 | # [FEATURE] Enable HTTP2 support in downloader module. 21 | # 22 | # I would like to use HTTP2 features to increase the performance of 23 | # my application. 24 | # 25 | # I updated the Downloader module to configure the HTTP client to use 26 | # HTTP 2 features. 27 | # 28 | # [TESTING] 29 | # 30 | # I tested this change with my application in the following scenarios: 31 | # * X 32 | # * Y 33 | # * Z 34 | # 35 | # I also implemented 2 new unit tests to specify the behavior of this 36 | # new feature 37 | # 38 | # issue https://github.com/awslabs/graphql-schema-validator/issues/13 -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | *Issue #, if available:* 2 | 3 | *Description of changes:* 4 | 5 | 6 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Coverage directory used by tools like istanbul 7 | coverage 8 | 9 | # Dependency directory 10 | node_modules 11 | typings 12 | */node_modules 13 | 14 | # build directory 15 | dist 16 | 17 | # mac directories 18 | .DS_Store 19 | 20 | 21 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional 4 | documentation, we greatly value feedback and contributions from our community. 5 | 6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary 7 | information to effectively respond to your bug report or contribution. 8 | 9 | 10 | ## Reporting Bugs/Feature Requests 11 | 12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 13 | 14 | When filing an issue, please check [existing open](https://github.com/awslabs/graphql-schema-utilities/issues), or [recently closed](https://github.com/awslabs/graphql-schema-utilities/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already 15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 16 | 17 | * A reproducible test case or series of steps 18 | * The version of our code being used 19 | * Any modifications you've made relevant to the bug 20 | * Anything unusual about your environment or deployment 21 | 22 | 23 | ## Contributing via Pull Requests 24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 25 | 26 | 1. You are working against the latest source on the *master* branch. 27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. 29 | 30 | To send us a pull request, please: 31 | 32 | 1. Fork the repository. 33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 34 | 3. Ensure local tests pass. 35 | 4. Commit to your fork using clear commit messages. 36 | 5. Send us a pull request, answering any default questions in the pull request interface. 37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 38 | 39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and 40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 41 | 42 | 43 | ## Finding contributions to work on 44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/awslabs/graphql-schema-utilities/labels/help%20wanted) issues is a great place to start. 45 | 46 | 47 | ## Code of Conduct 48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 50 | opensource-codeofconduct@amazon.com with any additional questions or comments. 51 | 52 | 53 | ## Security issue notifications 54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. 55 | 56 | 57 | ## Licensing 58 | 59 | See the [LICENSE](https://github.com/awslabs/graphql-schema-utilities/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. 60 | 61 | We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. 62 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Graphql Schema Tools 2 | Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # graphql-schema-utilities 2 | 3 | 4 | A CLI tool to merge schema files, and validate operations against a GraphQL Schema. 5 | 6 | ## Installation 7 | 8 | 9 | ```sh 10 | npm install -g graphql-schema-utilities 11 | ``` 12 | 13 | # Usage 14 | 15 | ## Using the CLI tool 16 | 17 | ```sh 18 | >> graphql-schema-utilities 19 | ``` 20 | 21 | The tool will first merge schema files and then validate the merged schema, throwing errors if the schema isn't valid and exit with exit code 1. If Schema is valid it will check each operation in the file glob by parsing the operation and validating it against the schema. If errors are found, they will be displayed by file name and exit with exit code 1. 22 | 23 | ### Merging schema files 24 | You can merge your schema files across different modules and directories. In this example, you have three different set of files in three different directories: 25 | 26 | ``` 27 | ~/moduleMain/schemas/Root.graphql: 28 | type Query; 29 | 30 | ~/module1/schemas/Book.graphql: 31 | extend type Query { 32 | bookById(id: ID!): Book 33 | } 34 | 35 | type Book { 36 | id: ID! 37 | authorId: ID! 38 | } 39 | 40 | ~/module2/schemas/User.graphql: 41 | extend type Query { 42 | userById(id: ID!): User 43 | } 44 | 45 | type User { 46 | id: ID! 47 | name: String! 48 | } 49 | 50 | ``` 51 | 52 | Running the CLI utility generates the merged schema file, Merged_schema.graphQL: 53 | 54 | ``` 55 | 56 | type Query { 57 | userById(id: ID!): User 58 | bookById(id: ID!): Book 59 | } 60 | 61 | type User { 62 | id: ID! 63 | name: String! 64 | } 65 | 66 | type Book { 67 | id: ID! 68 | authorId: ID! 69 | } 70 | 71 | ``` 72 | 73 | 74 | ### The CLI options: 75 | 76 | ``` 77 | Options: 78 | -V, --version output the version number. 79 | -o, --output [pattern] The file path where the merged schema will be outputted to. 80 | -s, --schema [pattern] Use a glob path that would define all of your schema files to merge them into a valid schema. (default: ""). 81 | -r, --rules [pattern] The file path for your custom rules to validate your operations, and your merged schema. To learn abot how to write your custom rules: check the README.md file (default: ""). 82 | -p, --operations [pattern] Use a glob that that contains your graphql operation files to test against the merged schema file. (default: ""). 83 | -d, --includeDirectives By default will NOT merge the directives, unless you added this flag. 84 | -h, --help output usage information. 85 | ``` 86 | 87 | ### How to merge the schema files: 88 | ```sh 89 | >> graphql-schema-utilities -s "{./First_Directory/**/*.graphql,./Second_Directory/users/**/ 90 | *.graphql}" 91 | ``` 92 | That will merge all the schema files in both directories. Note that we are passing the directories as [Glob](https://github.com/isaacs/node-glob#readme). 93 | 94 | ### How to validate your operations against your merged schema: 95 | ```sh 96 | >> graphql-schema-utilities -s "{./First_Directory/**/*.graphql,./Second_Directory/users/**/ 97 | *.graphql}" -p "./path_to_directory/operations/*.graphql" 98 | ``` 99 | Note that the "./path_to_directory/operations/*.graphql" **operations path** is also using [Glob](https://github.com/isaacs/node-glob#readme). 100 | 101 | ### How to add your custom validation rules: 102 | These tools will use the validation rules as defined in graphql-js [validation rules](https://github.com/graphql/graphql-js/tree/master/src/validation/rules). But you can create your own validation rule. Here is an example for custom validation rule against your operation which validates that your operation name must be prefixed with **Hawaii_** . 103 | 104 | ```js 105 | ### file name: custom_rule.ts 106 | 107 | import { GraphQLError } from 'graphql'; 108 | 109 | export function doesNotStartWithHawaii(operationName: string): string { 110 | return `"${operationName}" operation does not start with Hawaii_.`; 111 | } 112 | 113 | /** 114 | * Valid only if it starts with Hawaii_. 115 | * A GraphQL document is only valid if all defined operations starts with Hawaii_. 116 | */ 117 | export function OperationNameStartsWithHawaii( 118 | context: any, 119 | ): any { 120 | const knownOperationNames = Object.create(null); 121 | return { 122 | OperationDefinition(node) { 123 | const operationName = node.name; 124 | if (operationName) { 125 | if (!operationName.value.startsWith('Hawaii_')) { 126 | 127 | context.reportError( 128 | new GraphQLError( 129 | doesNotStartWithHawaii(operationName.value) 130 | ), 131 | ); 132 | } else { 133 | knownOperationNames[operationName.value] = operationName; 134 | } 135 | } 136 | return false; 137 | }, 138 | FragmentDefinition: () => false, 139 | }; 140 | } 141 | ``` 142 | 143 | Then run the CLI with the rules option: 144 | 145 | ```sh 146 | >> graphql-schema-utilities -s "{./First_Directory/**/*.graphql,./Second_Directory/users/**/ 147 | *.graphql}" -p "./path_to_directory/operations/*.graphql" -r "path/to/custom_rule.js" 148 | ``` 149 | **Note:** 150 | 151 | 1- We are referencing the .js file not the .ts. 152 | 153 | 2- The path here is **NOT** Glob, You can use either relative or absolute path. 154 | 155 | 156 | To learn more about how to write your own custom validation rules against graphql schema or operation files: 157 | [Validate method in graphql-js](https://github.com/graphql/graphql-js/blob/master/src/validation/validate.js). 158 | 159 | 160 | 161 | 162 | ## Merge and Validate programmatically 163 | 164 | This tool can be used as a library for a JS app as well. you can call the mergeSchemas async using Promise. 165 | 166 | ```js 167 | const tools = require('graphql-schema-utilities'); 168 | 169 | const glob = "{./First_Directory/**/*.graphql,./Second_Directory/users/**/ 170 | *.graphql}" 171 | tools.mergeGQLSchemas(glob).then((schema) => { 172 | console.log('schema files were merged, and the valid schema is: ', schema) 173 | }) 174 | .catch((error) => { 175 | console.error(error) 176 | }) 177 | ``` 178 | 179 | 180 | 181 | Validate operations using promises: 182 | 183 | ```js 184 | 185 | tools.mergeGQLSchemas('./schema/*.graphql').then((schema) => { 186 | tools.validateOperations('./queries/*.graphql', schema).then((results) => { 187 | console.log(results) 188 | }) 189 | }) 190 | ``` 191 | 192 | 193 | *Note:* you must use quotes around each file glob or the utility will not work properly. 194 | 195 | ## Development 196 | 197 | Install dependencies with 198 | 199 | ```sh 200 | npm install 201 | ``` 202 | 203 | ### Build 204 | 205 | ```sh 206 | npm run build 207 | ``` 208 | 209 | 210 | ### Run test in watch mode 211 | 212 | ```sh 213 | npm run test:watch 214 | ``` 215 | 216 | ## Contributing 217 | 218 | Please help make this tool better. For more information take a look at [CONTRIBUTING.md](CONTRIBUTING.md) 219 | 220 | ## License 221 | [Apache 2.0](LICENSE) 222 | 223 | ## Notes 224 | This package was created based on a fork from [graphql-validator](https://github.com/creditkarma/graphql-validator) that was developed by credit-karma. 225 | -------------------------------------------------------------------------------- /fixtures/directiveSchemas/baseTypes.graphql: -------------------------------------------------------------------------------- 1 | interface BarInterface { 2 | bar: String! 3 | } 4 | 5 | interface FooInterface implements BarInterface { 6 | bar: String! 7 | nestedFoo: NestedFoo! @nullArg(stringArg: null) 8 | } 9 | 10 | type Foo implements FooInterface @noArg { 11 | bar: String! 12 | qux: Int! 13 | nestedFoo: NestedFoo! @nullArg(stringArg: null) 14 | } 15 | 16 | type NestedFoo { 17 | id: ID! 18 | bar: Bar! 19 | } 20 | 21 | enum Bar { 22 | MORE @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES) 23 | VALUES 24 | EVERYONE 25 | } 26 | 27 | input Input { 28 | field: String @nullArg(stringArg: "string") 29 | oldAttribute: String! @deprecated(reason: "reason") 30 | } -------------------------------------------------------------------------------- /fixtures/directiveSchemas/directives.graphql: -------------------------------------------------------------------------------- 1 | """This directive demonstrates using multiple args with multiple types.""" 2 | directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!, enumArg: Bar) on ENUM_VALUE | FIELD_DEFINITION | OBJECT 3 | 4 | # This directive demonstrates using no args. And using comment syntax instead 5 | directive @noArg on ENUM_VALUE | FIELD_DEFINITION | OBJECT 6 | 7 | """This directive demonstrates null types.""" 8 | directive @nullArg(stringArg: String) on ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | OBJECT 9 | 10 | """The directives decorates unions.""" 11 | directive @nestedFooUnion on UNION 12 | union NestedFooUnion @nestedFooUnion = NestedFoo 13 | -------------------------------------------------------------------------------- /fixtures/directiveSchemas/extendedTypes.graphql: -------------------------------------------------------------------------------- 1 | extend type NestedFoo { 2 | anotherAttribute: String! @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES) @noArg 3 | oldAttribute: String! @deprecated(reason: "reason") 4 | } -------------------------------------------------------------------------------- /fixtures/expectedOutput/directiveSchemas/printedDefault.graphql: -------------------------------------------------------------------------------- 1 | """This directive demonstrates using multiple args with multiple types.""" 2 | directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!, enumArg: Bar) on ENUM_VALUE | FIELD_DEFINITION | OBJECT 3 | 4 | directive @noArg on ENUM_VALUE | FIELD_DEFINITION | OBJECT 5 | 6 | """This directive demonstrates null types.""" 7 | directive @nullArg(stringArg: String) on ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | OBJECT 8 | 9 | """The directives decorates unions.""" 10 | directive @nestedFooUnion on UNION 11 | 12 | interface BarInterface { 13 | bar: String! 14 | } 15 | 16 | interface FooInterface implements BarInterface { 17 | bar: String! 18 | nestedFoo: NestedFoo! 19 | } 20 | 21 | type Foo implements FooInterface { 22 | bar: String! 23 | qux: Int! 24 | nestedFoo: NestedFoo! 25 | } 26 | 27 | type NestedFoo { 28 | id: ID! 29 | bar: Bar! 30 | anotherAttribute: String! 31 | oldAttribute: String! @deprecated(reason: "reason") 32 | } 33 | 34 | enum Bar { 35 | MORE 36 | VALUES 37 | EVERYONE 38 | } 39 | 40 | input Input { 41 | field: String 42 | oldAttribute: String! @deprecated(reason: "reason") 43 | } 44 | 45 | union NestedFooUnion = NestedFoo 46 | -------------------------------------------------------------------------------- /fixtures/expectedOutput/directiveSchemas/printedWithDirectives.graphql: -------------------------------------------------------------------------------- 1 | """This directive demonstrates using multiple args with multiple types.""" 2 | directive @multiArgAndType(stringArg: String!, booleanArg: Boolean!, intArg: Int!, floatArg: Float!, listArg: [String!]!, enumArg: Bar) on ENUM_VALUE | FIELD_DEFINITION | OBJECT 3 | 4 | directive @noArg on ENUM_VALUE | FIELD_DEFINITION | OBJECT 5 | 6 | """This directive demonstrates null types.""" 7 | directive @nullArg(stringArg: String) on ENUM_VALUE | FIELD_DEFINITION | INPUT_FIELD_DEFINITION | OBJECT 8 | 9 | """The directives decorates unions.""" 10 | directive @nestedFooUnion on UNION 11 | 12 | enum Bar { 13 | MORE @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES) 14 | VALUES 15 | EVERYONE 16 | } 17 | 18 | interface BarInterface { 19 | bar: String! 20 | } 21 | 22 | type Foo implements FooInterface @noArg { 23 | bar: String! 24 | qux: Int! 25 | nestedFoo: NestedFoo! @nullArg(stringArg: null) 26 | } 27 | 28 | interface FooInterface implements BarInterface { 29 | bar: String! 30 | nestedFoo: NestedFoo! @nullArg(stringArg: null) 31 | } 32 | 33 | input Input { 34 | field: String @nullArg(stringArg: "string") 35 | oldAttribute: String! @deprecated(reason: "reason") 36 | } 37 | 38 | type NestedFoo { 39 | id: ID! 40 | bar: Bar! 41 | anotherAttribute: String! @multiArgAndType(stringArg: "string", booleanArg: true, intArg: 314, floatArg: 3.14, listArg: ["string"], enumArg: VALUES) @noArg 42 | oldAttribute: String! @deprecated(reason: "reason") 43 | } 44 | 45 | union NestedFooUnion @nestedFooUnion = NestedFoo 46 | -------------------------------------------------------------------------------- /fixtures/expectedOutput/helloWorld/expectedOutput.graphql: -------------------------------------------------------------------------------- 1 | """Input type for a hello person.""" 2 | input HelloPersonInput { 3 | """ 4 | The name to set as the default for the helloPerson query when no name is provided to the query. See helloPerson query for 5 | more details. 6 | """ 7 | name: String! 8 | } 9 | 10 | """A root type for mutations""" 11 | type Mutation { 12 | """ 13 | Sets the default helloPerson details used if no person name is provided in the helloPerson query. 14 | """ 15 | setDefaultHelloPerson(helloPersonInput: HelloPersonInput!): String! 16 | } 17 | 18 | """A root type for queries""" 19 | type Query { 20 | """The Hello World! query.""" 21 | helloWorld: String! 22 | 23 | """ 24 | The Hello ! query. That is, says hello to whatever String "name" is set to. Defaults to the currently stored 25 | default name as set by the setDefaultHelloPerson mutation or "Hello Everyone!", if no default name has been set yet. 26 | """ 27 | helloPerson(name: String): String! 28 | } 29 | 30 | """A root type for subscriptions""" 31 | type Subscription { 32 | """ 33 | The hello person default name subscription. Subscribes to events related to the changing of the default hello person 34 | name. 35 | """ 36 | defaultHelloPersonChanged: String! 37 | } 38 | -------------------------------------------------------------------------------- /fixtures/expectedOutput/inputObjectInDirective/printedInputObject.graphql: -------------------------------------------------------------------------------- 1 | directive @color(colors: ColorInput) on OBJECT 2 | 3 | directive @horror on OBJECT 4 | 5 | type Book @horror { 6 | id: ID 7 | name: String 8 | } 9 | 10 | enum Color { 11 | Red 12 | Blue 13 | } 14 | 15 | input ColorInput { 16 | color: Color 17 | OR: [ColorInput] 18 | AND: [ColorInput] 19 | } 20 | 21 | type Page @color(colors: {OR: [{color: Blue}, {color: Red}]}) { 22 | id: ID 23 | content: String 24 | } 25 | 26 | type Query { 27 | book: Book 28 | } 29 | -------------------------------------------------------------------------------- /fixtures/helloWorld/mutations.graphql: -------------------------------------------------------------------------------- 1 | """A root type for mutations""" 2 | type Mutation { 3 | """Sets the default helloPerson details used if no person name is provided in the helloPerson query.""" 4 | setDefaultHelloPerson(helloPersonInput: HelloPersonInput!): String! 5 | } 6 | 7 | """Input type for a hello person.""" 8 | input HelloPersonInput { 9 | """ 10 | The name to set as the default for the helloPerson query when no name is provided to the query. See helloPerson query for 11 | more details. 12 | """ 13 | name: String! 14 | } 15 | -------------------------------------------------------------------------------- /fixtures/helloWorld/queries.graphql: -------------------------------------------------------------------------------- 1 | """A root type for queries""" 2 | type Query { 3 | """The Hello World! query.""" 4 | helloWorld: String! 5 | 6 | """ 7 | The Hello ! query. That is, says hello to whatever String "name" is set to. Defaults to the currently stored 8 | default name as set by the setDefaultHelloPerson mutation or "Hello Everyone!", if no default name has been set yet. 9 | """ 10 | helloPerson(name: String): String! 11 | } 12 | -------------------------------------------------------------------------------- /fixtures/helloWorld/subscriptions.graphql: -------------------------------------------------------------------------------- 1 | """A root type for subscriptions""" 2 | type Subscription { 3 | """ 4 | The hello person default name subscription. Subscribes to events related to the changing of the default hello person 5 | name. 6 | """ 7 | defaultHelloPersonChanged: String! 8 | } 9 | -------------------------------------------------------------------------------- /fixtures/inputObjectInDirective/directiveWithObject.graphql: -------------------------------------------------------------------------------- 1 | directive @color(colors: ColorInput) on OBJECT 2 | 3 | type Page @color(colors: {OR : [{color : Blue}, {color : Red}]}) { 4 | id: ID 5 | content: String 6 | } 7 | 8 | input ColorInput { 9 | color: Color 10 | OR: [ColorInput] 11 | AND: [ColorInput] 12 | } 13 | 14 | enum Color { 15 | Red 16 | Blue 17 | } 18 | -------------------------------------------------------------------------------- /fixtures/inputObjectInDirective/directiveWithoutObject.graphql: -------------------------------------------------------------------------------- 1 | type Query { 2 | book: Book 3 | } 4 | 5 | directive @horror on OBJECT 6 | 7 | type Book @horror { 8 | id: ID 9 | name: String 10 | } 11 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/dataTypes/characters/people.graphql: -------------------------------------------------------------------------------- 1 | type Person implements Node { 2 | name: String 3 | birthYear: String 4 | eyeColor: String 5 | gender: String 6 | hairColor: String 7 | height: Int 8 | mass: Int 9 | skinColor: String 10 | homeworld: Planet 11 | films: [Film] 12 | species: [Species] 13 | starships: [Starship] 14 | vehicles: [Vehicle] 15 | created: String 16 | edited: String 17 | id: ID! 18 | } 19 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/dataTypes/characters/species.graphql: -------------------------------------------------------------------------------- 1 | type Species implements Node { 2 | name: String 3 | classification: String 4 | designation: String 5 | averageHeight: Float 6 | averageLifespan: Int 7 | eyeColors: [String] 8 | hairColors: [String] 9 | skinColors: [String] 10 | language: String 11 | homeworld: Planet 12 | people: [Person] 13 | films: [Film] 14 | created: String 15 | edited: String 16 | id: ID! 17 | } 18 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/dataTypes/film.graphql: -------------------------------------------------------------------------------- 1 | type Film implements Node { 2 | title: String 3 | episodeID: Int 4 | openingCrawl: String 5 | director: String 6 | producers: [String] 7 | releaseDate: String 8 | species: [Species] 9 | starships: [Starship] 10 | vehicles: [Vehicle] 11 | characters: [Person] 12 | planets: [Planet] 13 | created: String 14 | edited: String 15 | id: ID! 16 | } 17 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/dataTypes/planet.graphql: -------------------------------------------------------------------------------- 1 | type Planet implements Node { 2 | name: String 3 | diameter: Int 4 | rotationPeriod: Int 5 | orbitalPeriod: Int 6 | gravity: String 7 | population: Int 8 | climates: [String] 9 | terrains: [String] 10 | surfaceWater: Float 11 | residents: [Person] 12 | films: [Film] 13 | created: String 14 | edited: String 15 | id: ID! 16 | } 17 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/dataTypes/ships/starship.graphql: -------------------------------------------------------------------------------- 1 | type Starship implements Node { 2 | name: String 3 | model: String 4 | starshipClass: String 5 | manufacturers: [String] 6 | costInCredits: Float 7 | length: Float 8 | crew: String 9 | passengers: String 10 | maxAtmospheringSpeed: Int 11 | hyperdriveRating: Float 12 | MGLT: Int 13 | cargoCapacity: Float 14 | consumables: String 15 | pilots: [Person] 16 | films: [Film] 17 | created: String 18 | edited: String 19 | id: ID! 20 | } 21 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/dataTypes/ships/vehicle.graphql: -------------------------------------------------------------------------------- 1 | type Vehicle implements Node { 2 | name: String 3 | model: String 4 | vehicleClass: String 5 | manufacturers: [String] 6 | costInCredits: Int 7 | length: Float 8 | crew: String 9 | passengers: String 10 | maxAtmospheringSpeed: Int 11 | cargoCapacity: Int 12 | consumables: String 13 | pilots: [Person] 14 | films: [Film] 15 | created: String 16 | edited: String 17 | id: ID! 18 | } 19 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/rootQuery.graphql: -------------------------------------------------------------------------------- 1 | interface Node { 2 | id: ID! 3 | } 4 | 5 | type RootQuery { 6 | allFilms(offset: Int, limit: Int): [Film] 7 | film(id: ID, filmID: ID): Film 8 | allPeople(offset: Int, limit: Int): [Person] 9 | person(id: ID, personID: ID): Person 10 | allPlanets(offset: Int, limit: Int): [Planet] 11 | planet(id: ID, planetID: ID): Planet 12 | allSpecies(offset: Int, limit: Int): [Species] 13 | species(id: ID, speciesID: ID): Species 14 | allStarships(offset: Int, limit: Int): [Starship] 15 | starship(id: ID, starshipID: ID): Starship 16 | allVehicles(offset: Int, limit: Int): [Vehicle] 17 | vehicle(id: ID, vehicleID: ID): Vehicle 18 | vehicle(id: ID, vehicleID: ID): Vehicle 19 | node(id: ID!): Node 20 | } 21 | -------------------------------------------------------------------------------- /fixtures/invalidSchemas/schema.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: RootQuery 3 | } 4 | -------------------------------------------------------------------------------- /fixtures/queries/allFilms.graphql: -------------------------------------------------------------------------------- 1 | {allFilms{title}} 2 | -------------------------------------------------------------------------------- /fixtures/queries/allPeople.graphql: -------------------------------------------------------------------------------- 1 | {allPeople{name}} 2 | -------------------------------------------------------------------------------- /fixtures/queries/invalid/allFilms.graphql: -------------------------------------------------------------------------------- 1 | {allFilms{titles names}} 2 | -------------------------------------------------------------------------------- /fixtures/schema/dataTypes/characters/people.graphql: -------------------------------------------------------------------------------- 1 | type Person implements Node { 2 | name: String 3 | birthYear: String 4 | eyeColor: String 5 | gender: String 6 | hairColor: String 7 | height: Int 8 | mass: Int 9 | skinColor: String 10 | homeworld: Planet 11 | films: [Film] 12 | species: [Species] 13 | starships: [Starship] 14 | vehicles: [Vehicle] 15 | created: String 16 | edited: String 17 | id: ID! 18 | } 19 | -------------------------------------------------------------------------------- /fixtures/schema/dataTypes/characters/species.graphql: -------------------------------------------------------------------------------- 1 | type Species implements Node { 2 | name: String 3 | classification: String 4 | designation: String 5 | averageHeight: Float 6 | averageLifespan: Int 7 | eyeColors: [String] 8 | hairColors: [String] 9 | skinColors: [String] 10 | language: String 11 | homeworld: Planet 12 | people: [Person] 13 | films: [Film] 14 | created: String 15 | edited: String 16 | id: ID! 17 | } 18 | -------------------------------------------------------------------------------- /fixtures/schema/dataTypes/film.graphql: -------------------------------------------------------------------------------- 1 | type Film implements Node { 2 | title: String 3 | episodeID: Int 4 | openingCrawl: String 5 | director: String 6 | producers: [String] 7 | releaseDate: String 8 | species: [Species] 9 | starships: [Starship] 10 | vehicles: [Vehicle] 11 | characters: [Person] 12 | planets: [Planet] 13 | created: String 14 | edited: String 15 | id: ID! 16 | } 17 | -------------------------------------------------------------------------------- /fixtures/schema/dataTypes/planet.graphql: -------------------------------------------------------------------------------- 1 | type Planet implements Node { 2 | name: String 3 | diameter: Int 4 | rotationPeriod: Int 5 | orbitalPeriod: Int 6 | gravity: String 7 | population: Int 8 | climates: [String] 9 | terrains: [String] 10 | surfaceWater: Float 11 | residents: [Person] 12 | films: [Film] 13 | created: String 14 | edited: String 15 | id: ID! 16 | } 17 | -------------------------------------------------------------------------------- /fixtures/schema/dataTypes/ships/starship.graphql: -------------------------------------------------------------------------------- 1 | type Starship implements Node { 2 | name: String 3 | model: String 4 | starshipClass: String 5 | manufacturers: [String] 6 | costInCredits: Float 7 | length: Float 8 | crew: String 9 | passengers: String 10 | maxAtmospheringSpeed: Int 11 | hyperdriveRating: Float 12 | MGLT: Int 13 | cargoCapacity: Float 14 | consumables: String 15 | pilots: [Person] 16 | films: [Film] 17 | created: String 18 | edited: String 19 | id: ID! 20 | } 21 | -------------------------------------------------------------------------------- /fixtures/schema/dataTypes/ships/vehicle.graphql: -------------------------------------------------------------------------------- 1 | type Vehicle implements Node { 2 | name: String 3 | model: String 4 | vehicleClass: String 5 | manufacturers: [String] 6 | costInCredits: Int 7 | length: Float 8 | crew: String 9 | passengers: String 10 | maxAtmospheringSpeed: Int 11 | cargoCapacity: Int 12 | consumables: String 13 | pilots: [Person] 14 | films: [Film] 15 | created: String 16 | edited: String 17 | id: ID! 18 | } 19 | -------------------------------------------------------------------------------- /fixtures/schema/rootQuery.graphql: -------------------------------------------------------------------------------- 1 | interface Node { 2 | id: ID! 3 | } 4 | 5 | type RootQuery { 6 | allFilms(offset: Int, limit: Int): [Film] 7 | film(id: ID, filmID: ID): Film 8 | allPeople(offset: Int, limit: Int): [Person] 9 | person(id: ID, personID: ID): Person 10 | allPlanets(offset: Int, limit: Int): [Planet] 11 | planet(id: ID, planetID: ID): Planet 12 | allSpecies(offset: Int, limit: Int): [Species] 13 | species(id: ID, speciesID: ID): Species 14 | allStarships(offset: Int, limit: Int): [Starship] 15 | starship(id: ID, starshipID: ID): Starship 16 | allVehicles(offset: Int, limit: Int): [Vehicle] 17 | vehicle(id: ID, vehicleID: ID): Vehicle 18 | node(id: ID!): Node 19 | } 20 | -------------------------------------------------------------------------------- /fixtures/schema/schema.graphql: -------------------------------------------------------------------------------- 1 | schema { 2 | query: RootQuery 3 | } 4 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graphql-schema-utilities", 3 | "version": "1.1.8", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@apollo/client": { 8 | "version": "3.7.17", 9 | "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.7.17.tgz", 10 | "integrity": "sha512-0EErSHEtKPNl5wgWikHJbKFAzJ/k11O0WO2QyqZSHpdxdAnw7UWHY4YiLbHCFG7lhrD+NTQ3Z/H9Jn4rcikoJA==", 11 | "optional": true, 12 | "requires": { 13 | "@graphql-typed-document-node/core": "^3.1.1", 14 | "@wry/context": "^0.7.0", 15 | "@wry/equality": "^0.5.0", 16 | "@wry/trie": "^0.4.0", 17 | "graphql-tag": "^2.12.6", 18 | "hoist-non-react-statics": "^3.3.2", 19 | "optimism": "^0.16.2", 20 | "prop-types": "^15.7.2", 21 | "response-iterator": "^0.2.6", 22 | "symbol-observable": "^4.0.0", 23 | "ts-invariant": "^0.10.3", 24 | "tslib": "^2.3.0", 25 | "zen-observable-ts": "^1.2.5" 26 | } 27 | }, 28 | "@babel/code-frame": { 29 | "version": "7.22.5", 30 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", 31 | "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", 32 | "dev": true, 33 | "requires": { 34 | "@babel/highlight": "^7.22.5" 35 | } 36 | }, 37 | "@babel/helper-validator-identifier": { 38 | "version": "7.22.5", 39 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", 40 | "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", 41 | "dev": true 42 | }, 43 | "@babel/highlight": { 44 | "version": "7.22.5", 45 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", 46 | "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", 47 | "dev": true, 48 | "requires": { 49 | "@babel/helper-validator-identifier": "^7.22.5", 50 | "chalk": "^2.0.0", 51 | "js-tokens": "^4.0.0" 52 | } 53 | }, 54 | "@graphql-tools/merge": { 55 | "version": "8.4.2", 56 | "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", 57 | "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", 58 | "requires": { 59 | "@graphql-tools/utils": "^9.2.1", 60 | "tslib": "^2.4.0" 61 | } 62 | }, 63 | "@graphql-tools/schema": { 64 | "version": "9.0.19", 65 | "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", 66 | "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", 67 | "requires": { 68 | "@graphql-tools/merge": "^8.4.1", 69 | "@graphql-tools/utils": "^9.2.1", 70 | "tslib": "^2.4.0", 71 | "value-or-promise": "^1.0.12" 72 | } 73 | }, 74 | "@graphql-tools/utils": { 75 | "version": "9.2.1", 76 | "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", 77 | "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", 78 | "requires": { 79 | "@graphql-typed-document-node/core": "^3.1.1", 80 | "tslib": "^2.4.0" 81 | } 82 | }, 83 | "@graphql-typed-document-node/core": { 84 | "version": "3.2.0", 85 | "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", 86 | "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==" 87 | }, 88 | "@types/code": { 89 | "version": "4.0.6", 90 | "resolved": "https://registry.npmjs.org/@types/code/-/code-4.0.6.tgz", 91 | "integrity": "sha512-sgZtDIS22MwVDYhWaHWYCm3MWdfMFtBxUPHLl0EJq6nxayz/J3WVuXaewLSqINxWyRgvzhYMvjf1h8K/jj+1OA==", 92 | "dev": true 93 | }, 94 | "@types/glob": { 95 | "version": "5.0.38", 96 | "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.38.tgz", 97 | "integrity": "sha512-rTtf75rwyP9G2qO5yRpYtdJ6aU1QqEhWbtW55qEgquEDa6bXW0s2TWZfDm02GuppjEozOWG/F2UnPq5hAQb+gw==", 98 | "dev": true, 99 | "requires": { 100 | "@types/minimatch": "*", 101 | "@types/node": "*" 102 | } 103 | }, 104 | "@types/graphql": { 105 | "version": "14.5.0", 106 | "resolved": "https://registry.npmjs.org/@types/graphql/-/graphql-14.5.0.tgz", 107 | "integrity": "sha512-MOkzsEp1Jk5bXuAsHsUi6BVv0zCO+7/2PTiZMXWDSsMXvNU6w/PLMQT2vHn8hy2i0JqojPz1Sz6rsFjHtsU0lA==", 108 | "dev": true, 109 | "requires": { 110 | "graphql": "*" 111 | } 112 | }, 113 | "@types/lab": { 114 | "version": "11.1.1", 115 | "resolved": "https://registry.npmjs.org/@types/lab/-/lab-11.1.1.tgz", 116 | "integrity": "sha512-NaXdzbVpy/6qaFziGQh87Ap+5TTnF3sukVIBKLx9fSAE5YPhAq/E1bF2/3sOI7sRRsh8oZ/+/KK3qws3JzIa0A==", 117 | "dev": true 118 | }, 119 | "@types/minimatch": { 120 | "version": "5.1.2", 121 | "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", 122 | "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", 123 | "dev": true 124 | }, 125 | "@types/mkdirp": { 126 | "version": "0.5.2", 127 | "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz", 128 | "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==", 129 | "dev": true, 130 | "requires": { 131 | "@types/node": "*" 132 | } 133 | }, 134 | "@types/node": { 135 | "version": "8.10.66", 136 | "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", 137 | "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==", 138 | "dev": true 139 | }, 140 | "@types/rimraf": { 141 | "version": "0.0.28", 142 | "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-0.0.28.tgz", 143 | "integrity": "sha512-xnLdvcPWgKF71R2DEQCZfXLutuAApHhJT+Y4/ptZ8FN610hSVT98TyLLkMjRm3VJ2BqUUXRjYtdZ12KvDXBT7A==", 144 | "dev": true 145 | }, 146 | "@wry/context": { 147 | "version": "0.7.3", 148 | "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.3.tgz", 149 | "integrity": "sha512-Nl8WTesHp89RF803Se9X3IiHjdmLBrIvPMaJkl+rKVJAYyPsz1TEUbu89943HpvujtSJgDUx9W4vZw3K1Mr3sA==", 150 | "optional": true, 151 | "requires": { 152 | "tslib": "^2.3.0" 153 | } 154 | }, 155 | "@wry/equality": { 156 | "version": "0.5.6", 157 | "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.6.tgz", 158 | "integrity": "sha512-D46sfMTngaYlrH+OspKf8mIJETntFnf6Hsjb0V41jAXJ7Bx2kB8Rv8RCUujuVWYttFtHkUNp7g+FwxNQAr6mXA==", 159 | "optional": true, 160 | "requires": { 161 | "tslib": "^2.3.0" 162 | } 163 | }, 164 | "@wry/trie": { 165 | "version": "0.4.3", 166 | "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", 167 | "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", 168 | "optional": true, 169 | "requires": { 170 | "tslib": "^2.3.0" 171 | } 172 | }, 173 | "acorn": { 174 | "version": "5.7.4", 175 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", 176 | "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", 177 | "dev": true 178 | }, 179 | "acorn-jsx": { 180 | "version": "3.0.1", 181 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", 182 | "integrity": "sha512-AU7pnZkguthwBjKgCg6998ByQNIMjbuDQZ8bb78QAFZwPfmKia8AIzgY/gWgqCjnht8JLdXmB4YxA0KaV60ncQ==", 183 | "dev": true, 184 | "requires": { 185 | "acorn": "^3.0.4" 186 | }, 187 | "dependencies": { 188 | "acorn": { 189 | "version": "3.3.0", 190 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", 191 | "integrity": "sha512-OLUyIIZ7mF5oaAUT1w0TFqQS81q3saT46x8t7ukpPjMNk+nbs4ZHhs7ToV8EWnLYLepjETXd4XaCE4uxkMeqUw==", 192 | "dev": true 193 | } 194 | } 195 | }, 196 | "ajv": { 197 | "version": "5.5.2", 198 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", 199 | "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", 200 | "dev": true, 201 | "requires": { 202 | "co": "^4.6.0", 203 | "fast-deep-equal": "^1.0.0", 204 | "fast-json-stable-stringify": "^2.0.0", 205 | "json-schema-traverse": "^0.3.0" 206 | } 207 | }, 208 | "ajv-keywords": { 209 | "version": "2.1.1", 210 | "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", 211 | "integrity": "sha512-ZFztHzVRdGLAzJmpUT9LNFLe1YiVOEylcaNpEutM26PVTCtOD919IMfD01CgbRouB42Dd9atjx1HseC15DgOZA==", 212 | "dev": true 213 | }, 214 | "ansi-escapes": { 215 | "version": "3.2.0", 216 | "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", 217 | "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", 218 | "dev": true 219 | }, 220 | "ansi-regex": { 221 | "version": "2.1.1", 222 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 223 | "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", 224 | "dev": true 225 | }, 226 | "ansi-styles": { 227 | "version": "3.2.1", 228 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 229 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 230 | "requires": { 231 | "color-convert": "^1.9.0" 232 | } 233 | }, 234 | "argparse": { 235 | "version": "1.0.10", 236 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 237 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 238 | "dev": true, 239 | "requires": { 240 | "sprintf-js": "~1.0.2" 241 | } 242 | }, 243 | "babel-code-frame": { 244 | "version": "6.26.0", 245 | "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", 246 | "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", 247 | "dev": true, 248 | "requires": { 249 | "chalk": "^1.1.3", 250 | "esutils": "^2.0.2", 251 | "js-tokens": "^3.0.2" 252 | }, 253 | "dependencies": { 254 | "ansi-styles": { 255 | "version": "2.2.1", 256 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", 257 | "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", 258 | "dev": true 259 | }, 260 | "chalk": { 261 | "version": "1.1.3", 262 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", 263 | "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", 264 | "dev": true, 265 | "requires": { 266 | "ansi-styles": "^2.2.1", 267 | "escape-string-regexp": "^1.0.2", 268 | "has-ansi": "^2.0.0", 269 | "strip-ansi": "^3.0.0", 270 | "supports-color": "^2.0.0" 271 | } 272 | }, 273 | "js-tokens": { 274 | "version": "3.0.2", 275 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", 276 | "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", 277 | "dev": true 278 | }, 279 | "strip-ansi": { 280 | "version": "3.0.1", 281 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 282 | "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", 283 | "dev": true, 284 | "requires": { 285 | "ansi-regex": "^2.0.0" 286 | } 287 | }, 288 | "supports-color": { 289 | "version": "2.0.0", 290 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", 291 | "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", 292 | "dev": true 293 | } 294 | } 295 | }, 296 | "balanced-match": { 297 | "version": "1.0.2", 298 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 299 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" 300 | }, 301 | "bossy": { 302 | "version": "3.0.4", 303 | "resolved": "https://registry.npmjs.org/bossy/-/bossy-3.0.4.tgz", 304 | "integrity": "sha512-kmr2xDwDRb/wQb5gLv/tFU5po4o/wqpoC+PkyTR0f96PMKoUqZJBN44Uurk6T+y1+Em46PYATWIagcPTcU0Zsg==", 305 | "dev": true, 306 | "requires": { 307 | "hoek": "4.x.x", 308 | "joi": "10.x.x" 309 | } 310 | }, 311 | "brace-expansion": { 312 | "version": "1.1.11", 313 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 314 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 315 | "requires": { 316 | "balanced-match": "^1.0.0", 317 | "concat-map": "0.0.1" 318 | } 319 | }, 320 | "buffer-from": { 321 | "version": "1.1.2", 322 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 323 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", 324 | "dev": true 325 | }, 326 | "builtin-modules": { 327 | "version": "1.1.1", 328 | "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", 329 | "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", 330 | "dev": true 331 | }, 332 | "caller-path": { 333 | "version": "0.1.0", 334 | "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", 335 | "integrity": "sha512-UJiE1otjXPF5/x+T3zTnSFiTOEmJoGTD9HmBoxnCUwho61a2eSNn/VwtwuIBDAo2SEOv1AJ7ARI5gCmohFLu/g==", 336 | "dev": true, 337 | "requires": { 338 | "callsites": "^0.2.0" 339 | } 340 | }, 341 | "callsites": { 342 | "version": "0.2.0", 343 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", 344 | "integrity": "sha512-Zv4Dns9IbXXmPkgRRUjAaJQgfN4xX5p6+RQFhWUqscdvvK2xK/ZL8b3IXIJsj+4sD+f24NwnWy2BY8AJ82JB0A==", 345 | "dev": true 346 | }, 347 | "chalk": { 348 | "version": "2.4.2", 349 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 350 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 351 | "requires": { 352 | "ansi-styles": "^3.2.1", 353 | "escape-string-regexp": "^1.0.5", 354 | "supports-color": "^5.3.0" 355 | } 356 | }, 357 | "chardet": { 358 | "version": "0.4.2", 359 | "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", 360 | "integrity": "sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==", 361 | "dev": true 362 | }, 363 | "circular-json": { 364 | "version": "0.3.3", 365 | "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", 366 | "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", 367 | "dev": true 368 | }, 369 | "cli-cursor": { 370 | "version": "2.1.0", 371 | "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", 372 | "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", 373 | "dev": true, 374 | "requires": { 375 | "restore-cursor": "^2.0.0" 376 | } 377 | }, 378 | "cli-width": { 379 | "version": "2.2.1", 380 | "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", 381 | "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", 382 | "dev": true 383 | }, 384 | "co": { 385 | "version": "4.6.0", 386 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 387 | "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", 388 | "dev": true 389 | }, 390 | "code": { 391 | "version": "4.1.0", 392 | "resolved": "https://registry.npmjs.org/code/-/code-4.1.0.tgz", 393 | "integrity": "sha512-xE9Tq+zJSWfFLBkPsc556eHD+8qD8ZLyx4FyuTnUSneINNMwa7GKy/mpJlw8686GqNm5nICyfAeBaxbdqvLsRQ==", 394 | "dev": true, 395 | "requires": { 396 | "hoek": "4.x.x" 397 | } 398 | }, 399 | "color-convert": { 400 | "version": "1.9.3", 401 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 402 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 403 | "requires": { 404 | "color-name": "1.1.3" 405 | } 406 | }, 407 | "color-name": { 408 | "version": "1.1.3", 409 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 410 | "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" 411 | }, 412 | "commander": { 413 | "version": "6.2.1", 414 | "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", 415 | "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==" 416 | }, 417 | "concat-map": { 418 | "version": "0.0.1", 419 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 420 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" 421 | }, 422 | "concat-stream": { 423 | "version": "1.6.2", 424 | "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", 425 | "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", 426 | "dev": true, 427 | "requires": { 428 | "buffer-from": "^1.0.0", 429 | "inherits": "^2.0.3", 430 | "readable-stream": "^2.2.2", 431 | "typedarray": "^0.0.6" 432 | } 433 | }, 434 | "core-util-is": { 435 | "version": "1.0.3", 436 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", 437 | "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", 438 | "dev": true 439 | }, 440 | "cross-spawn": { 441 | "version": "5.1.0", 442 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", 443 | "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", 444 | "dev": true, 445 | "requires": { 446 | "lru-cache": "^4.0.1", 447 | "shebang-command": "^1.2.0", 448 | "which": "^1.2.9" 449 | } 450 | }, 451 | "debug": { 452 | "version": "3.2.7", 453 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", 454 | "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", 455 | "dev": true, 456 | "requires": { 457 | "ms": "^2.1.1" 458 | } 459 | }, 460 | "deep-is": { 461 | "version": "0.1.4", 462 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", 463 | "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", 464 | "dev": true 465 | }, 466 | "diff": { 467 | "version": "3.5.0", 468 | "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", 469 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", 470 | "dev": true 471 | }, 472 | "doctrine": { 473 | "version": "2.1.0", 474 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", 475 | "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", 476 | "dev": true, 477 | "requires": { 478 | "esutils": "^2.0.2" 479 | } 480 | }, 481 | "escape-string-regexp": { 482 | "version": "1.0.5", 483 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 484 | "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" 485 | }, 486 | "eslint": { 487 | "version": "4.19.1", 488 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", 489 | "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", 490 | "dev": true, 491 | "requires": { 492 | "ajv": "^5.3.0", 493 | "babel-code-frame": "^6.22.0", 494 | "chalk": "^2.1.0", 495 | "concat-stream": "^1.6.0", 496 | "cross-spawn": "^5.1.0", 497 | "debug": "^3.1.0", 498 | "doctrine": "^2.1.0", 499 | "eslint-scope": "^3.7.1", 500 | "eslint-visitor-keys": "^1.0.0", 501 | "espree": "^3.5.4", 502 | "esquery": "^1.0.0", 503 | "esutils": "^2.0.2", 504 | "file-entry-cache": "^2.0.0", 505 | "functional-red-black-tree": "^1.0.1", 506 | "glob": "^7.1.2", 507 | "globals": "^11.0.1", 508 | "ignore": "^3.3.3", 509 | "imurmurhash": "^0.1.4", 510 | "inquirer": "^3.0.6", 511 | "is-resolvable": "^1.0.0", 512 | "js-yaml": "^3.9.1", 513 | "json-stable-stringify-without-jsonify": "^1.0.1", 514 | "levn": "^0.3.0", 515 | "lodash": "^4.17.4", 516 | "minimatch": "^3.0.2", 517 | "mkdirp": "^0.5.1", 518 | "natural-compare": "^1.4.0", 519 | "optionator": "^0.8.2", 520 | "path-is-inside": "^1.0.2", 521 | "pluralize": "^7.0.0", 522 | "progress": "^2.0.0", 523 | "regexpp": "^1.0.1", 524 | "require-uncached": "^1.0.3", 525 | "semver": "^5.3.0", 526 | "strip-ansi": "^4.0.0", 527 | "strip-json-comments": "~2.0.1", 528 | "table": "4.0.2", 529 | "text-table": "~0.2.0" 530 | } 531 | }, 532 | "eslint-config-hapi": { 533 | "version": "10.1.0", 534 | "resolved": "https://registry.npmjs.org/eslint-config-hapi/-/eslint-config-hapi-10.1.0.tgz", 535 | "integrity": "sha512-tAUedyvZla1qKt6jhOx7mj5tYDVCwdSyImpEK7wk/A/atKUjg18aHUK6Q6qWWM6rq21I1F/A8JAhIpkk0SvFMQ==", 536 | "dev": true 537 | }, 538 | "eslint-plugin-hapi": { 539 | "version": "4.1.0", 540 | "resolved": "https://registry.npmjs.org/eslint-plugin-hapi/-/eslint-plugin-hapi-4.1.0.tgz", 541 | "integrity": "sha512-z1yUoSWArx6pXaC0FoWRFpqjbHn8QWonJiTVhJmiC14jOAT7FZKdKWCkhM4jQrgrkEK9YEv3p2HuzSf5dtWmuQ==", 542 | "dev": true, 543 | "requires": { 544 | "hapi-capitalize-modules": "1.x.x", 545 | "hapi-for-you": "1.x.x", 546 | "hapi-no-var": "1.x.x", 547 | "hapi-scope-start": "2.x.x", 548 | "no-arrowception": "1.x.x" 549 | } 550 | }, 551 | "eslint-scope": { 552 | "version": "3.7.3", 553 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", 554 | "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", 555 | "dev": true, 556 | "requires": { 557 | "esrecurse": "^4.1.0", 558 | "estraverse": "^4.1.1" 559 | } 560 | }, 561 | "eslint-visitor-keys": { 562 | "version": "1.3.0", 563 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", 564 | "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", 565 | "dev": true 566 | }, 567 | "espree": { 568 | "version": "3.5.4", 569 | "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", 570 | "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", 571 | "dev": true, 572 | "requires": { 573 | "acorn": "^5.5.0", 574 | "acorn-jsx": "^3.0.0" 575 | } 576 | }, 577 | "esprima": { 578 | "version": "4.0.1", 579 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 580 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 581 | "dev": true 582 | }, 583 | "esquery": { 584 | "version": "1.5.0", 585 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", 586 | "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", 587 | "dev": true, 588 | "requires": { 589 | "estraverse": "^5.1.0" 590 | }, 591 | "dependencies": { 592 | "estraverse": { 593 | "version": "5.3.0", 594 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", 595 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 596 | "dev": true 597 | } 598 | } 599 | }, 600 | "esrecurse": { 601 | "version": "4.3.0", 602 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", 603 | "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 604 | "dev": true, 605 | "requires": { 606 | "estraverse": "^5.2.0" 607 | }, 608 | "dependencies": { 609 | "estraverse": { 610 | "version": "5.3.0", 611 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", 612 | "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", 613 | "dev": true 614 | } 615 | } 616 | }, 617 | "estraverse": { 618 | "version": "4.3.0", 619 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", 620 | "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", 621 | "dev": true 622 | }, 623 | "esutils": { 624 | "version": "2.0.3", 625 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 626 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 627 | "dev": true 628 | }, 629 | "external-editor": { 630 | "version": "2.2.0", 631 | "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", 632 | "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", 633 | "dev": true, 634 | "requires": { 635 | "chardet": "^0.4.0", 636 | "iconv-lite": "^0.4.17", 637 | "tmp": "^0.0.33" 638 | } 639 | }, 640 | "fast-deep-equal": { 641 | "version": "1.1.0", 642 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", 643 | "integrity": "sha512-fueX787WZKCV0Is4/T2cyAdM4+x1S3MXXOAhavE1ys/W42SHAPacLTQhucja22QBYrfGw50M2sRiXPtTGv9Ymw==", 644 | "dev": true 645 | }, 646 | "fast-json-stable-stringify": { 647 | "version": "2.1.0", 648 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 649 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 650 | "dev": true 651 | }, 652 | "fast-levenshtein": { 653 | "version": "2.0.6", 654 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 655 | "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", 656 | "dev": true 657 | }, 658 | "figures": { 659 | "version": "2.0.0", 660 | "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", 661 | "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", 662 | "dev": true, 663 | "requires": { 664 | "escape-string-regexp": "^1.0.5" 665 | } 666 | }, 667 | "file-entry-cache": { 668 | "version": "2.0.0", 669 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", 670 | "integrity": "sha512-uXP/zGzxxFvFfcZGgBIwotm+Tdc55ddPAzF7iHshP4YGaXMww7rSF9peD9D1sui5ebONg5UobsZv+FfgEpGv/w==", 671 | "dev": true, 672 | "requires": { 673 | "flat-cache": "^1.2.1", 674 | "object-assign": "^4.0.1" 675 | } 676 | }, 677 | "find-rc": { 678 | "version": "3.0.1", 679 | "resolved": "https://registry.npmjs.org/find-rc/-/find-rc-3.0.1.tgz", 680 | "integrity": "sha512-hfHlHPO+pdC+ZPNtGCpHl5JDpmodJKSAjxl3AcEHocrnWDAqAcHktZBsKOrd7Obaly7/FnJLs8hVI1VQR/KaXg==", 681 | "dev": true 682 | }, 683 | "flat-cache": { 684 | "version": "1.3.4", 685 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", 686 | "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", 687 | "dev": true, 688 | "requires": { 689 | "circular-json": "^0.3.1", 690 | "graceful-fs": "^4.1.2", 691 | "rimraf": "~2.6.2", 692 | "write": "^0.2.1" 693 | }, 694 | "dependencies": { 695 | "rimraf": { 696 | "version": "2.6.3", 697 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", 698 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", 699 | "dev": true, 700 | "requires": { 701 | "glob": "^7.1.3" 702 | } 703 | } 704 | } 705 | }, 706 | "fs.realpath": { 707 | "version": "1.0.0", 708 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 709 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" 710 | }, 711 | "function-bind": { 712 | "version": "1.1.1", 713 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 714 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", 715 | "dev": true 716 | }, 717 | "functional-red-black-tree": { 718 | "version": "1.0.1", 719 | "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", 720 | "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", 721 | "dev": true 722 | }, 723 | "glob": { 724 | "version": "7.2.3", 725 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", 726 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", 727 | "requires": { 728 | "fs.realpath": "^1.0.0", 729 | "inflight": "^1.0.4", 730 | "inherits": "2", 731 | "minimatch": "^3.1.1", 732 | "once": "^1.3.0", 733 | "path-is-absolute": "^1.0.0" 734 | } 735 | }, 736 | "globals": { 737 | "version": "11.12.0", 738 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 739 | "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", 740 | "dev": true 741 | }, 742 | "graceful-fs": { 743 | "version": "4.2.11", 744 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", 745 | "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", 746 | "dev": true 747 | }, 748 | "graphql": { 749 | "version": "15.8.0", 750 | "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", 751 | "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==" 752 | }, 753 | "graphql-tag": { 754 | "version": "2.12.6", 755 | "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", 756 | "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", 757 | "optional": true, 758 | "requires": { 759 | "tslib": "^2.1.0" 760 | } 761 | }, 762 | "graphql-tools": { 763 | "version": "8.3.20", 764 | "resolved": "https://registry.npmjs.org/graphql-tools/-/graphql-tools-8.3.20.tgz", 765 | "integrity": "sha512-x3VkXkaGyPaZu1G0Vr2x/7yxTiuTB6xpY3RbH2uTjBv01Z+985J3//B81fooTtEf2eySBiyPplMYwFmAybOIrQ==", 766 | "requires": { 767 | "@apollo/client": "~3.2.5 || ~3.3.0 || ~3.4.0 || ~3.5.0 || ~3.6.0 || ~3.7.0", 768 | "@graphql-tools/schema": "^9.0.18", 769 | "tslib": "^2.4.0" 770 | } 771 | }, 772 | "handlebars": { 773 | "version": "4.7.7", 774 | "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", 775 | "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", 776 | "dev": true, 777 | "requires": { 778 | "minimist": "^1.2.5", 779 | "neo-async": "^2.6.0", 780 | "source-map": "^0.6.1", 781 | "uglify-js": "^3.1.4", 782 | "wordwrap": "^1.0.0" 783 | } 784 | }, 785 | "hapi-capitalize-modules": { 786 | "version": "1.1.6", 787 | "resolved": "https://registry.npmjs.org/hapi-capitalize-modules/-/hapi-capitalize-modules-1.1.6.tgz", 788 | "integrity": "sha512-85G4tBkLlclAqtRkE9kzTE4O0tjV0EdYJwfj2iePP0O73c4yg1AF9poyec2HqA7TGhgWPX1CxJaz/qFV2wOc+g==", 789 | "dev": true 790 | }, 791 | "hapi-for-you": { 792 | "version": "1.0.0", 793 | "resolved": "https://registry.npmjs.org/hapi-for-you/-/hapi-for-you-1.0.0.tgz", 794 | "integrity": "sha512-GgXImy7IBOMZ59H34oVb8UO0eDxtGzY5qWa28xUjHo7ET8Z00HuJ/Py6jZVYhfpUUJbr9ulYH+K5hJGqRAjz+g==", 795 | "dev": true 796 | }, 797 | "hapi-no-var": { 798 | "version": "1.0.1", 799 | "resolved": "https://registry.npmjs.org/hapi-no-var/-/hapi-no-var-1.0.1.tgz", 800 | "integrity": "sha512-kk2xyyTzI+eQ/oA1rO4eVdCpYsrPHVERHa6+mTHD08XXFLaAkkaEs6reMg1VyqGh2o5xPt//DO4EhCacLx/cRA==", 801 | "dev": true 802 | }, 803 | "hapi-scope-start": { 804 | "version": "2.1.1", 805 | "resolved": "https://registry.npmjs.org/hapi-scope-start/-/hapi-scope-start-2.1.1.tgz", 806 | "integrity": "sha512-VrA6AMV07yV9J1LniAC1MAvxRAZvl3yZHjm8bHGiS3YD22eEyChs5MyASfG+4HvxkS6aQHiJb01631LVBHglZw==", 807 | "dev": true 808 | }, 809 | "has": { 810 | "version": "1.0.3", 811 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 812 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 813 | "dev": true, 814 | "requires": { 815 | "function-bind": "^1.1.1" 816 | } 817 | }, 818 | "has-ansi": { 819 | "version": "2.0.0", 820 | "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", 821 | "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", 822 | "dev": true, 823 | "requires": { 824 | "ansi-regex": "^2.0.0" 825 | } 826 | }, 827 | "has-flag": { 828 | "version": "3.0.0", 829 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 830 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" 831 | }, 832 | "hoek": { 833 | "version": "4.2.1", 834 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", 835 | "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", 836 | "dev": true 837 | }, 838 | "hoist-non-react-statics": { 839 | "version": "3.3.2", 840 | "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", 841 | "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", 842 | "optional": true, 843 | "requires": { 844 | "react-is": "^16.7.0" 845 | } 846 | }, 847 | "iconv-lite": { 848 | "version": "0.4.24", 849 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 850 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 851 | "dev": true, 852 | "requires": { 853 | "safer-buffer": ">= 2.1.2 < 3" 854 | } 855 | }, 856 | "ignore": { 857 | "version": "3.3.10", 858 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", 859 | "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", 860 | "dev": true 861 | }, 862 | "imurmurhash": { 863 | "version": "0.1.4", 864 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 865 | "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", 866 | "dev": true 867 | }, 868 | "inflight": { 869 | "version": "1.0.6", 870 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 871 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", 872 | "requires": { 873 | "once": "^1.3.0", 874 | "wrappy": "1" 875 | } 876 | }, 877 | "inherits": { 878 | "version": "2.0.4", 879 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 880 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 881 | }, 882 | "inquirer": { 883 | "version": "3.3.0", 884 | "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", 885 | "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", 886 | "dev": true, 887 | "requires": { 888 | "ansi-escapes": "^3.0.0", 889 | "chalk": "^2.0.0", 890 | "cli-cursor": "^2.1.0", 891 | "cli-width": "^2.0.0", 892 | "external-editor": "^2.0.4", 893 | "figures": "^2.0.0", 894 | "lodash": "^4.3.0", 895 | "mute-stream": "0.0.7", 896 | "run-async": "^2.2.0", 897 | "rx-lite": "^4.0.8", 898 | "rx-lite-aggregates": "^4.0.8", 899 | "string-width": "^2.1.0", 900 | "strip-ansi": "^4.0.0", 901 | "through": "^2.3.6" 902 | } 903 | }, 904 | "is-core-module": { 905 | "version": "2.12.1", 906 | "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.12.1.tgz", 907 | "integrity": "sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==", 908 | "dev": true, 909 | "requires": { 910 | "has": "^1.0.3" 911 | } 912 | }, 913 | "is-fullwidth-code-point": { 914 | "version": "2.0.0", 915 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", 916 | "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", 917 | "dev": true 918 | }, 919 | "is-resolvable": { 920 | "version": "1.1.0", 921 | "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", 922 | "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", 923 | "dev": true 924 | }, 925 | "isarray": { 926 | "version": "1.0.0", 927 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 928 | "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", 929 | "dev": true 930 | }, 931 | "isemail": { 932 | "version": "2.2.1", 933 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz", 934 | "integrity": "sha512-LPjFxaTatluwGAJlGe4FtRdzg0a9KlXrahHoHAR4HwRNf90Ttwi6sOQ9zj+EoCPmk9yyK+WFUqkm0imUo8UJbw==", 935 | "dev": true 936 | }, 937 | "isexe": { 938 | "version": "2.0.0", 939 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 940 | "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", 941 | "dev": true 942 | }, 943 | "items": { 944 | "version": "2.1.2", 945 | "resolved": "https://registry.npmjs.org/items/-/items-2.1.2.tgz", 946 | "integrity": "sha512-kezcEqgB97BGeZZYtX/MA8AG410ptURstvnz5RAgyFZ8wQFPMxHY8GpTq+/ZHKT3frSlIthUq7EvLt9xn3TvXg==", 947 | "dev": true 948 | }, 949 | "joi": { 950 | "version": "10.6.0", 951 | "resolved": "https://registry.npmjs.org/joi/-/joi-10.6.0.tgz", 952 | "integrity": "sha512-hBF3LcqyAid+9X/pwg+eXjD2QBZI5eXnBFJYaAkH4SK3mp9QSRiiQnDYlmlz5pccMvnLcJRS4whhDOTCkmsAdQ==", 953 | "dev": true, 954 | "requires": { 955 | "hoek": "4.x.x", 956 | "isemail": "2.x.x", 957 | "items": "2.x.x", 958 | "topo": "2.x.x" 959 | } 960 | }, 961 | "js-tokens": { 962 | "version": "4.0.0", 963 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 964 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 965 | }, 966 | "js-yaml": { 967 | "version": "3.14.1", 968 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", 969 | "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", 970 | "dev": true, 971 | "requires": { 972 | "argparse": "^1.0.7", 973 | "esprima": "^4.0.0" 974 | } 975 | }, 976 | "json-schema-traverse": { 977 | "version": "0.3.1", 978 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", 979 | "integrity": "sha512-4JD/Ivzg7PoW8NzdrBSr3UFwC9mHgvI7Z6z3QGBsSHgKaRTUDmyZAAKJo2UbG1kUVfS9WS8bi36N49U1xw43DA==", 980 | "dev": true 981 | }, 982 | "json-stable-stringify": { 983 | "version": "1.0.2", 984 | "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz", 985 | "integrity": "sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g==", 986 | "dev": true, 987 | "requires": { 988 | "jsonify": "^0.0.1" 989 | } 990 | }, 991 | "json-stable-stringify-without-jsonify": { 992 | "version": "1.0.1", 993 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 994 | "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", 995 | "dev": true 996 | }, 997 | "json-stringify-safe": { 998 | "version": "5.0.1", 999 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 1000 | "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", 1001 | "dev": true 1002 | }, 1003 | "jsonify": { 1004 | "version": "0.0.1", 1005 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", 1006 | "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", 1007 | "dev": true 1008 | }, 1009 | "lab": { 1010 | "version": "14.3.4", 1011 | "resolved": "https://registry.npmjs.org/lab/-/lab-14.3.4.tgz", 1012 | "integrity": "sha512-IFnuYVRd6CtnFTFgUbjPCFrrCIked5BvGH/dX+/h+6pi3IrQrK21JsKy/J1CshEm6sMe980+oswtK8lZCusHSA==", 1013 | "dev": true, 1014 | "requires": { 1015 | "bossy": "3.x.x", 1016 | "code": "4.1.x", 1017 | "diff": "3.5.x", 1018 | "eslint": "4.19.x", 1019 | "eslint-config-hapi": "10.x.x", 1020 | "eslint-plugin-hapi": "4.x.x", 1021 | "espree": "3.5.x", 1022 | "find-rc": "3.0.x", 1023 | "handlebars": "4.x.x", 1024 | "hoek": "4.x.x", 1025 | "items": "2.x.x", 1026 | "json-stable-stringify": "1.x.x", 1027 | "json-stringify-safe": "5.x.x", 1028 | "mkdirp": "0.5.x", 1029 | "seedrandom": "2.4.x", 1030 | "source-map": "0.6.x", 1031 | "source-map-support": "0.4.x", 1032 | "supports-color": "4.4.x" 1033 | }, 1034 | "dependencies": { 1035 | "has-flag": { 1036 | "version": "2.0.0", 1037 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", 1038 | "integrity": "sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng==", 1039 | "dev": true 1040 | }, 1041 | "supports-color": { 1042 | "version": "4.4.0", 1043 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", 1044 | "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", 1045 | "dev": true, 1046 | "requires": { 1047 | "has-flag": "^2.0.0" 1048 | } 1049 | } 1050 | } 1051 | }, 1052 | "levn": { 1053 | "version": "0.3.0", 1054 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", 1055 | "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", 1056 | "dev": true, 1057 | "requires": { 1058 | "prelude-ls": "~1.1.2", 1059 | "type-check": "~0.3.2" 1060 | } 1061 | }, 1062 | "lodash": { 1063 | "version": "4.17.21", 1064 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 1065 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 1066 | }, 1067 | "loose-envify": { 1068 | "version": "1.4.0", 1069 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 1070 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 1071 | "optional": true, 1072 | "requires": { 1073 | "js-tokens": "^3.0.0 || ^4.0.0" 1074 | } 1075 | }, 1076 | "lru-cache": { 1077 | "version": "4.1.5", 1078 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", 1079 | "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", 1080 | "dev": true, 1081 | "requires": { 1082 | "pseudomap": "^1.0.2", 1083 | "yallist": "^2.1.2" 1084 | } 1085 | }, 1086 | "mimic-fn": { 1087 | "version": "1.2.0", 1088 | "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", 1089 | "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", 1090 | "dev": true 1091 | }, 1092 | "minimatch": { 1093 | "version": "3.1.2", 1094 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", 1095 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", 1096 | "requires": { 1097 | "brace-expansion": "^1.1.7" 1098 | } 1099 | }, 1100 | "minimist": { 1101 | "version": "1.2.8", 1102 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", 1103 | "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", 1104 | "dev": true 1105 | }, 1106 | "mkdirp": { 1107 | "version": "0.5.6", 1108 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", 1109 | "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", 1110 | "dev": true, 1111 | "requires": { 1112 | "minimist": "^1.2.6" 1113 | } 1114 | }, 1115 | "ms": { 1116 | "version": "2.1.3", 1117 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 1118 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 1119 | "dev": true 1120 | }, 1121 | "mute-stream": { 1122 | "version": "0.0.7", 1123 | "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", 1124 | "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", 1125 | "dev": true 1126 | }, 1127 | "natural-compare": { 1128 | "version": "1.4.0", 1129 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 1130 | "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", 1131 | "dev": true 1132 | }, 1133 | "neo-async": { 1134 | "version": "2.6.2", 1135 | "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", 1136 | "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", 1137 | "dev": true 1138 | }, 1139 | "no-arrowception": { 1140 | "version": "1.0.0", 1141 | "resolved": "https://registry.npmjs.org/no-arrowception/-/no-arrowception-1.0.0.tgz", 1142 | "integrity": "sha512-MQr2WCU4rbCkaFNDTxHMG/2z5j38gR57tPGfHKt217w+ElOvom1CZX28PcFPxngepjI8e/ZttMWidG1Kqzb/1Q==", 1143 | "dev": true 1144 | }, 1145 | "object-assign": { 1146 | "version": "4.1.1", 1147 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 1148 | "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==" 1149 | }, 1150 | "once": { 1151 | "version": "1.4.0", 1152 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 1153 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", 1154 | "requires": { 1155 | "wrappy": "1" 1156 | } 1157 | }, 1158 | "onetime": { 1159 | "version": "2.0.1", 1160 | "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", 1161 | "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", 1162 | "dev": true, 1163 | "requires": { 1164 | "mimic-fn": "^1.0.0" 1165 | } 1166 | }, 1167 | "optimism": { 1168 | "version": "0.16.2", 1169 | "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.16.2.tgz", 1170 | "integrity": "sha512-zWNbgWj+3vLEjZNIh/okkY2EUfX+vB9TJopzIZwT1xxaMqC5hRLLraePod4c5n4He08xuXNH+zhKFFCu390wiQ==", 1171 | "optional": true, 1172 | "requires": { 1173 | "@wry/context": "^0.7.0", 1174 | "@wry/trie": "^0.3.0" 1175 | }, 1176 | "dependencies": { 1177 | "@wry/trie": { 1178 | "version": "0.3.2", 1179 | "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.3.2.tgz", 1180 | "integrity": "sha512-yRTyhWSls2OY/pYLfwff867r8ekooZ4UI+/gxot5Wj8EFwSf2rG+n+Mo/6LoLQm1TKA4GRj2+LCpbfS937dClQ==", 1181 | "optional": true, 1182 | "requires": { 1183 | "tslib": "^2.3.0" 1184 | } 1185 | } 1186 | } 1187 | }, 1188 | "optionator": { 1189 | "version": "0.8.3", 1190 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", 1191 | "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", 1192 | "dev": true, 1193 | "requires": { 1194 | "deep-is": "~0.1.3", 1195 | "fast-levenshtein": "~2.0.6", 1196 | "levn": "~0.3.0", 1197 | "prelude-ls": "~1.1.2", 1198 | "type-check": "~0.3.2", 1199 | "word-wrap": "~1.2.3" 1200 | } 1201 | }, 1202 | "os-tmpdir": { 1203 | "version": "1.0.2", 1204 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 1205 | "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", 1206 | "dev": true 1207 | }, 1208 | "path-is-absolute": { 1209 | "version": "1.0.1", 1210 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 1211 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" 1212 | }, 1213 | "path-is-inside": { 1214 | "version": "1.0.2", 1215 | "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", 1216 | "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", 1217 | "dev": true 1218 | }, 1219 | "path-parse": { 1220 | "version": "1.0.7", 1221 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 1222 | "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", 1223 | "dev": true 1224 | }, 1225 | "pluralize": { 1226 | "version": "7.0.0", 1227 | "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", 1228 | "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", 1229 | "dev": true 1230 | }, 1231 | "prelude-ls": { 1232 | "version": "1.1.2", 1233 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", 1234 | "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", 1235 | "dev": true 1236 | }, 1237 | "process-nextick-args": { 1238 | "version": "2.0.1", 1239 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 1240 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", 1241 | "dev": true 1242 | }, 1243 | "progress": { 1244 | "version": "2.0.3", 1245 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 1246 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", 1247 | "dev": true 1248 | }, 1249 | "prop-types": { 1250 | "version": "15.8.1", 1251 | "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", 1252 | "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", 1253 | "optional": true, 1254 | "requires": { 1255 | "loose-envify": "^1.4.0", 1256 | "object-assign": "^4.1.1", 1257 | "react-is": "^16.13.1" 1258 | } 1259 | }, 1260 | "pseudomap": { 1261 | "version": "1.0.2", 1262 | "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", 1263 | "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", 1264 | "dev": true 1265 | }, 1266 | "react-is": { 1267 | "version": "16.13.1", 1268 | "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", 1269 | "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", 1270 | "optional": true 1271 | }, 1272 | "readable-stream": { 1273 | "version": "2.3.8", 1274 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", 1275 | "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", 1276 | "dev": true, 1277 | "requires": { 1278 | "core-util-is": "~1.0.0", 1279 | "inherits": "~2.0.3", 1280 | "isarray": "~1.0.0", 1281 | "process-nextick-args": "~2.0.0", 1282 | "safe-buffer": "~5.1.1", 1283 | "string_decoder": "~1.1.1", 1284 | "util-deprecate": "~1.0.1" 1285 | } 1286 | }, 1287 | "regexpp": { 1288 | "version": "1.1.0", 1289 | "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", 1290 | "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", 1291 | "dev": true 1292 | }, 1293 | "require-uncached": { 1294 | "version": "1.0.3", 1295 | "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", 1296 | "integrity": "sha512-Xct+41K3twrbBHdxAgMoOS+cNcoqIjfM2/VxBF4LL2hVph7YsF8VSKyQ3BDFZwEVbok9yeDl2le/qo0S77WG2w==", 1297 | "dev": true, 1298 | "requires": { 1299 | "caller-path": "^0.1.0", 1300 | "resolve-from": "^1.0.0" 1301 | } 1302 | }, 1303 | "resolve": { 1304 | "version": "1.22.2", 1305 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", 1306 | "integrity": "sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==", 1307 | "dev": true, 1308 | "requires": { 1309 | "is-core-module": "^2.11.0", 1310 | "path-parse": "^1.0.7", 1311 | "supports-preserve-symlinks-flag": "^1.0.0" 1312 | } 1313 | }, 1314 | "resolve-from": { 1315 | "version": "1.0.1", 1316 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", 1317 | "integrity": "sha512-kT10v4dhrlLNcnO084hEjvXCI1wUG9qZLoz2RogxqDQQYy7IxjI/iMUkOtQTNEh6rzHxvdQWHsJyel1pKOVCxg==", 1318 | "dev": true 1319 | }, 1320 | "response-iterator": { 1321 | "version": "0.2.6", 1322 | "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", 1323 | "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==", 1324 | "optional": true 1325 | }, 1326 | "restore-cursor": { 1327 | "version": "2.0.0", 1328 | "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", 1329 | "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", 1330 | "dev": true, 1331 | "requires": { 1332 | "onetime": "^2.0.0", 1333 | "signal-exit": "^3.0.2" 1334 | } 1335 | }, 1336 | "rimraf": { 1337 | "version": "3.0.2", 1338 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 1339 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 1340 | "dev": true, 1341 | "requires": { 1342 | "glob": "^7.1.3" 1343 | } 1344 | }, 1345 | "run-async": { 1346 | "version": "2.4.1", 1347 | "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", 1348 | "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", 1349 | "dev": true 1350 | }, 1351 | "rx-lite": { 1352 | "version": "4.0.8", 1353 | "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", 1354 | "integrity": "sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA==", 1355 | "dev": true 1356 | }, 1357 | "rx-lite-aggregates": { 1358 | "version": "4.0.8", 1359 | "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", 1360 | "integrity": "sha512-3xPNZGW93oCjiO7PtKxRK6iOVYBWBvtf9QHDfU23Oc+dLIQmAV//UnyXV/yihv81VS/UqoQPk4NegS8EFi55Hg==", 1361 | "dev": true, 1362 | "requires": { 1363 | "rx-lite": "*" 1364 | } 1365 | }, 1366 | "safe-buffer": { 1367 | "version": "5.1.2", 1368 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 1369 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 1370 | "dev": true 1371 | }, 1372 | "safer-buffer": { 1373 | "version": "2.1.2", 1374 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 1375 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", 1376 | "dev": true 1377 | }, 1378 | "seedrandom": { 1379 | "version": "2.4.4", 1380 | "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-2.4.4.tgz", 1381 | "integrity": "sha512-9A+PDmgm+2du77B5i0Ip2cxOqqHjgNxnBgglxLcX78A2D6c2rTo61z4jnVABpF4cKeDMDG+cmXXvdnqse2VqMA==", 1382 | "dev": true 1383 | }, 1384 | "semver": { 1385 | "version": "5.7.2", 1386 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", 1387 | "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", 1388 | "dev": true 1389 | }, 1390 | "shebang-command": { 1391 | "version": "1.2.0", 1392 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", 1393 | "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", 1394 | "dev": true, 1395 | "requires": { 1396 | "shebang-regex": "^1.0.0" 1397 | } 1398 | }, 1399 | "shebang-regex": { 1400 | "version": "1.0.0", 1401 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", 1402 | "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", 1403 | "dev": true 1404 | }, 1405 | "signal-exit": { 1406 | "version": "3.0.7", 1407 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", 1408 | "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", 1409 | "dev": true 1410 | }, 1411 | "slice-ansi": { 1412 | "version": "1.0.0", 1413 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", 1414 | "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", 1415 | "dev": true, 1416 | "requires": { 1417 | "is-fullwidth-code-point": "^2.0.0" 1418 | } 1419 | }, 1420 | "source-map": { 1421 | "version": "0.6.1", 1422 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 1423 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 1424 | "dev": true 1425 | }, 1426 | "source-map-support": { 1427 | "version": "0.4.18", 1428 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", 1429 | "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", 1430 | "dev": true, 1431 | "requires": { 1432 | "source-map": "^0.5.6" 1433 | }, 1434 | "dependencies": { 1435 | "source-map": { 1436 | "version": "0.5.7", 1437 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 1438 | "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", 1439 | "dev": true 1440 | } 1441 | } 1442 | }, 1443 | "sprintf-js": { 1444 | "version": "1.0.3", 1445 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 1446 | "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", 1447 | "dev": true 1448 | }, 1449 | "string-width": { 1450 | "version": "2.1.1", 1451 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", 1452 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", 1453 | "dev": true, 1454 | "requires": { 1455 | "is-fullwidth-code-point": "^2.0.0", 1456 | "strip-ansi": "^4.0.0" 1457 | } 1458 | }, 1459 | "string_decoder": { 1460 | "version": "1.1.1", 1461 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 1462 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 1463 | "dev": true, 1464 | "requires": { 1465 | "safe-buffer": "~5.1.0" 1466 | } 1467 | }, 1468 | "strip-ansi": { 1469 | "version": "4.0.0", 1470 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", 1471 | "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", 1472 | "dev": true, 1473 | "requires": { 1474 | "ansi-regex": "^3.0.0" 1475 | }, 1476 | "dependencies": { 1477 | "ansi-regex": { 1478 | "version": "3.0.1", 1479 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", 1480 | "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", 1481 | "dev": true 1482 | } 1483 | } 1484 | }, 1485 | "strip-json-comments": { 1486 | "version": "2.0.1", 1487 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 1488 | "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", 1489 | "dev": true 1490 | }, 1491 | "supports-color": { 1492 | "version": "5.5.0", 1493 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 1494 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 1495 | "requires": { 1496 | "has-flag": "^3.0.0" 1497 | } 1498 | }, 1499 | "supports-preserve-symlinks-flag": { 1500 | "version": "1.0.0", 1501 | "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 1502 | "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", 1503 | "dev": true 1504 | }, 1505 | "symbol-observable": { 1506 | "version": "4.0.0", 1507 | "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", 1508 | "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", 1509 | "optional": true 1510 | }, 1511 | "table": { 1512 | "version": "4.0.2", 1513 | "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", 1514 | "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", 1515 | "dev": true, 1516 | "requires": { 1517 | "ajv": "^5.2.3", 1518 | "ajv-keywords": "^2.1.0", 1519 | "chalk": "^2.1.0", 1520 | "lodash": "^4.17.4", 1521 | "slice-ansi": "1.0.0", 1522 | "string-width": "^2.1.1" 1523 | } 1524 | }, 1525 | "text-table": { 1526 | "version": "0.2.0", 1527 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 1528 | "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", 1529 | "dev": true 1530 | }, 1531 | "through": { 1532 | "version": "2.3.8", 1533 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 1534 | "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", 1535 | "dev": true 1536 | }, 1537 | "tmp": { 1538 | "version": "0.0.33", 1539 | "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", 1540 | "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", 1541 | "dev": true, 1542 | "requires": { 1543 | "os-tmpdir": "~1.0.2" 1544 | } 1545 | }, 1546 | "topo": { 1547 | "version": "2.0.2", 1548 | "resolved": "https://registry.npmjs.org/topo/-/topo-2.0.2.tgz", 1549 | "integrity": "sha512-QMfJ9TC5lKcmLZImOZ/BTSWJeVbay7XK2nlzvFALW3BA5OkvBnbs0poku4EsRpDMndDVnM58EU/8D3ZcoVehWg==", 1550 | "dev": true, 1551 | "requires": { 1552 | "hoek": "4.x.x" 1553 | } 1554 | }, 1555 | "ts-invariant": { 1556 | "version": "0.10.3", 1557 | "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", 1558 | "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", 1559 | "optional": true, 1560 | "requires": { 1561 | "tslib": "^2.1.0" 1562 | } 1563 | }, 1564 | "tslib": { 1565 | "version": "2.6.0", 1566 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", 1567 | "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" 1568 | }, 1569 | "tslint": { 1570 | "version": "6.1.3", 1571 | "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", 1572 | "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", 1573 | "dev": true, 1574 | "requires": { 1575 | "@babel/code-frame": "^7.0.0", 1576 | "builtin-modules": "^1.1.1", 1577 | "chalk": "^2.3.0", 1578 | "commander": "^2.12.1", 1579 | "diff": "^4.0.1", 1580 | "glob": "^7.1.1", 1581 | "js-yaml": "^3.13.1", 1582 | "minimatch": "^3.0.4", 1583 | "mkdirp": "^0.5.3", 1584 | "resolve": "^1.3.2", 1585 | "semver": "^5.3.0", 1586 | "tslib": "^1.13.0", 1587 | "tsutils": "^2.29.0" 1588 | }, 1589 | "dependencies": { 1590 | "commander": { 1591 | "version": "2.20.3", 1592 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 1593 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 1594 | "dev": true 1595 | }, 1596 | "diff": { 1597 | "version": "4.0.2", 1598 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 1599 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 1600 | "dev": true 1601 | }, 1602 | "tslib": { 1603 | "version": "1.14.1", 1604 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", 1605 | "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", 1606 | "dev": true 1607 | } 1608 | } 1609 | }, 1610 | "tsutils": { 1611 | "version": "2.29.0", 1612 | "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", 1613 | "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", 1614 | "dev": true, 1615 | "requires": { 1616 | "tslib": "^1.8.1" 1617 | }, 1618 | "dependencies": { 1619 | "tslib": { 1620 | "version": "1.14.1", 1621 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", 1622 | "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", 1623 | "dev": true 1624 | } 1625 | } 1626 | }, 1627 | "type-check": { 1628 | "version": "0.3.2", 1629 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", 1630 | "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", 1631 | "dev": true, 1632 | "requires": { 1633 | "prelude-ls": "~1.1.2" 1634 | } 1635 | }, 1636 | "typedarray": { 1637 | "version": "0.0.6", 1638 | "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", 1639 | "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", 1640 | "dev": true 1641 | }, 1642 | "typescript": { 1643 | "version": "5.1.6", 1644 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", 1645 | "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", 1646 | "dev": true 1647 | }, 1648 | "uglify-js": { 1649 | "version": "3.17.4", 1650 | "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", 1651 | "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", 1652 | "dev": true, 1653 | "optional": true 1654 | }, 1655 | "util-deprecate": { 1656 | "version": "1.0.2", 1657 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 1658 | "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", 1659 | "dev": true 1660 | }, 1661 | "value-or-promise": { 1662 | "version": "1.0.12", 1663 | "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", 1664 | "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==" 1665 | }, 1666 | "which": { 1667 | "version": "1.3.1", 1668 | "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", 1669 | "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", 1670 | "dev": true, 1671 | "requires": { 1672 | "isexe": "^2.0.0" 1673 | } 1674 | }, 1675 | "word-wrap": { 1676 | "version": "1.2.5", 1677 | "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", 1678 | "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", 1679 | "dev": true 1680 | }, 1681 | "wordwrap": { 1682 | "version": "1.0.0", 1683 | "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", 1684 | "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", 1685 | "dev": true 1686 | }, 1687 | "wrappy": { 1688 | "version": "1.0.2", 1689 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 1690 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" 1691 | }, 1692 | "write": { 1693 | "version": "0.2.1", 1694 | "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", 1695 | "integrity": "sha512-CJ17OoULEKXpA5pef3qLj5AxTJ6mSt7g84he2WIskKwqFO4T97d5V7Tadl0DYDk7qyUOQD5WlUlOMChaYrhxeA==", 1696 | "dev": true, 1697 | "requires": { 1698 | "mkdirp": "^0.5.1" 1699 | } 1700 | }, 1701 | "yallist": { 1702 | "version": "2.1.2", 1703 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", 1704 | "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", 1705 | "dev": true 1706 | }, 1707 | "zen-observable": { 1708 | "version": "0.8.15", 1709 | "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", 1710 | "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==", 1711 | "optional": true 1712 | }, 1713 | "zen-observable-ts": { 1714 | "version": "1.2.5", 1715 | "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", 1716 | "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", 1717 | "optional": true, 1718 | "requires": { 1719 | "zen-observable": "0.8.15" 1720 | } 1721 | } 1722 | } 1723 | } 1724 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graphql-schema-utilities", 3 | "version": "1.1.8", 4 | "description": "Merge GraphQL Schema files and validate queries against the merged Schema", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/awslabs/graphql-schema-utilities" 8 | }, 9 | "main": "dist/index.js", 10 | "files": [ 11 | "dist" 12 | ], 13 | "scripts": { 14 | "clean": "rimraf coverage/ dist/ node_modules/", 15 | "build": "npm run lint && tsc", 16 | "prepack": "tsc", 17 | "build:watch": "tsc --watch", 18 | "lint": "tslint -c tslint.json 'src/**/*.ts'", 19 | "pretest": "npm run build", 20 | "test:only": "lab -l -c -S dist/test", 21 | "test": "npm run test:only --", 22 | "test:watch": "npm test -- -w", 23 | "coverage": "lab -c -S -r console -o stdout -r html -o ./coverage/coverage.html ./dist/test", 24 | "release:patch": "npm version patch && npm run release:publish", 25 | "release:minor": "npm version minor && npm run release:publish", 26 | "release:major": "npm version major && npm run release:publish", 27 | "release:publish": "npm publish && git push --follow-tags" 28 | }, 29 | "bin": { 30 | "graphql-schema-utilities": "./dist/cli-launcher.js" 31 | }, 32 | "keywords": [ 33 | "GraphQL", 34 | "Schema stitching", 35 | "validate schema", 36 | "merge schema", 37 | "validate graphql operations", 38 | "graphql schema utilities", 39 | "graphql schema tools" 40 | ], 41 | "author": "Amazon", 42 | "license": "Apache-2.0", 43 | "devDependencies": { 44 | "@types/code": "^4.0.0", 45 | "@types/glob": "^5.0.30", 46 | "@types/graphql": "^14.2.0", 47 | "@types/lab": "^11.1.0", 48 | "@types/mkdirp": "^0.5.0", 49 | "@types/node": "^8.10.49", 50 | "@types/rimraf": "0.0.28", 51 | "code": "^4.0.0", 52 | "lab": "^14.1.0", 53 | "mkdirp": "^0.5.1", 54 | "rimraf": "^3.0.0", 55 | "tslint": "^6.1.3", 56 | "typescript": "^5.0.2" 57 | }, 58 | "dependencies": { 59 | "chalk": "^2.4.2", 60 | "commander": "^6.0.0", 61 | "glob": "^7.1.2", 62 | "graphql": "^15.8.0", 63 | "graphql-tools": "^8.3.19", 64 | "lodash": "^4.17.14" 65 | }, 66 | "typescript": { 67 | "definition": "dist/index.d.ts" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/cli-launcher.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /* 4 | This is the CLI tool to validate scripts against a schema. It uses the API found 5 | in the src/ directory to validate all the files in the file glob CLI parameter. 6 | */ 7 | 8 | import * as program from 'commander'; 9 | import * as fs from 'fs'; 10 | import * as path from 'path'; 11 | import * as cli from './cli'; 12 | import { consoleLogger } from './logger'; 13 | import { printSchemaDefault, printSchemaWithDirectives } from './printers'; 14 | // @ts-ignore 15 | const packageJson = require('../package.json'); 16 | program 17 | .version(packageJson.version) 18 | .usage(`[options] ()`) 19 | .option('-o, --output [pattern]', 20 | 'The file path where the merged schema will be outputted to.') 21 | .option('-s, --schema [pattern]', 22 | 'Use a glob path that would define all of your schema files to merge them into a valid schema.', '') 23 | .option('-r, --rules [pattern]', 24 | 'The file path for your custom rules to validate your operations, and your merged schema.', '') 25 | .option('-p, --operations [pattern]', 26 | 'Use a glob that that contains your graphql operation files to test against the merged schema file.', '') 27 | .option('-q, --quiet', 28 | 'Run in quite mode, suppressing all logs except errors.', false) 29 | .option('-d, --includeDirectives', 30 | 'By default will NOT merge the directives, unless you added this flag.', false) 31 | .parse(process.argv); 32 | 33 | if (!program.schema) { 34 | program.outputHelp(); 35 | } else { 36 | cli.mergeGQLSchemas(program.schema) 37 | .then((schema) => { 38 | let data = ''; 39 | if (program.includeDirectives) { 40 | data = printSchemaWithDirectives(schema); 41 | } else { 42 | data = printSchemaDefault(schema); 43 | } 44 | if (schema.getQueryType().toString() === 'Query' && (!schema.getMutationType() 45 | || schema.getMutationType().toString() === 'Mutation') 46 | && (!schema.getSubscriptionType() 47 | || schema.getSubscriptionType().toString() === 'Subscription')) { 48 | const typeDefs = 49 | `schema { \n query: Query ${schema.getMutationType() 50 | ? '\n mutation: Mutation' : ''} ${schema.getSubscriptionType() 51 | ? '\n subscription: Subscription' : ''} \n}\n\n`; 52 | data = typeDefs + data; 53 | } 54 | 55 | if (!program.quiet) { 56 | process.stdout.write(data); 57 | } 58 | 59 | if (program.output) { 60 | ensureDirectoryExistence(program.output); 61 | fs.writeFile(program.output, data, (err) => { 62 | if (err) { 63 | consoleLogger.error('Error while copying the merged schema into the file. ', program.output, err); 64 | process.exit(1); 65 | } else { 66 | consoleLogger.log('Successfully written merged schema into a file.'); 67 | } 68 | }); 69 | } 70 | if (program.operations) { 71 | if (!program.rules) { 72 | cli.validateOperations(program.operations, schema).catch((error) => { 73 | consoleLogger.error('Operation files are not valid!'); 74 | process.exit(1); 75 | }); 76 | } else { 77 | try { 78 | const setOfRules = require(`${program.rules}`); 79 | cli.validateOperations(program.operations, schema, setOfRules.specifiedRules).catch((error) => { 80 | consoleLogger.error('Operation files are not valid!\n'); 81 | process.exit(1); 82 | }); 83 | } catch (err) { 84 | consoleLogger.error(`Could not read ${(program.rules)} for the custom validation rules. Exiting...`, err); 85 | process.exit(1); 86 | } 87 | } 88 | } 89 | }, 90 | ) 91 | .catch((err) => { 92 | consoleLogger.error('Could not merge Schema files!\n', err); 93 | process.exit(1); 94 | }); 95 | } 96 | 97 | function ensureDirectoryExistence(filePath) { 98 | const dirname = path.dirname(filePath); 99 | if (fs.existsSync(dirname)) { 100 | return true; 101 | } 102 | ensureDirectoryExistence(dirname); 103 | fs.mkdirSync(dirname); 104 | } 105 | -------------------------------------------------------------------------------- /src/cli.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import * as Glob from 'glob'; 3 | import { 4 | DocumentNode, 5 | graphql, 6 | GraphQLError, 7 | GraphQLSchema, 8 | parse, 9 | printSchema, 10 | } from 'graphql'; 11 | import { 12 | makeExecutableSchema, 13 | } from 'graphql-tools'; 14 | import * as validator from './index'; 15 | import { consoleLogger } from './logger'; 16 | import { ValidationRule } from './types'; 17 | import * as utils from './utilities'; 18 | import { validateSchemaWithSourceMap } from './validate-schema'; 19 | 20 | /** 21 | * Returns GraphQLSchema after merging the set of files from the Glob pattern. 22 | * @returns Promise 23 | * @param schemaPattern 24 | */ 25 | export function mergeGQLSchemas(schemaPattern: string): Promise { 26 | return new Promise((resolve, reject) => { 27 | consoleLogger.log(`\nLoading schema from ${schemaPattern}`); 28 | utils.readGlob(schemaPattern).then((files) => { 29 | if (!files.length) { 30 | const noFilesMatching = `No matching files were found with Glob: ${schemaPattern}.`; 31 | consoleLogger.error(noFilesMatching); 32 | reject(new Error(noFilesMatching)); 33 | } 34 | Promise.all( 35 | files.map((file) => 36 | utils 37 | .readFile(file) 38 | .then((subSchema: string) => subSchema) 39 | .catch((error) => { 40 | consoleLogger.error( 41 | `An error occurred while trying to read your graphql schemas in ${schemaPattern}. \n`, 42 | error, 43 | ); 44 | reject(error); 45 | }), 46 | ), 47 | ).then((listOfSchemas: string[]) => { 48 | try { 49 | const map = new Map(); 50 | files.forEach((fileName, index) => { 51 | map.set(fileName, listOfSchemas[index]); 52 | }); 53 | const mergedSchema = validateSchemaWithSourceMap(map); 54 | resolve(mergedSchema); 55 | } catch (errs) { 56 | reject(errs); 57 | } 58 | }); 59 | }); 60 | }); 61 | } 62 | 63 | /** 64 | * Validates your operations against your valid schema object. 65 | * @param queriesPattern 66 | * @param validSchema 67 | */ 68 | export function validateOperations( 69 | queriesPattern: string, 70 | validSchema: GraphQLSchema, 71 | rules?: ReadonlyArray, 72 | ): Promise { 73 | return new Promise((resolve, reject) => { 74 | consoleLogger.log( 75 | `\nValidating queries for ${queriesPattern} using loaded schema`, 76 | ); 77 | 78 | function outputErrors(errs) { 79 | consoleLogger.log('\nErrors found:'); 80 | errs.forEach((err) => { 81 | consoleLogger.log(`\nFile: ${err.file}`); 82 | err.errors.forEach((errStr) => { 83 | consoleLogger.log(`\t${errStr}`); 84 | }); 85 | }); 86 | consoleLogger.log('\n'); 87 | } 88 | 89 | validator 90 | .validateQueryFiles(queriesPattern, validSchema, rules) 91 | .then(() => { 92 | consoleLogger.log('All queries are valid\n'); 93 | resolve(); 94 | }) 95 | .catch((errs) => { 96 | outputErrors(errs); 97 | reject(errs); 98 | }); 99 | }); 100 | } 101 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import * as globUtil from 'glob'; 3 | import { 4 | DocumentNode, 5 | GraphQLError, 6 | GraphQLSchema, 7 | parse, 8 | specifiedRules, 9 | validate, 10 | } from 'graphql'; 11 | import { 12 | ValidationRule, 13 | } from './types'; 14 | import * as utils from './utilities'; 15 | export { mergeGQLSchemas, validateOperations} from './cli'; 16 | 17 | export interface IQueryFileError { 18 | file: string; 19 | errors: string[]; 20 | } 21 | 22 | export interface ILoadQueryCallback { 23 | (err, docs?: DocumentNode[]); 24 | } 25 | 26 | export interface IValidateCallback { 27 | (errors?: IQueryFileError[], results?: DocumentNode[]); 28 | } 29 | 30 | export function validateQuery( 31 | schema: GraphQLSchema, 32 | document: DocumentNode, 33 | rules?: ReadonlyArray, 34 | ): ReadonlyArray { 35 | if (!rules) { 36 | return validate(schema, document); 37 | } else { 38 | return validate(schema, document, rules); 39 | } 40 | } 41 | 42 | export function loadQueryFiles( 43 | glob: string | string[], 44 | callback?: ILoadQueryCallback, 45 | ): Promise { 46 | return new Promise((resolve, reject) => { 47 | function loadAll(files) { 48 | const promises = files.map(utils.readFile); 49 | return Promise.all(promises) 50 | .then((fileResults) => { 51 | const docs = fileResults.map((text: string, index) => parse(text)); 52 | callback ? callback(null, docs) : resolve(docs); 53 | }) 54 | .catch((err) => (callback ? callback(err) : reject(err))); 55 | } 56 | if (glob instanceof Array) { 57 | loadAll(glob); 58 | } else { 59 | utils 60 | .readGlob(glob) 61 | .then(loadAll) 62 | .catch((err) => (callback ? callback(err) : reject(err))); 63 | } 64 | }); 65 | } 66 | 67 | export function validateQueryFiles( 68 | glob: string, 69 | schema: GraphQLSchema, 70 | rules?: ReadonlyArray, 71 | callback?: IValidateCallback, 72 | ): Promise { 73 | return new Promise((resolve, reject) => { 74 | let queries; 75 | utils 76 | .readGlob(glob) 77 | .then((files) => { 78 | queries = files; 79 | return loadQueryFiles(files); 80 | }) 81 | .then((docs) => { 82 | const errors = validateQueries(docs, schema, rules, queries); 83 | if (errors.length) { 84 | callback ? callback(errors) : reject(errors); 85 | } else { 86 | callback ? callback(null, queries) : resolve(queries); 87 | } 88 | }) 89 | .catch((err) => { 90 | const errs = [ 91 | { 92 | errors: [err.toString()], 93 | file: '', 94 | }, 95 | ]; 96 | callback ? callback(errs) : reject(errs); 97 | }); 98 | }); 99 | } 100 | 101 | export function validateQueries( 102 | docs: DocumentNode[], 103 | schema: GraphQLSchema, 104 | rules?: ReadonlyArray, 105 | files?: string[], 106 | ): IQueryFileError[] { 107 | const results = []; 108 | 109 | docs.forEach((doc, index) => { 110 | const errs = validateQuery(schema, doc, rules); 111 | 112 | if (errs.length) { 113 | results.push({ 114 | errors: errs.map((err) => err.toString()), 115 | file: files ? files[index] : '', 116 | }); 117 | } 118 | }); 119 | 120 | return results; 121 | } 122 | -------------------------------------------------------------------------------- /src/logger.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | import * as program from 'commander'; 3 | 4 | export interface ILogger { 5 | error(...args); 6 | warn(...args); 7 | log(...args); 8 | } 9 | 10 | export class ConsoleLogger implements ILogger { 11 | public error(errorMessage: string, ...args) { 12 | console.error(chalk.red(errorMessage), args.length ? args : ''); 13 | } 14 | 15 | public log(message: string, ...args) { 16 | if (!program.quiet) { 17 | console.log(message, args.length ? args : ''); 18 | } 19 | } 20 | 21 | public warn(warnMessage: string, ...args) { 22 | console.warn(chalk.yellow(warnMessage), args.length ? args : ''); 23 | } 24 | } 25 | 26 | export const consoleLogger = new ConsoleLogger(); 27 | -------------------------------------------------------------------------------- /src/printers.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ArgumentNode, 3 | astFromValue, 4 | BooleanValueNode, 5 | EnumValueNode, 6 | FloatValueNode, 7 | GraphQLDirective, 8 | GraphQLEnumType, 9 | GraphQLInputObjectType, 10 | GraphQLInterfaceType, 11 | GraphQLNamedType, 12 | GraphQLObjectType, 13 | GraphQLScalarType, 14 | GraphQLSchema, 15 | GraphQLUnionType, 16 | IntValueNode, 17 | isEnumType, 18 | isInputObjectType, 19 | isInterfaceType, 20 | isIntrospectionType, 21 | isObjectType, 22 | isScalarType, 23 | isSpecifiedDirective, 24 | isSpecifiedScalarType, 25 | isUnionType, 26 | ListValueNode, 27 | NullValueNode, 28 | ObjectValueNode, 29 | print, 30 | printSchema, 31 | StringValueNode, 32 | ValueNode, 33 | } from 'graphql'; 34 | import { printBlockString } from 'graphql/language/blockString'; 35 | import objectValues from 'graphql/polyfills/objectValues'; 36 | 37 | /** 38 | * This method is a workaround for the issue of not being able to print the 39 | * directives fields for the merged schema when using printSchema method 40 | * 41 | * This is mostly copied from GQL v14, but we differ from the reference 42 | * implementation in how we handle printing directives. 43 | * 44 | * The existing implementation will not print directives declared on various 45 | * parts of the AST instead relying on the actual application to handle those at evaluation time. 46 | * 47 | * However, our build system is used to re-present schemas. We need to preserve the directive information 48 | * until the upstream systems can decided what to do with them. 49 | * 50 | * @param schema 51 | */ 52 | export function printSchemaWithDirectives(schema: GraphQLSchema): string { 53 | return printFilteredSchema( 54 | schema, 55 | (n) => !isSpecifiedDirective(n), 56 | isDefinedType, 57 | ); 58 | } 59 | 60 | export function printSchemaDefault(schema: GraphQLSchema): string { 61 | return printSchema(schema); 62 | } 63 | 64 | function printFilteredSchema( 65 | schema: GraphQLSchema, 66 | directiveFilter: (type: GraphQLDirective) => boolean, 67 | typeFilter: (type: GraphQLNamedType) => boolean, 68 | ): string { 69 | const directives = schema.getDirectives().filter(directiveFilter); 70 | const typeMap = schema.getTypeMap(); 71 | const types = objectValues(typeMap) 72 | .sort((type1, type2) => type1.name.localeCompare(type2.name)) 73 | .filter(typeFilter); 74 | 75 | return ( 76 | [printSchemaDefinition(schema)] 77 | .concat( 78 | directives.map((directive) => printDirective(directive)), 79 | types.map((type) => printType(type)), 80 | ) 81 | .filter(Boolean) 82 | .join('\n\n') + '\n' 83 | ); 84 | 85 | } 86 | 87 | function printType(type: GraphQLNamedType): string { 88 | if (isScalarType(type)) { 89 | return printScalar(type); 90 | } else if (isObjectType(type)) { 91 | return printObject(type); 92 | } else if (isInterfaceType(type)) { 93 | return printInterface(type); 94 | } else if (isUnionType(type)) { 95 | return printUnion(type); 96 | } else if (isEnumType(type)) { 97 | return printEnum(type); 98 | } else if (isInputObjectType(type)) { 99 | return printInputObject(type); 100 | } 101 | 102 | // Not reachable. All possible types have been considered. 103 | throw Error('Unexpected type: ' + type); 104 | } 105 | 106 | function printScalar(type: GraphQLScalarType): string { 107 | return printDescription(type) + `scalar ${type.name}`; 108 | } 109 | 110 | 111 | function getImplementedInterfaces(type: GraphQLObjectType | GraphQLInterfaceType): string { 112 | const interfaces = type.getInterfaces(); 113 | const implementedInterfaces = interfaces.length 114 | ? ' implements ' + interfaces.map((i) => i.name).join(' & ') 115 | : ''; 116 | return implementedInterfaces; 117 | } 118 | 119 | function printInterface(type: GraphQLInterfaceType): string { 120 | const implementedInterfaces = getImplementedInterfaces(type); 121 | return ( 122 | printDescription(type) + 123 | `interface ${type.name}${implementedInterfaces}` + 124 | printFields(type) 125 | ); 126 | } 127 | function printObject(type: GraphQLObjectType): string { 128 | const implementedInterfaces = getImplementedInterfaces(type); 129 | return ( 130 | printDescription(type) + 131 | `type ${type.name}${implementedInterfaces}` + 132 | printFields(type) 133 | ); 134 | } 135 | 136 | function printUnion(type: GraphQLUnionType): string { 137 | const types = type.getTypes(); 138 | const possibleTypes = types.length ? ' = ' + types.join(' | ') : ''; 139 | return printDescription(type) + 'union ' + type.name + printDirectiveNode(type.astNode) + possibleTypes; 140 | } 141 | 142 | function printEnum(type: GraphQLEnumType): string { 143 | const values = type 144 | .getValues() 145 | .map( 146 | (value, i) => 147 | printDescription(value, ' ', !i) + 148 | ' ' + 149 | value.name + 150 | printDirectiveField(value), 151 | ); 152 | 153 | return ( 154 | printDescription(type) + `enum ${type.name}` + printBlock(type, values) 155 | ); 156 | } 157 | 158 | function printInputObject(type: GraphQLInputObjectType): string { 159 | const fields = printInputFields(type); 160 | return ( 161 | printDescription(type) + 162 | `input ${type.name}` + 163 | printBlock(type, fields) 164 | ); 165 | } 166 | 167 | function printInputFields(type) { 168 | return objectValues(type.getFields()).map( 169 | (f, i) => 170 | printDescription(f, ' ', !i) + 171 | ' ' + 172 | printInputValue(f), 173 | ); 174 | } 175 | 176 | function printFields(type) { 177 | const fields = objectValues(type.getFields()).map( 178 | (f, i) => 179 | printDescription(f, ' ', !i) + 180 | ' ' + 181 | f.name + 182 | printArgs(f.args, ' ') + 183 | ': ' + 184 | String(f.type) + 185 | printDirectiveField(f), 186 | ); 187 | return printBlock(type, fields); 188 | } 189 | 190 | function printDirectiveField(field) { 191 | const node = field.astNode; 192 | return printDirectiveNode(node); 193 | } 194 | 195 | function printDirectiveNode(node) { 196 | if (!node || !node.directives || node.directives.length === 0) { 197 | return ''; 198 | } 199 | 200 | const directives = node.directives.map( 201 | (directive) => { 202 | let directiveString = ''; 203 | directiveString += ' @'; 204 | directiveString += directive.name.value; 205 | 206 | if (directive.arguments.length > 0) { 207 | directiveString += '('; 208 | directive.arguments.forEach((arg, i) => { 209 | directiveString += printArgument(arg); 210 | if (i !== directive.arguments.length - 1) { 211 | directiveString += ', '; 212 | } 213 | }); 214 | directiveString += ')'; 215 | } 216 | return directiveString; 217 | }); 218 | 219 | return directives.join(''); 220 | } 221 | 222 | function printArgument(node: ArgumentNode) { 223 | return node.name.value 224 | + ': ' 225 | + printArgumentValueNode(node.value); 226 | } 227 | 228 | function printBlock(type, items) { 229 | const directiveStatement = printDirectiveNode(type.astNode); 230 | if (items.length !== 0) { 231 | return directiveStatement + ' {\n' + items.join('\n') + '\n}'; 232 | } else { 233 | return ''; 234 | } 235 | } 236 | 237 | function isDefinedType(type: GraphQLNamedType): boolean { 238 | return !isSpecifiedScalarType(type) && !isIntrospectionType(type); 239 | } 240 | 241 | function printSchemaDefinition(schema: GraphQLSchema): string { 242 | if (isSchemaOfCommonNames(schema)) { 243 | return; 244 | } 245 | 246 | const operationTypes = []; 247 | 248 | const queryType = schema.getQueryType(); 249 | if (queryType) { 250 | operationTypes.push(` query: ${queryType.name}`); 251 | } 252 | 253 | const mutationType = schema.getMutationType(); 254 | if (mutationType) { 255 | operationTypes.push(` mutation: ${mutationType.name}`); 256 | } 257 | 258 | const subscriptionType = schema.getSubscriptionType(); 259 | if (subscriptionType) { 260 | operationTypes.push(` subscription: ${subscriptionType.name}`); 261 | } 262 | 263 | return `schema {\n${operationTypes.join('\n')}\n}`; 264 | } 265 | 266 | function isSchemaOfCommonNames(schema: GraphQLSchema): boolean { 267 | const queryType = schema.getQueryType(); 268 | if (queryType && queryType.name !== 'Query') { 269 | return false; 270 | } 271 | 272 | const mutationType = schema.getMutationType(); 273 | if (mutationType && mutationType.name !== 'Mutation') { 274 | return false; 275 | } 276 | 277 | const subscriptionType = schema.getSubscriptionType(); 278 | return !(subscriptionType && subscriptionType.name !== 'Subscription'); 279 | } 280 | 281 | function printDirective(directive) { 282 | return ( 283 | printDescription(directive) + 284 | 'directive @' + 285 | directive.name + 286 | printArgs(directive.args) + 287 | (directive.isRepeatable ? ' repeatable' : '') + 288 | ' on ' + 289 | directive.locations.join(' | ') 290 | ); 291 | } 292 | 293 | function printDescription( 294 | def, 295 | indentation = '', 296 | firstInBlock = true, 297 | ): string { 298 | if (!def.description) { 299 | return ''; 300 | } 301 | const lines = descriptionLines(def.description, 120 - indentation.length); 302 | const text = lines.join('\n'); 303 | const preferMultipleLines = text.length > 70; 304 | const blockString = printBlockString(text, '', preferMultipleLines); 305 | const prefix = 306 | indentation && !firstInBlock ? '\n' + indentation : indentation; 307 | 308 | return prefix + blockString.replace(/\n/g, '\n' + indentation) + '\n'; 309 | } 310 | 311 | function printArgs(args, indentation = '') { 312 | if (args.length === 0) { 313 | return ''; 314 | } 315 | 316 | // If every arg does not have a description, print them on one line. 317 | if (args.every((arg) => !arg.description)) { 318 | return '(' + args.map(printInputValue).join(', ') + ')'; 319 | } 320 | 321 | return ( 322 | '(\n' + 323 | args 324 | .map( 325 | (arg, i) => 326 | printDescription(arg, ' ' + indentation, !i) + 327 | ' ' + 328 | indentation + 329 | printInputValue(arg), 330 | ) 331 | .join('\n') + 332 | '\n' + 333 | indentation + 334 | ')' 335 | ); 336 | } 337 | 338 | function printInputValue(arg) { 339 | const defaultAST = astFromValue(arg.defaultValue, arg.type); 340 | // printDirectiveNode 341 | let argDecl = arg.name + ': ' + String(arg.type) + printDirectiveField(arg); 342 | if (defaultAST) { 343 | argDecl += ` = ${print(defaultAST)}`; 344 | } 345 | return argDecl; 346 | } 347 | 348 | function printArgumentValueNode(type: ValueNode) { 349 | switch (type.kind) { 350 | case 'BooleanValue': 351 | return printLiteralArgumentValueNode(type as BooleanValueNode); 352 | 353 | case 'FloatValue': 354 | return printLiteralArgumentValueNode(type as FloatValueNode); 355 | 356 | case 'IntValue': 357 | return printLiteralArgumentValueNode(type as IntValueNode); 358 | 359 | case 'NullValue': 360 | return printNullValueNode(type as NullValueNode); 361 | 362 | case 'StringValue': 363 | return printStringValueNode(type as StringValueNode); 364 | 365 | case 'ListValue': 366 | return printListValueNode(type as ListValueNode); 367 | 368 | case 'EnumValue': 369 | return printEnumValueNode(type as EnumValueNode); 370 | 371 | case 'ObjectValue': 372 | return printObjectValueNode(type as ObjectValueNode); 373 | } 374 | 375 | throw Error('Cannot print complex directive of type: ' + String(type.kind)); 376 | } 377 | 378 | function printLiteralArgumentValueNode(node: IntValueNode | FloatValueNode | BooleanValueNode) { 379 | return node.value; 380 | } 381 | 382 | function printStringValueNode(node: StringValueNode) { 383 | return '"' + node.value + '"'; 384 | } 385 | 386 | function printNullValueNode(node: NullValueNode) { 387 | return null; 388 | } 389 | 390 | function printListValueNode(node: ListValueNode) { 391 | return '[' + node.values.map(printArgumentValueNode).join(', ') + ']'; 392 | } 393 | 394 | function printEnumValueNode(node: EnumValueNode) { 395 | return node.value; 396 | } 397 | 398 | function printObjectValueNode(node) { 399 | return '{' + node.fields.map(printObjectField).join(', ') + '}'; 400 | } 401 | 402 | function printObjectField(field) { 403 | return field.name.value + ': ' + printArgumentValueNode(field.value); 404 | } 405 | 406 | function descriptionLines(description: string, maxLen: number): string[] { 407 | const rawLines = description.split('\n'); 408 | const updatedLines = []; 409 | for (const line of rawLines) { 410 | if (line.length < maxLen + 5) { 411 | updatedLines.push(line); 412 | } else { 413 | // For > 120 character long lines, cut at space boundaries into sublines 414 | // of ~80 chars. 415 | const brokenLines = breakLine(line, maxLen); 416 | for (const brokenLine of brokenLines) { 417 | updatedLines.push(brokenLine); 418 | } 419 | } 420 | } 421 | return updatedLines; 422 | } 423 | 424 | function breakLine(line: string, maxLen: number): string[] { 425 | const parts = line.split(new RegExp(`((?: |^).{15,${maxLen - 40}}(?= |$))`)); 426 | if (parts.length < 4) { 427 | return [line]; 428 | } 429 | const sublines = [parts[0] + parts[1] + parts[2]]; 430 | for (let i = 3; i < parts.length; i += 2) { 431 | sublines.push(parts[i].slice(1) + parts[i + 1]); 432 | } 433 | return sublines; 434 | } 435 | -------------------------------------------------------------------------------- /src/test/cli.test.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'code'; 2 | import * as Lab from 'lab'; 3 | export const lab = Lab.script(); 4 | 5 | const describe = lab.describe; 6 | const it = lab.it; 7 | const before = lab.before; 8 | 9 | import * as fs from 'fs'; 10 | import * as graphql from 'graphql'; 11 | import * as mkdirp from 'mkdirp'; 12 | import * as rimraf from 'rimraf'; 13 | import * as cli from '../cli'; 14 | 15 | describe('GraphQL Validator CLI', () => { 16 | describe('#mergeGQLSchemas', () => { 17 | describe('when loading a schema glob', () => { 18 | const glob = './fixtures/schema/**/*.graphql'; 19 | let schema; 20 | before((done) => { 21 | cli.mergeGQLSchemas(glob).then((s) => { 22 | schema = s; 23 | done(); 24 | }); 25 | }); 26 | 27 | it('expect schema to be a graphql schema', (done) => { 28 | expect(schema).to.exist(); 29 | expect(schema).to.be.an.instanceof(graphql.GraphQLSchema); 30 | done(); 31 | }); 32 | }); 33 | 34 | describe(`When merging schema files with duplicate types.`, () => { 35 | const glob = './fixtures/invalidSchemas/**/*.graphql'; 36 | let err; 37 | before((done) => { 38 | cli.mergeGQLSchemas(glob).catch((e) => { 39 | err = e; 40 | done(); 41 | }, 42 | ); 43 | }); 44 | 45 | it('schema wont merge when having duplicate types', (done) => { 46 | expect(err).to.exist(); 47 | done(); 48 | }); 49 | }); 50 | }); 51 | 52 | describe(`when loading an invalid glob`, () => { 53 | const glob = './fixtures/not/an/existing/path'; 54 | let errs; 55 | cli.mergeGQLSchemas(glob).catch((e) => { 56 | errs = e; 57 | }); 58 | 59 | it('expect error to exist', (done) => { 60 | expect(errs).to.exist(); 61 | done(); 62 | }); 63 | }); 64 | 65 | describe('#validateQueries', () => { 66 | let schema: graphql.GraphQLSchema; 67 | before(() => cli.mergeGQLSchemas('./fixtures/schema/**/*.graphql').then((r) => schema = r)); 68 | 69 | describe('when validating a query glob', () => { 70 | let results; 71 | const glob = './fixtures/queries/*.graphql'; 72 | before((done) => { 73 | cli.validateOperations(glob, schema).then((r) => { 74 | results = r; 75 | done(); 76 | }); 77 | }); 78 | 79 | it('expect results to be empty', (done) => { 80 | expect(results).to.be.undefined(); 81 | done(); 82 | }); 83 | }); 84 | 85 | describe('when validating a query glob with invalid queries', () => { 86 | let errs; 87 | const glob = './fixtures/queries/**/*.graphql'; 88 | before((done) => { 89 | cli.validateOperations(glob, schema).catch((e) => { 90 | errs = e; 91 | done(); 92 | }); 93 | }); 94 | 95 | it('expect validation results to exist', (done) => { 96 | expect(errs).to.be.an.array(); 97 | expect(errs.length).to.equal(1); 98 | done(); 99 | }); 100 | }); 101 | 102 | describe('when validating a glob with unreadable files', () => { 103 | const root = './fixtures/queries/unreadable'; 104 | const glob = `${root}/*.graphql`; 105 | let errs; 106 | before((done) => { 107 | mkdirp(root, () => { 108 | fs.writeFile(`${root}/operation.graphql`, 'hello', { mode: '333' }, (err) => { 109 | cli.validateOperations(glob, schema).catch((e) => { 110 | errs = e; 111 | rimraf(root, done); 112 | }); 113 | }); 114 | }); 115 | }); 116 | 117 | it('expect error to exist', (done) => { 118 | expect(errs).to.exist(); 119 | expect(errs.length).to.equal(1); 120 | done(); 121 | }); 122 | }); 123 | }); 124 | }); 125 | -------------------------------------------------------------------------------- /src/test/index.test.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'code'; 2 | import * as Lab from 'lab'; 3 | export const lab = Lab.script(); 4 | 5 | const describe = lab.describe; 6 | const it = lab.it; 7 | const before = lab.before; 8 | 9 | import * as fs from 'fs'; 10 | import * as globUtil from 'glob'; 11 | import * as graphql from 'graphql'; 12 | import * as mkdirp from 'mkdirp'; 13 | import * as rimraf from 'rimraf'; 14 | import { mergeGQLSchemas } from '../cli'; 15 | import * as schemaUtilities from '../index'; 16 | 17 | describe('GraphQL Validator', () => { 18 | 19 | describe('#mergeGQLSchemas', () => { 20 | describe('when loading a schema glob', () => { 21 | const glob = './fixtures/schema/**/*.graphql'; 22 | let schema; 23 | before((done) => { 24 | schemaUtilities.mergeGQLSchemas(glob).then((s) => { 25 | schema = s; 26 | done(); 27 | }); 28 | }); 29 | 30 | it('expect schema to be a graphql schema', (done) => { 31 | expect(schema).to.exist(); 32 | expect(schema).to.be.an.instanceof(graphql.GraphQLSchema); 33 | done(); 34 | }); 35 | }); 36 | 37 | describe(`When merging schema files with duplicate types.`, () => { 38 | const glob = './fixtures/invalidSchemas/**/*.graphql'; 39 | let err; 40 | before((done) => { 41 | schemaUtilities.mergeGQLSchemas(glob).catch((e) => { 42 | err = e; 43 | done(); 44 | }, 45 | ); 46 | }); 47 | 48 | it('schema wont merge when having duplicate types', (done) => { 49 | expect(err).to.exist(); 50 | done(); 51 | }); 52 | }); 53 | }); 54 | 55 | describe(`when loading an invalid glob`, () => { 56 | const glob = './fixtures/not/an/existing/path'; 57 | let errs; 58 | schemaUtilities.mergeGQLSchemas(glob).catch((e) => { 59 | errs = e; 60 | }); 61 | 62 | it('expect error to exist', (done) => { 63 | expect(errs).to.exist(); 64 | done(); 65 | }); 66 | }); 67 | 68 | describe('#validateQueries', () => { 69 | let schema: graphql.GraphQLSchema; 70 | before(() => schemaUtilities.mergeGQLSchemas('./fixtures/schema/**/*.graphql').then((r) => schema = r)); 71 | 72 | describe('when validating a query glob', () => { 73 | let results; 74 | const glob = './fixtures/queries/*.graphql'; 75 | before((done) => { 76 | schemaUtilities.validateOperations(glob, schema).then((r) => { 77 | results = r; 78 | done(); 79 | }); 80 | }); 81 | 82 | it('expect results to be empty', (done) => { 83 | expect(results).to.be.undefined(); 84 | done(); 85 | }); 86 | }); 87 | 88 | describe('when validating a query glob with invalid queries', () => { 89 | let errs; 90 | const glob = './fixtures/queries/**/*.graphql'; 91 | before((done) => { 92 | schemaUtilities.validateOperations(glob, schema).catch((e) => { 93 | errs = e; 94 | done(); 95 | }); 96 | }); 97 | 98 | it('expect validation results to exist', (done) => { 99 | expect(errs).to.be.an.array(); 100 | expect(errs.length).to.equal(1); 101 | done(); 102 | }); 103 | }); 104 | 105 | describe('when validating a glob with unreadable files', () => { 106 | const root = './fixtures/queries/unreadable'; 107 | const glob = `${root}/*.graphql`; 108 | let errs; 109 | before((done) => { 110 | mkdirp(root, () => { 111 | fs.writeFile(`${root}/operation.graphql`, 'hello', { mode: '333' }, (err) => { 112 | schemaUtilities.validateOperations(glob, schema).catch((e) => { 113 | errs = e; 114 | rimraf(root, done); 115 | }); 116 | }); 117 | }); 118 | }); 119 | 120 | it('expect error to exist', (done) => { 121 | expect(errs).to.exist(); 122 | expect(errs.length).to.equal(1); 123 | done(); 124 | }); 125 | }); 126 | }); 127 | 128 | let graphqlSchema: graphql.GraphQLSchema; 129 | before(() => 130 | mergeGQLSchemas('./fixtures/schema/**/*.graphql').then((r) => (graphqlSchema = r)), 131 | ); 132 | 133 | describe('when validating a valid query', () => { 134 | let results; 135 | before((done) => { 136 | const query = graphql.parse(`{allPeople{name}}`); 137 | results = schemaUtilities.validateQuery(graphqlSchema, query); 138 | done(); 139 | }); 140 | 141 | it('expect results to be an empty array', (done) => { 142 | expect(results).to.exist(); 143 | expect(results.length).to.equal(0); 144 | done(); 145 | }); 146 | }); 147 | 148 | describe('when validating a invalid query', () => { 149 | let results; 150 | before((done) => { 151 | const query = graphql.parse(`{allPeople{anInvalidFieldName}}`); 152 | results = schemaUtilities.validateQuery(graphqlSchema, query); 153 | done(); 154 | }); 155 | 156 | it('expect errors to exist', (done) => { 157 | expect(results.length).to.equal(1); 158 | expect(results[0].message).to.contain('anInvalidFieldName'); 159 | done(); 160 | }); 161 | }); 162 | 163 | describe('#loadQueryFiles', () => { 164 | describe('when loading a query glob', () => { 165 | const gqlGlob = './fixtures/queries/{allFilms,allPeople}.graphql'; 166 | let results; 167 | let cbResults; 168 | before((done) => { 169 | schemaUtilities.loadQueryFiles(gqlGlob).then((r) => { 170 | results = r; 171 | schemaUtilities.loadQueryFiles(gqlGlob, (err, cbr) => { 172 | cbResults = cbr; 173 | done(); 174 | }); 175 | }); 176 | }); 177 | 178 | it('expect results to be two', (done) => { 179 | expect(results.length).to.equal(2); 180 | done(); 181 | }); 182 | it('expect callback results to be two', (done) => { 183 | expect(cbResults.length).to.equal(2); 184 | done(); 185 | }); 186 | }); 187 | 188 | describe('when passing an invalid glob', () => { 189 | const gqlGlob = './fixtures/queries/{allFilms,allPeople}.test'; 190 | let results; 191 | let cbResults; 192 | before((done) => { 193 | schemaUtilities.loadQueryFiles(gqlGlob).then((r) => { 194 | results = r; 195 | schemaUtilities.loadQueryFiles(gqlGlob, (err, cbr) => { 196 | cbResults = cbr; 197 | done(); 198 | }); 199 | }); 200 | }); 201 | 202 | it('expect results to empty', (done) => { 203 | expect(results.length).to.exist(); 204 | done(); 205 | }); 206 | it('expect callback results to empty', (done) => { 207 | expect(cbResults.length).to.exist(); 208 | done(); 209 | }); 210 | }); 211 | 212 | describe('when accessing inaccessable path in glob', () => { 213 | const root = './fixtures/test'; 214 | const gqlGlob = `${root}/*.graphql`; 215 | let results; 216 | let cbResults; 217 | before((done) => { 218 | mkdirp(root, '333', () => { 219 | schemaUtilities.loadQueryFiles(gqlGlob).catch((r) => { 220 | results = r; 221 | schemaUtilities.loadQueryFiles(gqlGlob, (cbr) => { 222 | cbResults = cbr; 223 | rimraf(root, done); 224 | }); 225 | }); 226 | }); 227 | }); 228 | 229 | it('expect error to exist', (done) => { 230 | expect(results).to.exist(); 231 | done(); 232 | }); 233 | it('expect callback error to exist', (done) => { 234 | expect(cbResults).to.exist(); 235 | done(); 236 | }); 237 | }); 238 | 239 | describe('when accessing unreadable file in glob', () => { 240 | const root = './fixtures/queries/unreadable'; 241 | const gqlGlob = `${root}/*.graphql`; 242 | let results; 243 | let cbResults; 244 | before((done) => { 245 | mkdirp(root, () => { 246 | fs.writeFile( 247 | `${root}/operation.graphql`, 248 | 'hello', 249 | { mode: 333 }, 250 | (err) => { 251 | schemaUtilities.loadQueryFiles(gqlGlob).catch((r) => { 252 | results = r; 253 | schemaUtilities.loadQueryFiles(gqlGlob, (cbr) => { 254 | cbResults = cbr; 255 | rimraf(root, done); 256 | }); 257 | }); 258 | }, 259 | ); 260 | }); 261 | }); 262 | 263 | it('expect error to exist', (done) => { 264 | expect(results).to.exist(); 265 | done(); 266 | }); 267 | it('expect callback error to exist', (done) => { 268 | expect(cbResults).to.exist(); 269 | done(); 270 | }); 271 | }); 272 | 273 | describe('when loading a query file array', () => { 274 | let results; 275 | let fileNames; 276 | let cbResults; 277 | before((done) => { 278 | globUtil('./fixtures/queries/*.graphql', (_, files) => { 279 | fileNames = files; 280 | schemaUtilities.loadQueryFiles(files).then((r) => { 281 | results = r; 282 | schemaUtilities.loadQueryFiles(files, (err, cbr) => { 283 | cbResults = cbr; 284 | done(); 285 | }); 286 | }); 287 | }); 288 | }); 289 | 290 | it('should load one query per file', (done) => { 291 | expect(results.length).to.equal(fileNames.length); 292 | done(); 293 | }); 294 | it('should load one query per file by callback', (done) => { 295 | expect(cbResults.length).to.equal(fileNames.length); 296 | done(); 297 | }); 298 | }); 299 | }); 300 | 301 | describe('#validateQueryFiles', () => { 302 | describe('when validating a query array', () => { 303 | let results; 304 | before(() => { 305 | return schemaUtilities 306 | .loadQueryFiles('./fixtures/queries/*.graphql') 307 | .then((queries) => { 308 | results = schemaUtilities.validateQueries(queries, graphqlSchema); 309 | }); 310 | }); 311 | 312 | it('expect results to be emtpy', (done) => { 313 | expect(results.length).to.equal(0); 314 | done(); 315 | }); 316 | }); 317 | 318 | describe('when validating a query array with invalid queries', () => { 319 | let results; 320 | before(() => { 321 | return schemaUtilities 322 | .loadQueryFiles('./fixtures/queries/**/*.graphql') 323 | .then((queries) => { 324 | results = schemaUtilities.validateQueries(queries, graphqlSchema); 325 | }); 326 | }); 327 | 328 | it('expect results to be equal 1', (done) => { 329 | expect(results.length).to.equal(1); 330 | done(); 331 | }); 332 | }); 333 | 334 | describe('when validating a query glob', () => { 335 | const gqlGlob = './fixtures/queries/*.graphql'; 336 | let results; 337 | let cbResults; 338 | before((done) => { 339 | schemaUtilities.validateQueryFiles(gqlGlob, graphqlSchema).then((r) => { 340 | results = r; 341 | schemaUtilities.validateQueryFiles(gqlGlob, graphqlSchema, [], (err, cbr) => { 342 | cbResults = cbr; 343 | done(); 344 | }); 345 | }); 346 | }); 347 | 348 | it('expect results to be empty', (done) => { 349 | expect(results) 350 | .to.be.instanceOf(Array) 351 | .and.to.have.length(2) 352 | .and.to.contain('./fixtures/queries/allFilms.graphql') 353 | .and.to.contain('./fixtures/queries/allPeople.graphql'); 354 | done(); 355 | }); 356 | it('expect callback results to be empty', (done) => { 357 | expect(cbResults) 358 | .to.be.instanceOf(Array) 359 | .and.to.have.length(2) 360 | .and.to.contain('./fixtures/queries/allFilms.graphql') 361 | .and.to.contain('./fixtures/queries/allPeople.graphql'); 362 | done(); 363 | }); 364 | }); 365 | 366 | describe('when validating a query glob with invalid queries', () => { 367 | const gqlGlob = './fixtures/queries/**/*.graphql'; 368 | let results; 369 | let cbResults; 370 | before((done) => { 371 | schemaUtilities.validateQueryFiles(gqlGlob, graphqlSchema).catch((r) => { 372 | results = r; 373 | schemaUtilities.validateQueryFiles(gqlGlob, graphqlSchema, [], (err, cbr) => { 374 | cbResults = cbr; 375 | done(); 376 | }); 377 | }); 378 | }); 379 | 380 | it('expect validation results to exist', (done) => { 381 | expect(results).to.be.an.array(); 382 | expect(results.length).to.equal(1); 383 | done(); 384 | }); 385 | }); 386 | 387 | describe('when validating a glob with unreadable files', () => { 388 | const root = './fixtures/queries/unreadable'; 389 | const gqlGlob = `${root}/*.graphql`; 390 | let results; 391 | let cbResults; 392 | before((done) => { 393 | mkdirp(root, () => { 394 | fs.writeFile( 395 | `${root}/operation.graphql`, 396 | 'hello', 397 | { mode: '333' }, 398 | (err) => { 399 | schemaUtilities.validateQueryFiles(gqlGlob, graphqlSchema).catch((r) => { 400 | results = r; 401 | schemaUtilities.validateQueryFiles(gqlGlob, graphqlSchema, [], (cbr) => { 402 | cbResults = cbr; 403 | rimraf(root, done); 404 | }); 405 | }); 406 | }, 407 | ); 408 | }); 409 | }); 410 | 411 | it('expect error to exist', (done) => { 412 | expect(results).to.exist(); 413 | done(); 414 | }); 415 | it('expect callback error to exist', (done) => { 416 | expect(cbResults).to.exist(); 417 | done(); 418 | }); 419 | }); 420 | }); 421 | }); 422 | -------------------------------------------------------------------------------- /src/test/printers.test.ts: -------------------------------------------------------------------------------- 1 | import { expect } from 'code'; 2 | import * as Lab from 'lab'; 3 | export const lab = Lab.script(); 4 | 5 | const describe = lab.describe; 6 | const it = lab.it; 7 | const before = lab.before; 8 | 9 | import * as fs from 'fs'; 10 | import * as cli from '../cli'; 11 | import * as printers from '../printers'; 12 | 13 | describe('GraphQL Schema Printers', () => { 14 | describe('#printSchemaWithDirectives', () => { 15 | describe(`When loading and printing a schema with directives.`, () => { 16 | const glob = './fixtures/directiveSchemas/**/*.graphql'; 17 | let printedSchema; 18 | before((done) => { 19 | cli.mergeGQLSchemas(glob).then((s) => { 20 | printedSchema = printers.printSchemaWithDirectives(s); 21 | done(); 22 | }); 23 | }); 24 | 25 | it('Has symmetric equality preserving directives', (done) => { 26 | expect(printedSchema).to.exist(); 27 | const expectedSchema: string = fs.readFileSync( 28 | './fixtures/expectedOutput/directiveSchemas/printedWithDirectives.graphql', 'utf8'); 29 | expect(printedSchema).to.equal(expectedSchema); 30 | done(); 31 | }); 32 | }); 33 | 34 | describe(`When loading and printing the canonical schema example.`, () => { 35 | const glob = './fixtures/helloWorld/**/*.graphql'; 36 | let printedSchema: string; 37 | before((done) => { 38 | cli.mergeGQLSchemas(glob).then((s) => { 39 | printedSchema = printers.printSchemaWithDirectives(s); 40 | done(); 41 | }); 42 | }); 43 | 44 | it('Has symmetric equality preserving directives', (done) => { 45 | expect(printedSchema).to.exist(); 46 | const expectedSchema: string = fs.readFileSync( 47 | './fixtures/expectedOutput/helloWorld/expectedOutput.graphql', 'utf8'); 48 | expect(printedSchema).to.equal(expectedSchema); 49 | done(); 50 | }); 51 | }); 52 | 53 | describe(`When loading and printing the custom input object in directive arguments.`, () => { 54 | const glob = './fixtures/inputObjectInDirective/**/*.graphql'; 55 | let printedSchema: string; 56 | before((done) => { 57 | cli.mergeGQLSchemas(glob).then((s) => { 58 | printedSchema = printers.printSchemaWithDirectives(s); 59 | done(); 60 | }); 61 | }); 62 | 63 | it('Has symmetric equality preserving directives', (done) => { 64 | expect(printedSchema).to.exist(); 65 | const expectedSchema: string = fs.readFileSync( 66 | './fixtures/expectedOutput/inputObjectInDirective/printedInputObject.graphql', 'utf8'); 67 | expect(printedSchema).to.equal(expectedSchema); 68 | done(); 69 | }); 70 | }); 71 | }); 72 | 73 | describe('#printSchemaDefault', () => { 74 | describe(`When loading and printing a schema with directives.`, () => { 75 | const glob = './fixtures/directiveSchemas/**/*.graphql'; 76 | let printedSchema: string; 77 | before((done) => { 78 | cli.mergeGQLSchemas(glob).then((s) => { 79 | printedSchema = printers.printSchemaDefault(s); 80 | done(); 81 | }); 82 | }); 83 | 84 | it('Has symmetric equality without custom directives', (done) => { 85 | expect(printedSchema).to.exist(); 86 | const expectedSchema: string = fs.readFileSync( 87 | './fixtures/expectedOutput/directiveSchemas/printedDefault.graphql', 'utf8'); 88 | expect(printedSchema).to.equal(expectedSchema); 89 | done(); 90 | }); 91 | }); 92 | 93 | describe(`When loading and printing the canonical schema example with directives.`, () => { 94 | const glob = './fixtures/helloWorld/**/*.graphql'; 95 | let printedSchema: string; 96 | before((done) => { 97 | cli.mergeGQLSchemas(glob).then((s) => { 98 | printedSchema = printers.printSchemaWithDirectives(s); 99 | done(); 100 | }); 101 | }); 102 | 103 | it('Has symmetric equality preserving directives', (done) => { 104 | expect(printedSchema).to.exist(); 105 | const expectedSchema: string = fs.readFileSync( 106 | './fixtures/expectedOutput/helloWorld/expectedOutput.graphql', 'utf8'); 107 | expect(printedSchema).to.equal(expectedSchema); 108 | done(); 109 | }); 110 | }); 111 | }); 112 | }); 113 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ASTVisitor, 3 | ValidationContext, 4 | } from 'graphql'; 5 | 6 | /** 7 | * The Custom validation rules to validate the against merged schema and operation files. 8 | */ 9 | export type ValidationRule = (context: ValidationContext) => ASTVisitor; 10 | -------------------------------------------------------------------------------- /src/utilities.ts: -------------------------------------------------------------------------------- 1 | import * as fs from 'fs'; 2 | import * as globUtil from 'glob'; 3 | 4 | export function readGlob(pattern: string): Promise { 5 | return new Promise((resolve, reject) => { 6 | globUtil(pattern, { silent: false }, (err, files) => { 7 | if (err) { 8 | reject(err); 9 | } 10 | resolve(files); 11 | }); 12 | }); 13 | } 14 | 15 | export function readFile(file: string): Promise { 16 | return new Promise((resolve, reject) => { 17 | fs.readFile(file, 'utf8', (err, data) => 18 | err ? reject(err) : resolve(data), 19 | ); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /src/validate-schema.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | import * as fs from 'fs'; 3 | import { GraphQLError, GraphQLSchema } from 'graphql'; 4 | import { 5 | makeExecutableSchema, 6 | } from 'graphql-tools'; 7 | import * as validator from './index'; 8 | import { consoleLogger } from './logger'; 9 | 10 | /** 11 | * Validates the schema against Syntax and Semantics errors. 12 | * If an error is found then will log the file path that is causing the schema error and the error message itself. 13 | * @param map that contains filename as key and the file content as the value. 14 | */ 15 | export const validateSchemaWithSourceMap = ( 16 | map: Map, 17 | ): GraphQLSchema => { 18 | let errorCounter = 0; 19 | const listOfErrors: string[] = []; 20 | const errorsSeparator = '\n\n'; 21 | const listOfSchemas: string[] = Array.from(map.values()); 22 | const fileNames: string[] = Array.from(map.keys()); 23 | try { 24 | const mergedSchema = makeExecutableSchema({ typeDefs: listOfSchemas }); 25 | return mergedSchema; 26 | } catch (allErrors) { 27 | const allErrorsMessages: string = allErrors.message; 28 | const allErrorsList: string[] = allErrorsMessages.split(errorsSeparator); 29 | const errorListClone: string[] = allErrorsList.slice(); 30 | let listOfUnMappedErrors: string[] = allErrorsList.slice(); 31 | for (let i = 0; i < listOfSchemas.length; i++) { 32 | try { 33 | const fileSchema = makeExecutableSchema({ typeDefs: listOfSchemas[i] }); 34 | } catch (error) { 35 | const errorsMessages: string = error.message; 36 | const errorsList = errorsMessages.split(errorsSeparator); 37 | errorsList.forEach((errorItem) => { 38 | allErrorsList.forEach((allErrorsItem, x) => { 39 | const locations = error.locations; 40 | // If the Error exists in both the mergedschema and in the file X, then file X is the reason. 41 | // Special case for the locations here. 42 | // It is because the location in the merged file will be different from the file itself. 43 | if (allErrorsItem.includes(errorItem) || error.locations) { 44 | listOfErrors.push( 45 | constructErrorMessage(++errorCounter, errorItem, fileNames[i]), 46 | ); 47 | listOfUnMappedErrors = popError(listOfUnMappedErrors, errorItem); 48 | if (locations) { 49 | // Syntax error found. locations are only availble for syntax errors. 50 | consoleLogger.error('Location of errors: ', locations); 51 | } 52 | const index = errorListClone.indexOf(allErrorsItem); 53 | if (index > -1) { 54 | errorListClone.splice(index, 1); 55 | } 56 | } 57 | }); 58 | }); 59 | } 60 | } 61 | 62 | // The loop below detects if there is an error in mergedschema but not in mergedschema without file X, 63 | // then file X is the reason for that error. 64 | for (let i = 0; i < listOfSchemas.length; i++) { 65 | try { 66 | const schemaWithoutFilei = listOfSchemas.slice(); 67 | const index = schemaWithoutFilei.indexOf(listOfSchemas[i]); 68 | if (index > -1) { 69 | schemaWithoutFilei.splice(index, 1); 70 | } 71 | const mergedSchemaWithoutFile = makeExecutableSchema({ 72 | typeDefs: schemaWithoutFilei, 73 | }); 74 | errorListClone.forEach((errorItem) => { 75 | listOfErrors.push( 76 | constructErrorMessage(++errorCounter, errorItem, fileNames[i]), 77 | ); 78 | listOfUnMappedErrors = popError(listOfUnMappedErrors, errorItem); 79 | }); 80 | } catch (error) { 81 | const errorsMessages: string = error.message; 82 | const errorsList = errorsMessages.split(errorsSeparator); 83 | errorListClone.forEach((errorItem) => { 84 | if (errorsList.indexOf(errorItem) < 0) { 85 | listOfErrors.push( 86 | constructErrorMessage(++errorCounter, errorItem, fileNames[i]), 87 | ); 88 | listOfUnMappedErrors = popError(listOfUnMappedErrors, errorItem); 89 | } 90 | }); 91 | } 92 | } 93 | 94 | if (errorCounter) { 95 | // Go over the list of unmapped errors if it is not empty then add new errors that source map could detect. 96 | listOfUnMappedErrors.forEach((errorItem) => { 97 | consoleLogger.error(`>> Error(${++errorCounter}): ${errorItem}.`); 98 | }); 99 | consoleLogger.log( 100 | `>> Total numbers of errors found: ${errorCounter + 101 | listOfUnMappedErrors.length}.`, 102 | ); 103 | throw new Error(`${listOfErrors}`); 104 | } 105 | } 106 | }; 107 | 108 | /** 109 | * Returns the full path for a specific schema file. 110 | * @param fileName 111 | */ 112 | function getFullPath(fileName: string): string { 113 | return encodeURI(`file://${process.cwd() + '/' + fileName}`); 114 | } 115 | 116 | /** 117 | * Construct the error message. 118 | * @param errorCounter 119 | * @param errorItem 120 | * @param fileName 121 | */ 122 | function constructErrorMessage( 123 | errorCounter: number, 124 | errorItem: string, 125 | fileName: string, 126 | ): string { 127 | const errorMessage = `>> Error(${errorCounter}): ${errorItem} check the file:\n${chalk.blue. 128 | underline(getFullPath( 129 | fileName, 130 | ))}`; 131 | consoleLogger.error(`${errorMessage}\n`); 132 | return errorMessage; 133 | } 134 | 135 | /** 136 | * Popout/Removes a specific error from the list of errors when one of the error items in the list is identical. 137 | * @param errorList 138 | * @param errorItem 139 | */ 140 | function popError(errorList: string[], errorItem: string) { 141 | return errorList.filter((item) => item !== errorItem); 142 | } 143 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "declaration": true, 8 | "noImplicitAny": false, 9 | "lib": ["es2015", "esnext.asynciterable"], 10 | "rootDir": "./src", 11 | "outDir": "./dist", 12 | "allowSyntheticDefaultImports": true, 13 | "pretty": true, 14 | "removeComments": true, 15 | "types": [ 16 | "@types/node" 17 | ] 18 | }, 19 | "exclude": [ 20 | "node_modules", 21 | "dist", 22 | "bin" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "tslint:recommended", 3 | "rules": { 4 | "no-console": false, 5 | "quotemark": [true, "single", "avoid-escape"], 6 | "no-var-keyword": true, 7 | "no-var-requires": false 8 | } 9 | } 10 | --------------------------------------------------------------------------------