diff --git a/bin/graphql-schema-petstore.sh b/bin/graphql-schema-petstore.sh new file mode 100755 index 0000000000..10dfb5a5dc --- /dev/null +++ b/bin/graphql-schema-petstore.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" +ags="generate -t modules/openapi-generator/src/main/resources/graphql-schema -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g graphql-schema -o samples/config/petstore/graphql-schema -DpackageName=petstore $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/graphql-server-petstore.sh b/bin/graphql-server-petstore.sh new file mode 100755 index 0000000000..3d61172f3c --- /dev/null +++ b/bin/graphql-server-petstore.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties $@" +ags="generate -t modules/openapi-generator/src/main/resources/graphql-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g graphql-server -o samples/server/petstore/graphql-server -DpackageName=petstore $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/openapi3/graphql-petstore-server.sh b/bin/openapi3/graphql-petstore-server.sh new file mode 100755 index 0000000000..c1aa8b8f28 --- /dev/null +++ b/bin/openapi3/graphql-petstore-server.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +# Make sure that the working directory is the root dir +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "${SCRIPT_DIR}/../" + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +# Make sure that we are regenerating the sample by removing any existing target directory +TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/graphql-server" +if [ -d "$TARGET_DIR" ]; then + rm -rf $TARGET_DIR +fi + +executable="$SCRIPT_DIR/../../modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -t $SCRIPT_DIR/../../modules/openapi-generator/src/main/resources/graphql-server -i $SCRIPT_DIR/../../modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g graphql-server -o $TARGET_DIR $@" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/graphql-petstore-server.bat b/bin/windows/graphql-petstore-server.bat new file mode 100755 index 0000000000..156a2cbbc6 --- /dev/null +++ b/bin/windows/graphql-petstore-server.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -t modules\openapi-generator\src\main\resources\graphql-server -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g graphql-server -o samples\server\petstore\graphql-server + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/bin/windows/graphql-schema-petstore.bat b/bin/windows/graphql-schema-petstore.bat new file mode 100755 index 0000000000..5a5f44ef61 --- /dev/null +++ b/bin/windows/graphql-schema-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -t modules\openapi-generator\src\main\resources\graphql-schema -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g graphql-schema -o samples\config\petstore\graphql-schema + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java new file mode 100644 index 0000000000..fad8c3a3c8 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGraphQLCodegen.java @@ -0,0 +1,463 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.*; + +public abstract class AbstractGraphQLCodegen extends DefaultCodegen implements CodegenConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractGraphQLCodegen.class); + + protected String specFolder = "spec"; + protected String packageName = "openapi2graphql"; + protected String packageVersion = "1.0.0"; + protected String apiDocPath = "docs/"; + protected String modelDocPath = "docs/"; + + protected String graphQlInputsPackage = ""; + + public AbstractGraphQLCodegen() { + super(); + + setReservedWordsLowerCase( + Arrays.asList( + // data type + "null", "Int", "Float", "String", "Boolean", "ID", + + // reserved words: TODO + "type", "implements", "query", "union", "interface" + ) + ); + + defaultIncludes = new HashSet( + Arrays.asList( + "map", + "array") + ); + + languageSpecificPrimitives = new HashSet( + Arrays.asList( + "null", + "ID", + "Int", + "String", + "Float", + "Boolean") + ); + + instantiationTypes.clear(); + + typeMapping.clear(); + typeMapping.put("integer", "Int"); + typeMapping.put("long", "Int"); + typeMapping.put("number", "Float"); + typeMapping.put("float", "Float"); + typeMapping.put("double", "Float"); + typeMapping.put("boolean", "Boolean"); + typeMapping.put("string", "String"); + typeMapping.put("UUID", "ID"); + typeMapping.put("date", "String"); + typeMapping.put("DateTime", "String"); + typeMapping.put("password", "String"); + // TODO fix mapping + typeMapping.put("file", "String"); + typeMapping.put("binary", "String"); + typeMapping.put("ByteArray", "String"); + typeMapping.put("object", "TODO_OBJECT_MAPPING"); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { + setPackageVersion((String) additionalProperties.get(CodegenConstants.PACKAGE_VERSION)); + } + + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); + + additionalProperties.put("apiDocPath", apiDocPath); + additionalProperties.put("modelDocPath", modelDocPath); + } + + public void setPackageName(String packageName) { + this.packageName = packageName; + } + + public void setPackageVersion(String packageVersion) { + this.packageVersion = packageVersion; + } + + @Override + public String escapeReservedWord(String name) { + // Can't start with an underscore, as our fields need to start with an + + // Options? + // - MyName + // - AName + // - TheName + // - XName + // - X_Name + // ... or maybe a suffix? + // - Name_ ... think this will work. + if (this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return camelize(name) + '_'; + } + + @Override + public String apiFileFolder() { + return outputFolder + File.separator + packageName + File.separator + "api" + File.separator; + } + + public String modelFileFolder() { + return outputFolder + File.separator + packageName + File.separator + "model" + File.separator; + } + + @Override + public String toVarName(String name) { + // replace - with _ e.g. created-at => created_at + name = sanitizeName(name.replaceAll("-", "_")); + + // if it's all uppper case, do nothing + if (name.matches("^[A-Z_]*$")) + return name; + + name = camelize(name, true); + + // for reserved word or word starting with number, append _ + if (isReservedWord(name)) + name = escapeReservedWord(name); + + // for reserved word or word starting with number, append _ + if (name.matches("^\\d.*")) + name = camelize("var_" + name); + + return name; + } + + @Override + public String toParamName(String name) { + return toVarName(name); + } + + @Override + public String toModelName(String name) { + return camelize(toModelFilename(name)); + } + + @Override + public String toModelFilename(String name) { + if (!StringUtils.isEmpty(modelNamePrefix)) { + name = modelNamePrefix + "_" + name; + } + + if (!StringUtils.isEmpty(modelNameSuffix)) { + name = name + "_" + modelNameSuffix; + } + + name = sanitizeName(name); + + // model name cannot use reserved keyword, e.g. return + if (isReservedWord(name)) { + LOGGER.warn(name + " (reserved word) cannot be used as model name. Renamed to " + ("model_" + name)); + name = "model_" + name; // e.g. return => ModelReturn (after camelize) + } + + // model name starts with number + if (name.matches("^\\d.*")) { + LOGGER.warn(name + " (model name starts with number) cannot be used as model name. Renamed to " + ("model_" + name)); + name = "model_" + name; // e.g. 200Response => Model200Response (after camelize) + } + + return underscore(name); + } + + @Override + public String toApiFilename(String name) { + // replace - with _ e.g. created-at => created_at + name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + // e.g. PetApi.graphql => pet_api.graphql + return underscore(name) + "_api"; + } + + @Override + public String toApiTestFilename(String name) { + return toApiFilename(name) + "_spec"; + } + + @Override + public String toModelTestFilename(String name) { + return toModelFilename(name) + "_spec"; + } + + @Override + public void postProcessParameter(CodegenParameter parameter) { + } + + @Override + public String apiTestFileFolder() { + return outputFolder + File.separator + specFolder.replace("/", File.separator); + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separator + specFolder.replace("/", File.separator); + } + + @Override + public String apiDocFileFolder() { + return (outputFolder + "/" + apiDocPath).replace('/', File.separatorChar); + } + + @Override + public String modelDocFileFolder() { + return (outputFolder + "/" + modelDocPath).replace('/', File.separatorChar); + } + + @Override + public String toModelDocFilename(String name) { + return toModelName(name); + } + + @Override + public String toApiDocFilename(String name) { + return toApiName(name); + } + + @Override + public String toApiName(String name) { + return underscore(super.toApiName(name)); + } + + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + return "[" + getTypeDeclaration(inner) + "]"; + } else if (ModelUtils.isMapSchema(p)) { + Schema inner = (Schema) p.getAdditionalProperties(); + return getTypeDeclaration(inner); + } + + // Not using the supertype invocation, because we want to UpperCamelize + // the type. + String schemaType = getSchemaType(p); + String nullable = ModelUtils.isNullable(p) ? "" : "!"; + /* + if (p != null && Boolean.TRUE.equals(p.getNullable())) { + nullable = ""; + } else { + nullable = "!"; + }*/ + + if (typeMapping.containsKey(schemaType)) { + return typeMapping.get(schemaType) + nullable; + } + + if (languageSpecificPrimitives.contains(schemaType)) { + return schemaType + nullable; + } + + return toModelName(schemaType); + } + + @Override + public String getSchemaType(Schema p) { + String schemaType = super.getSchemaType(p); + String type = null; + if (typeMapping.containsKey(schemaType)) { + type = typeMapping.get(schemaType); + if (languageSpecificPrimitives.contains(type)) + return (type); + } else { + type = schemaType; + } + return type; + } + + @Override + public String toOperationId(String operationId) { + String sanitizedOperationId = sanitizeName(operationId); + + // method name cannot use reserved keyword, e.g. return + if (isReservedWord(sanitizedOperationId)) { + LOGGER.warn(operationId + " (reserved word) cannot be used as method name. Renamed to " + underscore("call_" + operationId)); + sanitizedOperationId = "call_" + sanitizedOperationId; + } + + return camelize(sanitizedOperationId, false); + } + + @Override + protected boolean needToImport(String type) { + return !defaultIncludes.contains(type) + && !languageSpecificPrimitives.contains(type); + } + + @Override + public String escapeQuotationMark(String input) { + // remove " to avoid code injection + return input.replace("\"", ""); + } + + @Override + public String escapeUnsafeCharacters(String input) { + return input.replace("]]", "] ]"); + } + + public Map createMapping(String key, String value) { + Map customImport = new HashMap(); + customImport.put(key, value); + + return customImport; + } + + @Override + public String toEnumValue(String value, String datatype) { + if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + return value; + } else { + return escapeText(value); + } + } + + @Override + public String toEnumDefaultValue(String value, String datatype) { + return datatype + "_" + value; + } + + @Override + public String toEnumVarName(String name, String datatype) { + if (name.length() == 0) { + return "EMPTY"; + } + + // number + if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + String varName = name; + varName = varName.replaceAll("-", "MINUS_"); + varName = varName.replaceAll("\\+", "PLUS_"); + varName = varName.replaceAll("\\.", "_DOT_"); + return varName; + } + + // for symbol, e.g. $, # + if (getSymbolName(name) != null) { + return getSymbolName(name).toUpperCase(Locale.ROOT); + } + + // string + String enumName = sanitizeName(underscore(name).toUpperCase(Locale.ROOT)); + enumName = enumName.replaceFirst("^_", ""); + enumName = enumName.replaceFirst("_$", ""); + + if (isReservedWord(enumName) || enumName.matches("\\d.*")) { // reserved word or starts with number + return escapeReservedWord(enumName); + } else { + return enumName; + } + } + + @Override + public String toEnumName(CodegenProperty property) { + String enumName = toModelName(property.name); + + // remove [] for array or map of enum + enumName = enumName.replace("[]", ""); + + if (enumName.matches("\\d.*")) { // starts with number + return "_" + enumName; + } else { + return enumName; + } + } + + @Override + public String toModelImport(String name) { + if (needToImport(toModelName(name))) { + return toModelName(name); + } + + return name; + } + + @Override + public Map postProcessOperations(Map operations) { + Map objs = (Map) operations.get("operations"); + + for (CodegenOperation op : (List) objs.get("operation")) { + // non GET/HEAD methods are mutation + if (!"GET".equals(op.httpMethod.toUpperCase(Locale.ROOT)) && !"HEAD".equals(op.httpMethod.toUpperCase(Locale.ROOT))) { + op.vendorExtensions.put("x-is-mutation", Boolean.TRUE); + } + for (CodegenParameter p : op.allParams) { + // TODO check and adjust! + // {{#vendorExtensions.x-graphql-nullable}}?{{/vendorExtensions.x-graphql-nullable}} + if (p.required) { + op.vendorExtensions.put("x-graphql-nullable", Boolean.FALSE); + } else { + op.vendorExtensions.put("x-graphql-nullable", Boolean.TRUE); + } + } + } + + return objs; + } + + public String graphQlInputsPackage() { + return graphQlInputsPackage; + } + + public String graphQlInputsFileFolder() { + return outputFolder + File.separator + graphQlInputsPackage().replace('.', File.separatorChar); + } + + public String graphQlInputsFilename(String templateName, String tag) { + String suffix = apiTemplateFiles().get(templateName); + return graphQlInputsFileFolder() + File.separator + tographQlInputsFilename(tag) + suffix; + } + + public String tographQlInputsFilename(String name) { + return tographQlInputsName(name); + } + + public String tographQlInputsName(String name) { + if (name.length() == 0) { + return "EmptyInput"; + } + + return camelize(name) + "Input"; + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java new file mode 100644 index 0000000000..4b694b3b47 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLSchemaCodegen.java @@ -0,0 +1,90 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConfig; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class GraphQLSchemaCodegen extends AbstractGraphQLCodegen implements CodegenConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLSchemaCodegen.class); + + @Override + public CodegenType getTag() { + return CodegenType.CONFIG; + } + + public String getName() { + return "graphql-schema"; + } + + public String getHelp() { + return "Generates GraphQL schema files (beta)"; + } + + public GraphQLSchemaCodegen() { + super(); + outputFolder = "generated-code/graphql-schema"; + modelTemplateFiles.put("model.mustache", ".graphql"); + apiTemplateFiles.put("api.mustache", ".graphql"); + embeddedTemplateDir = templateDir = "graphql-schema"; + hideGenerationTimestamp = Boolean.TRUE; + + + modelDocTemplateFiles.put("model_doc.mustache", ".md"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + + + cliOptions.clear(); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "GraphQL package name (convention: lowercase).") + .defaultValue("openapi2graphql")); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "GraphQL package version.") + .defaultValue("1.0.0")); + cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) + .defaultValue(Boolean.TRUE.toString())); + + } + + @Override + public void processOpts() { + super.processOpts(); + + //apiTestTemplateFiles.put("api_test.mustache", ".graphql"); + //modelTestTemplateFiles.put("model_test.mustache", ".graphql"); + + apiDocTemplateFiles.clear(); // TODO: add api doc template + modelDocTemplateFiles.clear(); // TODO: add model doc template + + modelPackage = packageName; + apiPackage = packageName; + + //supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + //supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); + //supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")) + //supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLServerCodegen.java new file mode 100644 index 0000000000..5ca3c4eca0 --- /dev/null +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GraphQLServerCodegen.java @@ -0,0 +1,147 @@ +/* + * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openapitools.codegen.languages; + +import io.swagger.v3.oas.models.media.ArraySchema; +import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.lang3.StringUtils; +import org.openapitools.codegen.*; +import org.openapitools.codegen.utils.ModelUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; + +public class GraphQLServerCodegen extends AbstractGraphQLCodegen implements CodegenConfig { + + private static final Logger LOGGER = LoggerFactory.getLogger(GraphQLServerCodegen.class); + + @Override + public CodegenType getTag() { + return CodegenType.SERVER; + } + + @Override + public String getName() { + return "graphql-server"; + } + + @Override + public String getHelp() { + return "Generates a GraphQL express server including it's types, queries, mutations, (resolvers)"; + } + + public GraphQLServerCodegen() { + super(); + + packageName = "openapi3graphql-server"; + packageVersion = "1.0.0"; + + outputFolder = "generated-code/graphql-server"; + embeddedTemplateDir = templateDir = "graphql-server"; + + hideGenerationTimestamp = Boolean.TRUE; + + apiTemplateFiles.put("api.mustache", ".graphql"); + apiTemplateFiles.put("resolvers.mustache", "_resolver.js"); + apiDocTemplateFiles.put("api_doc.mustache", ".md"); + modelTemplateFiles.put("model.mustache", ".graphql"); + modelDocTemplateFiles.put("model_doc.mustache", ".md"); + // TODO check why api doc is not written + + cliOptions.clear(); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "GraphQL express server package name (convention: lowercase).") + .defaultValue("openapi3graphql-server")); + cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "GraphQL express server package version.") + .defaultValue("1.0.0")); + cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) + .defaultValue(Boolean.TRUE.toString())); + } + + @Override + public void processOpts() { + super.processOpts(); + + // TODO: add api test template + //apiTestTemplateFiles.put("api_test.mustache", ".graphql"); + + // TODO: add model test template + //modelTestTemplateFiles.put("model_test.mustache", ".graphql"); + modelTestTemplateFiles.clear(); + + modelPackage = packageName; + apiPackage = packageName; + + String supportFolder = apiPackage().replace('.', File.separatorChar); + + // Dynamic express/graphql related stuff + supportingFiles.add(new SupportingFile("schema.graphql.mustache", supportFolder, "schema.graphql")); + + // General stuff + supportingFiles.add(new SupportingFile(".gitignore", supportFolder, ".gitignore")); + supportingFiles.add(new SupportingFile("README.mustache", supportFolder, "README.md")); + supportingFiles.add(new SupportingFile("package.json.mustache", supportFolder, "package.json")); + supportingFiles.add(new SupportingFile("server.js", supportFolder, "server.js")); + supportingFiles.add(new SupportingFile("start.js", supportFolder, "start.js")); + } + + @Override + public String getTypeDeclaration(Schema p) { + if (ModelUtils.isArraySchema(p)) { + ArraySchema ap = (ArraySchema) p; + Schema inner = ap.getItems(); + + // IMPORTANT NOTE we add the braces within template because there we have the possibility to differenciate + // between some specific types for GraphQL: + // return "[" + getTypeDeclaration(inner) + "]"; + return getTypeDeclaration(inner); + } else if (ModelUtils.isMapSchema(p)) { + Schema inner = (Schema) p.getAdditionalProperties(); + + return getTypeDeclaration(inner); + } + + // IMPORANT NOTE Not using the supertype invocation, because we want to UpperCamelize the type: + String schemaType = getSchemaType(p); + String nullable = ModelUtils.isNullable(p) ? "" : "!"; + + if (typeMapping.containsKey(schemaType)) { + return typeMapping.get(schemaType) + nullable; + } + + if (languageSpecificPrimitives.contains(schemaType)) { + return schemaType + nullable; + } + + return toModelName(schemaType); + } + + @Override + public String toEnumName(CodegenProperty property) { + String enumName = toModelName(property.name); + + // Remove [] for array or map of ENUM + enumName = enumName.replace("[]", ""); + + // ENUM starts with a number + if (enumName.matches("\\d.*")) { + return StringUtils.capitalize("_" + enumName) + "Enum"; + } else { + return StringUtils.capitalize(enumName) + "Enum"; + } + } +} diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java index 86edabc970..8f72c1e50c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/utils/ModelUtils.java @@ -822,4 +822,20 @@ public class ModelUtils { } return null; } + + public static boolean isNullable(Schema schema) { + if (schema == null) { + return false; + } + + if (Boolean.TRUE.equals(schema.getNullable())) { + return true; + } + + if (schema.getExtensions() != null && schema.getExtensions().get("x-nullable") != null) { + return Boolean.valueOf(schema.getExtensions().get("x-nullable").toString()); + } + + return false; + } } diff --git a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig index 6136232e98..910a76f04e 100644 --- a/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig +++ b/modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig @@ -31,6 +31,8 @@ org.openapitools.codegen.languages.FinchServerCodegen org.openapitools.codegen.languages.GoClientCodegen org.openapitools.codegen.languages.GoServerCodegen org.openapitools.codegen.languages.GoGinServerCodegen +org.openapitools.codegen.languages.GraphQLSchemaCodegen +org.openapitools.codegen.languages.GraphQLServerCodegen org.openapitools.codegen.languages.GroovyClientCodegen org.openapitools.codegen.languages.KotlinClientCodegen org.openapitools.codegen.languages.KotlinServerCodegen @@ -98,4 +100,4 @@ org.openapitools.codegen.languages.TypeScriptAxiosClientCodegen org.openapitools.codegen.languages.TypeScriptFetchClientCodegen org.openapitools.codegen.languages.TypeScriptInversifyClientCodegen org.openapitools.codegen.languages.TypeScriptJqueryClientCodegen -org.openapitools.codegen.languages.TypeScriptNodeClientCodegen \ No newline at end of file +org.openapitools.codegen.languages.TypeScriptNodeClientCodegen diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache new file mode 100644 index 0000000000..2b8a89c7a1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache @@ -0,0 +1,96 @@ +# Lua API client for {{packageName}} + +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Installation +Put the package under your project folder and add the following in import: +``` + "./{{packageName}}" +``` + +## Documentation for API Endpoints + +All URIs are relative to *{{basePath}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization +{{^authMethods}} Endpoints do not require authorization. +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} +{{#authMethods}} +## {{{name}}} +{{#isApiKey}}- **Type**: API key + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. + }) + r, err := client.Service.Operation(auth, args) +``` +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", + }) + r, err := client.Service.Operation(auth, args) +``` +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} + +Example +``` + auth := context.WithValue(context.TODO(), sw.ContextAccessToken, "ACCESSTOKENSTRING") + r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. +``` + import "golang.org/x/oauth2" + + / .. Perform OAuth2 round trip request and obtain a token .. // + + tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) + auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) + r, err := client.Service.Operation(auth, args) +``` +{{/isOAuth}} +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} +{{/hasMore}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache new file mode 100644 index 0000000000..3563da7eab --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache @@ -0,0 +1,47 @@ +{{>partial_header}} +# package {{packageName}} + +# {{classname}} + +{{#operations}} +type mutation { +{{#operation}} +{{#vendorExtensions.x-is-mutation}} + {{#summary}} + # {{summary}} + {{/summary}} + {{#notes}} + # {{notes}} + {{/notes}} + {{#allParams}} + # @param {{dataType}} {{paramName}} {{description}} + {{/allParams}} + # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}] + {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{#returnType}}{{.}}{{/returnType}}{{^returnType}}null{{/returnType}} + +{{/vendorExtensions.x-is-mutation}} +{{/operation}} +} + +{{/operations}} +{{#operations}} +type query { +{{#operation}} +{{^vendorExtensions.x-is-mutation}} + {{#summary}} + # {{summary}} + {{/summary}} + {{#notes}} + # {{notes}} + {{/notes}} + {{#allParams}} + # @param {{dataType}} {{paramName}} {{description}} + {{/allParams}} + # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}] + {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): {{#returnType}}{{.}}{{/returnType}}{{^returnType}}null{{/returnType}} + +{{/vendorExtensions.x-is-mutation}} +{{/operation}} +} + +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/api_doc.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/api_doc.mustache new file mode 100644 index 0000000000..b74d876792 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/api_doc.mustache @@ -0,0 +1,5 @@ +{{#operations}} +{{#operation}} +# {{{operationId}}} +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/api_test.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/api_test.mustache new file mode 100644 index 0000000000..a8044cda96 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/api_test.mustache @@ -0,0 +1,10 @@ +{{> partial_header}} +{{#operations}} +{{#operation}} + {{#models}} + # TODO + {{#model}} + {{/model}} + {{/models}} +{{/operation}} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache new file mode 100755 index 0000000000..c344020eab --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/gitignore.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/gitignore.mustache new file mode 100644 index 0000000000..180988936c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/gitignore.mustache @@ -0,0 +1,40 @@ +# Compiled Lua sources +luac.out + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache new file mode 100644 index 0000000000..9c06501f43 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache @@ -0,0 +1,33 @@ +{{#models}} +{{#model}} +{{>partial_header}} +{{#description}} +# {{description}} +{{/description}} +type {{classname}} { + +{{#vars}} + {{#description}} + # {{description}} + {{/description}} + {{baseName}}: {{datatypeWithEnum}} + +{{/vars}} +} +{{#vars}} +{{#isEnum}} + +{{#description}} +# {{description}} +{{/description}} +enum {{enumName}} { + {{#allowableValues}} + {{#values}} + {{.}} + {{/values}} + {{/allowableValues}} +} +{{/isEnum}} +{{/vars}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/model_doc.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/model_doc.mustache new file mode 100644 index 0000000000..ccfd3f8d0d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/model_doc.mustache @@ -0,0 +1,11 @@ +{{#models}}{{#model}}# {{classname}} + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/model_test.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/model_test.mustache new file mode 100644 index 0000000000..9608f7037d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/model_test.mustache @@ -0,0 +1,23 @@ +{{> partial_header}} +{{#models}} +{{#model}} +--[[ +Unit tests for {{{packageName}}}.model.{{{classname}}} +Automatically generated by openapi-generator (https://openapi-generator.tech) +Please update as you see appropriate +]] +describe("{{classname}}", function() + local {{{packageName}}}_{{{classname}}} = require "{{{packageName}}}.model.{{{classname}}}" + + {{#vars}} + -- unit tests for the property '{{{name}}}' + describe("property {{{name}}} test", function() + it("should work", function() + -- TODO assertion here: http://olivinelabs.com/busted/#asserts + end) + end) + + {{/vars}} +end) +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache new file mode 100644 index 0000000000..f06661bc1a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache @@ -0,0 +1,14 @@ +{{#appName}} +# {{{appName}}} +{{/appName}} +{{#appDescription}} +# {{{appDescription}}} +{{/appDescription}} +{{#version}} +# OpenAPI spec version: {{{version}}} +{{/version}} +{{#infoEmail}} +# Contact: {{{infoEmail}}} +{{/infoEmail}} +# Generated by OpenAPI Generator: https://openapi-generator.tech +# diff --git a/modules/openapi-generator/src/main/resources/graphql-server/.gitignore b/modules/openapi-generator/src/main/resources/graphql-server/.gitignore new file mode 100644 index 0000000000..f86de69214 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/.gitignore @@ -0,0 +1,8 @@ +# MacOS +.DS_Store + +# IDE +/.idea + +# JS specific +/node_modules diff --git a/modules/openapi-generator/src/main/resources/graphql-server/README.mustache b/modules/openapi-generator/src/main/resources/graphql-server/README.mustache new file mode 100644 index 0000000000..4746e0c95a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/README.mustache @@ -0,0 +1,20 @@ +# GraphQL express API server + +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +## Requirements + +- node 10+ + +## Gettings started + + npm install + npm run start + +# TODOs + +- use `ID`-type for unique identifiers instead of `Int` (detect UUID) +- add example responses to resolvers.mustache +- support for union types diff --git a/modules/openapi-generator/src/main/resources/graphql-server/api.mustache b/modules/openapi-generator/src/main/resources/graphql-server/api.mustache new file mode 100644 index 0000000000..9e22616af9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/api.mustache @@ -0,0 +1,55 @@ +{{>partial_header_graphql}} +# package {{packageName}} + +# {{classname}} + +{{#operations}} +{{#operation}} +{{#vendorExtensions.x-is-mutation}}{{#hasParams}} + +input {{operationId}}Input { + {{#allParams}} + {{#description}}# {{description}}{{/description}} + {{paramName}}: {{#isContainer}}[{{/isContainer}}{{dataType}}{{#isListContainer}}Input{{/isListContainer}}{{#isModel}}Input{{/isModel}}{{#isContainer}}]{{/isContainer}}{{#hasMore}}, {{/hasMore}} + {{/allParams}} +}{{/hasParams}}{{/vendorExtensions.x-is-mutation}}{{/operation}} + +type Mutation { +{{#operation}} +{{#vendorExtensions.x-is-mutation}} + {{#summary}} + # {{summary}} + {{/summary}} + {{#notes}} + # {{notes}} + {{/notes}} + {{#allParams}} + # @param {{dataType}} {{paramName}} {{description}} + {{/allParams}} + # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Boolean{{/returnType}}] + {{operationId}}{{#hasParams}}(input: {{operationId}}Input!){{/hasParams}}: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}Boolean{{/returnType}} +{{/vendorExtensions.x-is-mutation}} +{{/operation}} +} + +{{/operations}} +{{#operations}} +type Query { +{{#operation}} +{{^vendorExtensions.x-is-mutation}} + {{#summary}} + # {{summary}} + {{/summary}} + {{#notes}} + # {{notes}} + {{/notes}} + {{#allParams}} + # @param {{dataType}} {{paramName}} {{description}} + {{/allParams}} + # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Boolean{{/returnType}}] + {{operationId}}{{#hasParams}}({{#allParams}}{{paramName}}: {{dataType}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{/hasParams}}: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}Boolean{{/returnType}} +{{/vendorExtensions.x-is-mutation}} +{{/operation}} +} + +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-server/api_doc.mustache b/modules/openapi-generator/src/main/resources/graphql-server/api_doc.mustache new file mode 100644 index 0000000000..f87712a3fc --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/api_doc.mustache @@ -0,0 +1,21 @@ +# {{classname}}{{#description}} + {{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} + {{#operation}} + +# **{{operationId}}** +> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + +{{summary}}{{#notes}} + +{{notes}}{{/notes}} + {{/operation}} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-server/model.mustache b/modules/openapi-generator/src/main/resources/graphql-server/model.mustache new file mode 100644 index 0000000000..3bbbb5199d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/model.mustache @@ -0,0 +1,40 @@ +{{#models}} +{{#model}} +{{>partial_header_graphql}} +{{#description}} +# {{{description}}} +{{/description}} +type {{classname}} { +{{#vars}} + {{#description}} + # {{{description}}} + {{/description}} + {{baseName}}: {{#isEnum}}{{classname}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{datatypeWithEnum}}{{/isEnum}} +{{/vars}} +} + +input {{classname}}Input { +{{#vars}} + {{#description}} + # {{{description}}} + {{/description}} + {{baseName}}: {{#isEnum}}{{classname}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{#isContainer}}[{{datatypeWithEnum}}{{#complexType}}Input{{/complexType}}]{{/isContainer}}{{^isContainer}}{{datatypeWithEnum}}{{#isModel}}Input{{/isModel}}{{/isContainer}}{{/isEnum}} +{{/vars}} +} +{{#vars}} +{{#isEnum}} + +{{#description}} +# {{{description}}} +{{/description}} +enum {{classname}}{{enumName}} { + {{#allowableValues}} + {{#values}} + {{{.}}} + {{/values}} + {{/allowableValues}} +} +{{/isEnum}} +{{/vars}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/graphql-server/model_doc.mustache b/modules/openapi-generator/src/main/resources/graphql-server/model_doc.mustache new file mode 100644 index 0000000000..ccfd3f8d0d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/model_doc.mustache @@ -0,0 +1,11 @@ +{{#models}}{{#model}}# {{classname}} + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{/vars}} + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + +{{/model}}{{/models}} diff --git a/modules/openapi-generator/src/main/resources/graphql-server/model_test.mustache b/modules/openapi-generator/src/main/resources/graphql-server/model_test.mustache new file mode 100644 index 0000000000..9608f7037d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/model_test.mustache @@ -0,0 +1,23 @@ +{{> partial_header}} +{{#models}} +{{#model}} +--[[ +Unit tests for {{{packageName}}}.model.{{{classname}}} +Automatically generated by openapi-generator (https://openapi-generator.tech) +Please update as you see appropriate +]] +describe("{{classname}}", function() + local {{{packageName}}}_{{{classname}}} = require "{{{packageName}}}.model.{{{classname}}}" + + {{#vars}} + -- unit tests for the property '{{{name}}}' + describe("property {{{name}}} test", function() + it("should work", function() + -- TODO assertion here: http://olivinelabs.com/busted/#asserts + end) + end) + + {{/vars}} +end) +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/graphql-server/package.json.mustache b/modules/openapi-generator/src/main/resources/graphql-server/package.json.mustache new file mode 100644 index 0000000000..71324a2093 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/package.json.mustache @@ -0,0 +1,25 @@ +{ + "name": "graphql-server", + "version": "1.0.0", + "description": "{{#appDescription}} {{{appDescription}}} {{/appDescription}}", + "main": "index.js", + "scripts": { + "start": "node start.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "latest", + "graphql": "latest", + "apollo-server-express": "latest", + "graphql-combine": "latest", + "lodash": "latest", + "path": "latest" + }, + "devDependencies": { + "babel-register": "latest", + "babel-preset-env": "latest" + } +} diff --git a/modules/openapi-generator/src/main/resources/graphql-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/graphql-server/partial_header.mustache new file mode 100644 index 0000000000..1e1214c8a6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/partial_header.mustache @@ -0,0 +1,11 @@ +/** + * {{#appName}} + * {{{appName}}} + * {{/appName}} + * {{#appDescription}} + * {{{appDescription}}} + * {{/appDescription}} + * {{#version}}Version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * Generated by OpenAPI Generator: https://openapi-generator.tech + */ diff --git a/modules/openapi-generator/src/main/resources/graphql-server/partial_header_graphql.mustache b/modules/openapi-generator/src/main/resources/graphql-server/partial_header_graphql.mustache new file mode 100644 index 0000000000..8e97c5d4f0 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/partial_header_graphql.mustache @@ -0,0 +1,9 @@ +# {{#appName}} +# {{{appName}}} +# {{/appName}} +# {{#appDescription}} +# {{{appDescription}}} +# {{/appDescription}} +# {{#version}}Version: {{{version}}}{{/version}} +# {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +# Generated by OpenAPI Generator: https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/graphql-server/resolvers.mustache b/modules/openapi-generator/src/main/resources/graphql-server/resolvers.mustache new file mode 100644 index 0000000000..161cca2949 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/resolvers.mustache @@ -0,0 +1,34 @@ +{{>partial_header}} +// package {{packageName}} + +// {{classname}} + +export default { + Query: { +{{#operations}} +{{#operation}}{{^vendorExtensions.x-is-mutation}} + // @return {{returnType}} + {{operationId}}: ({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) => { + return { + {{#allParams}}"{{paramName}}": "{{example}}"{{#hasMore}}, + {{/hasMore}}{{/allParams}} + }; + }, +{{/vendorExtensions.x-is-mutation}}{{/operation}} +{{/operations}} + }, + + Mutation: { +{{#operations}} +{{#operation}}{{#vendorExtensions.x-is-mutation}} + // @return {{returnType}} + {{operationId}}: ({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) => { + return { + {{#allParams}}"{{paramName}}": "{{example}}"{{#hasMore}}, + {{/hasMore}}{{/allParams}} + }; + }, +{{/vendorExtensions.x-is-mutation}}{{/operation}} +{{/operations}} + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-server/schema.graphql.mustache b/modules/openapi-generator/src/main/resources/graphql-server/schema.graphql.mustache new file mode 100644 index 0000000000..94c2def809 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/schema.graphql.mustache @@ -0,0 +1,3 @@ +interface Entity { + id: Int! +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-server/server.js b/modules/openapi-generator/src/main/resources/graphql-server/server.js new file mode 100644 index 0000000000..e149816253 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/server.js @@ -0,0 +1,37 @@ +import express from 'express'; +import {ApolloServer, graphiqlExpress, graphqlExpress} from 'apollo-server-express' +import combine from 'graphql-combine' +import path from 'path' + +const PORT = 4000 || process.env; + +// Initialize the app +const app = express(); + +// Get combined typeDefs and resolvers object +const {typeDefs, resolvers} = combine({ + // TypeDefs glob pattern + typeDefs: path.join(__dirname, '**/*.graphql'), + + // Resolvers glob pattern + resolvers: path.join(__dirname, 'api/*_resolver.js') +}); + +// GraphQL: Schema +const server = new ApolloServer({ + typeDefs: typeDefs, + resolvers: resolvers, + playground: { + endpoint: `http://localhost:${PORT}/graphql`, + settings: { + 'editor.theme': 'light' + } + } +}); + +server.applyMiddleware({app: app}); + +// Start the server +app.listen(PORT, () => { + console.log(`You can reach GraphQL at: http://localhost:${PORT}/graphql`); +}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-server/start.js b/modules/openapi-generator/src/main/resources/graphql-server/start.js new file mode 100644 index 0000000000..1cdb39b91a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/start.js @@ -0,0 +1,7 @@ +// Transpile all code following this line with babel and use 'env' (aka ES6) preset. +require('babel-register')({ + presets: ['env'] +}); + +// Import the rest of our application. +module.exports = require('./server.js'); diff --git a/modules/openapi-generator/src/main/resources/graphql-server/type-defs.mustache b/modules/openapi-generator/src/main/resources/graphql-server/type-defs.mustache new file mode 100644 index 0000000000..001b9a7295 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/graphql-server/type-defs.mustache @@ -0,0 +1,11 @@ +{{>partial_header}} + +import { merge } from 'lodash'; +{{#models}}{{#model}} +import { typeDef as {{classname}} } from './model/{{classFilename}}.js';{{/model}}{{/models}} + +export const typeDefs = [ + + {{#models}}{{#model}}{{classname}}, + {{/model}}{{/models}} +].join('\r\n'); diff --git a/samples/config/petstore/graphql-schema/.openapi-generator-ignore b/samples/config/petstore/graphql-schema/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/config/petstore/graphql-schema/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/config/petstore/graphql-schema/.openapi-generator/VERSION b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION new file mode 100644 index 0000000000..afa6365606 --- /dev/null +++ b/samples/config/petstore/graphql-schema/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql new file mode 100644 index 0000000000..d7111afda9 --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/api/pet_api.graphql @@ -0,0 +1,64 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# package petstore + +# pet_api + +type mutation { + # Add a new pet to the store + # @param Pet pet Pet object that needs to be added to the store + # @return [null] + AddPet(pet: Pet): null + + # Deletes a pet + # @param Int! petId Pet id to delete + # @param String! apiKey + # @return [null] + DeletePet(petId: Int!, apiKey: String!): null + + # Update an existing pet + # @param Pet pet Pet object that needs to be added to the store + # @return [null] + UpdatePet(pet: Pet): null + + # Updates a pet in the store with form data + # @param Int! petId ID of pet that needs to be updated + # @param String! name Updated name of the pet + # @param String! status Updated status of the pet + # @return [null] + UpdatePetWithForm(petId: Int!, name: String!, status: String!): null + + # uploads an image + # @param Int! petId ID of pet to update + # @param String! additionalMetadata Additional data to pass to server + # @param String! file file to upload + # @return [ApiResponse] + UploadFile(petId: Int!, additionalMetadata: String!, file: String!): ApiResponse + +} + +type query { + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param [String!] status Status values that need to be considered for filter + # @return [[Pet]] + FindPetsByStatus(status: [String!]): [Pet] + + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param [String!] tags Tags to filter by + # @return [[Pet]] + FindPetsByTags(tags: [String!]): [Pet] + + # Find pet by ID + # Returns a single pet + # @param Int! petId ID of pet to return + # @return [Pet] + GetPetById(petId: Int!): Pet + +} + diff --git a/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql new file mode 100644 index 0000000000..af7d5d955d --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/api/store_api.graphql @@ -0,0 +1,38 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# package petstore + +# store_api + +type mutation { + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param String! orderId ID of the order that needs to be deleted + # @return [null] + DeleteOrder(orderId: String!): null + + # Place an order for a pet + # @param Order order order placed for purchasing the pet + # @return [Order] + PlaceOrder(order: Order): Order + +} + +type query { + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @return [Int!] + GetInventory(): Int! + + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param Int! orderId ID of pet that needs to be fetched + # @return [Order] + GetOrderById(orderId: Int!): Order + +} + diff --git a/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql new file mode 100644 index 0000000000..8afc817401 --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/api/user_api.graphql @@ -0,0 +1,60 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# package petstore + +# user_api + +type mutation { + # Create user + # This can only be done by the logged in user. + # @param User user Created user object + # @return [null] + CreateUser(user: User): null + + # Creates list of users with given input array + # @param [User] user List of user object + # @return [null] + CreateUsersWithArrayInput(user: [User]): null + + # Creates list of users with given input array + # @param [User] user List of user object + # @return [null] + CreateUsersWithListInput(user: [User]): null + + # Delete user + # This can only be done by the logged in user. + # @param String! username The name that needs to be deleted + # @return [null] + DeleteUser(username: String!): null + + # Updated user + # This can only be done by the logged in user. + # @param String! username name that need to be deleted + # @param User user Updated user object + # @return [null] + UpdateUser(username: String!, user: User): null + +} + +type query { + # Get user by user name + # @param String! username The name that needs to be fetched. Use user1 for testing. + # @return [User] + GetUserByName(username: String!): User + + # Logs user into the system + # @param String! username The user name for login + # @param String! password The password for login in clear text + # @return [String!] + LoginUser(username: String!, password: String!): String! + + # Logs out current logged in user session + # @return [null] + LogoutUser(): null + +} + diff --git a/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql new file mode 100644 index 0000000000..2f8221d6f7 --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/model/api_response.graphql @@ -0,0 +1,16 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# Describes the result of uploading an image resource +type ApiResponse { + + code: Int! + + type: String! + + message: String! + +} diff --git a/samples/config/petstore/graphql-schema/petstore/model/category.graphql b/samples/config/petstore/graphql-schema/petstore/model/category.graphql new file mode 100644 index 0000000000..eeeef5998a --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/model/category.graphql @@ -0,0 +1,14 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# A category for a pet +type Category { + + id: Int! + + name: String! + +} diff --git a/samples/config/petstore/graphql-schema/petstore/model/order.graphql b/samples/config/petstore/graphql-schema/petstore/model/order.graphql new file mode 100644 index 0000000000..a76301107a --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/model/order.graphql @@ -0,0 +1,30 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# An order for a pets from the pet store +type Order { + + id: Int! + + petId: Int! + + quantity: Int! + + shipDate: String! + + # Order Status + status: Status + + complete: Boolean! + +} + +# Order Status +enum Status { + placed + approved + delivered +} diff --git a/samples/config/petstore/graphql-schema/petstore/model/pet.graphql b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql new file mode 100644 index 0000000000..e8ce58e93d --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/model/pet.graphql @@ -0,0 +1,30 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# A pet for sale in the pet store +type Pet { + + id: Int! + + category: Category + + name: String! + + photoUrls: [String!] + + tags: [Tag] + + # pet status in the store + status: Status + +} + +# pet status in the store +enum Status { + available + pending + sold +} diff --git a/samples/config/petstore/graphql-schema/petstore/model/tag.graphql b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql new file mode 100644 index 0000000000..9fc620141a --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/model/tag.graphql @@ -0,0 +1,14 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# A tag for a pet +type Tag { + + id: Int! + + name: String! + +} diff --git a/samples/config/petstore/graphql-schema/petstore/model/user.graphql b/samples/config/petstore/graphql-schema/petstore/model/user.graphql new file mode 100644 index 0000000000..da66c49fb8 --- /dev/null +++ b/samples/config/petstore/graphql-schema/petstore/model/user.graphql @@ -0,0 +1,27 @@ +# OpenAPI Petstore +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# OpenAPI spec version: 1.0.0 +# Generated by OpenAPI Generator: https://openapi-generator.tech +# + +# A User who is purchasing from the pet store +type User { + + id: Int! + + username: String! + + firstName: String! + + lastName: String! + + email: String! + + password: String! + + phone: String! + + # User Status + userStatus: Int! + +} diff --git a/samples/server/petstore/graphql-server/.openapi-generator-ignore b/samples/server/petstore/graphql-server/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/server/petstore/graphql-server/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/graphql-server/.openapi-generator/VERSION b/samples/server/petstore/graphql-server/.openapi-generator/VERSION new file mode 100644 index 0000000000..afa6365606 --- /dev/null +++ b/samples/server/petstore/graphql-server/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/docs/ApiResponse.md b/samples/server/petstore/graphql-server/docs/ApiResponse.md new file mode 100644 index 0000000000..0eb9a19a1c --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/ApiResponse.md @@ -0,0 +1,12 @@ +# ApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Int!** | | [optional] [default to null] +**Type_** | **String!** | | [optional] [default to null] +**message** | **String!** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/Category.md b/samples/server/petstore/graphql-server/docs/Category.md new file mode 100644 index 0000000000..a19d286ced --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/Category.md @@ -0,0 +1,11 @@ +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id_** | **Int!** | | [optional] [default to null] +**name** | **String!** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/InlineObject.md b/samples/server/petstore/graphql-server/docs/InlineObject.md new file mode 100644 index 0000000000..85328bff1d --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/InlineObject.md @@ -0,0 +1,11 @@ +# InlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String!** | Updated name of the pet | [optional] [default to null] +**status** | **String!** | Updated status of the pet | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/InlineObject1.md b/samples/server/petstore/graphql-server/docs/InlineObject1.md new file mode 100644 index 0000000000..e9c888d563 --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/InlineObject1.md @@ -0,0 +1,11 @@ +# InlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String!** | Additional data to pass to server | [optional] [default to null] +**file** | **String!** | file to upload | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/Order.md b/samples/server/petstore/graphql-server/docs/Order.md new file mode 100644 index 0000000000..2391f0f27e --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/Order.md @@ -0,0 +1,15 @@ +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id_** | **Int!** | | [optional] [default to null] +**petId** | **Int!** | | [optional] [default to null] +**quantity** | **Int!** | | [optional] [default to null] +**shipDate** | **String!** | | [optional] [default to null] +**status** | **String!** | Order Status | [optional] [default to null] +**complete** | **Boolean!** | | [optional] [default to false] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/Pet.md b/samples/server/petstore/graphql-server/docs/Pet.md new file mode 100644 index 0000000000..4e7c9c15bc --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/Pet.md @@ -0,0 +1,15 @@ +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id_** | **Int!** | | [optional] [default to null] +**category** | [***Category**](Category.md) | | [optional] [default to null] +**name** | **String!** | | [default to null] +**photoUrls** | **String!** | | [default to null] +**tags** | [**Tag**](Tag.md) | | [optional] [default to null] +**status** | **String!** | pet status in the store | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/Tag.md b/samples/server/petstore/graphql-server/docs/Tag.md new file mode 100644 index 0000000000..9a9e8a60c2 --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/Tag.md @@ -0,0 +1,11 @@ +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id_** | **Int!** | | [optional] [default to null] +**name** | **String!** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/User.md b/samples/server/petstore/graphql-server/docs/User.md new file mode 100644 index 0000000000..7050f7aaef --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/User.md @@ -0,0 +1,17 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id_** | **Int!** | | [optional] [default to null] +**username** | **String!** | | [optional] [default to null] +**firstName** | **String!** | | [optional] [default to null] +**lastName** | **String!** | | [optional] [default to null] +**email** | **String!** | | [optional] [default to null] +**password** | **String!** | | [optional] [default to null] +**phone** | **String!** | | [optional] [default to null] +**userStatus** | **Int!** | User Status | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/server/petstore/graphql-server/docs/pet_api.md b/samples/server/petstore/graphql-server/docs/pet_api.md new file mode 100644 index 0000000000..8c1f1a1002 --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/pet_api.md @@ -0,0 +1,62 @@ +# pet_api + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddPet**](pet_api.md#AddPet) | **POST** /pet | Add a new pet to the store +[**DeletePet**](pet_api.md#DeletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**FindPetsByStatus**](pet_api.md#FindPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**FindPetsByTags**](pet_api.md#FindPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**GetPetById**](pet_api.md#GetPetById) | **GET** /pet/{petId} | Find pet by ID +[**UpdatePet**](pet_api.md#UpdatePet) | **PUT** /pet | Update an existing pet +[**UpdatePetWithForm**](pet_api.md#UpdatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**UploadFile**](pet_api.md#UploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +# **AddPet** +> AddPet(pet) + +Add a new pet to the store + +# **DeletePet** +> DeletePet(petId, apiKey) + +Deletes a pet + +# **FindPetsByStatus** +> Pet FindPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +# **FindPetsByTags** +> Pet FindPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +# **GetPetById** +> Pet GetPetById(petId) + +Find pet by ID + +Returns a single pet + +# **UpdatePet** +> UpdatePet(pet) + +Update an existing pet + +# **UpdatePetWithForm** +> UpdatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +# **UploadFile** +> ApiResponse UploadFile(petId, additionalMetadata, file) + +uploads an image diff --git a/samples/server/petstore/graphql-server/docs/store_api.md b/samples/server/petstore/graphql-server/docs/store_api.md new file mode 100644 index 0000000000..af02156f43 --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/store_api.md @@ -0,0 +1,38 @@ +# store_api + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteOrder**](store_api.md#DeleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**GetInventory**](store_api.md#GetInventory) | **GET** /store/inventory | Returns pet inventories by status +[**GetOrderById**](store_api.md#GetOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**PlaceOrder**](store_api.md#PlaceOrder) | **POST** /store/order | Place an order for a pet + + + +# **DeleteOrder** +> DeleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +# **GetInventory** +> Int! GetInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +# **GetOrderById** +> Order GetOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +# **PlaceOrder** +> Order PlaceOrder(order) + +Place an order for a pet diff --git a/samples/server/petstore/graphql-server/docs/user_api.md b/samples/server/petstore/graphql-server/docs/user_api.md new file mode 100644 index 0000000000..deb512ef0e --- /dev/null +++ b/samples/server/petstore/graphql-server/docs/user_api.md @@ -0,0 +1,62 @@ +# user_api + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](user_api.md#CreateUser) | **POST** /user | Create user +[**CreateUsersWithArrayInput**](user_api.md#CreateUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**CreateUsersWithListInput**](user_api.md#CreateUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**DeleteUser**](user_api.md#DeleteUser) | **DELETE** /user/{username} | Delete user +[**GetUserByName**](user_api.md#GetUserByName) | **GET** /user/{username} | Get user by user name +[**LoginUser**](user_api.md#LoginUser) | **GET** /user/login | Logs user into the system +[**LogoutUser**](user_api.md#LogoutUser) | **GET** /user/logout | Logs out current logged in user session +[**UpdateUser**](user_api.md#UpdateUser) | **PUT** /user/{username} | Updated user + + + +# **CreateUser** +> CreateUser(user) + +Create user + +This can only be done by the logged in user. + +# **CreateUsersWithArrayInput** +> CreateUsersWithArrayInput(user) + +Creates list of users with given input array + +# **CreateUsersWithListInput** +> CreateUsersWithListInput(user) + +Creates list of users with given input array + +# **DeleteUser** +> DeleteUser(username) + +Delete user + +This can only be done by the logged in user. + +# **GetUserByName** +> User GetUserByName(username) + +Get user by user name + +# **LoginUser** +> String! LoginUser(username, password) + +Logs user into the system + +# **LogoutUser** +> LogoutUser() + +Logs out current logged in user session + +# **UpdateUser** +> UpdateUser(username, user) + +Updated user + +This can only be done by the logged in user. diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/.gitignore b/samples/server/petstore/graphql-server/openapi3graphql-server/.gitignore new file mode 100644 index 0000000000..f86de69214 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/.gitignore @@ -0,0 +1,8 @@ +# MacOS +.DS_Store + +# IDE +/.idea + +# JS specific +/node_modules diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/README.md b/samples/server/petstore/graphql-server/openapi3graphql-server/README.md new file mode 100644 index 0000000000..0a840b4047 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/README.md @@ -0,0 +1,18 @@ +# GraphQL express API server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Requirements + +- node 10+ + +## Gettings started + + npm install + npm run start + +# TODOs + +- use `ID`-type for unique identifiers instead of `Int` (detect UUID) +- add example responses to resolvers.mustache +- support for union types diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/api/pet_api.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/api/pet_api.graphql new file mode 100644 index 0000000000..c1e7adb27f --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/api/pet_api.graphql @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# package openapi3graphql-server + +# pet_api + + + +input AddPetInput { + # Pet object that needs to be added to the store + pet: PetInput +} + +input DeletePetInput { + # Pet id to delete + petId: Int!, + + apiKey: String! +} + +input UpdatePetInput { + # Pet object that needs to be added to the store + pet: PetInput +} + +input UpdatePetWithFormInput { + # ID of pet that needs to be updated + petId: Int!, + # Updated name of the pet + name: String!, + # Updated status of the pet + status: String! +} + +input UploadFileInput { + # ID of pet to update + petId: Int!, + # Additional data to pass to server + additionalMetadata: String!, + # file to upload + file: String! +} + +type Mutation { + # Add a new pet to the store + # @param Pet pet Pet object that needs to be added to the store + # @return [Boolean] + AddPet(input: AddPetInput!): Boolean + # Deletes a pet + # @param Int! petId Pet id to delete + # @param String! apiKey + # @return [Boolean] + DeletePet(input: DeletePetInput!): Boolean + # Update an existing pet + # @param Pet pet Pet object that needs to be added to the store + # @return [Boolean] + UpdatePet(input: UpdatePetInput!): Boolean + # Updates a pet in the store with form data + # @param Int! petId ID of pet that needs to be updated + # @param String! name Updated name of the pet + # @param String! status Updated status of the pet + # @return [Boolean] + UpdatePetWithForm(input: UpdatePetWithFormInput!): Boolean + # uploads an image + # @param Int! petId ID of pet to update + # @param String! additionalMetadata Additional data to pass to server + # @param String! file file to upload + # @return [ApiResponse] + UploadFile(input: UploadFileInput!): ApiResponse +} + +type Query { + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param String! status Status values that need to be considered for filter + # @return [Pet] + FindPetsByStatus(status: String!): Pet + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param String! tags Tags to filter by + # @return [Pet] + FindPetsByTags(tags: String!): Pet + # Find pet by ID + # Returns a single pet + # @param Int! petId ID of pet to return + # @return [Pet] + GetPetById(petId: Int!): Pet +} + diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/api/pet_api_resolver.js b/samples/server/petstore/graphql-server/openapi3graphql-server/api/pet_api_resolver.js new file mode 100644 index 0000000000..3baf5ba736 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/api/pet_api_resolver.js @@ -0,0 +1,86 @@ +/** + * + * OpenAPI Petstore + * + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * Version: 1.0.0 + * + * Generated by OpenAPI Generator: https://openapi-generator.tech + */ + +// package openapi3graphql-server + +// pet_api + +export default { + Query: { + + // @return Pet + FindPetsByStatus: ($status) => { + return { + "status": "" + }; + }, + + // @return Pet + FindPetsByTags: ($tags) => { + return { + "tags": "" + }; + }, + + // @return Pet + GetPetById: ($petId) => { + return { + "petId": "789" + }; + }, + + }, + + Mutation: { + + // @return + AddPet: ($pet) => { + return { + "pet": "" + }; + }, + + // @return + DeletePet: ($petId, $apiKey) => { + return { + "petId": "789", + "apiKey": "apiKey_example" + }; + }, + + // @return + UpdatePet: ($pet) => { + return { + "pet": "" + }; + }, + + // @return + UpdatePetWithForm: ($petId, $name, $status) => { + return { + "petId": "789", + "name": "name_example", + "status": "status_example" + }; + }, + + // @return ApiResponse + UploadFile: ($petId, $additionalMetadata, $file) => { + return { + "petId": "789", + "additionalMetadata": "additionalMetadata_example", + "file": "BINARY_DATA_HERE" + }; + }, + + } +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/api/store_api.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/api/store_api.graphql new file mode 100644 index 0000000000..91abf10482 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/api/store_api.graphql @@ -0,0 +1,50 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# package openapi3graphql-server + +# store_api + + + +input DeleteOrderInput { + # ID of the order that needs to be deleted + orderId: String! +} + +input PlaceOrderInput { + # order placed for purchasing the pet + order: OrderInput +} + +type Mutation { + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param String! orderId ID of the order that needs to be deleted + # @return [Boolean] + DeleteOrder(input: DeleteOrderInput!): Boolean + # Place an order for a pet + # @param Order order order placed for purchasing the pet + # @return [Order] + PlaceOrder(input: PlaceOrderInput!): Order +} + +type Query { + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @return [Int!] + GetInventory: Int! + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param Int! orderId ID of pet that needs to be fetched + # @return [Order] + GetOrderById(orderId: Int!): Order +} + diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/api/store_api_resolver.js b/samples/server/petstore/graphql-server/openapi3graphql-server/api/store_api_resolver.js new file mode 100644 index 0000000000..d5222cc57f --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/api/store_api_resolver.js @@ -0,0 +1,53 @@ +/** + * + * OpenAPI Petstore + * + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * Version: 1.0.0 + * + * Generated by OpenAPI Generator: https://openapi-generator.tech + */ + +// package openapi3graphql-server + +// store_api + +export default { + Query: { + + // @return Int! + GetInventory: () => { + return { + + }; + }, + + // @return Order + GetOrderById: ($orderId) => { + return { + "orderId": "789" + }; + }, + + }, + + Mutation: { + + // @return + DeleteOrder: ($orderId) => { + return { + "orderId": "orderId_example" + }; + }, + + // @return Order + PlaceOrder: ($order) => { + return { + "order": "" + }; + }, + + } +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/api/user_api.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/api/user_api.graphql new file mode 100644 index 0000000000..2c549b3362 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/api/user_api.graphql @@ -0,0 +1,85 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# package openapi3graphql-server + +# user_api + + + +input CreateUserInput { + # Created user object + user: UserInput +} + +input CreateUsersWithArrayInputInput { + # List of user object + user: [UserInput] +} + +input CreateUsersWithListInputInput { + # List of user object + user: [UserInput] +} + +input DeleteUserInput { + # The name that needs to be deleted + username: String! +} + +input UpdateUserInput { + # name that need to be deleted + username: String!, + # Updated user object + user: UserInput +} + +type Mutation { + # Create user + # This can only be done by the logged in user. + # @param User user Created user object + # @return [Boolean] + CreateUser(input: CreateUserInput!): Boolean + # Creates list of users with given input array + # @param User user List of user object + # @return [Boolean] + CreateUsersWithArrayInput(input: CreateUsersWithArrayInputInput!): Boolean + # Creates list of users with given input array + # @param User user List of user object + # @return [Boolean] + CreateUsersWithListInput(input: CreateUsersWithListInputInput!): Boolean + # Delete user + # This can only be done by the logged in user. + # @param String! username The name that needs to be deleted + # @return [Boolean] + DeleteUser(input: DeleteUserInput!): Boolean + # Updated user + # This can only be done by the logged in user. + # @param String! username name that need to be deleted + # @param User user Updated user object + # @return [Boolean] + UpdateUser(input: UpdateUserInput!): Boolean +} + +type Query { + # Get user by user name + # @param String! username The name that needs to be fetched. Use user1 for testing. + # @return [User] + GetUserByName(username: String!): User + # Logs user into the system + # @param String! username The user name for login + # @param String! password The password for login in clear text + # @return [String!] + LoginUser(username: String!, password: String!): String! + # Logs out current logged in user session + # @return [Boolean] + LogoutUser: Boolean +} + diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/api/user_api_resolver.js b/samples/server/petstore/graphql-server/openapi3graphql-server/api/user_api_resolver.js new file mode 100644 index 0000000000..1402403132 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/api/user_api_resolver.js @@ -0,0 +1,83 @@ +/** + * + * OpenAPI Petstore + * + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * Version: 1.0.0 + * + * Generated by OpenAPI Generator: https://openapi-generator.tech + */ + +// package openapi3graphql-server + +// user_api + +export default { + Query: { + + // @return User + GetUserByName: ($username) => { + return { + "username": "username_example" + }; + }, + + // @return String! + LoginUser: ($username, $password) => { + return { + "username": "username_example", + "password": "password_example" + }; + }, + + // @return + LogoutUser: () => { + return { + + }; + }, + + }, + + Mutation: { + + // @return + CreateUser: ($user) => { + return { + "user": "" + }; + }, + + // @return + CreateUsersWithArrayInput: ($user) => { + return { + "user": "" + }; + }, + + // @return + CreateUsersWithListInput: ($user) => { + return { + "user": "" + }; + }, + + // @return + DeleteUser: ($username) => { + return { + "username": "username_example" + }; + }, + + // @return + UpdateUser: ($username, $user) => { + return { + "username": "username_example", + "user": "" + }; + }, + + } +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/api_response.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/api_response.graphql new file mode 100644 index 0000000000..3115457836 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/api_response.graphql @@ -0,0 +1,22 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# Describes the result of uploading an image resource +type ApiResponse { + code: Int! + type: String! + message: String! +} + +input ApiResponseInput { + code: Int! + type: String! + message: String! +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/category.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/category.graphql new file mode 100644 index 0000000000..cb07f7c3e4 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/category.graphql @@ -0,0 +1,20 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A category for a pet +type Category { + id: Int! + name: String! +} + +input CategoryInput { + id: Int! + name: String! +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/inline_object.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/inline_object.graphql new file mode 100644 index 0000000000..ef9c97e15d --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/inline_object.graphql @@ -0,0 +1,23 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +type InlineObject { + # Updated name of the pet + name: String! + # Updated status of the pet + status: String! +} + +input InlineObjectInput { + # Updated name of the pet + name: String! + # Updated status of the pet + status: String! +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/inline_object_1.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/inline_object_1.graphql new file mode 100644 index 0000000000..ef13a19d0b --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/inline_object_1.graphql @@ -0,0 +1,23 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +type InlineObject1 { + # Additional data to pass to server + additionalMetadata: String! + # file to upload + file: String! +} + +input InlineObject1Input { + # Additional data to pass to server + additionalMetadata: String! + # file to upload + file: String! +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/order.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/order.graphql new file mode 100644 index 0000000000..eb22a186b2 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/order.graphql @@ -0,0 +1,37 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# An order for a pets from the pet store +type Order { + id: Int! + petId: Int! + quantity: Int! + shipDate: String! + # Order Status + status: OrderStatusEnum + complete: Boolean! +} + +input OrderInput { + id: Int! + petId: Int! + quantity: Int! + shipDate: String! + # Order Status + status: OrderStatusEnum + complete: Boolean! +} + +# Order Status +enum OrderStatusEnum { + placed + approved + delivered +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/pet.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/pet.graphql new file mode 100644 index 0000000000..14f10c8062 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/pet.graphql @@ -0,0 +1,37 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A pet for sale in the pet store +type Pet { + id: Int! + category: Category + name: String! + photoUrls: String! + tags: Tag + # pet status in the store + status: PetStatusEnum +} + +input PetInput { + id: Int! + category: CategoryInput + name: String! + photoUrls: [String!] + tags: [TagInput] + # pet status in the store + status: PetStatusEnum +} + +# pet status in the store +enum PetStatusEnum { + available + pending + sold +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/tag.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/tag.graphql new file mode 100644 index 0000000000..d1bafdfd22 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/tag.graphql @@ -0,0 +1,20 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A tag for a pet +type Tag { + id: Int! + name: String! +} + +input TagInput { + id: Int! + name: String! +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/model/user.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/model/user.graphql new file mode 100644 index 0000000000..02d1748a14 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/model/user.graphql @@ -0,0 +1,34 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A User who is purchasing from the pet store +type User { + id: Int! + username: String! + firstName: String! + lastName: String! + email: String! + password: String! + phone: String! + # User Status + userStatus: Int! +} + +input UserInput { + id: Int! + username: String! + firstName: String! + lastName: String! + email: String! + password: String! + phone: String! + # User Status + userStatus: Int! +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/package-lock.json b/samples/server/petstore/graphql-server/openapi3graphql-server/package-lock.json new file mode 100644 index 0000000000..3b92abb597 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/package-lock.json @@ -0,0 +1,2123 @@ +{ + "name": "graphql-server", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@apollographql/apollo-tools": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.2.6.tgz", + "integrity": "sha512-IKn35EzAHFQw4x8THux+fkVLkFNs8HDzIgKqcU5ZMfkDt3MOa1nfMbGVoVh2YdvpIjPtyUR3kvAAVQwmRPRjAQ==", + "requires": { + "apollo-env": "0.2.3" + } + }, + "@apollographql/apollo-upload-server": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-upload-server/-/apollo-upload-server-5.0.3.tgz", + "integrity": "sha512-tGAp3ULNyoA8b5o9LsU2Lq6SwgVPUOKAqKywu2liEtTvrFSGPrObwanhYwArq3GPeOqp2bi+JknSJCIU3oQN1Q==", + "requires": { + "@babel/runtime-corejs2": "^7.0.0-rc.1", + "busboy": "^0.2.14", + "object-path": "^0.11.4" + } + }, + "@apollographql/graphql-playground-html": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.4.tgz", + "integrity": "sha512-gwvaQO6/Hv4DEwhDLmmu2tzCU9oPjC5Xl9Kk8Yd0IxyKhYLlLalmkMMjsZLzU5H3fGaalLD96OYfxHL0ClVUDQ==" + }, + "@babel/runtime-corejs2": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.1.5.tgz", + "integrity": "sha512-WsYRwQsFhVmxkAqwypPTZyV9GpkqMEaAr2zOItOmqSX2GBFaI+eq98CN81e13o0zaUKJOQGYyjhNVqj56nnkYg==", + "requires": { + "core-js": "^2.5.7", + "regenerator-runtime": "^0.12.0" + } + }, + "@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78=" + }, + "@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A=" + }, + "@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=", + "requires": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=" + }, + "@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=" + }, + "@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=" + }, + "@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=" + }, + "@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" + }, + "@types/accepts": { + "version": "1.3.5", + "resolved": "http://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/body-parser": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.17.0.tgz", + "integrity": "sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w==", + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.32", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.32.tgz", + "integrity": "sha512-4r8qa0quOvh7lGD0pre62CAb1oni1OO6ecJLGCezTmhQ8Fz50Arx9RUszryR8KlgK6avuSXvviL6yWyViQABOg==", + "requires": { + "@types/node": "*" + } + }, + "@types/cors": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.4.tgz", + "integrity": "sha512-ipZjBVsm2tF/n8qFGOuGBkUij9X9ZswVi9G3bx/6dz7POpVa6gVHcj1wsX/LVEn9MMF41fxK/PnZPPoTD1UFPw==", + "requires": { + "@types/express": "*" + } + }, + "@types/events": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/@types/events/-/events-1.2.0.tgz", + "integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==" + }, + "@types/express": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.0.tgz", + "integrity": "sha512-TtPEYumsmSTtTetAPXlJVf3kEqb6wZK0bZojpJQrnD/djV4q1oB6QQ8aKvKqwNPACoe02GNiy5zDzcYivR5Z2w==", + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.0.tgz", + "integrity": "sha512-lTeoCu5NxJU4OD9moCgm0ESZzweAx0YqsAcab6OB0EB3+As1OaHtKnaGJvcngQxYsi9UNv0abn4/DRavrRxt4w==", + "requires": { + "@types/events": "*", + "@types/node": "*", + "@types/range-parser": "*" + } + }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, + "@types/mime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", + "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==" + }, + "@types/node": { + "version": "10.12.8", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.8.tgz", + "integrity": "sha512-INamyRZG4rW3lDCUmwVd5Xho/bXvQm/v1yP8V0UN1RuInU7RoWoaO570b+yLX4Ia/0szsx1wa8VzcsVlsvbWLA==" + }, + "@types/range-parser": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.2.tgz", + "integrity": "sha512-HtKGu+qG1NPvYe1z7ezLsyIaXYyi8SoAVqWDZgDQ8dLrsZvSzUNCwZyfX33uhWxL/SU0ZDQZ3nwZ0nimt507Kw==" + }, + "@types/serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-/BZ4QRLpH/bNYgZgwhKEh+5AsboDBcUdlBYgzoLX0fpj3Y2gp6EApyOlM3bK53wQS/OE1SrdSYBAbux2D1528Q==", + "requires": { + "@types/express-serve-static-core": "*", + "@types/mime": "*" + } + }, + "@types/ws": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-6.0.1.tgz", + "integrity": "sha512-EzH8k1gyZ4xih/MaZTXwT2xOkPiIMSrhQ9b8wrlX88L0T02eYsddatQlwVFlEPyEqV0ChpdpNnE51QPH6NVT4Q==", + "requires": { + "@types/events": "*", + "@types/node": "*" + } + }, + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "requires": { + "mime-types": "~2.1.18", + "negotiator": "0.6.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "apollo-cache-control": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/apollo-cache-control/-/apollo-cache-control-0.3.2.tgz", + "integrity": "sha512-/fhgCWGEoTsgyA83usy/1NvJWi6hbD4rSGO5jvyNNtMZ9ledOvKUvIdzSQ1r5hxK5yds/eehWXhMJ4Pu200qrQ==", + "requires": { + "apollo-server-env": "2.2.0", + "graphql-extensions": "0.3.2" + } + }, + "apollo-datasource": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-0.2.0.tgz", + "integrity": "sha512-WJM9Ix3uogIfAG7mjL1NZQM9+45rcikn4mPWhE1Iuyw2+Y857J3uKJqQgF5h9Fg64SlCJh9u5WL3N7N5mg1fVw==", + "requires": { + "apollo-server-caching": "0.2.0", + "apollo-server-env": "2.2.0" + } + }, + "apollo-engine-reporting": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/apollo-engine-reporting/-/apollo-engine-reporting-0.1.2.tgz", + "integrity": "sha512-W6zBTypI2ZLe9ZpMI4EasyXJP2WG8CpxYOU3Q4iuCKh8HYJqrQC5QVFXRF7TRBQTE6tc1seYnAHdgqv0ozxBrw==", + "requires": { + "apollo-engine-reporting-protobuf": "0.1.0", + "apollo-server-env": "2.2.0", + "async-retry": "^1.2.1", + "graphql-extensions": "0.3.2", + "lodash": "^4.17.10" + } + }, + "apollo-engine-reporting-protobuf": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.1.0.tgz", + "integrity": "sha512-GReJtAYTmpwg0drb9VgFtqObYYTCHkJhlHEYCeXY8bJV4fOgXsAZ7CIXR9nPKO0mBaoHIHaGYvXGcyCLrZ36VA==", + "requires": { + "protobufjs": "^6.8.6" + } + }, + "apollo-env": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/apollo-env/-/apollo-env-0.2.3.tgz", + "integrity": "sha512-7hRWPG8tWQNXCNrZsOMqxtkHGqhTzFgsw7RpFDyC1xgcZvVFCJvthWgWO07EhcaHhRqvrPxmicLnoTw2e/iCsA==", + "requires": { + "core-js": "^3.0.0-beta.3", + "node-fetch": "^2.2.0" + }, + "dependencies": { + "core-js": { + "version": "3.0.0-beta.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.0.0-beta.3.tgz", + "integrity": "sha512-kM/OfrnMThP5PwGAj5HhQLdjUqzjrllqN2EVnk/X9qrLsfYjR2hzZ+E/8CzH0xuosexZtqMTLQrk//BULrBj9w==" + } + } + }, + "apollo-link": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.3.tgz", + "integrity": "sha512-iL9yS2OfxYhigme5bpTbmRyC+Htt6tyo2fRMHT3K1XRL/C5IQDDz37OjpPy4ndx7WInSvfSZaaOTKFja9VWqSw==", + "requires": { + "apollo-utilities": "^1.0.0", + "zen-observable-ts": "^0.8.10" + } + }, + "apollo-server-caching": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/apollo-server-caching/-/apollo-server-caching-0.2.0.tgz", + "integrity": "sha512-/v7xWEcyyahs3hwX4baH/GekuHz3LRt9NoIYwg869G1eeqjuwY6NsowRIujZ100anJQwm9v5A9/sLtHBFvbgYg==", + "requires": { + "lru-cache": "^4.1.3" + } + }, + "apollo-server-core": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-2.2.2.tgz", + "integrity": "sha512-F6d4u5m1rJB4ucpLPGCoa9Dvo5OjGMIGdAzT9A35yOvlFWwvIR46jGmYmGmNp4Qx852rb1axSZVzNy7k/Dix0w==", + "requires": { + "@apollographql/apollo-tools": "^0.2.6", + "@apollographql/apollo-upload-server": "^5.0.3", + "@apollographql/graphql-playground-html": "^1.6.4", + "@types/ws": "^6.0.0", + "apollo-cache-control": "0.3.2", + "apollo-datasource": "0.2.0", + "apollo-engine-reporting": "0.1.2", + "apollo-server-caching": "0.2.0", + "apollo-server-env": "2.2.0", + "apollo-server-errors": "2.2.0", + "apollo-server-plugin-base": "0.1.2", + "apollo-tracing": "0.3.2", + "graphql-extensions": "0.3.2", + "graphql-subscriptions": "^1.0.0", + "graphql-tag": "^2.9.2", + "graphql-tools": "^4.0.0", + "json-stable-stringify": "^1.0.1", + "lodash": "^4.17.10", + "subscriptions-transport-ws": "^0.9.11", + "ws": "^6.0.0" + } + }, + "apollo-server-env": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-2.2.0.tgz", + "integrity": "sha512-wjJiI5nQWPBpNmpiLP389Ezpstp71szS6DHAeTgYLb/ulCw3CTuuA+0/E1bsThVWiQaDeHZE0sE3yI8q2zrYiA==", + "requires": { + "node-fetch": "^2.1.2", + "util.promisify": "^1.0.0" + } + }, + "apollo-server-errors": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-2.2.0.tgz", + "integrity": "sha512-gV9EZG2tovFtT1cLuCTavnJu2DaKxnXPRNGSTo+SDI6IAk6cdzyW0Gje5N2+3LybI0Wq5KAbW6VLei31S4MWmg==" + }, + "apollo-server-express": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-2.2.2.tgz", + "integrity": "sha512-DPxHOUd0Waztuix0r1ed6xfdlR7P7RzIXPmybhPXj1bZJtYHz5If0ngYNjtFqnXVrC8aSRtMz108SQUAnduYwA==", + "requires": { + "@apollographql/apollo-upload-server": "^5.0.3", + "@apollographql/graphql-playground-html": "^1.6.4", + "@types/accepts": "^1.3.5", + "@types/body-parser": "1.17.0", + "@types/cors": "^2.8.4", + "@types/express": "4.16.0", + "accepts": "^1.3.5", + "apollo-server-core": "2.2.2", + "body-parser": "^1.18.3", + "cors": "^2.8.4", + "graphql-subscriptions": "^1.0.0", + "graphql-tools": "^4.0.0", + "type-is": "^1.6.16" + } + }, + "apollo-server-plugin-base": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-0.1.2.tgz", + "integrity": "sha512-+uicMcNctlP6YwIhzLLEycZzao/810OSzcxgPYKItXr5lGa1GuHD7sRIWldT3YoSdpw6Gal2lBuw6/DmnoDsPg==" + }, + "apollo-tracing": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/apollo-tracing/-/apollo-tracing-0.3.2.tgz", + "integrity": "sha512-YwN1m1k0JJsxGh0QWsEM3OLnyem0GT2tZnGeO2OogCr6dH5lE0SjKPc6UzpcI/3fPyxRrx5QvpUiP+DJeehhTA==", + "requires": { + "apollo-server-env": "2.2.0", + "graphql-extensions": "0.3.2" + } + }, + "apollo-utilities": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.0.25.tgz", + "integrity": "sha512-AXvqkhni3Ir1ffm4SA1QzXn8k8I5BBl4PVKEyak734i4jFdp+xgfUyi2VCqF64TJlFTA/B73TRDUvO2D+tKtZg==", + "requires": { + "fast-json-stable-stringify": "^2.0.0" + } + }, + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "async-limiter": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", + "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + }, + "async-retry": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.2.3.tgz", + "integrity": "sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q==", + "requires": { + "retry": "0.12.0" + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "http://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "body-parser": { + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "~1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "~2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "~1.6.16" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, + "busboy": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", + "integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=", + "requires": { + "dicer": "0.2.5", + "readable-stream": "1.1.x" + } + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "caniuse-lite": { + "version": "1.0.30000907", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000907.tgz", + "integrity": "sha512-No5sQ/OB2Nmka8MNOOM6nJx+Hxt6MQ6h7t7kgJFu9oTuwjykyKRSBP/+i/QAyFHxeHB+ddE0Da1CG5ihx9oehQ==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "deprecated-decorator": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/deprecated-decorator/-/deprecated-decorator-0.1.6.tgz", + "integrity": "sha1-AJZjF7ehL+kvPMgx91g68ym4bDc=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "^2.0.0" + } + }, + "dicer": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", + "integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=", + "requires": { + "readable-stream": "1.1.x", + "streamsearch": "0.1.2" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "electron-to-chromium": { + "version": "1.3.84", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.84.tgz", + "integrity": "sha512-IYhbzJYOopiTaNWMBp7RjbecUBsbnbDneOP86f3qvS0G0xfzwNSvMJpTrvi5/Y1gU7tg2NAgeg8a8rCYvW9Whw==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" + }, + "express": { + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz", + "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==", + "requires": { + "accepts": "~1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.3", + "content-disposition": "0.5.2", + "content-type": "~1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.4", + "qs": "6.5.2", + "range-parser": "~1.2.0", + "safe-buffer": "5.1.2", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "~1.4.0", + "type-is": "~1.6.16", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.4.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } + } + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "graphql": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-14.0.2.tgz", + "integrity": "sha512-gUC4YYsaiSJT1h40krG3J+USGlwhzNTXSb4IOZljn9ag5Tj+RkoXrWp+Kh7WyE3t1NCfab5kzCuxBIvOMERMXw==", + "requires": { + "iterall": "^1.2.2" + } + }, + "graphql-combine": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/graphql-combine/-/graphql-combine-1.0.0.tgz", + "integrity": "sha512-BoopwLFAxCA8K7XLWE5a0NCGSrImlhcpb4HeUGWV5re1PTBPV5DUcXdU3jToguVg6DPNv+9awzl4CVj17Ffbeg==", + "requires": { + "glob": "^7.1.2", + "lodash.merge": "^4.6.1" + } + }, + "graphql-extensions": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/graphql-extensions/-/graphql-extensions-0.3.2.tgz", + "integrity": "sha512-eIAWwtZNlUAHtHF6uNP6+4M+GCksqUYfNBxW5rTAlCB4/ZcuIvchVtN1CgVM7MooW3akPM1Eci11WyeXvgOugQ==", + "requires": { + "@apollographql/apollo-tools": "^0.2.6" + } + }, + "graphql-subscriptions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/graphql-subscriptions/-/graphql-subscriptions-1.0.0.tgz", + "integrity": "sha512-+ytmryoHF1LVf58NKEaNPRUzYyXplm120ntxfPcgOBC7TnK7Tv/4VRHeh4FAR9iL+O1bqhZs4nkibxQ+OA5cDQ==", + "requires": { + "iterall": "^1.2.1" + } + }, + "graphql-tag": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.0.tgz", + "integrity": "sha512-9FD6cw976TLLf9WYIUPCaaTpniawIjHWZSwIRZSjrfufJamcXbVVYfN2TWvJYbw0Xf2JjYbl1/f2+wDnBVw3/w==" + }, + "graphql-tools": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/graphql-tools/-/graphql-tools-4.0.3.tgz", + "integrity": "sha512-NNZM0WSnVLX1zIMUxu7SjzLZ4prCp15N5L2T2ro02OVyydZ0fuCnZYRnx/yK9xjGWbZA0Q58yEO//Bv/psJWrg==", + "requires": { + "apollo-link": "^1.2.3", + "apollo-utilities": "^1.0.1", + "deprecated-decorator": "^0.1.6", + "iterall": "^1.1.3", + "uuid": "^3.1.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "ipaddr.js": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", + "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==" + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "requires": { + "has-symbols": "^1.0.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "iterall": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.2.2.tgz", + "integrity": "sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA==" + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "jsesc": { + "version": "0.5.0", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "requires": { + "jsonify": "~0.0.0" + } + }, + "json5": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=" + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "requires": { + "mime-db": "~1.37.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" + }, + "node-fetch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", + "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==" + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-keys": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" + }, + "object-path": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.4.tgz", + "integrity": "sha1-NwrnUvvzfePqcKhhwju6iRVpGUk=" + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "path": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", + "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "requires": { + "process": "^0.11.1", + "util": "^0.10.3" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "protobufjs": { + "version": "6.8.8", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.8.8.tgz", + "integrity": "sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw==", + "requires": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + } + }, + "proxy-addr": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", + "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "requires": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.8.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "raw-body": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" + } + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==" + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" + }, + "dependencies": { + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" + } + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", + "send": "0.16.2" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "^0.5.6" + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "streamsearch": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", + "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "subscriptions-transport-ws": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.9.15.tgz", + "integrity": "sha512-f9eBfWdHsePQV67QIX+VRhf++dn1adyC/PZHP6XI5AfKnZ4n0FW+v5omxwdHVpd4xq2ZijaHEcmlQrhBY79ZWQ==", + "requires": { + "backo2": "^1.0.2", + "eventemitter3": "^3.1.0", + "iterall": "^1.2.1", + "symbol-observable": "^1.0.4", + "ws": "^5.2.0" + }, + "dependencies": { + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.18" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "requires": { + "inherits": "2.0.3" + } + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "ws": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.0.tgz", + "integrity": "sha512-H3dGVdGvW2H8bnYpIDc3u3LH8Wue3Qh+Zto6aXXFzvESkTVT6rAfKR6tR/+coaUvxs8yHtmNV0uioBF62ZGSTg==", + "requires": { + "async-limiter": "~1.0.0" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "zen-observable": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.11.tgz", + "integrity": "sha512-N3xXQVr4L61rZvGMpWe8XoCGX8vhU35dPyQ4fm5CY/KDlG0F75un14hjbckPXTDuKUY6V0dqR2giT6xN8Y4GEQ==" + }, + "zen-observable-ts": { + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-0.8.10.tgz", + "integrity": "sha512-5vqMtRggU/2GhePC9OU4sYEWOdvmayp2k3gjPf4F0mXwB3CSbbNznfDUvDJx9O2ZTa1EIXdJhPchQveFKwNXPQ==", + "requires": { + "zen-observable": "^0.8.0" + } + } + } +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/package.json b/samples/server/petstore/graphql-server/openapi3graphql-server/package.json new file mode 100644 index 0000000000..f49cf22d70 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/package.json @@ -0,0 +1,25 @@ +{ + "name": "graphql-server", + "version": "1.0.0", + "description": " This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. ", + "main": "index.js", + "scripts": { + "start": "node start.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "latest", + "graphql": "latest", + "apollo-server-express": "latest", + "graphql-combine": "latest", + "lodash": "latest", + "path": "latest" + }, + "devDependencies": { + "babel-register": "latest", + "babel-preset-env": "latest" + } +} diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/schema.graphql b/samples/server/petstore/graphql-server/openapi3graphql-server/schema.graphql new file mode 100644 index 0000000000..94c2def809 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/schema.graphql @@ -0,0 +1,3 @@ +interface Entity { + id: Int! +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/server.js b/samples/server/petstore/graphql-server/openapi3graphql-server/server.js new file mode 100644 index 0000000000..e149816253 --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/server.js @@ -0,0 +1,37 @@ +import express from 'express'; +import {ApolloServer, graphiqlExpress, graphqlExpress} from 'apollo-server-express' +import combine from 'graphql-combine' +import path from 'path' + +const PORT = 4000 || process.env; + +// Initialize the app +const app = express(); + +// Get combined typeDefs and resolvers object +const {typeDefs, resolvers} = combine({ + // TypeDefs glob pattern + typeDefs: path.join(__dirname, '**/*.graphql'), + + // Resolvers glob pattern + resolvers: path.join(__dirname, 'api/*_resolver.js') +}); + +// GraphQL: Schema +const server = new ApolloServer({ + typeDefs: typeDefs, + resolvers: resolvers, + playground: { + endpoint: `http://localhost:${PORT}/graphql`, + settings: { + 'editor.theme': 'light' + } + } +}); + +server.applyMiddleware({app: app}); + +// Start the server +app.listen(PORT, () => { + console.log(`You can reach GraphQL at: http://localhost:${PORT}/graphql`); +}); \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/openapi3graphql-server/start.js b/samples/server/petstore/graphql-server/openapi3graphql-server/start.js new file mode 100644 index 0000000000..1cdb39b91a --- /dev/null +++ b/samples/server/petstore/graphql-server/openapi3graphql-server/start.js @@ -0,0 +1,7 @@ +// Transpile all code following this line with babel and use 'env' (aka ES6) preset. +require('babel-register')({ + presets: ['env'] +}); + +// Import the rest of our application. +module.exports = require('./server.js'); diff --git a/samples/server/petstore/graphql-server/petstore/.gitignore b/samples/server/petstore/graphql-server/petstore/.gitignore new file mode 100644 index 0000000000..f86de69214 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/.gitignore @@ -0,0 +1,8 @@ +# MacOS +.DS_Store + +# IDE +/.idea + +# JS specific +/node_modules diff --git a/samples/server/petstore/graphql-server/petstore/README.md b/samples/server/petstore/graphql-server/petstore/README.md new file mode 100644 index 0000000000..0a840b4047 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/README.md @@ -0,0 +1,18 @@ +# GraphQL express API server + +This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + +## Requirements + +- node 10+ + +## Gettings started + + npm install + npm run start + +# TODOs + +- use `ID`-type for unique identifiers instead of `Int` (detect UUID) +- add example responses to resolvers.mustache +- support for union types diff --git a/samples/server/petstore/graphql-server/petstore/api/pet_api.graphql b/samples/server/petstore/graphql-server/petstore/api/pet_api.graphql new file mode 100644 index 0000000000..ed1b0337f7 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/api/pet_api.graphql @@ -0,0 +1,97 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# package petstore + +# pet_api + + + +input AddPetInput { + # Pet object that needs to be added to the store + pet: PetInput +} + +input DeletePetInput { + # Pet id to delete + petId: Int!, + + apiKey: String! +} + +input UpdatePetInput { + # Pet object that needs to be added to the store + pet: PetInput +} + +input UpdatePetWithFormInput { + # ID of pet that needs to be updated + petId: Int!, + # Updated name of the pet + name: String!, + # Updated status of the pet + status: String! +} + +input UploadFileInput { + # ID of pet to update + petId: Int!, + # Additional data to pass to server + additionalMetadata: String!, + # file to upload + file: String! +} + +type Mutation { + # Add a new pet to the store + # @param Pet pet Pet object that needs to be added to the store + # @return [Boolean] + AddPet(input: AddPetInput!): Boolean + # Deletes a pet + # @param Int! petId Pet id to delete + # @param String! apiKey + # @return [Boolean] + DeletePet(input: DeletePetInput!): Boolean + # Update an existing pet + # @param Pet pet Pet object that needs to be added to the store + # @return [Boolean] + UpdatePet(input: UpdatePetInput!): Boolean + # Updates a pet in the store with form data + # @param Int! petId ID of pet that needs to be updated + # @param String! name Updated name of the pet + # @param String! status Updated status of the pet + # @return [Boolean] + UpdatePetWithForm(input: UpdatePetWithFormInput!): Boolean + # uploads an image + # @param Int! petId ID of pet to update + # @param String! additionalMetadata Additional data to pass to server + # @param String! file file to upload + # @return [ApiResponse] + UploadFile(input: UploadFileInput!): ApiResponse +} + +type Query { + # Finds Pets by status + # Multiple status values can be provided with comma separated strings + # @param String! status Status values that need to be considered for filter + # @return [Pet] + FindPetsByStatus(status: String!): Pet + # Finds Pets by tags + # Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + # @param String! tags Tags to filter by + # @return [Pet] + FindPetsByTags(tags: String!): Pet + # Find pet by ID + # Returns a single pet + # @param Int! petId ID of pet to return + # @return [Pet] + GetPetById(petId: Int!): Pet +} + diff --git a/samples/server/petstore/graphql-server/petstore/api/pet_api_resolver.js b/samples/server/petstore/graphql-server/petstore/api/pet_api_resolver.js new file mode 100644 index 0000000000..f4f8256078 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/api/pet_api_resolver.js @@ -0,0 +1,86 @@ +/** + * + * OpenAPI Petstore + * + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * Version: 1.0.0 + * + * Generated by OpenAPI Generator: https://openapi-generator.tech + */ + +// package petstore + +// pet_api + +export default { + Query: { + + // @return Pet + FindPetsByStatus: ($status) => { + return { + "status": "" + }; + }, + + // @return Pet + FindPetsByTags: ($tags) => { + return { + "tags": "" + }; + }, + + // @return Pet + GetPetById: ($petId) => { + return { + "petId": "789" + }; + }, + + }, + + Mutation: { + + // @return + AddPet: ($pet) => { + return { + "pet": "" + }; + }, + + // @return + DeletePet: ($petId, $apiKey) => { + return { + "petId": "789", + "apiKey": "apiKey_example" + }; + }, + + // @return + UpdatePet: ($pet) => { + return { + "pet": "" + }; + }, + + // @return + UpdatePetWithForm: ($petId, $name, $status) => { + return { + "petId": "789", + "name": "name_example", + "status": "status_example" + }; + }, + + // @return ApiResponse + UploadFile: ($petId, $additionalMetadata, $file) => { + return { + "petId": "789", + "additionalMetadata": "additionalMetadata_example", + "file": "BINARY_DATA_HERE" + }; + }, + + } +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/petstore/api/store_api.graphql b/samples/server/petstore/graphql-server/petstore/api/store_api.graphql new file mode 100644 index 0000000000..4ad4c53c00 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/api/store_api.graphql @@ -0,0 +1,50 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# package petstore + +# store_api + + + +input DeleteOrderInput { + # ID of the order that needs to be deleted + orderId: String! +} + +input PlaceOrderInput { + # order placed for purchasing the pet + order: OrderInput +} + +type Mutation { + # Delete purchase order by ID + # For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + # @param String! orderId ID of the order that needs to be deleted + # @return [Boolean] + DeleteOrder(input: DeleteOrderInput!): Boolean + # Place an order for a pet + # @param Order order order placed for purchasing the pet + # @return [Order] + PlaceOrder(input: PlaceOrderInput!): Order +} + +type Query { + # Returns pet inventories by status + # Returns a map of status codes to quantities + # @return [Int!] + GetInventory: Int! + # Find purchase order by ID + # For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + # @param Int! orderId ID of pet that needs to be fetched + # @return [Order] + GetOrderById(orderId: Int!): Order +} + diff --git a/samples/server/petstore/graphql-server/petstore/api/store_api_resolver.js b/samples/server/petstore/graphql-server/petstore/api/store_api_resolver.js new file mode 100644 index 0000000000..a20d3113ac --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/api/store_api_resolver.js @@ -0,0 +1,53 @@ +/** + * + * OpenAPI Petstore + * + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * Version: 1.0.0 + * + * Generated by OpenAPI Generator: https://openapi-generator.tech + */ + +// package petstore + +// store_api + +export default { + Query: { + + // @return Int! + GetInventory: () => { + return { + + }; + }, + + // @return Order + GetOrderById: ($orderId) => { + return { + "orderId": "789" + }; + }, + + }, + + Mutation: { + + // @return + DeleteOrder: ($orderId) => { + return { + "orderId": "orderId_example" + }; + }, + + // @return Order + PlaceOrder: ($order) => { + return { + "order": "" + }; + }, + + } +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/petstore/api/user_api.graphql b/samples/server/petstore/graphql-server/petstore/api/user_api.graphql new file mode 100644 index 0000000000..e709fb3c56 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/api/user_api.graphql @@ -0,0 +1,85 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# package petstore + +# user_api + + + +input CreateUserInput { + # Created user object + user: UserInput +} + +input CreateUsersWithArrayInputInput { + # List of user object + user: [UserInput] +} + +input CreateUsersWithListInputInput { + # List of user object + user: [UserInput] +} + +input DeleteUserInput { + # The name that needs to be deleted + username: String! +} + +input UpdateUserInput { + # name that need to be deleted + username: String!, + # Updated user object + user: UserInput +} + +type Mutation { + # Create user + # This can only be done by the logged in user. + # @param User user Created user object + # @return [Boolean] + CreateUser(input: CreateUserInput!): Boolean + # Creates list of users with given input array + # @param User user List of user object + # @return [Boolean] + CreateUsersWithArrayInput(input: CreateUsersWithArrayInputInput!): Boolean + # Creates list of users with given input array + # @param User user List of user object + # @return [Boolean] + CreateUsersWithListInput(input: CreateUsersWithListInputInput!): Boolean + # Delete user + # This can only be done by the logged in user. + # @param String! username The name that needs to be deleted + # @return [Boolean] + DeleteUser(input: DeleteUserInput!): Boolean + # Updated user + # This can only be done by the logged in user. + # @param String! username name that need to be deleted + # @param User user Updated user object + # @return [Boolean] + UpdateUser(input: UpdateUserInput!): Boolean +} + +type Query { + # Get user by user name + # @param String! username The name that needs to be fetched. Use user1 for testing. + # @return [User] + GetUserByName(username: String!): User + # Logs user into the system + # @param String! username The user name for login + # @param String! password The password for login in clear text + # @return [String!] + LoginUser(username: String!, password: String!): String! + # Logs out current logged in user session + # @return [Boolean] + LogoutUser: Boolean +} + diff --git a/samples/server/petstore/graphql-server/petstore/api/user_api_resolver.js b/samples/server/petstore/graphql-server/petstore/api/user_api_resolver.js new file mode 100644 index 0000000000..9865bd72c9 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/api/user_api_resolver.js @@ -0,0 +1,83 @@ +/** + * + * OpenAPI Petstore + * + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * Version: 1.0.0 + * + * Generated by OpenAPI Generator: https://openapi-generator.tech + */ + +// package petstore + +// user_api + +export default { + Query: { + + // @return User + GetUserByName: ($username) => { + return { + "username": "username_example" + }; + }, + + // @return String! + LoginUser: ($username, $password) => { + return { + "username": "username_example", + "password": "password_example" + }; + }, + + // @return + LogoutUser: () => { + return { + + }; + }, + + }, + + Mutation: { + + // @return + CreateUser: ($user) => { + return { + "user": "" + }; + }, + + // @return + CreateUsersWithArrayInput: ($user) => { + return { + "user": "" + }; + }, + + // @return + CreateUsersWithListInput: ($user) => { + return { + "user": "" + }; + }, + + // @return + DeleteUser: ($username) => { + return { + "username": "username_example" + }; + }, + + // @return + UpdateUser: ($username, $user) => { + return { + "username": "username_example", + "user": "" + }; + }, + + } +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/petstore/model/api_response.graphql b/samples/server/petstore/graphql-server/petstore/model/api_response.graphql new file mode 100644 index 0000000000..3115457836 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/model/api_response.graphql @@ -0,0 +1,22 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# Describes the result of uploading an image resource +type ApiResponse { + code: Int! + type: String! + message: String! +} + +input ApiResponseInput { + code: Int! + type: String! + message: String! +} diff --git a/samples/server/petstore/graphql-server/petstore/model/category.graphql b/samples/server/petstore/graphql-server/petstore/model/category.graphql new file mode 100644 index 0000000000..cb07f7c3e4 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/model/category.graphql @@ -0,0 +1,20 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A category for a pet +type Category { + id: Int! + name: String! +} + +input CategoryInput { + id: Int! + name: String! +} diff --git a/samples/server/petstore/graphql-server/petstore/model/order.graphql b/samples/server/petstore/graphql-server/petstore/model/order.graphql new file mode 100644 index 0000000000..eb22a186b2 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/model/order.graphql @@ -0,0 +1,37 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# An order for a pets from the pet store +type Order { + id: Int! + petId: Int! + quantity: Int! + shipDate: String! + # Order Status + status: OrderStatusEnum + complete: Boolean! +} + +input OrderInput { + id: Int! + petId: Int! + quantity: Int! + shipDate: String! + # Order Status + status: OrderStatusEnum + complete: Boolean! +} + +# Order Status +enum OrderStatusEnum { + placed + approved + delivered +} diff --git a/samples/server/petstore/graphql-server/petstore/model/pet.graphql b/samples/server/petstore/graphql-server/petstore/model/pet.graphql new file mode 100644 index 0000000000..14f10c8062 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/model/pet.graphql @@ -0,0 +1,37 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A pet for sale in the pet store +type Pet { + id: Int! + category: Category + name: String! + photoUrls: String! + tags: Tag + # pet status in the store + status: PetStatusEnum +} + +input PetInput { + id: Int! + category: CategoryInput + name: String! + photoUrls: [String!] + tags: [TagInput] + # pet status in the store + status: PetStatusEnum +} + +# pet status in the store +enum PetStatusEnum { + available + pending + sold +} diff --git a/samples/server/petstore/graphql-server/petstore/model/tag.graphql b/samples/server/petstore/graphql-server/petstore/model/tag.graphql new file mode 100644 index 0000000000..d1bafdfd22 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/model/tag.graphql @@ -0,0 +1,20 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A tag for a pet +type Tag { + id: Int! + name: String! +} + +input TagInput { + id: Int! + name: String! +} diff --git a/samples/server/petstore/graphql-server/petstore/model/user.graphql b/samples/server/petstore/graphql-server/petstore/model/user.graphql new file mode 100644 index 0000000000..02d1748a14 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/model/user.graphql @@ -0,0 +1,34 @@ +# +# OpenAPI Petstore +# +# +# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +# +# Version: 1.0.0 +# +# Generated by OpenAPI Generator: https://openapi-generator.tech + +# A User who is purchasing from the pet store +type User { + id: Int! + username: String! + firstName: String! + lastName: String! + email: String! + password: String! + phone: String! + # User Status + userStatus: Int! +} + +input UserInput { + id: Int! + username: String! + firstName: String! + lastName: String! + email: String! + password: String! + phone: String! + # User Status + userStatus: Int! +} diff --git a/samples/server/petstore/graphql-server/petstore/package.json b/samples/server/petstore/graphql-server/petstore/package.json new file mode 100644 index 0000000000..f49cf22d70 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/package.json @@ -0,0 +1,25 @@ +{ + "name": "graphql-server", + "version": "1.0.0", + "description": " This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. ", + "main": "index.js", + "scripts": { + "start": "node start.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "express": "latest", + "graphql": "latest", + "apollo-server-express": "latest", + "graphql-combine": "latest", + "lodash": "latest", + "path": "latest" + }, + "devDependencies": { + "babel-register": "latest", + "babel-preset-env": "latest" + } +} diff --git a/samples/server/petstore/graphql-server/petstore/schema.graphql b/samples/server/petstore/graphql-server/petstore/schema.graphql new file mode 100644 index 0000000000..94c2def809 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/schema.graphql @@ -0,0 +1,3 @@ +interface Entity { + id: Int! +} \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/petstore/server.js b/samples/server/petstore/graphql-server/petstore/server.js new file mode 100644 index 0000000000..e149816253 --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/server.js @@ -0,0 +1,37 @@ +import express from 'express'; +import {ApolloServer, graphiqlExpress, graphqlExpress} from 'apollo-server-express' +import combine from 'graphql-combine' +import path from 'path' + +const PORT = 4000 || process.env; + +// Initialize the app +const app = express(); + +// Get combined typeDefs and resolvers object +const {typeDefs, resolvers} = combine({ + // TypeDefs glob pattern + typeDefs: path.join(__dirname, '**/*.graphql'), + + // Resolvers glob pattern + resolvers: path.join(__dirname, 'api/*_resolver.js') +}); + +// GraphQL: Schema +const server = new ApolloServer({ + typeDefs: typeDefs, + resolvers: resolvers, + playground: { + endpoint: `http://localhost:${PORT}/graphql`, + settings: { + 'editor.theme': 'light' + } + } +}); + +server.applyMiddleware({app: app}); + +// Start the server +app.listen(PORT, () => { + console.log(`You can reach GraphQL at: http://localhost:${PORT}/graphql`); +}); \ No newline at end of file diff --git a/samples/server/petstore/graphql-server/petstore/start.js b/samples/server/petstore/graphql-server/petstore/start.js new file mode 100644 index 0000000000..1cdb39b91a --- /dev/null +++ b/samples/server/petstore/graphql-server/petstore/start.js @@ -0,0 +1,7 @@ +// Transpile all code following this line with babel and use 'env' (aka ES6) preset. +require('babel-register')({ + presets: ['env'] +}); + +// Import the rest of our application. +module.exports = require('./server.js');