├── README.md ├── admin ├── controller │ └── extension │ │ └── module │ │ └── d_vuefront.php ├── language │ └── en-gb │ │ └── extension │ │ └── module │ │ └── d_vuefront.php └── view │ ├── image │ └── d_vuefront │ │ └── logo.png │ ├── javascript │ ├── d_pax │ │ ├── .babelrc │ │ ├── .editorconfig │ │ ├── .eslintrc.js │ │ ├── assets │ │ │ ├── img │ │ │ │ ├── Bottom_image.svg │ │ │ │ ├── Top_image.svg │ │ │ │ ├── banned-email.svg │ │ │ │ ├── bottom-info.svg │ │ │ │ ├── confirm-email.svg │ │ │ │ ├── firstBuild.svg │ │ │ │ ├── footer-modal.svg │ │ │ │ ├── logo-icon.svg │ │ │ │ ├── logo.svg │ │ │ │ ├── profile.png │ │ │ │ ├── rocket.png │ │ │ │ ├── rocket.svg │ │ │ │ ├── top-info.svg │ │ │ │ └── user.svg │ │ │ └── scss │ │ │ │ ├── _colors.scss │ │ │ │ ├── _modal.scss │ │ │ │ ├── _variables.scss │ │ │ │ ├── customMediaVariables.css │ │ │ │ ├── main.scss │ │ │ │ └── variables.json │ │ ├── components │ │ │ ├── access.vue │ │ │ ├── activity.vue │ │ │ ├── alien.vue │ │ │ ├── apps.vue │ │ │ ├── banned.vue │ │ │ ├── banner.vue │ │ │ ├── check.vue │ │ │ ├── confirm.vue │ │ │ ├── development.vue │ │ │ ├── editApp.vue │ │ │ ├── firstBuild.vue │ │ │ ├── header.vue │ │ │ ├── header │ │ │ │ ├── Account.vue │ │ │ │ ├── Activation.vue │ │ │ │ └── Logo.vue │ │ │ ├── information.vue │ │ │ ├── login.vue │ │ │ ├── modal.vue │ │ │ ├── rebuild.vue │ │ │ ├── register.vue │ │ │ ├── sign-in-banner.vue │ │ │ ├── signIn.vue │ │ │ ├── subscription.vue │ │ │ └── welcome.vue │ │ ├── core │ │ │ ├── App.vue │ │ │ ├── main.js │ │ │ └── utils │ │ │ │ ├── i18n.js │ │ │ │ ├── index.js │ │ │ │ ├── layouts.js │ │ │ │ ├── plugins.js │ │ │ │ ├── router.js │ │ │ │ └── store.js │ │ ├── layouts │ │ │ ├── auth.vue │ │ │ ├── confirm.vue │ │ │ └── default.vue │ │ ├── locales │ │ │ └── en │ │ │ │ └── index.js │ │ ├── middleware │ │ │ ├── alien.js │ │ │ ├── authenticated.js │ │ │ ├── banned.js │ │ │ ├── confirmed.js │ │ │ ├── noAlien.js │ │ │ ├── noBanned.js │ │ │ ├── notAuthenticated.js │ │ │ ├── notConfirmed.js │ │ │ └── withEmail.js │ │ ├── package.json │ │ ├── pages │ │ │ └── index.vue │ │ ├── pax.config.js │ │ ├── plugins │ │ │ ├── VeeValidate.js │ │ │ ├── apollo.js │ │ │ ├── axios.js │ │ │ ├── bootstrapVue.js │ │ │ ├── clipboard.js │ │ │ ├── cookie.js │ │ │ ├── fontawesome.js │ │ │ ├── modal.js │ │ │ ├── moment.js │ │ │ └── scrollTo.js │ │ ├── postcss.config.js │ │ ├── store │ │ │ ├── account.js │ │ │ ├── apollo.js │ │ │ ├── apps.js │ │ │ ├── auth.js │ │ │ ├── cms.js │ │ │ ├── index.js │ │ │ ├── information.js │ │ │ └── settings.js │ │ ├── test.html │ │ ├── webpack-manifest.js │ │ ├── webpack.config.js │ │ └── yarn.lock │ └── d_vuefront │ │ ├── 1752130d064cc59c9a4d.bundle.js │ │ ├── img │ │ ├── bottom-info.svg │ │ ├── confirm-email.svg │ │ ├── firstBuild.svg │ │ └── rocket.png │ │ ├── main.1752130d064cc59c9a4d.css │ │ └── manifest.json │ └── template │ └── extension │ └── module │ └── d_vuefront.twig ├── catalog ├── controller │ └── extension │ │ ├── d_vuefront │ │ ├── blog │ │ │ ├── category.php │ │ │ ├── post.php │ │ │ └── review.php │ │ ├── common │ │ │ ├── account.php │ │ │ ├── contact.php │ │ │ ├── country.php │ │ │ ├── file.php │ │ │ ├── home.php │ │ │ ├── language.php │ │ │ ├── page.php │ │ │ └── zone.php │ │ └── store │ │ │ ├── cart.php │ │ │ ├── category.php │ │ │ ├── checkout.php │ │ │ ├── compare.php │ │ │ ├── currency.php │ │ │ ├── manufacturer.php │ │ │ ├── option.php │ │ │ ├── product.php │ │ │ ├── review.php │ │ │ └── wishlist.php │ │ └── module │ │ ├── d_vuefront.php │ │ └── d_vuefront_schema │ │ ├── mapping.json │ │ ├── schema.graphql │ │ └── schemaAdmin.graphql ├── model │ └── extension │ │ ├── d_vuefront │ │ ├── address.php │ │ ├── cart.php │ │ ├── category.php │ │ ├── compare.php │ │ ├── country.php │ │ ├── customer.php │ │ ├── d_blog_module.php │ │ ├── manufacturer.php │ │ ├── option.php │ │ ├── page.php │ │ ├── product.php │ │ ├── seo.php │ │ ├── wishlist.php │ │ └── zone.php │ │ └── module │ │ └── d_vuefront.php └── view │ ├── javascript │ └── d_vuefront │ │ ├── css │ │ ├── index.css │ │ └── index.css.map │ │ └── js │ │ ├── middleware.js │ │ └── middleware.js.map │ └── theme │ └── default │ └── template │ └── extension │ └── module │ └── d_vuefront.twig └── system └── library ├── d_graphql ├── composer.json ├── composer.lock └── vendor │ ├── autoload.php │ ├── composer │ ├── ClassLoader.php │ ├── LICENSE │ ├── autoload_classmap.php │ ├── autoload_files.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.php │ ├── autoload_static.php │ └── installed.json │ └── webonyx │ └── graphql-php │ ├── .gitattributes │ ├── .travis.yml │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── UPGRADE.md │ ├── benchmarks │ ├── HugeSchemaBench.php │ ├── LexerBench.php │ ├── StarWarsBench.php │ └── Utils │ │ ├── QueryGenerator.php │ │ └── SchemaGenerator.php │ ├── composer.json │ ├── docs │ ├── best-practices.md │ ├── complementary-tools.md │ ├── concepts.md │ ├── data-fetching.md │ ├── error-handling.md │ ├── executing-queries.md │ ├── getting-started.md │ ├── how-it-works.md │ ├── index.md │ ├── reference.md │ ├── security.md │ └── type-system │ │ ├── directives.md │ │ ├── enum-types.md │ │ ├── index.md │ │ ├── input-types.md │ │ ├── interfaces.md │ │ ├── lists-and-nonnulls.md │ │ ├── object-types.md │ │ ├── scalar-types.md │ │ ├── schema.md │ │ ├── type-language.md │ │ └── unions.md │ ├── examples │ ├── 00-hello-world │ │ ├── README.md │ │ └── graphql.php │ ├── 01-blog │ │ ├── Blog │ │ │ ├── AppContext.php │ │ │ ├── Data │ │ │ │ ├── Comment.php │ │ │ │ ├── DataSource.php │ │ │ │ ├── Image.php │ │ │ │ ├── Story.php │ │ │ │ └── User.php │ │ │ ├── Type │ │ │ │ ├── CommentType.php │ │ │ │ ├── Enum │ │ │ │ │ ├── ContentFormatEnum.php │ │ │ │ │ └── ImageSizeEnumType.php │ │ │ │ ├── Field │ │ │ │ │ └── HtmlField.php │ │ │ │ ├── ImageType.php │ │ │ │ ├── NodeType.php │ │ │ │ ├── QueryType.php │ │ │ │ ├── Scalar │ │ │ │ │ ├── EmailType.php │ │ │ │ │ └── UrlType.php │ │ │ │ ├── SearchResultType.php │ │ │ │ ├── StoryType.php │ │ │ │ └── UserType.php │ │ │ └── Types.php │ │ ├── README.md │ │ └── graphql.php │ ├── 02-shorthand │ │ ├── README.md │ │ ├── graphql.php │ │ ├── rootvalue.php │ │ └── schema.graphqls │ └── 03-server │ │ ├── README.md │ │ └── graphql.php │ ├── mkdocs.yml │ ├── phpbench.json │ ├── phpunit.xml.dist │ ├── src │ ├── Deferred.php │ ├── Error.php │ ├── Error │ │ ├── ClientAware.php │ │ ├── Debug.php │ │ ├── Error.php │ │ ├── FormattedError.php │ │ ├── InvariantViolation.php │ │ ├── SyntaxError.php │ │ ├── UserError.php │ │ └── Warning.php │ ├── Executor │ │ ├── ExecutionContext.php │ │ ├── ExecutionResult.php │ │ ├── Executor.php │ │ ├── Promise │ │ │ ├── Adapter │ │ │ │ ├── ReactPromiseAdapter.php │ │ │ │ ├── SyncPromise.php │ │ │ │ └── SyncPromiseAdapter.php │ │ │ ├── Promise.php │ │ │ └── PromiseAdapter.php │ │ └── Values.php │ ├── GraphQL.php │ ├── Language │ │ ├── AST │ │ │ ├── ArgumentNode.php │ │ │ ├── BooleanValueNode.php │ │ │ ├── DefinitionNode.php │ │ │ ├── DirectiveDefinitionNode.php │ │ │ ├── DirectiveNode.php │ │ │ ├── DocumentNode.php │ │ │ ├── EnumTypeDefinitionNode.php │ │ │ ├── EnumValueDefinitionNode.php │ │ │ ├── EnumValueNode.php │ │ │ ├── FieldDefinitionNode.php │ │ │ ├── FieldNode.php │ │ │ ├── FloatValueNode.php │ │ │ ├── FragmentDefinitionNode.php │ │ │ ├── FragmentSpreadNode.php │ │ │ ├── HasSelectionSet.php │ │ │ ├── InlineFragmentNode.php │ │ │ ├── InputObjectTypeDefinitionNode.php │ │ │ ├── InputValueDefinitionNode.php │ │ │ ├── IntValueNode.php │ │ │ ├── InterfaceTypeDefinitionNode.php │ │ │ ├── ListTypeNode.php │ │ │ ├── ListValueNode.php │ │ │ ├── Location.php │ │ │ ├── NameNode.php │ │ │ ├── NamedTypeNode.php │ │ │ ├── Node.php │ │ │ ├── NodeKind.php │ │ │ ├── NodeList.php │ │ │ ├── NonNullTypeNode.php │ │ │ ├── NullValueNode.php │ │ │ ├── ObjectFieldNode.php │ │ │ ├── ObjectTypeDefinitionNode.php │ │ │ ├── ObjectValueNode.php │ │ │ ├── OperationDefinitionNode.php │ │ │ ├── OperationTypeDefinitionNode.php │ │ │ ├── ScalarTypeDefinitionNode.php │ │ │ ├── SchemaDefinitionNode.php │ │ │ ├── SelectionNode.php │ │ │ ├── SelectionSetNode.php │ │ │ ├── StringValueNode.php │ │ │ ├── TypeDefinitionNode.php │ │ │ ├── TypeExtensionDefinitionNode.php │ │ │ ├── TypeNode.php │ │ │ ├── TypeSystemDefinitionNode.php │ │ │ ├── UnionTypeDefinitionNode.php │ │ │ ├── ValueNode.php │ │ │ ├── VariableDefinitionNode.php │ │ │ └── VariableNode.php │ │ ├── Lexer.php │ │ ├── Parser.php │ │ ├── Printer.php │ │ ├── Source.php │ │ ├── SourceLocation.php │ │ ├── Token.php │ │ └── Visitor.php │ ├── Schema.php │ ├── Server.php │ ├── Server │ │ ├── Helper.php │ │ ├── OperationParams.php │ │ ├── RequestError.php │ │ ├── ServerConfig.php │ │ └── StandardServer.php │ ├── Type │ │ ├── Definition │ │ │ ├── AbstractType.php │ │ │ ├── BooleanType.php │ │ │ ├── CompositeType.php │ │ │ ├── Config.php │ │ │ ├── CustomScalarType.php │ │ │ ├── Directive.php │ │ │ ├── DirectiveLocation.php │ │ │ ├── EnumType.php │ │ │ ├── EnumValueDefinition.php │ │ │ ├── FieldArgument.php │ │ │ ├── FieldDefinition.php │ │ │ ├── FloatType.php │ │ │ ├── IDType.php │ │ │ ├── InputObjectField.php │ │ │ ├── InputObjectType.php │ │ │ ├── InputType.php │ │ │ ├── IntType.php │ │ │ ├── InterfaceType.php │ │ │ ├── LeafType.php │ │ │ ├── ListOfType.php │ │ │ ├── NonNull.php │ │ │ ├── ObjectType.php │ │ │ ├── OutputType.php │ │ │ ├── ResolveInfo.php │ │ │ ├── ScalarType.php │ │ │ ├── StringType.php │ │ │ ├── Type.php │ │ │ ├── UnionType.php │ │ │ ├── UnmodifiedType.php │ │ │ └── WrappingType.php │ │ ├── EagerResolution.php │ │ ├── Introspection.php │ │ ├── LazyResolution.php │ │ ├── Resolution.php │ │ ├── Schema.php │ │ └── SchemaConfig.php │ ├── Utils.php │ ├── Utils │ │ ├── AST.php │ │ ├── BuildSchema.php │ │ ├── FindBreakingChanges.php │ │ ├── MixedStore.php │ │ ├── PairSet.php │ │ ├── SchemaPrinter.php │ │ ├── TypeComparators.php │ │ ├── TypeInfo.php │ │ └── Utils.php │ ├── Validator │ │ ├── DocumentValidator.php │ │ ├── Rules │ │ │ ├── AbstractQuerySecurity.php │ │ │ ├── AbstractValidationRule.php │ │ │ ├── ArgumentsOfCorrectType.php │ │ │ ├── CustomValidationRule.php │ │ │ ├── DefaultValuesOfCorrectType.php │ │ │ ├── DisableIntrospection.php │ │ │ ├── FieldsOnCorrectType.php │ │ │ ├── FragmentsOnCompositeTypes.php │ │ │ ├── KnownArgumentNames.php │ │ │ ├── KnownDirectives.php │ │ │ ├── KnownFragmentNames.php │ │ │ ├── KnownTypeNames.php │ │ │ ├── LoneAnonymousOperation.php │ │ │ ├── NoFragmentCycles.php │ │ │ ├── NoUndefinedVariables.php │ │ │ ├── NoUnusedFragments.php │ │ │ ├── NoUnusedVariables.php │ │ │ ├── OverlappingFieldsCanBeMerged.php │ │ │ ├── PossibleFragmentSpreads.php │ │ │ ├── ProvidedNonNullArguments.php │ │ │ ├── QueryComplexity.php │ │ │ ├── QueryDepth.php │ │ │ ├── ScalarLeafs.php │ │ │ ├── UniqueArgumentNames.php │ │ │ ├── UniqueDirectivesPerLocation.php │ │ │ ├── UniqueFragmentNames.php │ │ │ ├── UniqueInputFieldNames.php │ │ │ ├── UniqueOperationNames.php │ │ │ ├── UniqueVariableNames.php │ │ │ ├── VariablesAreInputTypes.php │ │ │ └── VariablesInAllowedPosition.php │ │ └── ValidationContext.php │ └── deprecated.php │ ├── tests │ ├── ErrorTest.php │ ├── Executor │ │ ├── AbstractPromiseTest.php │ │ ├── AbstractTest.php │ │ ├── DeferredFieldsTest.php │ │ ├── DirectivesTest.php │ │ ├── ExecutionResultTest.php │ │ ├── ExecutorLazySchemaTest.php │ │ ├── ExecutorSchemaTest.php │ │ ├── ExecutorTest.php │ │ ├── LazyInterfaceTest.php │ │ ├── ListsTest.php │ │ ├── MutationsTest.php │ │ ├── NonNullTest.php │ │ ├── Promise │ │ │ ├── ReactPromiseAdapterTest.php │ │ │ ├── SyncPromiseAdapterTest.php │ │ │ └── SyncPromiseTest.php │ │ ├── ResolveTest.php │ │ ├── TestClasses.php │ │ ├── UnionInterfaceTest.php │ │ ├── ValuesTest.php │ │ └── VariablesTest.php │ ├── Language │ │ ├── LexerTest.php │ │ ├── ParserTest.php │ │ ├── PrinterTest.php │ │ ├── SchemaParserTest.php │ │ ├── SchemaPrinterTest.php │ │ ├── SerializationTest.php │ │ ├── TestUtils.php │ │ ├── TokenTest.php │ │ ├── VisitorTest.php │ │ ├── kitchen-sink-noloc.ast │ │ ├── kitchen-sink.ast │ │ ├── kitchen-sink.graphql │ │ └── schema-kitchen-sink.graphql │ ├── Server │ │ ├── Psr7 │ │ │ ├── PsrRequestStub.php │ │ │ ├── PsrResponseStub.php │ │ │ └── PsrStreamStub.php │ │ ├── PsrResponseTest.php │ │ ├── QueryExecutionTest.php │ │ ├── RequestParsingTest.php │ │ ├── RequestValidationTest.php │ │ ├── ServerConfigTest.php │ │ ├── StandardServerTest.php │ │ └── TestCase.php │ ├── ServerTest.php │ ├── StarWarsData.php │ ├── StarWarsIntrospectionTest.php │ ├── StarWarsQueryTest.php │ ├── StarWarsSchema.php │ ├── StarWarsValidationTest.php │ ├── Type │ │ ├── ConfigTest.php │ │ ├── DefinitionTest.php │ │ ├── EnumTypeTest.php │ │ ├── IntrospectionTest.php │ │ ├── ObjectIdStub.php │ │ ├── ResolutionTest.php │ │ ├── ResolveInfoTest.php │ │ ├── ScalarSerializationTest.php │ │ ├── TestClasses.php │ │ ├── TypeLoaderTest.php │ │ └── ValidationTest.php │ ├── Utils │ │ ├── AstFromValueTest.php │ │ ├── BuildSchemaTest.php │ │ ├── ExtractTypesTest.php │ │ ├── FindBreakingChangesTest.php │ │ ├── IsValidPHPValueTest.php │ │ ├── MixedStoreTest.php │ │ ├── SchemaPrinterTest.php │ │ └── ValueFromAstTest.php │ ├── UtilsTest.php │ └── Validator │ │ ├── AbstractQuerySecurityTest.php │ │ ├── ArgumentsOfCorrectTypeTest.php │ │ ├── DefaultValuesOfCorrectTypeTest.php │ │ ├── DisableIntrospectionTest.php │ │ ├── FieldsOnCorrectTypeTest.php │ │ ├── FragmentsOnCompositeTypesTest.php │ │ ├── KnownArgumentNamesTest.php │ │ ├── KnownDirectivesTest.php │ │ ├── KnownFragmentNamesTest.php │ │ ├── KnownTypeNamesTest.php │ │ ├── LoneAnonymousOperationTest.php │ │ ├── NoFragmentCyclesTest.php │ │ ├── NoUndefinedVariablesTest.php │ │ ├── NoUnusedFragmentsTest.php │ │ ├── NoUnusedVariablesTest.php │ │ ├── OverlappingFieldsCanBeMergedTest.php │ │ ├── PossibleFragmentSpreadsTest.php │ │ ├── ProvidedNonNullArgumentsTest.php │ │ ├── QueryComplexityTest.php │ │ ├── QueryDepthTest.php │ │ ├── QuerySecuritySchema.php │ │ ├── ScalarLeafsTest.php │ │ ├── TestCase.php │ │ ├── UniqueArgumentNamesTest.php │ │ ├── UniqueDirectivesPerLocationTest.php │ │ ├── UniqueFragmentNamesTest.php │ │ ├── UniqueInputFieldNamesTest.php │ │ ├── UniqueOperationNamesTest.php │ │ ├── UniqueVariableNamesTest.php │ │ ├── ValidationTest.php │ │ ├── VariablesAreInputTypesTest.php │ │ └── VariablesInAllowedPositionTest.php │ └── tools │ └── gendocs.php └── d_shopunity └── extension └── d_vuefront.json /admin/language/en-gb/extension/module/d_vuefront.php: -------------------------------------------------------------------------------- 1 | VueFront by Dreamvention'; 8 | $_['heading_title_main'] = 'VueFront'; 9 | $_['text_edit'] = 'Edit VueFront settings'; 10 | $_['text_module'] = 'Modules'; 11 | $_['text_copy'] = 'copy'; 12 | 13 | $_['text_title'] = 'CMS Connect URL'; 14 | $_['text_description'] = 'This is your CMS Connect URL link that shares your Store data via GraphQL. When installing VueFront via the command line, you will be prompted to enter this URL. Simply copy and paste it into the command line. 15 |

16 | Read more about the CMS Connect for OpenCart'; 17 | 18 | $_['text_blog_module'] = 'Blog support'; 19 | $_['text_blog_enabled'] = 'Blog enabled'; 20 | $_['text_blog_disabled'] = 'Blog module missing. Click to download'; 21 | $_['text_blog_description'] = 'VueFront relies on the free Blog Module by Dreamvention to implement blog support. The blog feature is optional and VueFront will work fine without it. You can install it via OpenCart Marketplace or Shopunity. '; 22 | //support 23 | $_['text_powered_by'] = 'Tested with Shopunity.net
Find more amazing extensions at Dreamvention.ee'; 24 | -------------------------------------------------------------------------------- /admin/view/image/d_vuefront/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/opencart/05354a950a97ef89859bb979bdfc727a938561cb/admin/view/image/d_vuefront/logo.png -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "browsers": ["last 2 versions"] 8 | }, 9 | "modules": false 10 | } 11 | ] 12 | ], 13 | "plugins": [ 14 | "@babel/plugin-proposal-object-rest-spread", 15 | "@babel/plugin-syntax-dynamic-import", 16 | "lodash" 17 | ], 18 | "env": { 19 | "test": { 20 | "presets": [ 21 | [ 22 | "@babel/preset-env", 23 | { 24 | "targets": { 25 | "node": "current" 26 | } 27 | } 28 | ] 29 | ] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'plugin:vue/recommended' 4 | ], 5 | rules: { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/assets/img/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/opencart/05354a950a97ef89859bb979bdfc727a938561cb/admin/view/javascript/d_pax/assets/img/profile.png -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/assets/img/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/opencart/05354a950a97ef89859bb979bdfc727a938561cb/admin/view/javascript/d_pax/assets/img/rocket.png -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/assets/img/user.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/assets/scss/_colors.scss: -------------------------------------------------------------------------------- 1 | /* Color palette */ 2 | $dark-mint: #53b982; 3 | $black: #1a1a1a; 4 | $dark-grey-blue: #2e5467; 5 | $pale-grey: #f1f6f8; 6 | $blue-grey: #7b96a4; 7 | $cloudy-blue: #bacdd6; 8 | $white: #ffffff; 9 | $pinkish-grey: #c4c4c4; 10 | $clear-blue: #206aff; 11 | $dark-seafoam-green: #3aab6e; 12 | $warm-grey: #787878; 13 | $warm-grey-two: #7d7d7d; 14 | $white-two: #f5f5f5; 15 | $brownish-grey: #6e6e6e; 16 | $white-three: #d9d8d8; 17 | $white-four: #f8f8f8; 18 | $white-five: #d9d9d9; 19 | $white-six: #e9e9e9; 20 | $tomato: #e32424; 21 | $yellow: #f1a908; 22 | $tomato-two: #d22619; 23 | $pale-grey-two: #f9fafc; 24 | $very-light-blue: #d5f1ff; 25 | $white-seven: #f2f2f2; 26 | $pale-grey-three: #f4f5f8; 27 | $white-eight: #dcdcdc; 28 | $steel: #858b91; 29 | $dark-blue-grey: #182b3c; 30 | $cloudy-blue-three: #c1ced9; 31 | $bluey-grey: #94a9bb; 32 | $blue-grey-two: #7990a4; 33 | $jade-green: #2eac68; 34 | $coral: #f35b5b; 35 | $dark-grey-blue-two: #254058; 36 | $slate: #475f75; 37 | $dark-grey-blue-three: #273a4b; 38 | $dark-blue-grey-two: #21374a; 39 | $slate-two: #566572; 40 | $dark-blue-grey-three: #0b1e2e; 41 | $greenish: #3f9b68; 42 | $dusk: #415c72; 43 | $dark-grey-blue-four: #244058; 44 | $blue-grey-three: #5a7082; 45 | $dark-grey-blue-five: #253f55; 46 | $dark-indigo: #071624; 47 | $dark-blue-grey-four: #1e384e; 48 | $slate-three: #445768; 49 | $light-blue-grey: #cedbe6; 50 | $pale-teal: #7dc8a0; 51 | $bluey-grey-two: #7f97ab; 52 | $white-eight: #e3e3e3; 53 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/assets/scss/customMediaVariables.css: -------------------------------------------------------------------------------- 1 | @custom-media --phone (min-width: 0px); 2 | @custom-media --tablet (min-width: 600px); 3 | @custom-media --phone-and-tablet (max-width: 960px); 4 | @custom-media --laptop (min-width: 960px); 5 | @custom-media --desktop (min-width: 1280px); 6 | @custom-media --widescreen (min-width: 1920px); 7 | @custom-media --desktop-and-laptop (min-width: 960px); 8 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/assets/scss/variables.json: -------------------------------------------------------------------------------- 1 | { 2 | "--primary-color": "#308cd6", 3 | "--danger-color": "#c75261", 4 | "--success-color": "#73b338", 5 | "--warning-color": "#f4c000", 6 | "--default-color": "#969696" 7 | } 8 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/components/banner.vue: -------------------------------------------------------------------------------- 1 | 19 | 72 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/components/header/Logo.vue: -------------------------------------------------------------------------------- 1 | 10 | 42 | 43 | { 44 | "text_vuefront": "VueFront" 45 | } 46 | 47 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/components/subscription.vue: -------------------------------------------------------------------------------- 1 | 19 | 28 | 29 | { 30 | "text_title": "Go Production!", 31 | "text_description": "Perfect for commercial projects. Increase your build minutes to 1000 per month with $5 for extra 300 minutes. ", 32 | "button_subscribe": "$10 for 1000 min / month" 33 | } 34 | 35 | 79 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/core/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 64 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/core/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { load } from '~/core/utils' 3 | import App from './App.vue' 4 | import store from '~/core/utils/store' 5 | import i18n from '~/core/utils/i18n' 6 | import { initRouter } from '~/core/utils/router' 7 | import paxConfig from '~/pax.config.js' 8 | import messagesEn from '~/locales/en' 9 | import { isUndefined } from 'lodash' 10 | /** 11 | * Main application file 12 | * @author Dreamvention 13 | * @date 20.12.2018 14 | */ 15 | /** 16 | *Creating the main component for the application 17 | */ 18 | Vue.component(`${paxConfig.prefix}-app`, App) 19 | 20 | let app = {} 21 | let injectVars = {} 22 | 23 | const inject = (key, value) => { 24 | if (isUndefined(app[key])) { 25 | key = '$' + key 26 | app[key] = value 27 | store[key] = value 28 | injectVars[key] = value 29 | Vue.use(() => { 30 | if (!Vue.prototype.hasOwnProperty(key)) { 31 | Object.defineProperty(Vue.prototype, key, { 32 | get() { 33 | return this.$root.$options[key] 34 | } 35 | }) 36 | } 37 | }) 38 | } 39 | } 40 | 41 | /** 42 | * Determination of the main function of the application 43 | */ 44 | window[paxConfig.codename] = async options => { 45 | await load({ ...options, app, store, ...paxConfig, ...injectVars }, inject) 46 | const router = initRouter({ store }) 47 | inject('paxConfig', paxConfig) 48 | inject('paxOptions', options) 49 | store.$router = router 50 | await store.dispatch('clientInit') 51 | app = new Vue({ 52 | ...injectVars, 53 | store, 54 | router, 55 | i18n 56 | }) 57 | 58 | app.$mount(options.selector) 59 | } 60 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/core/utils/i18n.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | import messagesEn from '~/locales/en' 4 | Vue.use(VueI18n) 5 | export default new VueI18n({ 6 | locale: 'en', 7 | messages: { 8 | en: messagesEn 9 | } 10 | }) 11 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/core/utils/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Search and connect all application utilities 3 | * @author Dreamvention 4 | * @date 20.12.2018 5 | */ 6 | 7 | /** 8 | * Utility downloads 9 | * @param {any} options Application settings 10 | */ 11 | const load = async (options, inject) => { 12 | const req = require.context('./', false, /\.js$/) 13 | const files = req.keys() 14 | 15 | for (const key in files) { 16 | const fileName = files[key] 17 | if (fileName === './index.js') continue 18 | if (fileName === './store.js') continue 19 | if (fileName === './i18n.js') continue 20 | if (fileName === './router.js') continue 21 | 22 | const util = req(fileName).default 23 | 24 | await util(options, inject) 25 | } 26 | } 27 | 28 | export { load } 29 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/core/utils/layouts.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | /** 3 | * Search and connect layouts 4 | * @author Dreamvention 5 | * @date 20.12.2018 6 | */ 7 | export default (options, inject) => { 8 | let req = require.context('~/layouts/', false, /\.vue$/) 9 | const files = req.keys() 10 | for (const key in files) { 11 | const fileName = files[key] 12 | const component = req(fileName).default 13 | let layoutName = fileName.replace('./', '') 14 | layoutName = layoutName.replace('.vue', '') 15 | Vue.component('layout-' + layoutName, component) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/core/utils/plugins.js: -------------------------------------------------------------------------------- 1 | import { isUndefined } from 'lodash' 2 | /** 3 | * Search and connect plugins 4 | * @author Dreamvention 5 | * @date 20.12.2018 6 | */ 7 | export default async (options, inject) => { 8 | const req = require.context('~/plugins/', false, /\.js$/) 9 | const files = req.keys() 10 | 11 | for (const fileName of files) { 12 | const plugin = req(fileName) 13 | 14 | if (!isUndefined(plugin.default)) { 15 | await plugin.default(options, inject) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/layouts/auth.vue: -------------------------------------------------------------------------------- 1 | 25 | 34 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/layouts/confirm.vue: -------------------------------------------------------------------------------- 1 | 21 | 30 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 16 | 30 | 31 | { 32 | "not_writable_htaccess": "File permissions. Please add writing permissions to the following files and folder: .htaccess", 33 | "validate_payment": "Not verified account", 34 | "not_exists_url": "The CMS Connect URL you have provided is not working. Please check if you have properly specified the url and try again.", 35 | "not_working_graphql_api": "The CMS Connect URL you have provided is not working. Please check if you have properly specified the url and try again." 36 | } 37 | 38 | 59 | 60 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/locales/en/index.js: -------------------------------------------------------------------------------- 1 | export default {} 2 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/alien.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const alien = store.getters['cms/alien'] 3 | if (!alien) { 4 | return redirect('/') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/authenticated.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const isAuth = store.getters['auth/isLogged'] 3 | if (!isAuth) { 4 | return redirect('/login') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/banned.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const banned = store.getters['account/banned'] 3 | if (!banned) { 4 | return redirect('/') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/confirmed.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const account = store.getters['account/get'] 3 | if (!account.confirmed) { 4 | return redirect('/confirm') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/noAlien.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const alien = store.getters['cms/alien'] 3 | if (alien) { 4 | return redirect('/alien') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/noBanned.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const banned = store.getters['account/banned'] 3 | if (banned) { 4 | return redirect('/banned') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/notAuthenticated.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | if (store.getters['auth/isLogged']) { 3 | return redirect('/') 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/notConfirmed.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const account = store.getters['account/get'] 3 | if (account.confirmed) { 4 | return redirect('/') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/middleware/withEmail.js: -------------------------------------------------------------------------------- 1 | export default function ({ redirect, store }) { 2 | const isEmail = store.getters['auth/email'] !== '' 3 | if (!isEmail) { 4 | return redirect('/check') 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/pax.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | codename: 'd_vuefront', 3 | prefix: 'vf', 4 | polyfill: true, 5 | router: { 6 | mode: 'hash' 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/VeeValidate.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { ValidationProvider, extend, ValidationObserver } from 'vee-validate' 3 | import { required, email, min, max, numeric, confirmed } from 'vee-validate/dist/rules' 4 | import isDecimal from 'validator/lib/isDecimal' 5 | 6 | Vue.component('ValidationProvider', ValidationProvider) 7 | Vue.component('ValidationObserver', ValidationObserver) 8 | 9 | extend('email', email) 10 | extend('required', required) 11 | extend('min', min) 12 | extend('max', max) 13 | extend('numeric', numeric) 14 | extend('confirmed', confirmed) 15 | extend('decimal', { 16 | validate: val => isDecimal(val.toString()), 17 | message: 'Please enter a valid number' 18 | }) 19 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/apollo.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueApollo from 'vue-apollo' 3 | import ApolloClient from "apollo-boost"; 4 | export default ({ tokenUrl, store }, inject) => { 5 | 6 | const apolloClient = new ApolloClient({ 7 | uri: `index.php?route=extension/module/d_vuefront/proxy&${tokenUrl}`, 8 | request: (operation) => { 9 | const headers = {} 10 | if ( 11 | store.getters['auth/isLogged'] 12 | ) { 13 | headers['token'] = `${ 14 | store.getters['auth/isLogged'] 15 | }` 16 | } 17 | operation.setContext({ 18 | headers 19 | }); 20 | } 21 | }) 22 | 23 | Vue.use(VueApollo) 24 | const apolloProvider = new VueApollo({ 25 | defaultClient: apolloClient 26 | }) 27 | 28 | inject('apolloClient', apolloProvider) 29 | } 30 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/bootstrapVue.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import BootstrapVue from 'bootstrap-vue' 3 | 4 | Vue.use(BootstrapVue) 5 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/clipboard.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueClipboard from 'vue-clipboard2' 3 | 4 | Vue.use(VueClipboard) 5 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/cookie.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueCookie from 'vue-cookie' 3 | 4 | export default ({ tokenUrl, baseURL, app, store, apiURL }, inject) => { 5 | inject('cookie', VueCookie) 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/fontawesome.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import SvgIcon from '@jamescoyle/vue-icon' 3 | // import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' 4 | 5 | Vue.component('SvgIcon', SvgIcon) 6 | // Vue.component('FontAwesomeIcon', FontAwesomeIcon) 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/modal.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VModal from 'vue-js-modal' 3 | 4 | Vue.use(VModal) 5 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/moment.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import moment from 'moment' 3 | 4 | export default ({ tokenUrl, baseURL, app, store, apiURL }, inject) => { 5 | inject('moment', moment) 6 | } 7 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/plugins/scrollTo.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueScrollTo from 'vue-scrollto' 3 | 4 | Vue.use(VueScrollTo) 5 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/postcss.config.js: -------------------------------------------------------------------------------- 1 | const variables = require('./assets/scss/variables.json') 2 | module.exports = () => ({ 3 | syntax: 'postcss-scss', 4 | plugins: [ 5 | require('autoprefixer')(), 6 | require('postcss-mixins'), 7 | require('postcss-css-variables')({ 8 | variables 9 | }), 10 | require('postcss-custom-media')({ 11 | importFrom: './assets/scss/customMediaVariables.css' 12 | }), 13 | require('postcss-font-magician')({ 14 | protocol: 'https:', 15 | foundries: 'bootstrap google' 16 | }), 17 | require('postcss-hexrgba')(), 18 | require('postcss-color-function')(), 19 | require('postcss-nested')(), 20 | require('postcss-rem-to-pixel')({ 21 | rootValue: 12 22 | }) 23 | ] 24 | }) 25 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/store/account.js: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | 3 | export const state = () => ({ 4 | account: {}, 5 | banned: false 6 | }) 7 | 8 | export const mutations = { 9 | setAccount(state, payload) { 10 | state.account = payload 11 | }, 12 | setBanned(state, payload) { 13 | state.banned = payload 14 | } 15 | } 16 | 17 | export const getters = { 18 | get(state) { 19 | return state.account 20 | }, 21 | banned(state) { 22 | return state.banned 23 | } 24 | } 25 | 26 | export const actions = { 27 | async load({commit}) { 28 | try { 29 | commit('setResponseError', false, {root: true}) 30 | 31 | const {data} = await this.$apolloClient.defaultClient.query({ 32 | query: gql` 33 | { 34 | account { 35 | id 36 | firstName 37 | lastName 38 | confirmed 39 | email 40 | banned 41 | subscribe 42 | subscribeCancel 43 | subscribeDateEnd 44 | paymentMethodChecked 45 | image(width: 101, height: 101) { 46 | url 47 | path 48 | } 49 | } 50 | cmsList { 51 | content { 52 | id 53 | url 54 | type 55 | } 56 | } 57 | } 58 | `, 59 | variables: {} 60 | }) 61 | 62 | commit('setAccount', data.account) 63 | commit('cms/setEntities', data.cmsList, {root: true}) 64 | commit('setBanned', data.account.banned) 65 | } catch (e) { 66 | commit('setResponseError', e, {root: true}) 67 | } 68 | this.$apolloClient.defaultClient.clearStore() 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/store/apollo.js: -------------------------------------------------------------------------------- 1 | import omitDeepLodash from 'omit-deep-lodash' 2 | 3 | export const state = () => ({ 4 | data: {} 5 | }) 6 | 7 | export const getters = { 8 | get(state) { 9 | return state.data 10 | } 11 | } 12 | 13 | export const mutations = { 14 | setData(state, payload) { 15 | state.data = payload.data 16 | } 17 | } 18 | 19 | export const actions = { 20 | async mutate({ commit }, options) { 21 | try { 22 | const variables = omitDeepLodash(options.variables, '__typename') 23 | let client = this.$apolloClient.defaultClient 24 | const res = await client.mutate({ ...options, variables }) 25 | commit('setError', false, { root: true }) 26 | commit('setData', res) 27 | } catch (e) { 28 | commit('setError', e.graphQLErrors ? e.graphQLErrors[0] : e, { 29 | root: true 30 | }) 31 | } 32 | }, 33 | async query({ commit }, options) { 34 | try { 35 | const variables = omitDeepLodash(options.variables, '__typename') 36 | let client = this.$apolloClient.defaultClient 37 | const res = await client.query({ ...options, variables }) 38 | commit('setError', false, { root: true }) 39 | commit('setData', res) 40 | } catch (e) { 41 | commit('setError', e.graphQLErrors ? e.graphQLErrors[0] : e, { 42 | root: true 43 | }) 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/store/apps.js: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | export const state = () => ({ 3 | entities: {}, 4 | edit: false 5 | }) 6 | 7 | export const mutations = { 8 | setEntities(state, payload) { 9 | state.entities = payload 10 | }, 11 | setEdit(state, payload) { 12 | state.edit = payload 13 | } 14 | } 15 | 16 | export const getters = { 17 | list(state) { 18 | return state.entities 19 | }, 20 | edit(state) { 21 | return state.edit 22 | } 23 | } 24 | 25 | export const actions = { 26 | 27 | async list({commit}) { 28 | try { 29 | commit('setResponseError', false, {root: true}) 30 | const {data} = await this.$axios.get('/api/vf_apps') 31 | 32 | commit('setEntities', data) 33 | } catch (e) { 34 | commit('setResponseError', e, {root: true}) 35 | } 36 | }, 37 | async create({commit}, payload) { 38 | try { 39 | commit('setResponseError', false, {root: true}) 40 | await this.$axios.post('/api/vf_apps_create', payload) 41 | 42 | } catch (e) { 43 | commit('setResponseError', e, {root: true}) 44 | } 45 | }, 46 | async edit({commit}, {key, app}) { 47 | try { 48 | commit('setResponseError', false, {root: true}) 49 | await this.$axios.post('/api/vf_apps_edit', {key, app}) 50 | 51 | } catch (e) { 52 | commit('setResponseError', e, {root: true}) 53 | } 54 | }, 55 | async remove({commit}, payload) { 56 | try { 57 | commit('setResponseError', false, {root: true}) 58 | await this.$axios.post('/api/vf_apps_remove', payload) 59 | 60 | } catch (e) { 61 | commit('setResponseError', e, {root: true}) 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/store/index.js: -------------------------------------------------------------------------------- 1 | import {isUndefined, isNull} from 'lodash' 2 | export const state = () => ({ 3 | error: false 4 | }) 5 | 6 | export const mutations = { 7 | setError(state, payload) { 8 | state.error = payload 9 | }, 10 | setResponseError (state, e) { 11 | if (e.graphQLErrors && e.graphQLErrors.message) { 12 | state.error = e.graphQLErrors.message.error 13 | } else if (e.graphQLErrors && !isUndefined(e.graphQLErrors[0])) { 14 | state.error = e.graphQLErrors[0].message.error 15 | } else if (e.graphQLErrors) { 16 | state.error = e.graphQLErrors 17 | } else if (e.response){ 18 | if(!isUndefined(e.response.data.data) && !isUndefined(e.response.data.data[0]) && e.response.data.data[0].message) { 19 | state.error = e.response.data.data[0].message 20 | } else { 21 | state.error = e.response.data.error 22 | } 23 | } else { 24 | state.error = e 25 | } 26 | }, 27 | } 28 | 29 | export const getters = { 30 | error(state) { 31 | return state.error 32 | } 33 | } 34 | 35 | export const actions = { 36 | async clientInit({ dispatch, commit, getters }) { 37 | await dispatch('settings/load') 38 | if(!isNull(this.$cookie.get('auth'))) { 39 | commit('auth/setAuth', this.$cookie.get('auth')) 40 | 41 | if(getters['auth/isLogged']) { 42 | await dispatch('account/load') 43 | 44 | if(!getters['error']) { 45 | const id = await dispatch('cms/search') 46 | 47 | if(id) { 48 | await dispatch('cms/load', {id}) 49 | } 50 | } else { 51 | await dispatch('auth/logout') 52 | } 53 | } 54 | } else { 55 | await dispatch('auth/logout') 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/store/information.js: -------------------------------------------------------------------------------- 1 | export const state = () => ({ 2 | information: {} 3 | }) 4 | 5 | export const mutations = { 6 | setInformation(state, payload) { 7 | state.information = payload 8 | } 9 | } 10 | 11 | export const getters = { 12 | get(state) { 13 | return state.information 14 | } 15 | } 16 | 17 | export const actions = { 18 | async updateVueFront({commit}, payload) { 19 | try { 20 | commit('setResponseError', false, {root: true}) 21 | 22 | const {data} = await this.$axios.post('/api/vf_update', payload) 23 | 24 | commit('setInformation', data) 25 | } catch (e) { 26 | commit('setResponseError', e, {root: true}) 27 | } 28 | }, 29 | async activateVueFront({commit}, payload) { 30 | try { 31 | commit('setResponseError', false, {root: true}) 32 | 33 | const {data} = await this.$axios.post('/api/vf_turn_on', payload) 34 | 35 | commit('setInformation', data) 36 | } catch (e) { 37 | commit('setResponseError', e, {root: true}) 38 | } 39 | }, 40 | async deActivateVueFront({commit, rootGetters}, payload) { 41 | try { 42 | commit('setResponseError', false, {root: true}) 43 | 44 | const {data} = await this.$axios.post('/api/vf_turn_off', payload) 45 | 46 | commit('setInformation', data) 47 | } catch (e) { 48 | commit('setResponseError', e, {root: true}) 49 | } 50 | }, 51 | async load({commit}) { 52 | try { 53 | commit('setResponseError', false, {root: true}) 54 | 55 | const {data} = await this.$axios.get('/api/vf_information') 56 | 57 | commit('setInformation', data) 58 | } catch (e) { 59 | commit('setResponseError', e, {root: true}) 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /admin/view/javascript/d_pax/store/settings.js: -------------------------------------------------------------------------------- 1 | import gql from 'graphql-tag' 2 | import _ from 'lodash' 3 | export const state = () => ({ 4 | setting: {}, 5 | edit: false 6 | }) 7 | 8 | export const mutations = { 9 | setSetting(state, payload) { 10 | state.setting = payload 11 | }, 12 | setEdit(state, payload) { 13 | state.edit = payload 14 | } 15 | } 16 | 17 | export const getters = { 18 | get(state) { 19 | return state.setting 20 | }, 21 | edit(state) { 22 | return state.edit 23 | } 24 | } 25 | 26 | export const actions = { 27 | 28 | async load({commit}) { 29 | try { 30 | commit('setResponseError', false, {root: true}) 31 | const {data} = await this.$axios.get('/api/vf_settings') 32 | 33 | commit('setSetting', data) 34 | } catch (e) { 35 | commit('setResponseError', e, {root: true}) 36 | } 37 | }, 38 | async edit({commit, getters}, payload) { 39 | try { 40 | const setting = _.merge(getters.get, payload) 41 | commit('setResponseError', false, {root: true}) 42 | await this.$axios.post('/api/vf_settings_edit', {setting}) 43 | 44 | } catch (e) { 45 | commit('setResponseError', e, {root: true}) 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /admin/view/javascript/d_vuefront/img/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/opencart/05354a950a97ef89859bb979bdfc727a938561cb/admin/view/javascript/d_vuefront/img/rocket.png -------------------------------------------------------------------------------- /admin/view/javascript/d_vuefront/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "id": 179, 4 | "next": null, 5 | "js": [ 6 | "/view/javascript/d_vuefront/1752130d064cc59c9a4d.bundle.js" 7 | ], 8 | "css": [ 9 | "/view/javascript/d_vuefront/main.1752130d064cc59c9a4d.css" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /admin/view/template/extension/module/d_vuefront.twig: -------------------------------------------------------------------------------- 1 | {{ header }}{{ column_left }} 2 |
3 | 21 |
22 | {% if error.warning %} 23 |
24 | 25 | {{ error.warning }} 26 | 27 |
28 | {% endif %} 29 | 30 |
31 | 43 |
44 | {{ footer }} 45 | -------------------------------------------------------------------------------- /catalog/controller/extension/d_vuefront/common/country.php: -------------------------------------------------------------------------------- 1 | load->model('extension/'.$this->codename.'/country'); 10 | $information_info = $this->model_extension_d_vuefront_country->getCountry($args['id']); 11 | 12 | return array( 13 | 'id' => $information_info['country_id'], 14 | 'name' => $information_info['name'] 15 | ); 16 | } 17 | 18 | public function getList($args) { 19 | $this->load->model('extension/'.$this->codename.'/country'); 20 | 21 | $countries = array(); 22 | 23 | $filter_data = array( 24 | 'sort' => $args['sort'], 25 | 'order' => $args['order'] 26 | ); 27 | 28 | if($args['size'] != -1) { 29 | $filter_data['start'] = ($args['page'] - 1) * $args['size']; 30 | $filter_data['limit'] = $args['size']; 31 | } 32 | 33 | if (!empty($args['search'])) { 34 | $filter_data['filter_name'] = $args['search']; 35 | } 36 | 37 | $country_total = $this->model_extension_d_vuefront_country->getTotalCountries($filter_data); 38 | 39 | $results = $this->model_extension_d_vuefront_country->getCountries($filter_data); 40 | 41 | if($args['size'] == -1) { 42 | $args['size'] = $country_total; 43 | } 44 | 45 | foreach ($results as $result) { 46 | $countries[] = $this->get(array('id' => $result['country_id'])); 47 | } 48 | 49 | return array( 50 | 'content' => $countries, 51 | 'first' => $args['page'] === 1, 52 | 'last' => $args['page'] === ceil($country_total / $args['size']), 53 | 'number' => (int)$args['page'], 54 | 'numberOfElements' => count($countries), 55 | 'size' => (int)$args['size'], 56 | 'totalPages' => (int)ceil($country_total / $args['size']), 57 | 'totalElements' => (int)$country_total, 58 | ); 59 | } 60 | } -------------------------------------------------------------------------------- /catalog/controller/extension/d_vuefront/common/language.php: -------------------------------------------------------------------------------- 1 | load->model('localisation/language'); 10 | 11 | $languages = array(); 12 | 13 | $results = $this->model_localisation_language->getLanguages(); 14 | 15 | $siteUrl = $this->request->server['HTTPS'] ? $this->config->get('config_ssl') : $this->config->get('config_url'); 16 | 17 | foreach ($results as $result) { 18 | if ($result['status']) { 19 | $code = $result['code']; 20 | 21 | if(VERSION < '2.2.0.0') { 22 | $code = $code == 'en' ? 'en-gb' : $code; 23 | $code = $code == 'ru' ? 'ru-ru' : $code; 24 | } 25 | $languages[] = array( 26 | 'name' => $result['name'], 27 | 'code' => $code, 28 | 'image' => $siteUrl."catalog/language/".$result['code']."/".$result['code'].".png", 29 | 'active' => $this->session->data['language'] == $result['code'] 30 | ); 31 | } 32 | } 33 | 34 | return $languages; 35 | } 36 | 37 | public function edit($args) 38 | { 39 | $this->session->data['language'] = $args['code']; 40 | 41 | return $this->get(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /catalog/controller/extension/d_vuefront/store/compare.php: -------------------------------------------------------------------------------- 1 | load->model("extension/".$this->codename."/compare"); 10 | $compare = array(); 11 | $results = $this->model_extension_d_vuefront_compare->getCompare(); 12 | 13 | foreach ($results as $product_id) { 14 | $compare[] = $this->vfload->data('store/product/get', array('id' => $product_id)); 15 | } 16 | 17 | return $compare; 18 | } 19 | 20 | public function add($args) 21 | { 22 | $this->load->model("extension/".$this->codename."/compare"); 23 | $this->request->post['product_id'] = $args['id']; 24 | 25 | $this->model_extension_d_vuefront_compare->addCompare($args['id']); 26 | 27 | 28 | return $this->get(array()); 29 | } 30 | 31 | public function remove($args) 32 | { 33 | $this->load->model("extension/".$this->codename."/compare"); 34 | $this->model_extension_d_vuefront_compare->deleteCompare($args['id']); 35 | 36 | return $this->get(array()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /catalog/controller/extension/d_vuefront/store/currency.php: -------------------------------------------------------------------------------- 1 | load->model('localisation/currency'); 10 | 11 | $currencies = array(); 12 | 13 | $results = $this->model_localisation_currency->getCurrencies(); 14 | 15 | foreach ($results as $result) { 16 | if ($result['status']) { 17 | $currencies[] = array( 18 | 'title' => $result['title'], 19 | 'name' => $result['title'], 20 | 'code' => $result['code'], 21 | 'symbol_left' => $result['symbol_left'], 22 | 'symbol_right' => $result['symbol_right'], 23 | 'active' => $this->session->data['currency'] == $result['code'] 24 | ); 25 | } 26 | } 27 | 28 | return $currencies; 29 | } 30 | 31 | public function edit($args) 32 | { 33 | $this->session->data['currency'] = $args['code']; 34 | 35 | unset($this->session->data['shipping_method']); 36 | unset($this->session->data['shipping_methods']); 37 | 38 | return $this->get(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /catalog/controller/extension/d_vuefront/store/review.php: -------------------------------------------------------------------------------- 1 | load->model('catalog/review'); 10 | 11 | $reviewData = array( 12 | 'name' => $args['author'], 13 | 'text' => $args['content'], 14 | 'rating' => $args['rating'] 15 | ); 16 | 17 | $this->model_catalog_review->addReview($args['id'], $reviewData); 18 | 19 | return $this->vfload->data('store/product/get', $args); 20 | } 21 | 22 | public function get($data) 23 | { 24 | $this->load->model('catalog/review'); 25 | $product = $data['parent']; 26 | 27 | $results = $this->model_catalog_review->getReviewsByProductId($product['id']); 28 | 29 | $reviews = array(); 30 | 31 | foreach ($results as $result) { 32 | $reviews[] = array( 33 | 'author' => $result['author'], 34 | 'author_email' => '', 35 | 'content' => nl2br($result['text']), 36 | 'rating' => (float)$result['rating'], 37 | 'created_at' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 38 | 39 | ); 40 | } 41 | 42 | return $reviews; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /catalog/controller/extension/d_vuefront/store/wishlist.php: -------------------------------------------------------------------------------- 1 | load->model("extension/".$this->codename."/wishlist"); 10 | $wishlist = array(); 11 | $results = $this->model_extension_d_vuefront_wishlist->getWishlist(); 12 | 13 | foreach ($results as $product_id) { 14 | $wishlist[] = $this->vfload->data('store/product/get', array('id' => $product_id)); 15 | } 16 | 17 | return $wishlist; 18 | } 19 | 20 | public function add($args) 21 | { 22 | $this->request->post['product_id'] = $args['id']; 23 | 24 | $this->load->controller('account/wishlist/add'); 25 | 26 | return $this->getList(array()); 27 | } 28 | 29 | public function remove($args) 30 | { 31 | $this->load->model("extension/".$this->codename."/wishlist"); 32 | $this->model_extension_d_vuefront_wishlist->deleteWishlist($args['id']); 33 | 34 | return $this->getList(array()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /catalog/controller/extension/module/d_vuefront_schema/schemaAdmin.graphql: -------------------------------------------------------------------------------- 1 | type CustomerResult { 2 | content: [Customer] 3 | first: Boolean 4 | last: Boolean 5 | number: Int 6 | numberOfElements: Int 7 | size: Int 8 | totalPages: Int 9 | totalElements: Int 10 | } 11 | type OptionResult { 12 | content: [Option] 13 | first: Boolean 14 | last: Boolean 15 | number: Int 16 | numberOfElements: Int 17 | size: Int 18 | totalPages: Int 19 | totalElements: Int 20 | } 21 | 22 | type Option { 23 | id: String 24 | name: String 25 | type: String 26 | sort_order: Int 27 | values: [OptionValue] 28 | } 29 | 30 | input InputAppSetting { 31 | eventUrl: String 32 | jwt: String 33 | authUrl: String 34 | } 35 | 36 | type AppSetting { 37 | codename: String 38 | authUrl: String 39 | eventUrl: String 40 | jwt: String 41 | } 42 | 43 | type RootQueryType { 44 | customersList(page: Int = 1, size: Int = 10, search: String, sort: String = "email", order: String = "ASC"): CustomerResult 45 | customer(id: String): Customer 46 | option(id: String): Option 47 | optionsList(page: Int = 1, size: Int = 10, search: String, sort: String = "sort_order", order: String = "ASC"): OptionResult 48 | } 49 | type RootMutationType { 50 | updateApp(name: String, settings: InputAppSetting): AppSetting 51 | updateSite(number: Int): Boolean 52 | } 53 | -------------------------------------------------------------------------------- /catalog/model/extension/d_vuefront/compare.php: -------------------------------------------------------------------------------- 1 | session->data['compare'])) { 9 | $result = $this->session->data['compare']; 10 | } 11 | 12 | return $result; 13 | } 14 | 15 | public function addCompare($product_id) 16 | { 17 | $this->load->model('catalog/product'); 18 | 19 | $product_info = $this->model_catalog_product->getProduct($product_id); 20 | 21 | if ($product_info) { 22 | if (!isset($this->session->data['compare'])) { 23 | $this->session->data['compare'] = array(); 24 | } 25 | if (!in_array($product_id, $this->session->data['compare'])) { 26 | if (count($this->session->data['compare']) >= 4) { 27 | array_shift($this->session->data['compare']); 28 | } 29 | $this->session->data['compare'][] = (int)$product_id; 30 | } 31 | } 32 | } 33 | 34 | public function deleteCompare($product_id) 35 | { 36 | if (!empty($this->session->data['compare'])) { 37 | $key = array_search($product_id, $this->session->data['compare']); 38 | 39 | if ($key !== false) { 40 | unset($this->session->data['compare'][$key]); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /catalog/view/javascript/d_vuefront/css/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | font-family: sans-serif; 5 | overflow: hidden; 6 | } 7 | 8 | #root { 9 | height: 100%; 10 | } 11 | 12 | body { 13 | font-family: 'Open Sans', sans-serif; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | color: rgba(0,0,0,.8); 17 | line-height: 1.5; 18 | height: 100vh; 19 | letter-spacing: 0.53px; 20 | margin-right: -1px !important; 21 | } 22 | 23 | html, body, p, a, h1, h2, h3, h4, ul, pre, code { 24 | margin: 0; 25 | padding: 0; 26 | color: inherit; 27 | } 28 | 29 | a:active, a:focus, button:focus, input:focus { 30 | outline: none; 31 | } 32 | 33 | input, button, submit { 34 | border: none; 35 | } 36 | 37 | input, button, pre { 38 | font-family: 'Open Sans', sans-serif; 39 | } 40 | 41 | code { 42 | font-family: Consolas, monospace; 43 | } 44 | 45 | /*# sourceMappingURL=index.css.map*/ -------------------------------------------------------------------------------- /catalog/view/javascript/d_vuefront/css/index.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../index.css"],"names":[],"mappings":"AAAA;EACE,SAAS;EACT,UAAU;EACV,uBAAuB;EACvB,gBAAgB;AAClB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,oCAAoC;EACpC,mCAAmC;EACnC,kCAAkC;EAClC,qBAAqB;EACrB,gBAAgB;EAChB,aAAa;EACb,sBAAsB;EACtB,6BAA6B;AAC/B;;AAEA;EACE,SAAS;EACT,UAAU;EACV,cAAc;AAChB;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,gCAAgC;AAClC","file":"static/css/index.css","sourcesContent":["body {\n margin: 0;\n padding: 0;\n font-family: sans-serif;\n overflow: hidden;\n}\n\n#root {\n height: 100%;\n}\n\nbody {\n font-family: 'Open Sans', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n color: rgba(0,0,0,.8);\n line-height: 1.5;\n height: 100vh;\n letter-spacing: 0.53px;\n margin-right: -1px !important;\n}\n\nhtml, body, p, a, h1, h2, h3, h4, ul, pre, code {\n margin: 0;\n padding: 0;\n color: inherit;\n}\n\na:active, a:focus, button:focus, input:focus {\n outline: none;\n}\n\ninput, button, submit {\n border: none;\n}\n\ninput, button, pre {\n font-family: 'Open Sans', sans-serif;\n}\n\ncode {\n font-family: Consolas, monospace;\n}\n"],"sourceRoot":""} -------------------------------------------------------------------------------- /catalog/view/theme/default/template/extension/module/d_vuefront.twig: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple GraphiQL Example 4 | 5 | 6 | 7 |
8 | 9 | 13 | 17 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /system/library/d_graphql/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "d_graphql", 3 | "authors": [ 4 | { 5 | "name": "Dreamvention", 6 | "email": "info@dreamvention.com" 7 | } 8 | ], 9 | "require": { 10 | "webonyx/graphql-php": "0.11.6" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/webonyx/graphql-php/src/deprecated.php', 10 | ); 11 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/webonyx/graphql-php/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/..' . '/webonyx/graphql-php/src/deprecated.php', 11 | ); 12 | 13 | public static $prefixLengthsPsr4 = array ( 14 | 'G' => 15 | array ( 16 | 'GraphQL\\' => 8, 17 | ), 18 | ); 19 | 20 | public static $prefixDirsPsr4 = array ( 21 | 'GraphQL\\' => 22 | array ( 23 | 0 => __DIR__ . '/..' . '/webonyx/graphql-php/src', 24 | ), 25 | ); 26 | 27 | public static function getInitializer(ClassLoader $loader) 28 | { 29 | return \Closure::bind(function () use ($loader) { 30 | $loader->prefixLengthsPsr4 = ComposerStaticInit3984d4e56159d6beade33335b85c7d77::$prefixLengthsPsr4; 31 | $loader->prefixDirsPsr4 = ComposerStaticInit3984d4e56159d6beade33335b85c7d77::$prefixDirsPsr4; 32 | 33 | }, null, ClassLoader::class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/composer/installed.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "webonyx/graphql-php", 4 | "version": "v0.11.6", 5 | "version_normalized": "0.11.6.0", 6 | "source": { 7 | "type": "git", 8 | "url": "https://github.com/webonyx/graphql-php.git", 9 | "reference": "f438a726cd523bc584e78d866eca270165c42fd5" 10 | }, 11 | "dist": { 12 | "type": "zip", 13 | "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/f438a726cd523bc584e78d866eca270165c42fd5", 14 | "reference": "f438a726cd523bc584e78d866eca270165c42fd5", 15 | "shasum": "" 16 | }, 17 | "require": { 18 | "ext-mbstring": "*", 19 | "php": ">=5.5,<8.0-DEV" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "^4.8", 23 | "psr/http-message": "^1.0" 24 | }, 25 | "suggest": { 26 | "psr/http-message": "To use standard GraphQL server", 27 | "react/promise": "To leverage async resolving on React PHP platform" 28 | }, 29 | "time": "2018-04-17T10:34:43+00:00", 30 | "type": "library", 31 | "installation-source": "dist", 32 | "autoload": { 33 | "files": [ 34 | "src/deprecated.php" 35 | ], 36 | "psr-4": { 37 | "GraphQL\\": "src/" 38 | } 39 | }, 40 | "notification-url": "https://packagist.org/downloads/", 41 | "license": [ 42 | "MIT" 43 | ], 44 | "description": "A PHP port of GraphQL reference implementation", 45 | "homepage": "https://github.com/webonyx/graphql-php", 46 | "keywords": [ 47 | "api", 48 | "graphql" 49 | ] 50 | } 51 | ] 52 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text eol=lf 3 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | # Required for HHVM, see https://github.com/travis-ci/travis-ci/issues/7712 4 | dist: trusty 5 | 6 | php: 7 | - 5.5 8 | - 5.6 9 | - 7.0 10 | - 7.1 11 | - hhvm 12 | - nightly 13 | 14 | matrix: 15 | allow_failures: 16 | - php: nightly 17 | 18 | cache: 19 | directories: 20 | - $HOME/.composer/cache 21 | 22 | before_install: 23 | - if [[ "$TRAVIS_PHP_VERSION" != "5.6" && "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini || true; fi 24 | - composer selfupdate 25 | 26 | install: 27 | - composer install --dev --prefer-dist 28 | - composer require react/promise:2.* 29 | - composer require psr/http-message:1.* 30 | 31 | script: if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then bin/phpunit --coverage-clover build/logs/clover.xml --group default,ReactPromise; else bin/phpunit --group default,ReactPromise; fi 32 | 33 | after_success: 34 | - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then composer require "satooshi/php-coveralls:^1.0" && travis_retry php bin/coveralls -v; fi 35 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to GraphQL PHP 2 | 3 | ## Workflow 4 | 5 | If your contribution requires significant or breaking changes, or if you plan to propose a major new feature, 6 | we recommend you to create an issue on the [Github](https://github.com/webonyx/graphql-php/issues) with 7 | a brief proposal and discuss it with us first. 8 | 9 | For smaller contributions just use this workflow: 10 | 11 | * Fork the project. 12 | * Add your features and or bug fixes. 13 | * Add tests. Tests are important for us. 14 | * Send a pull request 15 | 16 | ## Using GraphQL PHP from a Git checkout 17 | ``` 18 | $ git clone https://github.com/webonyx/graphql-php.git 19 | $ cd graphql-php 20 | $ composer install 21 | ``` 22 | 23 | ## Running tests 24 | From the project root: 25 | ``` 26 | $ ./bin/phpunit 27 | ``` 28 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2015-present, Webonyx, LLC. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/README.md: -------------------------------------------------------------------------------- 1 | # graphql-php 2 | [![Build Status](https://travis-ci.org/webonyx/graphql-php.svg?branch=master)](https://travis-ci.org/webonyx/graphql-php) 3 | [![Coverage Status](https://coveralls.io/repos/github/webonyx/graphql-php/badge.svg)](https://coveralls.io/github/webonyx/graphql-php) 4 | [![Latest Stable Version](https://poser.pugx.org/webonyx/graphql-php/version)](https://packagist.org/packages/webonyx/graphql-php) 5 | [![License](https://poser.pugx.org/webonyx/graphql-php/license)](https://packagist.org/packages/webonyx/graphql-php) 6 | 7 | This is a PHP implementation of the GraphQL [specification](https://github.com/facebook/graphql) 8 | based on the [reference implementation in JavaScript](https://github.com/graphql/graphql-js). 9 | 10 | ## Installation 11 | Via composer: 12 | ``` 13 | composer require webonyx/graphql-php 14 | ``` 15 | 16 | ## Documentation 17 | Full documentation is available on the [Documentation site](http://webonyx.github.io/graphql-php/) as well 18 | as in the [docs](docs/) folder of the distribution. 19 | 20 | If you don't know what GraphQL is, visit this [official website](http://graphql.org) 21 | by the Facebook engineering team. 22 | 23 | ## Examples 24 | There are several ready examples in the [examples](examples/) folder of the distribution with specific 25 | README file per example. 26 | 27 | ## Contribute 28 | Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for information on how to contribute. 29 | 30 | ## Old README.md 31 | Here is a [link to the old README.md](https://github.com/webonyx/graphql-php/blob/v0.9.14/README.md). 32 | 33 | Keep in mind that it relates to the version 0.9.x. It may contain outdated information for 34 | newer versions (even though we try to preserve backwards compatibility). 35 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/benchmarks/HugeSchemaBench.php: -------------------------------------------------------------------------------- 1 | schemaBuilder = new SchemaGenerator([ 36 | 'totalTypes' => 600, 37 | 'fieldsPerType' => 8, 38 | 'listFieldsPerType' => 2, 39 | 'nestingLevel' => 10 40 | ]); 41 | 42 | $this->schema = $this->schemaBuilder->buildSchema(); 43 | 44 | $queryBuilder = new QueryGenerator($this->schema, 0.05); 45 | $this->smallQuery = $queryBuilder->buildQuery(); 46 | } 47 | 48 | public function benchSchema() 49 | { 50 | $this->schemaBuilder 51 | ->buildSchema() 52 | ->getTypeMap() 53 | ; 54 | } 55 | 56 | public function benchSchemaLazy() 57 | { 58 | $this->createLazySchema(); 59 | } 60 | 61 | public function benchSmallQuery() 62 | { 63 | $result = GraphQL::execute($this->schema, $this->smallQuery); 64 | } 65 | 66 | public function benchSmallQueryLazy() 67 | { 68 | $schema = $this->createLazySchema(); 69 | $result = GraphQL::execute($schema, $this->smallQuery); 70 | } 71 | 72 | private function createLazySchema() 73 | { 74 | return new Schema( 75 | \GraphQL\Type\SchemaConfig::create() 76 | ->setQuery($this->schemaBuilder->buildQueryType()) 77 | ->setTypeLoader(function($name) { 78 | return $this->schemaBuilder->loadType($name); 79 | }) 80 | ); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/benchmarks/LexerBench.php: -------------------------------------------------------------------------------- 1 | introQuery = new Source(Introspection::getIntrospectionQuery()); 20 | } 21 | 22 | /** 23 | * @Warmup(2) 24 | * @Revs(100) 25 | * @Iterations(5) 26 | */ 27 | public function benchIntrospectionQuery() 28 | { 29 | $lexer = new Lexer($this->introQuery); 30 | 31 | do { 32 | $token = $lexer->advance(); 33 | } while ($token->kind !== Token::EOF); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/benchmarks/StarWarsBench.php: -------------------------------------------------------------------------------- 1 | introQuery = Introspection::getIntrospectionQuery(); 21 | } 22 | 23 | public function benchSchema() 24 | { 25 | StarWarsSchema::build(); 26 | } 27 | 28 | public function benchHeroQuery() 29 | { 30 | $q = ' 31 | query HeroNameQuery { 32 | hero { 33 | name 34 | } 35 | } 36 | '; 37 | 38 | GraphQL::execute( 39 | StarWarsSchema::build(), 40 | $q 41 | ); 42 | } 43 | 44 | public function benchNestedQuery() 45 | { 46 | $q = ' 47 | query NestedQuery { 48 | hero { 49 | name 50 | friends { 51 | name 52 | appearsIn 53 | friends { 54 | name 55 | } 56 | } 57 | } 58 | } 59 | '; 60 | GraphQL::execute( 61 | StarWarsSchema::build(), 62 | $q 63 | ); 64 | } 65 | 66 | public function benchQueryWithFragment() 67 | { 68 | $q = ' 69 | query UseFragment { 70 | luke: human(id: "1000") { 71 | ...HumanFragment 72 | } 73 | leia: human(id: "1003") { 74 | ...HumanFragment 75 | } 76 | } 77 | 78 | fragment HumanFragment on Human { 79 | name 80 | homePlanet 81 | } 82 | '; 83 | 84 | GraphQL::execute( 85 | StarWarsSchema::build(), 86 | $q 87 | ); 88 | } 89 | 90 | public function benchStarWarsIntrospectionQuery() 91 | { 92 | GraphQL::execute( 93 | StarWarsSchema::build(), 94 | $this->introQuery 95 | ); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webonyx/graphql-php", 3 | "description": "A PHP port of GraphQL reference implementation", 4 | "type": "library", 5 | "license": "MIT", 6 | "homepage": "https://github.com/webonyx/graphql-php", 7 | "keywords": [ 8 | "graphql", 9 | "API" 10 | ], 11 | "require": { 12 | "php": ">=5.5,<8.0-DEV", 13 | "ext-mbstring": "*" 14 | }, 15 | "require-dev": { 16 | "phpunit/phpunit": "^4.8", 17 | "psr/http-message": "^1.0" 18 | }, 19 | "config": { 20 | "bin-dir": "bin" 21 | }, 22 | "autoload": { 23 | "files": ["src/deprecated.php"], 24 | "psr-4": { 25 | "GraphQL\\": "src/" 26 | } 27 | }, 28 | "autoload-dev": { 29 | "psr-4": { 30 | "GraphQL\\Tests\\": "tests/", 31 | "GraphQL\\Benchmarks\\": "benchmarks/", 32 | "GraphQL\\Examples\\Blog\\": "examples/01-blog/Blog/" 33 | } 34 | }, 35 | "suggest": { 36 | "react/promise": "To leverage async resolving on React PHP platform", 37 | "psr/http-message": "To use standard GraphQL server" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/docs/best-practices.md: -------------------------------------------------------------------------------- 1 | # Config Validation 2 | Defining types using arrays may be error-prone, but **graphql-php** provides config validation 3 | tool to report when config has unexpected structure. 4 | 5 | This validation tool is **disabled by default** because it is time-consuming operation which only 6 | makes sense during development. 7 | 8 | To enable validation - call: `GraphQL\Type\Definition\Config::enableValidation();` in your bootstrap 9 | but make sure to restrict it to debug/development mode only. 10 | 11 | # Type Registry 12 | **graphql-php** expects that each type in Schema is presented by single instance. Therefore 13 | if you define your types as separate PHP classes you need to ensure that each type is referenced only once. 14 | 15 | Technically you can create several instances of your type (for example for tests), but `GraphQL\Type\Schema` 16 | will throw on attempt to add different instances with the same name. 17 | 18 | There are several ways to achieve this depending on your preferences. We provide reference 19 | implementation below that introduces TypeRegistry class: -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/docs/complementary-tools.md: -------------------------------------------------------------------------------- 1 | # Integrations 2 | 3 | - [Integration with Relay](https://github.com/ivome/graphql-relay-php) 4 | - [Integration with Laravel 5](https://github.com/Folkloreatelier/laravel-graphql) + [Relay Helpers for Laravel](https://github.com/nuwave/laravel-graphql-relay) 5 | - [Symfony Bundle](https://github.com/overblog/GraphQLBundle) by Overblog 6 | - Define types with Doctrine ORM annotations ([for PHP7.1](https://github.com/Ecodev/graphql-doctrine), for [earlier PHP versions](https://github.com/rahuljayaraman/doctrine-graphql)) 7 | - Out of the box integration with any PSR-7 compatible framework (like [Slim](http://slimframework.com) or [Zend Expressive](http://zendframework.github.io/zend-expressive/)) via [Standard Server](executing-queries.md/#using-server) 8 | 9 | # Tools 10 | - [GraphiQL](https://github.com/graphql/graphiql) - An in-browser IDE for exploring GraphQL 11 | - [ChromeiQL](https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij) 12 | or [GraphiQL Feen](https://chrome.google.com/webstore/detail/graphiql-feen/mcbfdonlkfpbfdpimkjilhdneikhfklp) - 13 | GraphiQL as Google Chrome extension 14 | - [DataLoader PHP](https://github.com/overblog/dataloader-php) - as a ready implementation for [deferred resolvers](data-fetching.md#solving-n1-problem) -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/docs/how-it-works.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | Following reading describes implementation details of query execution process. It may clarify some 3 | internals of GraphQL runtime but is not required to use it. 4 | 5 | # Parsing 6 | 7 | TODOC 8 | 9 | # Validating 10 | TODOC 11 | 12 | # Executing 13 | TODOC 14 | 15 | # Errors explained 16 | There are 3 types of errors in GraphQL: 17 | 18 | - **Syntax**: query has invalid syntax and could not be parsed; 19 | - **Validation**: query is incompatible with type system (e.g. unknown field is requested); 20 | - **Execution**: occurs when some field resolver throws (or returns unexpected value). 21 | 22 | Obviously, when **Syntax** or **Validation** error is detected - the process is interrupted and 23 | the query is not executed. 24 | 25 | Execution process never throws exceptions. Instead, all errors are caught and collected in 26 | execution result. 27 | 28 | GraphQL is forgiving to **Execution** errors which occur in resolvers of nullable fields. 29 | If such field throws or returns unexpected value the value of the field in response will be simply 30 | replaced with **null** and error entry will be registered. 31 | 32 | If an exception is thrown in the non-null field - error bubbles up to the first nullable field. 33 | This nullable field is replaced with **null** and error entry is added to the result. 34 | If all fields up to the root are non-null - **data** entry will be removed from the result 35 | and only **errors** key will be presented. 36 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/docs/type-system/unions.md: -------------------------------------------------------------------------------- 1 | # Union Type Definition 2 | A Union is an abstract type that simply enumerates other Object Types. 3 | The value of Union Type is actually a value of one of included Object Types. 4 | 5 | In **graphql-php** union type is an instance of `GraphQL\Type\Definition\UnionType` 6 | (or one of its subclasses) which accepts configuration array in a constructor: 7 | 8 | ```php 9 | 'SearchResult', 14 | 'types' => [ 15 | MyTypes::story(), 16 | MyTypes::user() 17 | ], 18 | 'resolveType' => function($value) { 19 | if ($value->type === 'story') { 20 | return MyTypes::story(); 21 | } else { 22 | return MyTypes::user(); 23 | } 24 | } 25 | ]); 26 | ``` 27 | 28 | This example uses **inline** style for Union definition, but you can also use 29 | [inheritance or type language](index.md#type-definition-styles). 30 | 31 | # Configuration options 32 | The constructor of UnionType accepts an array. Below is a full list of allowed options: 33 | 34 | Option | Type | Notes 35 | ------ | ---- | ----- 36 | name | `string` | **Required.** Unique name of this interface type within Schema 37 | types | `array` | **Required.** List of Object Types included in this Union. Note that you can't create a Union type out of Interfaces or other Unions. 38 | description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) 39 | resolveType | `callback` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Receives **$value** from resolver of the parent field and returns concrete Object Type for this **$value**. 40 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/00-hello-world/README.md: -------------------------------------------------------------------------------- 1 | # Hello world 2 | Clean and simple single-file example of main GraphQL concepts originally proposed and 3 | implemented by [Leo Cavalcante](https://github.com/leocavalcante) 4 | 5 | ### Run locally 6 | ``` 7 | php -S localhost:8080 ./graphql.php 8 | ``` 9 | 10 | ### Try query 11 | ``` 12 | curl http://localhost:8080 -d '{"query": "query { echo(message: \"Hello World\") }" }' 13 | ``` 14 | 15 | ### Try mutation 16 | ``` 17 | curl http://localhost:8080 -d '{"query": "mutation { sum(x: 2, y: 2) }" }' 18 | ``` 19 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/01-blog/Blog/AppContext.php: -------------------------------------------------------------------------------- 1 | 'ContentFormatEnum', 15 | 'values' => [self::FORMAT_TEXT, self::FORMAT_HTML] 16 | ]; 17 | parent::__construct($config); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/01-blog/Blog/Type/Enum/ImageSizeEnumType.php: -------------------------------------------------------------------------------- 1 | [ 14 | 'ICON' => Image::SIZE_ICON, 15 | 'SMALL' => Image::SIZE_SMALL, 16 | 'MEDIUM' => Image::SIZE_MEDIUM, 17 | 'ORIGINAL' => Image::SIZE_ORIGINAL 18 | ] 19 | ]; 20 | 21 | parent::__construct($config); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/01-blog/Blog/Type/Field/HtmlField.php: -------------------------------------------------------------------------------- 1 | $name, 18 | 'type' => Types::string(), 19 | 'args' => [ 20 | 'format' => [ 21 | 'type' => Types::contentFormatEnum(), 22 | 'defaultValue' => ContentFormatEnum::FORMAT_HTML 23 | ], 24 | 'maxLength' => Types::int() 25 | ], 26 | 'resolve' => function($object, $args) use ($objectKey) { 27 | $html = $object->{$objectKey}; 28 | $text = strip_tags($html); 29 | 30 | if (!empty($args['maxLength'])) { 31 | $safeText = mb_substr($text, 0, $args['maxLength']); 32 | } else { 33 | $safeText = $text; 34 | } 35 | 36 | switch ($args['format']) { 37 | case ContentFormatEnum::FORMAT_HTML: 38 | if ($safeText !== $text) { 39 | // Text was truncated, so just show what's safe: 40 | return nl2br($safeText); 41 | } else { 42 | return $html; 43 | } 44 | 45 | case ContentFormatEnum::FORMAT_TEXT: 46 | default: 47 | return $safeText; 48 | } 49 | } 50 | ]; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/01-blog/Blog/Type/NodeType.php: -------------------------------------------------------------------------------- 1 | 'Node', 16 | 'fields' => [ 17 | 'id' => Types::id() 18 | ], 19 | 'resolveType' => [$this, 'resolveNodeType'] 20 | ]; 21 | parent::__construct($config); 22 | } 23 | 24 | public function resolveNodeType($object) 25 | { 26 | if ($object instanceof User) { 27 | return Types::user(); 28 | } else if ($object instanceof Image) { 29 | return Types::image(); 30 | } else if ($object instanceof Story) { 31 | return Types::story(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/01-blog/Blog/Type/Scalar/UrlType.php: -------------------------------------------------------------------------------- 1 | parseValue($value); 26 | } 27 | 28 | /** 29 | * Parses an externally provided value (query variable) to use as an input 30 | * 31 | * @param mixed $value 32 | * @return mixed 33 | */ 34 | public function parseValue($value) 35 | { 36 | if (!is_string($value) || !filter_var($value, FILTER_VALIDATE_URL)) { // quite naive, but after all this is example 37 | throw new \UnexpectedValueException("Cannot represent value as URL: " . Utils::printSafe($value)); 38 | } 39 | return $value; 40 | } 41 | 42 | /** 43 | * Parses an externally provided literal value to use as an input (e.g. in Query AST) 44 | * 45 | * @param $ast Node 46 | * @return null|string 47 | * @throws Error 48 | */ 49 | public function parseLiteral($ast) 50 | { 51 | // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL 52 | // error location in query: 53 | if (!($ast instanceof StringValueNode)) { 54 | throw new Error('Query error: Can only parse strings got: ' . $ast->kind, [$ast]); 55 | } 56 | if (!is_string($ast->value) || !filter_var($ast->value, FILTER_VALIDATE_URL)) { 57 | throw new Error('Query error: Not a valid URL', [$ast]); 58 | } 59 | return $ast->value; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/01-blog/Blog/Type/SearchResultType.php: -------------------------------------------------------------------------------- 1 | 'SearchResultType', 15 | 'types' => function() { 16 | return [ 17 | Types::story(), 18 | Types::user() 19 | ]; 20 | }, 21 | 'resolveType' => function($value) { 22 | if ($value instanceof Story) { 23 | return Types::story(); 24 | } else if ($value instanceof User) { 25 | return Types::user(); 26 | } 27 | } 28 | ]; 29 | parent::__construct($config); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/02-shorthand/README.md: -------------------------------------------------------------------------------- 1 | # Parsing GraphQL IDL shorthand 2 | 3 | Same as the Hello world example but shows how to build GraphQL schema from shorthand 4 | and wire up some resolvers 5 | 6 | ### Run locally 7 | ``` 8 | php -S localhost:8080 ./graphql.php 9 | ``` 10 | 11 | ### Try query 12 | ``` 13 | curl http://localhost:8080 -d '{"query": "query { echo(message: \"Hello World\") }" }' 14 | ``` 15 | 16 | ### Try mutation 17 | ``` 18 | curl http://localhost:8080 -d '{"query": "mutation { sum(x: 2, y: 2) }" }' 19 | ``` 20 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/02-shorthand/graphql.php: -------------------------------------------------------------------------------- 1 | [ 25 | 'message' => $e->getMessage() 26 | ] 27 | ]; 28 | } 29 | header('Content-Type: application/json; charset=UTF-8'); 30 | echo json_encode($result); 31 | 32 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/02-shorthand/rootvalue.php: -------------------------------------------------------------------------------- 1 | function($root, $args, $context) { 25 | $sum = new Addition(); 26 | 27 | return $sum->resolve($root, $args, $context); 28 | }, 29 | 'echo' => function($root, $args, $context) { 30 | $echo = new Echoer(); 31 | 32 | return $echo->resolve($root, $args, $context); 33 | }, 34 | 'prefix' => 'You said: ', 35 | ]; 36 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/02-shorthand/schema.graphqls: -------------------------------------------------------------------------------- 1 | schema { 2 | query: Query 3 | mutation: Calc 4 | } 5 | 6 | type Calc { 7 | sum(x: Int, y: Int): Int 8 | } 9 | 10 | type Query { 11 | echo(message: String): String 12 | } 13 | 14 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/03-server/README.md: -------------------------------------------------------------------------------- 1 | # Hello world 2 | Same example as 01-hello-world, but uses 3 | [Standard Http Server](http://webonyx.github.io/graphql-php/executing-queries/#using-server) 4 | instead of manual parsing of incoming data. 5 | 6 | ### Run locally 7 | ``` 8 | php -S localhost:8080 ./graphql.php 9 | ``` 10 | 11 | ### Try query 12 | ``` 13 | curl http://localhost:8080 -d '{"query": "query { echo(message: \"Hello World\") }" }' 14 | ``` 15 | 16 | ### Try mutation 17 | ``` 18 | curl http://localhost:8080 -d '{"query": "mutation { sum(x: 2, y: 2) }" }' 19 | ``` 20 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/examples/03-server/graphql.php: -------------------------------------------------------------------------------- 1 | 'Query', 16 | 'fields' => [ 17 | 'echo' => [ 18 | 'type' => Type::string(), 19 | 'args' => [ 20 | 'message' => ['type' => Type::string()], 21 | ], 22 | 'resolve' => function ($root, $args) { 23 | return $root['prefix'] . $args['message']; 24 | } 25 | ], 26 | ], 27 | ]); 28 | 29 | $mutationType = new ObjectType([ 30 | 'name' => 'Calc', 31 | 'fields' => [ 32 | 'sum' => [ 33 | 'type' => Type::int(), 34 | 'args' => [ 35 | 'x' => ['type' => Type::int()], 36 | 'y' => ['type' => Type::int()], 37 | ], 38 | 'resolve' => function ($root, $args) { 39 | return $args['x'] + $args['y']; 40 | }, 41 | ], 42 | ], 43 | ]); 44 | 45 | // See docs on schema options: 46 | // http://webonyx.github.io/graphql-php/type-system/schema/#configuration-options 47 | $schema = new Schema([ 48 | 'query' => $queryType, 49 | 'mutation' => $mutationType, 50 | ]); 51 | 52 | // See docs on server options: 53 | // http://webonyx.github.io/graphql-php/executing-queries/#server-configuration-options 54 | $server = new StandardServer([ 55 | 'schema' => $schema 56 | ]); 57 | 58 | $server->handleRequest(); 59 | } catch (\Exception $e) { 60 | StandardServer::send500Error($e); 61 | } 62 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: graphql-php 2 | pages: 3 | - About: index.md 4 | - Getting Started: getting-started.md 5 | - Complementary Tools: complementary-tools.md 6 | - Type Definitions: 7 | - Introduction: type-system/index.md 8 | - Object Types: type-system/object-types.md 9 | - Scalar Types: type-system/scalar-types.md 10 | - Enumeration Types: type-system/enum-types.md 11 | - Lists and Non-Null: type-system/lists-and-nonnulls.md 12 | - Interfaces: type-system/interfaces.md 13 | - Unions: type-system/unions.md 14 | - Mutations and Input Types: type-system/input-types.md 15 | - Directives: type-system/directives.md 16 | - Schema: type-system/schema.md 17 | - Using Type Language: type-system/type-language.md 18 | - Executing Queries: executing-queries.md 19 | - Fetching Data: data-fetching.md 20 | - Handling Errors: error-handling.md 21 | # - Mutations: mutations.md 22 | - Security: security.md 23 | # - Performance tips: performance.md 24 | - How it works: how-it-works.md 25 | - Class Reference: reference.md 26 | theme: readthedocs 27 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/phpbench.json: -------------------------------------------------------------------------------- 1 | { 2 | "bootstrap": "vendor/autoload.php", 3 | "path": "benchmarks", 4 | "retry_threshold": 5, 5 | "time_unit": "milliseconds" 6 | } 7 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | ./tests/ 17 | 18 | 19 | 20 | 21 | 22 | ReactPromise 23 | 24 | 25 | 26 | 27 | 28 | ./src 29 | 30 | ./bin 31 | ./docs 32 | ./build 33 | ./tests 34 | ./vendor 35 | ./examples 36 | ./benchmarks 37 | ./src/deprecated.php 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Deferred.php: -------------------------------------------------------------------------------- 1 | isEmpty()) { 32 | /** @var self $dfd */ 33 | $dfd = $q->dequeue(); 34 | $dfd->run(); 35 | } 36 | } 37 | 38 | public function __construct(callable $callback) 39 | { 40 | $this->callback = $callback; 41 | $this->promise = new SyncPromise(); 42 | self::getQueue()->enqueue($this); 43 | } 44 | 45 | public function then($onFulfilled = null, $onRejected = null) 46 | { 47 | return $this->promise->then($onFulfilled, $onRejected); 48 | } 49 | 50 | private function run() 51 | { 52 | try { 53 | $cb = $this->callback; 54 | $this->promise->resolve($cb()); 55 | } catch (\Exception $e) { 56 | $this->promise->reject($e); 57 | } catch (\Throwable $e) { 58 | $this->promise->reject($e); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Error.php: -------------------------------------------------------------------------------- 1 | schema = $schema; 72 | $this->fragments = $fragments; 73 | $this->rootValue = $root; 74 | $this->contextValue = $contextValue; 75 | $this->operation = $operation; 76 | $this->variableValues = $variables; 77 | $this->errors = $errors ?: []; 78 | $this->fieldResolver = $fieldResolver; 79 | $this->promises = $promiseAdapter; 80 | } 81 | 82 | public function addError(Error $error) 83 | { 84 | $this->errors[] = $error; 85 | return $this; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php: -------------------------------------------------------------------------------- 1 | adapter = $adapter; 26 | $this->adoptedPromise = $adoptedPromise; 27 | } 28 | 29 | /** 30 | * @param callable|null $onFulfilled 31 | * @param callable|null $onRejected 32 | * 33 | * @return Promise 34 | */ 35 | public function then(callable $onFulfilled = null, callable $onRejected = null) 36 | { 37 | return $this->adapter->then($this, $onFulfilled, $onRejected); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php: -------------------------------------------------------------------------------- 1 | start = $start; 57 | $tmp->end = $end; 58 | return $tmp; 59 | } 60 | 61 | public function __construct(Token $startToken = null, Token $endToken = null, Source $source = null) 62 | { 63 | $this->startToken = $startToken; 64 | $this->endToken = $endToken; 65 | $this->source = $source; 66 | 67 | if ($startToken && $endToken) { 68 | $this->start = $startToken->start; 69 | $this->end = $endToken->end; 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php: -------------------------------------------------------------------------------- 1 | line = $line; 12 | $this->column = $col; 13 | } 14 | 15 | /** 16 | * @return array 17 | */ 18 | public function toArray() 19 | { 20 | return [ 21 | 'line' => $this->line, 22 | 'column' => $this->column 23 | ]; 24 | } 25 | 26 | /** 27 | * @return array 28 | */ 29 | public function toSerializableArray() 30 | { 31 | return $this->toArray(); 32 | } 33 | 34 | /** 35 | * Specify data which should be serialized to JSON 36 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php 37 | * @return mixed data which can be serialized by json_encode, 38 | * which is a value of any type other than a resource. 39 | * @since 5.4.0 40 | */ 41 | function jsonSerialize() 42 | { 43 | return $this->toSerializableArray(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Schema.php: -------------------------------------------------------------------------------- 1 | value; 48 | } 49 | return null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php: -------------------------------------------------------------------------------- 1 | config['serialize'], $value); 19 | } 20 | 21 | /** 22 | * @param mixed $value 23 | * @return mixed 24 | */ 25 | public function parseValue($value) 26 | { 27 | if (isset($this->config['parseValue'])) { 28 | return call_user_func($this->config['parseValue'], $value); 29 | } else { 30 | return null; 31 | } 32 | } 33 | 34 | /** 35 | * @param $valueNode 36 | * @return mixed 37 | */ 38 | public function parseLiteral(/* GraphQL\Language\AST\ValueNode */ $valueNode) 39 | { 40 | if (isset($this->config['parseLiteral'])) { 41 | return call_user_func($this->config['parseLiteral'], $valueNode); 42 | } else { 43 | return null; 44 | } 45 | } 46 | 47 | public function assertValid() 48 | { 49 | parent::assertValid(); 50 | 51 | Utils::invariant( 52 | isset($this->config['serialize']) && is_callable($this->config['serialize']), 53 | "{$this->name} must provide \"serialize\" function. If this custom Scalar " . 54 | 'is also used as an input type, ensure "parseValue" and "parseLiteral" ' . 55 | 'functions are also provided.' 56 | ); 57 | if (isset($this->config['parseValue']) || isset($this->config['parseLiteral'])) { 58 | Utils::invariant( 59 | isset($this->config['parseValue']) && isset($this->config['parseLiteral']) && 60 | is_callable($this->config['parseValue']) && is_callable($this->config['parseLiteral']), 61 | "{$this->name} must provide both \"parseValue\" and \"parseLiteral\" functions." 62 | ); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/DirectiveLocation.php: -------------------------------------------------------------------------------- 1 | name = isset($config['name']) ? $config['name'] : null; 45 | $this->value = isset($config['value']) ? $config['value'] : null; 46 | $this->deprecationReason = isset($config['deprecationReason']) ? $config['deprecationReason'] : null; 47 | $this->description = isset($config['description']) ? $config['description'] : null; 48 | $this->astNode = isset($config['astNode']) ? $config['astNode'] : null; 49 | 50 | $this->config = $config; 51 | } 52 | 53 | /** 54 | * @return bool 55 | */ 56 | public function isDeprecated() 57 | { 58 | return !!$this->deprecationReason; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php: -------------------------------------------------------------------------------- 1 | value; 64 | } 65 | return null; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php: -------------------------------------------------------------------------------- 1 | value; 69 | } 70 | return null; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php: -------------------------------------------------------------------------------- 1 | $v) { 55 | switch ($k) { 56 | case 'defaultValue': 57 | $this->defaultValue = $v; 58 | $this->defaultValueExists = true; 59 | break; 60 | case 'defaultValueExists': 61 | break; 62 | default: 63 | $this->{$k} = $v; 64 | } 65 | } 66 | $this->config = $opts; 67 | } 68 | 69 | /** 70 | * @return mixed 71 | */ 72 | public function getType() 73 | { 74 | return $this->type; 75 | } 76 | 77 | /** 78 | * @return bool 79 | */ 80 | public function defaultValueExists() 81 | { 82 | return $this->defaultValueExists; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php: -------------------------------------------------------------------------------- 1 | ofType = $type; 29 | } 30 | 31 | /** 32 | * @return string 33 | */ 34 | public function toString() 35 | { 36 | $type = $this->ofType; 37 | $str = $type instanceof Type ? $type->toString() : (string) $type; 38 | return '[' . $str . ']'; 39 | } 40 | 41 | /** 42 | * @param bool $recurse 43 | * @return ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType 44 | */ 45 | public function getWrappedType($recurse = false) 46 | { 47 | $type = $this->ofType; 48 | return ($recurse && $type instanceof WrappingType) ? $type->getWrappedType($recurse) : $type; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/NonNull.php: -------------------------------------------------------------------------------- 1 | ofType = $type; 39 | } 40 | 41 | /** 42 | * @param bool $recurse 43 | * @return ObjectType|InterfaceType|UnionType|ScalarType|InputObjectType|EnumType 44 | * @throws InvariantViolation 45 | */ 46 | public function getWrappedType($recurse = false) 47 | { 48 | $type = $this->ofType; 49 | 50 | Utils::invariant( 51 | !($type instanceof NonNull), 52 | 'Cannot nest NonNull inside NonNull' 53 | ); 54 | 55 | return ($recurse && $type instanceof WrappingType) ? $type->getWrappedType($recurse) : $type; 56 | } 57 | 58 | /** 59 | * @return string 60 | */ 61 | public function toString() 62 | { 63 | return $this->getWrappedType()->toString() . '!'; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php: -------------------------------------------------------------------------------- 1 | name = isset($config['name']) ? $config['name'] : $this->tryInferName(); 35 | $this->description = isset($config['description']) ? $config['description'] : $this->description; 36 | $this->astNode = isset($config['astNode']) ? $config['astNode'] : null; 37 | $this->config = $config; 38 | 39 | Utils::assertValidName($this->name); 40 | } 41 | 42 | /** 43 | * Determines if an internal value is valid for this type. 44 | * Equivalent to checking for if the parsedValue is nullish. 45 | * 46 | * @param $value 47 | * @return bool 48 | */ 49 | public function isValidValue($value) 50 | { 51 | return null !== $this->parseValue($value); 52 | } 53 | 54 | /** 55 | * Determines if an internal value is valid for this type. 56 | * Equivalent to checking for if the parsedLiteral is nullish. 57 | * 58 | * @param $valueNode 59 | * @return bool 60 | */ 61 | public function isValidLiteral($valueNode) 62 | { 63 | return null !== $this->parseLiteral($valueNode); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php: -------------------------------------------------------------------------------- 1 | value; 66 | } 67 | return null; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php: -------------------------------------------------------------------------------- 1 | > 12 | */ 13 | private $data; 14 | 15 | /** 16 | * @var array 17 | */ 18 | private $wrappers = []; 19 | 20 | /** 21 | * PairSet constructor. 22 | */ 23 | public function __construct() 24 | { 25 | $this->data = new \SplObjectStorage(); // SplObject hash instead? 26 | } 27 | 28 | /** 29 | * @param $a 30 | * @param $b 31 | * @return null|object 32 | */ 33 | public function has($a, $b) 34 | { 35 | $a = $this->toObj($a); 36 | $b = $this->toObj($b); 37 | 38 | /** @var \SplObjectStorage $first */ 39 | $first = isset($this->data[$a]) ? $this->data[$a] : null; 40 | return isset($first, $first[$b]) ? $first[$b] : null; 41 | } 42 | 43 | /** 44 | * @param $a 45 | * @param $b 46 | */ 47 | public function add($a, $b) 48 | { 49 | $this->pairSetAdd($a, $b); 50 | $this->pairSetAdd($b, $a); 51 | } 52 | 53 | /** 54 | * @param $var 55 | * @return mixed 56 | */ 57 | private function toObj($var) 58 | { 59 | // SplObjectStorage expects objects, so wrapping non-objects to objects 60 | if (is_object($var)) { 61 | return $var; 62 | } 63 | if (!isset($this->wrappers[$var])) { 64 | $tmp = new \stdClass(); 65 | $tmp->_internal = $var; 66 | $this->wrappers[$var] = $tmp; 67 | } 68 | return $this->wrappers[$var]; 69 | } 70 | 71 | /** 72 | * @param $a 73 | * @param $b 74 | */ 75 | private function pairSetAdd($a, $b) 76 | { 77 | $a = $this->toObj($a); 78 | $b = $this->toObj($b); 79 | $set = isset($this->data[$a]) ? $this->data[$a] : null; 80 | 81 | if (!isset($set)) { 82 | $set = new \SplObjectStorage(); 83 | $this->data[$a] = $set; 84 | } 85 | $set[$b] = true; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/AbstractValidationRule.php: -------------------------------------------------------------------------------- 1 | name ?: get_class($this); 14 | } 15 | 16 | public function __invoke(ValidationContext $context) 17 | { 18 | return $this->getVisitor($context); 19 | } 20 | 21 | /** 22 | * @param ValidationContext $context 23 | * @return Error[] 24 | */ 25 | abstract public function getVisitor(ValidationContext $context); 26 | } 27 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/ArgumentsOfCorrectType.php: -------------------------------------------------------------------------------- 1 | function(ArgumentNode $argNode) use ($context) { 24 | $argDef = $context->getArgument(); 25 | if ($argDef) { 26 | $errors = DocumentValidator::isValidLiteralValue($argDef->getType(), $argNode->value); 27 | 28 | if (!empty($errors)) { 29 | $context->reportError(new Error( 30 | self::badValueMessage($argNode->name->value, $argDef->getType(), Printer::doPrint($argNode->value), $errors), 31 | [$argNode->value] 32 | )); 33 | } 34 | } 35 | return Visitor::skipNode(); 36 | } 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php: -------------------------------------------------------------------------------- 1 | name = $name; 15 | $this->visitorFn = $visitorFn; 16 | } 17 | 18 | /** 19 | * @param ValidationContext $context 20 | * @return Error[] 21 | */ 22 | public function getVisitor(ValidationContext $context) 23 | { 24 | $fn = $this->visitorFn; 25 | return $fn($context); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php: -------------------------------------------------------------------------------- 1 | setEnabled($enabled); 17 | } 18 | 19 | public function setEnabled($enabled) 20 | { 21 | $this->isEnabled = $enabled; 22 | } 23 | 24 | static function introspectionDisabledMessage() 25 | { 26 | return 'GraphQL introspection is not allowed, but the query contained __schema or __type'; 27 | } 28 | 29 | protected function isEnabled() 30 | { 31 | return $this->isEnabled !== static::DISABLED; 32 | } 33 | 34 | public function getVisitor(ValidationContext $context) 35 | { 36 | return $this->invokeIfNeeded( 37 | $context, 38 | [ 39 | NodeKind::FIELD => function (FieldNode $node) use ($context) { 40 | if ($node->name->value === '__type' || $node->name->value === '__schema') { 41 | $context->reportError(new Error( 42 | static::introspectionDisabledMessage(), 43 | [$node] 44 | )); 45 | } 46 | } 47 | ] 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php: -------------------------------------------------------------------------------- 1 | 0) { 19 | $suggestions = array_slice($suggestedTypes, 0, $maxLength); 20 | $suggestions = Utils::map($suggestions, function($t) { return "\"$t\""; }); 21 | $suggestions = implode(', ', $suggestions); 22 | 23 | if ($count > $maxLength) { 24 | $suggestions .= ', and ' . ($count - $maxLength) . ' other types'; 25 | } 26 | $message .= " However, this field exists on $suggestions."; 27 | $message .= ' Perhaps you meant to use an inline fragment?'; 28 | } 29 | return $message; 30 | } 31 | 32 | public function getVisitor(ValidationContext $context) 33 | { 34 | return [ 35 | NodeKind::FIELD => function(FieldNode $node) use ($context) { 36 | $type = $context->getParentType(); 37 | if ($type) { 38 | $fieldDef = $context->getFieldDef(); 39 | if (!$fieldDef) { 40 | $context->reportError(new Error( 41 | static::undefinedFieldMessage($node->name->value, $type->name), 42 | [$node] 43 | )); 44 | } 45 | } 46 | } 47 | ]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php: -------------------------------------------------------------------------------- 1 | function(InlineFragmentNode $node) use ($context) { 29 | if ($node->typeCondition) { 30 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); 31 | if ($type && !Type::isCompositeType($type)) { 32 | $context->reportError(new Error( 33 | static::inlineFragmentOnNonCompositeErrorMessage($type), 34 | [$node->typeCondition] 35 | )); 36 | } 37 | } 38 | }, 39 | NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $node) use ($context) { 40 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); 41 | 42 | if ($type && !Type::isCompositeType($type)) { 43 | $context->reportError(new Error( 44 | static::fragmentOnNonCompositeErrorMessage($node->name->value, Printer::doPrint($node->typeCondition)), 45 | [$node->typeCondition] 46 | )); 47 | } 48 | } 49 | ]; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php: -------------------------------------------------------------------------------- 1 | function(FragmentSpreadNode $node) use ($context) { 22 | $fragmentName = $node->name->value; 23 | $fragment = $context->getFragment($fragmentName); 24 | if (!$fragment) { 25 | $context->reportError(new Error( 26 | self::unknownFragmentMessage($fragmentName), 27 | [$node->name] 28 | )); 29 | } 30 | } 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php: -------------------------------------------------------------------------------- 1 | $skip, 24 | NodeKind::INTERFACE_TYPE_DEFINITION => $skip, 25 | NodeKind::UNION_TYPE_DEFINITION => $skip, 26 | NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $skip, 27 | 28 | NodeKind::NAMED_TYPE => function(NamedTypeNode $node, $key) use ($context) { 29 | $typeName = $node->name->value; 30 | $type = $context->getSchema()->getType($typeName); 31 | if (!$type) { 32 | $context->reportError(new Error(self::unknownTypeMessage($typeName), [$node])); 33 | } 34 | } 35 | ]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php: -------------------------------------------------------------------------------- 1 | function(DocumentNode $node) use (&$operationCount) { 30 | $tmp = Utils::filter( 31 | $node->definitions, 32 | function ($definition) { 33 | return $definition->kind === NodeKind::OPERATION_DEFINITION; 34 | } 35 | ); 36 | $operationCount = count($tmp); 37 | }, 38 | NodeKind::OPERATION_DEFINITION => function(OperationDefinitionNode $node) use (&$operationCount, $context) { 39 | if (!$node->name && $operationCount > 1) { 40 | $context->reportError( 41 | new Error(self::anonOperationNotAloneMessage(), [$node]) 42 | ); 43 | } 44 | } 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php: -------------------------------------------------------------------------------- 1 | operationDefs = []; 24 | $this->fragmentDefs = []; 25 | 26 | return [ 27 | NodeKind::OPERATION_DEFINITION => function($node) { 28 | $this->operationDefs[] = $node; 29 | return Visitor::skipNode(); 30 | }, 31 | NodeKind::FRAGMENT_DEFINITION => function(FragmentDefinitionNode $def) { 32 | $this->fragmentDefs[] = $def; 33 | return Visitor::skipNode(); 34 | }, 35 | NodeKind::DOCUMENT => [ 36 | 'leave' => function() use ($context) { 37 | $fragmentNameUsed = []; 38 | 39 | foreach ($this->operationDefs as $operation) { 40 | foreach ($context->getRecursivelyReferencedFragments($operation) as $fragment) { 41 | $fragmentNameUsed[$fragment->name->value] = true; 42 | } 43 | } 44 | 45 | foreach ($this->fragmentDefs as $fragmentDef) { 46 | $fragName = $fragmentDef->name->value; 47 | if (empty($fragmentNameUsed[$fragName])) { 48 | $context->reportError(new Error( 49 | self::unusedFragMessage($fragName), 50 | [ $fragmentDef ] 51 | )); 52 | } 53 | } 54 | } 55 | ] 56 | ]; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php: -------------------------------------------------------------------------------- 1 | variableDefs = []; 23 | 24 | return [ 25 | NodeKind::OPERATION_DEFINITION => [ 26 | 'enter' => function() { 27 | $this->variableDefs = []; 28 | }, 29 | 'leave' => function(OperationDefinitionNode $operation) use ($context) { 30 | $variableNameUsed = []; 31 | $usages = $context->getRecursiveVariableUsages($operation); 32 | $opName = $operation->name ? $operation->name->value : null; 33 | 34 | foreach ($usages as $usage) { 35 | $node = $usage['node']; 36 | $variableNameUsed[$node->name->value] = true; 37 | } 38 | 39 | foreach ($this->variableDefs as $variableDef) { 40 | $variableName = $variableDef->variable->name->value; 41 | 42 | if (empty($variableNameUsed[$variableName])) { 43 | $context->reportError(new Error( 44 | self::unusedVariableMessage($variableName, $opName), 45 | [$variableDef] 46 | )); 47 | } 48 | } 49 | } 50 | ], 51 | NodeKind::VARIABLE_DEFINITION => function($def) { 52 | $this->variableDefs[] = $def; 53 | } 54 | ]; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php: -------------------------------------------------------------------------------- 1 | function(FieldNode $node) use ($context) { 26 | $type = $context->getType(); 27 | if ($type) { 28 | if (Type::isLeafType(Type::getNamedType($type))) { 29 | if ($node->selectionSet) { 30 | $context->reportError(new Error( 31 | self::noSubselectionAllowedMessage($node->name->value, $type), 32 | [$node->selectionSet] 33 | )); 34 | } 35 | } else if (!$node->selectionSet) { 36 | $context->reportError(new Error( 37 | self::requiredSubselectionMessage($node->name->value, $type), 38 | [$node] 39 | )); 40 | } 41 | } 42 | } 43 | ]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php: -------------------------------------------------------------------------------- 1 | knownArgNames = []; 23 | 24 | return [ 25 | NodeKind::FIELD => function () { 26 | $this->knownArgNames = [];; 27 | }, 28 | NodeKind::DIRECTIVE => function () { 29 | $this->knownArgNames = []; 30 | }, 31 | NodeKind::ARGUMENT => function (ArgumentNode $node) use ($context) { 32 | $argName = $node->name->value; 33 | if (!empty($this->knownArgNames[$argName])) { 34 | $context->reportError(new Error( 35 | self::duplicateArgMessage($argName), 36 | [$this->knownArgNames[$argName], $node->name] 37 | )); 38 | } else { 39 | $this->knownArgNames[$argName] = $node->name; 40 | } 41 | return Visitor::skipNode(); 42 | } 43 | ]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php: -------------------------------------------------------------------------------- 1 | function(Node $node) use ($context) { 20 | if (isset($node->directives)) { 21 | $knownDirectives = []; 22 | foreach ($node->directives as $directive) { 23 | /** @var DirectiveNode $directive */ 24 | $directiveName = $directive->name->value; 25 | if (isset($knownDirectives[$directiveName])) { 26 | $context->reportError(new Error( 27 | self::duplicateDirectiveMessage($directiveName), 28 | [$knownDirectives[$directiveName], $directive] 29 | )); 30 | } else { 31 | $knownDirectives[$directiveName] = $directive; 32 | } 33 | } 34 | } 35 | } 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php: -------------------------------------------------------------------------------- 1 | knownFragmentNames = []; 24 | 25 | return [ 26 | NodeKind::OPERATION_DEFINITION => function () { 27 | return Visitor::skipNode(); 28 | }, 29 | NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) { 30 | $fragmentName = $node->name->value; 31 | if (!empty($this->knownFragmentNames[$fragmentName])) { 32 | $context->reportError(new Error( 33 | self::duplicateFragmentNameMessage($fragmentName), 34 | [ $this->knownFragmentNames[$fragmentName], $node->name ] 35 | )); 36 | } else { 37 | $this->knownFragmentNames[$fragmentName] = $node->name; 38 | } 39 | return Visitor::skipNode(); 40 | } 41 | ]; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php: -------------------------------------------------------------------------------- 1 | knownNames = []; 24 | $this->knownNameStack = []; 25 | 26 | return [ 27 | NodeKind::OBJECT => [ 28 | 'enter' => function() { 29 | $this->knownNameStack[] = $this->knownNames; 30 | $this->knownNames = []; 31 | }, 32 | 'leave' => function() { 33 | $this->knownNames = array_pop($this->knownNameStack); 34 | } 35 | ], 36 | NodeKind::OBJECT_FIELD => function(ObjectFieldNode $node) use ($context) { 37 | $fieldName = $node->name->value; 38 | 39 | if (!empty($this->knownNames[$fieldName])) { 40 | $context->reportError(new Error( 41 | self::duplicateInputFieldMessage($fieldName), 42 | [ $this->knownNames[$fieldName], $node->name ] 43 | )); 44 | } else { 45 | $this->knownNames[$fieldName] = $node->name; 46 | } 47 | return Visitor::skipNode(); 48 | } 49 | ]; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php: -------------------------------------------------------------------------------- 1 | knownOperationNames = []; 23 | 24 | return [ 25 | NodeKind::OPERATION_DEFINITION => function(OperationDefinitionNode $node) use ($context) { 26 | $operationName = $node->name; 27 | 28 | if ($operationName) { 29 | if (!empty($this->knownOperationNames[$operationName->value])) { 30 | $context->reportError(new Error( 31 | self::duplicateOperationNameMessage($operationName->value), 32 | [ $this->knownOperationNames[$operationName->value], $operationName ] 33 | )); 34 | } else { 35 | $this->knownOperationNames[$operationName->value] = $operationName; 36 | } 37 | } 38 | return Visitor::skipNode(); 39 | }, 40 | NodeKind::FRAGMENT_DEFINITION => function() { 41 | return Visitor::skipNode(); 42 | } 43 | ]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php: -------------------------------------------------------------------------------- 1 | knownVariableNames = []; 22 | 23 | return [ 24 | NodeKind::OPERATION_DEFINITION => function() { 25 | $this->knownVariableNames = []; 26 | }, 27 | NodeKind::VARIABLE_DEFINITION => function(VariableDefinitionNode $node) use ($context) { 28 | $variableName = $node->variable->name->value; 29 | if (!empty($this->knownVariableNames[$variableName])) { 30 | $context->reportError(new Error( 31 | self::duplicateVariableMessage($variableName), 32 | [ $this->knownVariableNames[$variableName], $node->variable->name ] 33 | )); 34 | } else { 35 | $this->knownVariableNames[$variableName] = $node->variable->name; 36 | } 37 | } 38 | ]; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php: -------------------------------------------------------------------------------- 1 | function(VariableDefinitionNode $node) use ($context) { 26 | $type = TypeInfo::typeFromAST($context->getSchema(), $node->type); 27 | 28 | // If the variable type is not an input type, return an error. 29 | if ($type && !Type::isInputType($type)) { 30 | $variableName = $node->variable->name->value; 31 | $context->reportError(new Error( 32 | self::nonInputTypeOnVarMessage($variableName, Printer::doPrint($node->type)), 33 | [ $node->type ] 34 | )); 35 | } 36 | } 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Executor/ExecutionResultTest.php: -------------------------------------------------------------------------------- 1 | assertEquals([], $executionResult->toArray()); 13 | } 14 | 15 | public function testToArrayExtensions() 16 | { 17 | $executionResult = new ExecutionResult(null, [], ['foo' => 'bar']); 18 | 19 | $this->assertEquals(['extensions' => ['foo' => 'bar']], $executionResult->toArray()); 20 | 21 | $executionResult->extensions = ['bar' => 'foo']; 22 | 23 | $this->assertEquals(['extensions' => ['bar' => 'foo']], $executionResult->toArray()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Language/TestUtils.php: -------------------------------------------------------------------------------- 1 | $node->kind, 19 | 'loc' => self::locationToArray($node->loc) 20 | ]; 21 | 22 | foreach (get_object_vars($node) as $prop => $propValue) { 23 | if (isset($result[$prop])) 24 | continue; 25 | 26 | if (is_array($propValue) || $propValue instanceof NodeList) { 27 | $tmp = []; 28 | foreach ($propValue as $tmp1) { 29 | $tmp[] = $tmp1 instanceof Node ? self::nodeToArray($tmp1) : (array) $tmp1; 30 | } 31 | } else if ($propValue instanceof Node) { 32 | $tmp = self::nodeToArray($propValue); 33 | } else if (is_scalar($propValue) || null === $propValue) { 34 | $tmp = $propValue; 35 | } else { 36 | $tmp = null; 37 | } 38 | 39 | $result[$prop] = $tmp; 40 | } 41 | return $result; 42 | } 43 | 44 | /** 45 | * @param Location $loc 46 | * @return array 47 | */ 48 | public static function locationToArray(Location $loc) 49 | { 50 | return [ 51 | 'start' => $loc->start, 52 | 'end' => $loc->end 53 | ]; 54 | } 55 | 56 | /** 57 | * @param $start 58 | * @param $end 59 | * @return array 60 | */ 61 | public static function locArray($start, $end) 62 | { 63 | return ['start' => $start, 'end' => $end]; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Language/TokenTest.php: -------------------------------------------------------------------------------- 1 | 'Kind', 13 | 'value' => null, 14 | 'line' => 3, 15 | 'column' => 5 16 | ]; 17 | 18 | $this->assertEquals($expected, $token->toArray()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Language/kitchen-sink.graphql: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015, Facebook, Inc. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the BSD-style license found in the 5 | # LICENSE file in the root directory of this source tree. An additional grant 6 | # of patent rights can be found in the PATENTS file in the same directory. 7 | 8 | query queryName($foo: ComplexType, $site: Site = MOBILE) { 9 | whoever123is: node(id: [123, 456]) { 10 | id , 11 | ... on User @defer { 12 | field2 { 13 | id , 14 | alias: field1(first:10, after:$foo,) @include(if: $foo) { 15 | id, 16 | ...frag 17 | } 18 | } 19 | } 20 | ... @skip(unless: $foo) { 21 | id 22 | } 23 | ... { 24 | id 25 | } 26 | } 27 | } 28 | 29 | mutation likeStory { 30 | like(story: 123) @defer { 31 | story { 32 | id 33 | } 34 | } 35 | } 36 | 37 | subscription StoryLikeSubscription($input: StoryLikeSubscribeInput) { 38 | storyLikeSubscribe(input: $input) { 39 | story { 40 | likers { 41 | count 42 | } 43 | likeSentence { 44 | text 45 | } 46 | } 47 | } 48 | } 49 | 50 | fragment frag on Friend { 51 | foo(size: $size, bar: $b, obj: {key: "value"}) 52 | } 53 | 54 | { 55 | unnamed(truthy: true, falsey: false, nullish: null), 56 | query 57 | } 58 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Language/schema-kitchen-sink.graphql: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015, Facebook, Inc. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the BSD-style license found in the 5 | # LICENSE file in the root directory of this source tree. An additional grant 6 | # of patent rights can be found in the PATENTS file in the same directory. 7 | 8 | schema { 9 | query: QueryType 10 | mutation: MutationType 11 | } 12 | 13 | type Foo implements Bar { 14 | one: Type 15 | two(argument: InputType!): Type 16 | three(argument: InputType, other: String): Int 17 | four(argument: String = "string"): String 18 | five(argument: [String] = ["string", "string"]): String 19 | six(argument: InputType = {key: "value"}): Type 20 | seven(argument: Int = null): Type 21 | } 22 | 23 | type AnnotatedObject @onObject(arg: "value") { 24 | annotatedField(arg: Type = "default" @onArg): Type @onField 25 | } 26 | 27 | interface Bar { 28 | one: Type 29 | four(argument: String = "string"): String 30 | } 31 | 32 | interface AnnotatedInterface @onInterface { 33 | annotatedField(arg: Type @onArg): Type @onField 34 | } 35 | 36 | union Feed = Story | Article | Advert 37 | 38 | union AnnotatedUnion @onUnion = A | B 39 | 40 | union AnnotatedUnionTwo @onUnion = | A | B 41 | 42 | scalar CustomScalar 43 | 44 | scalar AnnotatedScalar @onScalar 45 | 46 | enum Site { 47 | DESKTOP 48 | MOBILE 49 | } 50 | 51 | enum AnnotatedEnum @onEnum { 52 | ANNOTATED_VALUE @onEnumValue 53 | OTHER_VALUE 54 | } 55 | 56 | input InputType { 57 | key: String! 58 | answer: Int = 42 59 | } 60 | 61 | input AnnotatedInput @onInputObjectType { 62 | annotatedField: Type @onField 63 | } 64 | 65 | extend type Foo { 66 | seven(argument: [String]): Type 67 | } 68 | 69 | extend type Foo @onType {} 70 | 71 | type NoFields {} 72 | 73 | directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT 74 | 75 | directive @include(if: Boolean!) 76 | on FIELD 77 | | FRAGMENT_SPREAD 78 | | INLINE_FRAGMENT 79 | 80 | directive @include2(if: Boolean!) on 81 | | FIELD 82 | | FRAGMENT_SPREAD 83 | | INLINE_FRAGMENT 84 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Server/PsrResponseTest.php: -------------------------------------------------------------------------------- 1 | 'value']); 14 | $stream = new PsrStreamStub(); 15 | $psrResponse = new PsrResponseStub(); 16 | 17 | $helper = new Helper(); 18 | 19 | /** @var PsrResponseStub $resp */ 20 | $resp = $helper->toPsrResponse($result, $psrResponse, $stream); 21 | $this->assertSame(json_encode($result), $resp->body->content); 22 | $this->assertSame(['Content-Type' => ['application/json']], $resp->headers); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Type/ObjectIdStub.php: -------------------------------------------------------------------------------- 1 | id = $id; 17 | } 18 | 19 | public function __toString() 20 | { 21 | return (string) $this->id; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Type/TestClasses.php: -------------------------------------------------------------------------------- 1 | [ 13 | 'a' => Type::string() 14 | ] 15 | ]; 16 | parent::__construct($config); 17 | } 18 | } 19 | 20 | // Note: named OtherCustom vs OtherCustomType intentionally 21 | class OtherCustom extends ObjectType 22 | { 23 | public function __construct() 24 | { 25 | $config = [ 26 | 'fields' => [ 27 | 'b' => Type::string() 28 | ] 29 | ]; 30 | parent::__construct($config); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/UtilsTest.php: -------------------------------------------------------------------------------- 1 | requiredKey = 'value'; 12 | 13 | try { 14 | Utils::assign($object, [], ['requiredKey']); 15 | $this->fail('Expected exception not thrown'); 16 | } catch (\InvalidArgumentException $e) { 17 | $this->assertEquals( 18 | "Key requiredKey is expected to be set and not to be null", 19 | $e->getMessage()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Validator/KnownFragmentNamesTest.php: -------------------------------------------------------------------------------- 1 | expectPassesRule(new KnownFragmentNames, ' 18 | { 19 | human(id: 4) { 20 | ...HumanFields1 21 | ... on Human { 22 | ...HumanFields2 23 | } 24 | } 25 | } 26 | fragment HumanFields1 on Human { 27 | name 28 | ...HumanFields3 29 | } 30 | fragment HumanFields2 on Human { 31 | name 32 | } 33 | fragment HumanFields3 on Human { 34 | name 35 | } 36 | '); 37 | } 38 | 39 | /** 40 | * @it unknown fragment names are invalid 41 | */ 42 | public function testUnknownFragmentNamesAreInvalid() 43 | { 44 | $this->expectFailsRule(new KnownFragmentNames, ' 45 | { 46 | human(id: 4) { 47 | ...UnknownFragment1 48 | ... on Human { 49 | ...UnknownFragment2 50 | } 51 | } 52 | } 53 | fragment HumanFields on Human { 54 | name 55 | ...UnknownFragment3 56 | } 57 | ', [ 58 | $this->undefFrag('UnknownFragment1', 4, 14), 59 | $this->undefFrag('UnknownFragment2', 6, 16), 60 | $this->undefFrag('UnknownFragment3', 12, 12) 61 | ]); 62 | } 63 | 64 | private function undefFrag($fragName, $line, $column) 65 | { 66 | return FormattedError::create( 67 | KnownFragmentNames::unknownFragmentMessage($fragName), 68 | [new SourceLocation($line, $column)] 69 | ); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Validator/UniqueVariableNamesTest.php: -------------------------------------------------------------------------------- 1 | expectPassesRule(new UniqueVariableNames(), ' 18 | query A($x: Int, $y: String) { __typename } 19 | query B($x: String, $y: Int) { __typename } 20 | '); 21 | } 22 | 23 | /** 24 | * @it duplicate variable names 25 | */ 26 | public function testDuplicateVariableNames() 27 | { 28 | $this->expectFailsRule(new UniqueVariableNames, ' 29 | query A($x: Int, $x: Int, $x: String) { __typename } 30 | query B($x: String, $x: Int) { __typename } 31 | query C($x: Int, $x: Int) { __typename } 32 | ', [ 33 | $this->duplicateVariable('x', 2, 16, 2, 25), 34 | $this->duplicateVariable('x', 2, 16, 2, 34), 35 | $this->duplicateVariable('x', 3, 16, 3, 28), 36 | $this->duplicateVariable('x', 4, 16, 4, 25) 37 | ]); 38 | } 39 | 40 | private function duplicateVariable($name, $l1, $c1, $l2, $c2) 41 | { 42 | return FormattedError::create( 43 | UniqueVariableNames::duplicateVariableMessage($name), 44 | [new SourceLocation($l1, $c1), new SourceLocation($l2, $c2)] 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Validator/ValidationTest.php: -------------------------------------------------------------------------------- 1 | expectPassesCompleteValidation(' 17 | query { 18 | catOrDog { 19 | ... on Cat { 20 | furColor 21 | } 22 | ... on Dog { 23 | isHousetrained 24 | } 25 | } 26 | } 27 | '); 28 | } 29 | /* 30 | public function testAllowsSettingRulesGlobally() 31 | { 32 | $rule = new QueryComplexity(0); 33 | 34 | DocumentValidator::addRule($rule); 35 | $instance = DocumentValidator::getRule(QueryComplexity::class); 36 | $this->assertSame($rule, $instance); 37 | } 38 | */ 39 | public function testPassesValidationWithEmptyRules() 40 | { 41 | $query = '{invalid}'; 42 | 43 | $expectedError = [ 44 | 'message' => 'Cannot query field "invalid" on type "QueryRoot".', 45 | 'locations' => [ ['line' => 1, 'column' => 2] ] 46 | ]; 47 | $this->expectFailsCompleteValidation($query, [$expectedError]); 48 | $this->expectValid($this->getDefaultSchema(), [], $query); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /system/library/d_graphql/vendor/webonyx/graphql-php/tests/Validator/VariablesAreInputTypesTest.php: -------------------------------------------------------------------------------- 1 | expectPassesRule(new VariablesAreInputTypes(), ' 18 | query Foo($a: String, $b: [Boolean!]!, $c: ComplexInput) { 19 | field(a: $a, b: $b, c: $c) 20 | } 21 | '); 22 | } 23 | 24 | /** 25 | * @it output types are invalid 26 | */ 27 | public function testOutputTypesAreInvalid() 28 | { 29 | $this->expectFailsRule(new VariablesAreInputTypes, ' 30 | query Foo($a: Dog, $b: [[CatOrDog!]]!, $c: Pet) { 31 | field(a: $a, b: $b, c: $c) 32 | } 33 | ', [ 34 | FormattedError::create( 35 | VariablesAreInputTypes::nonInputTypeOnVarMessage('a', 'Dog'), 36 | [new SourceLocation(2, 21)] 37 | ), 38 | FormattedError::create( 39 | VariablesAreInputTypes::nonInputTypeOnVarMessage('b', '[[CatOrDog!]]!'), 40 | [new SourceLocation(2, 30)] 41 | ), 42 | FormattedError::create( 43 | VariablesAreInputTypes::nonInputTypeOnVarMessage('c', 'Pet'), 44 | [new SourceLocation(2, 50)] 45 | ) 46 | ] 47 | ); 48 | } 49 | } 50 | --------------------------------------------------------------------------------