├── .DS_Store ├── .gitignore ├── README.md ├── languages ├── d_vuefront-ru_RU.mo └── d_vuefront-ru_RU.po ├── mapping.json ├── model ├── blog │ ├── category.php │ └── post.php ├── common │ ├── customer.php │ ├── page.php │ ├── seo.php │ ├── token.php │ └── vuefront.php ├── startup │ └── startup.php └── store │ ├── cart.php │ ├── category.php │ ├── checkout.php │ ├── compare.php │ ├── manufacturer.php │ ├── option.php │ ├── product.php │ └── wishlist.php ├── plugin.php ├── readme.txt ├── resolver ├── blog │ ├── category.php │ ├── post.php │ └── review.php ├── common │ ├── account.php │ ├── contact.php │ ├── country.php │ ├── file.php │ ├── home.php │ ├── language.php │ ├── page.php │ ├── token.php │ └── zone.php ├── startup │ └── startup.php └── store │ ├── cart.php │ ├── category.php │ ├── checkout.php │ ├── compare.php │ ├── currency.php │ ├── manufacturer.php │ ├── option.php │ ├── product.php │ ├── review.php │ └── wishlist.php ├── schema.graphql ├── schemaAdmin.graphql ├── system ├── composer.json ├── composer.lock ├── engine │ ├── action.php │ ├── loader.php │ ├── model.php │ ├── proxy.php │ ├── registry.php │ └── resolver.php ├── helpers │ └── MySafeException.php ├── library │ ├── currency.php │ └── template │ │ └── template.php ├── startup.php └── 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 │ ├── firebase │ └── php-jwt │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ └── src │ │ ├── BeforeValidException.php │ │ ├── ExpiredException.php │ │ ├── JWT.php │ │ └── SignatureInvalidException.php │ └── webonyx │ └── graphql-php │ ├── .gitattributes │ ├── .gitignore │ ├── .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 ├── view ├── .DS_Store ├── image │ ├── icon_admin.svg │ └── logo.png ├── javascript │ ├── .DS_Store │ ├── d_pax │ │ ├── .DS_Store │ │ ├── .babelrc │ │ ├── .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 │ │ ├── webpack-manifest.js │ │ ├── webpack.config.js │ │ ├── yarn-error.log │ │ └── yarn.lock │ ├── d_vuefront │ │ ├── aa4db611368acc1c390a.bundle.js │ │ ├── img │ │ │ ├── firstBuild.svg │ │ │ └── rocket.png │ │ ├── main.aa4db611368acc1c390a.css │ │ └── manifest.json │ └── polyfill.js ├── stylesheet │ └── menu.css └── template │ ├── general.tpl │ └── playground.tpl └── yarn.lock /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .editorconfig 2 | .vscode/ 3 | *.txt 4 | /view/javascript/d_pax/node_modules 5 | /view/javascript/d_pax/.npmrc 6 | /view/javascript/d_pax/.env 7 | /view/javascript/d_pax/.idea 8 | view/javascript/d_pax/node_modules 9 | view/javascript/.idea/ 10 | -------------------------------------------------------------------------------- /languages/d_vuefront-ru_RU.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/languages/d_vuefront-ru_RU.mo -------------------------------------------------------------------------------- /model/common/customer.php: -------------------------------------------------------------------------------- 1 | prefix.'vuefront_url` 12 | WHERE url LIKE \''.$url.'\''; 13 | 14 | $result = $wpdb->get_row( $sql ); 15 | if (!$result) { 16 | $wpdb->insert( $wpdb->prefix.'vuefront_url' , array("url" => $url, "id" => $id, "type" => $type)); 17 | } 18 | } 19 | public function get_category_by_url($url) { 20 | foreach( (get_terms()) as $category) { 21 | $keyword = str_replace(get_site_url(), '', get_term_link((int)$category->term_id)); 22 | $keyword = trim($keyword, '/?'); 23 | $keyword = trim($keyword, '/'); 24 | var_dump($keyword); 25 | 26 | if ( $keyword == $url ) { 27 | return array('id' => $category->term_id, 'slug' => $category->slug, 'type' => $category->taxonomy); 28 | } 29 | if ( '/' . $keyword == $url ) { 30 | return array('id' => $category->term_id, 'slug' => $category->slug, 'type' => $category->taxonomy); 31 | } 32 | if ( '/?' . $keyword == $url ) { 33 | return array('id' => $category->term_id, 'slug' => $category->slug, 'type' => $category->taxonomy); 34 | } 35 | 36 | } 37 | return false; 38 | } 39 | public function searchKeyword($url) { 40 | 41 | global $wpdb; 42 | 43 | $sql = 'SELECT * 44 | FROM 45 | `'.$wpdb->prefix.'vuefront_url` 46 | WHERE url LIKE \''.$url.'\''; 47 | 48 | $result = $wpdb->get_row( $sql ); 49 | if (!$result) { 50 | return array( 51 | 'id' => '', 52 | 'type' => '', 53 | 'url' => $url 54 | ); 55 | } 56 | return array( 57 | 'id' => $result->id, 58 | 'type' => $result->type, 59 | 'url' => $url 60 | ); 61 | } 62 | } -------------------------------------------------------------------------------- /model/startup/startup.php: -------------------------------------------------------------------------------- 1 | $value) { 11 | $that = $this; 12 | $result[$key] = function ($root, $args, $context) use ($value, $that) { 13 | try { 14 | return $that->load->resolver($value, $args); 15 | } catch (\Exception $e) { 16 | $message = preg_replace('/(\s+)?\.*\<\/a\>(\s)?/', '',$e->getMessage()); 17 | throw new VFA_MySafeException($message); 18 | } 19 | }; 20 | } 21 | 22 | return $result; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /model/store/cart.php: -------------------------------------------------------------------------------- 1 | cart->get_cart() as $product) { 7 | $this->load->model('store/product'); 8 | $cart['products'] = array(); 9 | foreach (WC()->cart->get_cart() as $product) { 10 | if ($product['variation_id'] !== 0) { 11 | $product_id = $product['variation_id']; 12 | } else { 13 | $product_id = $product['product_id']; 14 | } 15 | $option_data = array(); 16 | 17 | foreach ($product['variation'] as $key => $value) { 18 | $option_data[] = array( 19 | 'option_id' => str_replace('attribute_', '', $key), 20 | 'option_value_id' => $value 21 | ); 22 | } 23 | 24 | $cart['products'][] = array( 25 | 'key' => $product['key'], 26 | 'product' => array( 27 | 'product_id' => $product_id, 28 | 'price' => '1' 29 | ), 30 | 'quantity' => $product['quantity'], 31 | 'option' => $option_data, 32 | 'total' => $this->currency->format($product['line_total']) 33 | ); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /model/store/checkout.php: -------------------------------------------------------------------------------- 1 | $value) { 10 | if($value['codename'] == $codename) { 11 | $result = $value['jwt']; 12 | } 13 | } 14 | 15 | return $result; 16 | } 17 | public function requestCheckout($query, $variables) { 18 | $jwt = $this->getJwt('vuefront-checkout-app'); 19 | 20 | $ch = curl_init(); 21 | 22 | $requestData = array( 23 | 'operationName' => null, 24 | 'variables' => $variables, 25 | 'query' => $query 26 | ); 27 | 28 | $headr = array(); 29 | 30 | $headr[] = 'Content-type: application/json'; 31 | $headr[] = 'Authorization: '.$jwt; 32 | 33 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 34 | curl_setopt($ch, CURLOPT_HTTPHEADER,$headr); 35 | curl_setopt($ch, CURLOPT_POST,true); 36 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($requestData, JSON_FORCE_OBJECT) ); 37 | // curl_setopt($ch, CURLOPT_URL, 'http://localhost:3005/graphql'); 38 | curl_setopt($ch, CURLOPT_URL, 'https://api.checkout.vuefront.com/graphql'); 39 | 40 | $result = curl_exec($ch); 41 | 42 | $result = json_decode($result, true); 43 | 44 | return $result['data']; 45 | } 46 | } -------------------------------------------------------------------------------- /model/store/compare.php: -------------------------------------------------------------------------------- 1 | = 4 ) { 26 | array_shift( $compare ); 27 | } 28 | $compare[] = $product_id; 29 | setcookie( 'compare', json_encode( $compare ), 0, "/" ); 30 | $_COOKIE['compare'] = json_encode( $compare ); 31 | } 32 | } 33 | 34 | public function deleteCompare( $product_id ) { 35 | $compare = $_COOKIE['compare']; 36 | 37 | $result = array(); 38 | 39 | if ( ! empty( $compare ) ) { 40 | $result = json_decode( $compare ); 41 | } 42 | 43 | $key = array_search( $product_id, $result ); 44 | 45 | if ( $key !== false ) { 46 | unset( $result[ $key ] ); 47 | } 48 | 49 | setcookie( 'compare', json_encode( $result ), 0, "/" ); 50 | $_COOKIE['compare'] = json_encode( $result ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /model/store/wishlist.php: -------------------------------------------------------------------------------- 1 | $args['id'], 10 | 'comment_author' => $args['author'], 11 | 'comment_content' => $args['content'], 12 | 'comment_date' => $time, 13 | ); 14 | 15 | $comment_id = wp_insert_comment( $data ); 16 | 17 | add_comment_meta( $comment_id, 'rating', $args['rating'] ); 18 | 19 | return $this->load->resolver('blog/post/get', $args ); 20 | } 21 | 22 | public function get($data) { 23 | $post = $data['parent']; 24 | $result = get_comments( array( 'post_type' => 'post', 'post_id' => $post['id'] ) ); 25 | 26 | $comments = array(); 27 | 28 | 29 | foreach ( $result as $comment ) { 30 | $comments[] = array( 31 | 'author' => $comment->comment_author, 32 | 'author_email' => $comment->comment_author_email, 33 | 'created_at' => $comment->comment_date, 34 | 'content' => $comment->comment_content, 35 | 'rating' => (float) get_comment_meta( $comment->comment_ID, 'rating', true ) 36 | ); 37 | } 38 | 39 | return array( 40 | 'content' => $comments, 41 | 'totalElements' => count($comments) 42 | ); 43 | } 44 | } -------------------------------------------------------------------------------- /resolver/common/contact.php: -------------------------------------------------------------------------------- 1 | get_option('woocommerce_store_address'), 14 | 'address_2' => get_option('woocommerce_store_address_2'), 15 | 'city' => get_option('woocommerce_store_city'), 16 | 'postcode' => get_option('woocommerce_store_postcode'), 17 | 'country' => $split_country[0], 18 | 'state' => $split_country[1] 19 | ); 20 | 21 | $WC_Countries = new WC_Countries(); 22 | 23 | return array( 24 | 'store' => get_bloginfo('name'), 25 | 'email' => get_bloginfo('admin_email'), 26 | 'address' => $WC_Countries->get_formatted_address($address, ', '), 27 | 'geocode' => '', 28 | 'locations' => array(), 29 | 'telephone' => '', 30 | 'fax' => '', 31 | 'open' => '', 32 | 'comment' => get_bloginfo('description') 33 | ); 34 | } 35 | 36 | public function send($args) 37 | { 38 | wp_mail(get_bloginfo('admin_email'), 'Enquiry '.$args['name'],$args['message'], array( 39 | 'reply-to' => $args['email'] 40 | )); 41 | 42 | return array( 43 | "status" => true 44 | ); 45 | } 46 | } -------------------------------------------------------------------------------- /resolver/common/country.php: -------------------------------------------------------------------------------- 1 | countries->countries[$args['id']]; 10 | return array( 11 | 'id' => $args['id'], 12 | 'name' => $country_info 13 | ); 14 | } 15 | 16 | public function getList($args) 17 | { 18 | $countries = []; 19 | 20 | $results = WC()->countries->get_allowed_countries(); 21 | asort($results); 22 | 23 | $country_total = count($results); 24 | 25 | foreach ($results as $key => $value) { 26 | $countries[] = $this->get(array( 'id' => $key )); 27 | } 28 | 29 | return array( 30 | 'content' => $countries, 31 | 'first' => $args['page'] === 1, 32 | 'last' => $args['page'] === ceil($country_total / $args['size']), 33 | 'number' => (int) $args['page'], 34 | 'numberOfElements' => count($countries), 35 | 'size' => (int) $args['size'], 36 | 'totalPages' => (int) ceil($country_total / $args['size']), 37 | 'totalElements' => (int) $country_total, 38 | ); 39 | } 40 | } -------------------------------------------------------------------------------- /resolver/common/file.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'title' => get_option('blogname'), 10 | 'description' => get_option('blogdescription'), 11 | 'keyword' => '' 12 | ) 13 | ); 14 | } 15 | 16 | public function searchUrl($args) 17 | { 18 | $this->load->model('common/seo'); 19 | 20 | $result = $this->model_common_seo->searchKeyword($args['url']); 21 | 22 | return $result; 23 | } 24 | 25 | public function updateApp($args) 26 | { 27 | $this->load->model('common/vuefront'); 28 | $this->model_common_vuefront->editApp($args['name'], $args['settings']); 29 | 30 | return $this->model_common_vuefront->getApp($args['name']); 31 | } 32 | 33 | public function updateSite($args) 34 | { 35 | try { 36 | $tmpFile = download_url("https://vuefront2019.s3.amazonaws.com/sites/".$args['number']."/vuefront-app.tar"); 37 | VFA_vuefront_rmdir(ABSPATH . 'vuefront'); 38 | $phar = new PharData($tmpFile); 39 | $phar->extractTo(ABSPATH . 'vuefront'); 40 | } catch (\Exception $e) { 41 | echo $e->getMessage(); 42 | } 43 | } 44 | 45 | public function authProxy($args) 46 | { 47 | $this->load->model('common/vuefront'); 48 | 49 | if (!is_user_logged_in()) { 50 | return; 51 | } 52 | $app_info = $this->model_common_vuefront->getApp($args['app']); 53 | 54 | $user = wp_get_current_user(); 55 | 56 | $url = str_replace(':id', $user->ID, $app_info['authUrl']); 57 | $result = $this->model_common_vuefront->request($url, [ 58 | 'customer_id' => $user->ID, 59 | ], $app_info['jwt']); 60 | 61 | if (!$result) { 62 | return ''; 63 | } 64 | 65 | return $result['token']; 66 | } 67 | 68 | public function version() 69 | { 70 | return "1.0.0"; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /resolver/common/language.php: -------------------------------------------------------------------------------- 1 | 'English', 13 | 'code' => 'en-gb', 14 | 'image' => '', 15 | 'active' => true 16 | ); 17 | 18 | return $languages; 19 | } 20 | 21 | public function edit($args) 22 | { 23 | return $this->get(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /resolver/common/token.php: -------------------------------------------------------------------------------- 1 | load->model('common/token'); 6 | $token_info = $this->model_common_token->getToken(); 7 | return array( 8 | 'token' =>$token_info['token'], 9 | 'expire' => $token_info['expire'] 10 | ); 11 | } 12 | } -------------------------------------------------------------------------------- /resolver/common/zone.php: -------------------------------------------------------------------------------- 1 | get(array( 'id' => $product->ID )); 22 | } 23 | 24 | return array( 25 | 'content' => $zones, 26 | 'first' => $args['page'] === 1, 27 | 'last' => $args['page'] === ceil($zone_total / $args['size']), 28 | 'number' => (int) $args['page'], 29 | 'numberOfElements' => count($zones), 30 | 'size' => (int) $args['size'], 31 | 'totalPages' => (int) ceil($zone_total / $args['size']), 32 | 'totalElements' => (int) $zone_total, 33 | ); 34 | } 35 | } -------------------------------------------------------------------------------- /resolver/store/compare.php: -------------------------------------------------------------------------------- 1 | load->model('store/compare'); 6 | 7 | $this->model_store_compare->addCompare($args['id']); 8 | 9 | return $this->get(); 10 | } 11 | public function remove($args) { 12 | $this->load->model('store/compare'); 13 | $this->model_store_compare->deleteCompare($args['id']); 14 | 15 | return $this->get(); 16 | } 17 | public function get($args = array()) { 18 | $this->load->model('store/compare'); 19 | $compare = array(); 20 | $results = $this->model_store_compare->getCompare(); 21 | 22 | foreach ($results as $product_id) { 23 | $compare[] = $this->load->resolver('store/product/get', array('id' => $product_id)); 24 | } 25 | 26 | return $compare; 27 | } 28 | } -------------------------------------------------------------------------------- /resolver/store/currency.php: -------------------------------------------------------------------------------- 1 | load->model('store/product'); 11 | $currencies[] = array( 12 | 'title' => get_option( 'woocommerce_currency' ), 13 | 'name' => get_option( 'woocommerce_currency' ), 14 | 'code' => get_option( 'woocommerce_currency' ), 15 | 'symbol_left' => $this->model_store_product->getCurrencySymbol(), 16 | 'symbol_right' => '', 17 | 'active' => true 18 | ); 19 | 20 | return $currencies; 21 | } 22 | 23 | public function edit($args) 24 | { 25 | return $this->get(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /resolver/store/review.php: -------------------------------------------------------------------------------- 1 | $args['id'], 10 | 'comment_author' => $args['author'], 11 | 'comment_content' => $args['content'], 12 | 'comment_date' => $time, 13 | ); 14 | 15 | $comment_id = wp_insert_comment($data); 16 | 17 | add_comment_meta($comment_id, 'rating', $args['rating']); 18 | 19 | return $this->load->resolver('store/product/get', $args); 20 | } 21 | 22 | public function get($data) { 23 | $product = $data['parent']; 24 | $result = get_comments(array( 'post_type' => 'product', 'post_id' => $product['id'] )); 25 | 26 | $comments = array(); 27 | 28 | 29 | foreach ($result as $comment) { 30 | $comments[] = array( 31 | 'author' => $comment->comment_author, 32 | 'author_email' => $comment->comment_author_email, 33 | 'created_at' => $comment->comment_date, 34 | 'content' => $comment->comment_content, 35 | 'rating' => (float) get_comment_meta($comment->comment_ID, 'rating', true) 36 | ); 37 | } 38 | 39 | return $comments; 40 | } 41 | } -------------------------------------------------------------------------------- /resolver/store/wishlist.php: -------------------------------------------------------------------------------- 1 | load->model('store/wishlist'); 6 | 7 | $this->model_store_wishlist->addWishlist($args['id']); 8 | 9 | return $this->getList(); 10 | } 11 | public function remove($args) { 12 | $this->load->model('store/wishlist'); 13 | $this->model_store_wishlist->deleteWishlist($args['id']); 14 | 15 | return $this->getList(); 16 | } 17 | public function getList($args = array()) { 18 | $this->load->model('store/wishlist'); 19 | $wishlist = array(); 20 | $results = $this->model_store_wishlist->getWishlist(); 21 | 22 | foreach ($results as $product_id) { 23 | $wishlist[] = $this->load->resolver('store/product/get', array('id' => $product_id)); 24 | } 25 | 26 | return $wishlist; 27 | } 28 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /system/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "webonyx/graphql-php": "0.11.6", 4 | "firebase/php-jwt": "^5.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /system/engine/action.php: -------------------------------------------------------------------------------- 1 | id = $route; 10 | 11 | $parts = explode('/', preg_replace('/[^a-zA-Z0-9_\/]/', '', (string)$route)); 12 | 13 | // Break apart the route 14 | while ($parts) { 15 | $file = VFA_DIR_PLUGIN . 'resolver/' . implode('/', $parts) . '.php'; 16 | 17 | if (is_file($file)) { 18 | $this->route = implode('/', $parts); 19 | 20 | break; 21 | } else { 22 | $this->method = array_pop($parts); 23 | } 24 | } 25 | } 26 | 27 | public function getId() { 28 | return $this->id; 29 | } 30 | 31 | public function execute($registry, array $args = array()) { 32 | if (substr($this->method, 0, 2) == '__') { 33 | return new \Exception('Error: Calls to magic methods are not allowed!'); 34 | } 35 | 36 | $file = VFA_DIR_PLUGIN . 'resolver/' . $this->route . '.php'; 37 | $class = 'VFA_Resolver' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route); 38 | 39 | if (is_file($file)) { 40 | include_once($file); 41 | 42 | $resolver = new $class($registry); 43 | } else { 44 | return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!'); 45 | } 46 | 47 | $reflection = new ReflectionClass($class); 48 | 49 | if ($reflection->hasMethod($this->method) && $reflection->getMethod($this->method)->getNumberOfRequiredParameters() <= count($args)) { 50 | return call_user_func_array(array($resolver, $this->method), $args); 51 | } else { 52 | return new \Exception('Error: Could not call ' . $this->route . '/' . $this->method . '!'); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /system/engine/model.php: -------------------------------------------------------------------------------- 1 | registry = $registry; 11 | } 12 | 13 | public function __get($key) { 14 | return $this->registry->get($key); 15 | } 16 | 17 | public function __set($key, $value) { 18 | $this->registry->set($key, $value); 19 | } 20 | } -------------------------------------------------------------------------------- /system/engine/proxy.php: -------------------------------------------------------------------------------- 1 | {$key}; 6 | } 7 | 8 | public function __set($key, $value) { 9 | $this->{$key} = $value; 10 | } 11 | 12 | public function __call($key, $args) { 13 | $arg_data = array(); 14 | 15 | $args = func_get_args(); 16 | 17 | foreach ($args as $arg) { 18 | if ($arg instanceof Ref) { 19 | $arg_data[] =& $arg->getRef(); 20 | } else { 21 | $arg_data[] =& $arg; 22 | } 23 | } 24 | 25 | if (isset($this->{$key})) { 26 | return call_user_func_array($this->{$key}, $arg_data); 27 | } else { 28 | $trace = debug_backtrace(); 29 | 30 | exit('Notice: Undefined property: VFA_Proxy::' . $key . ' in ' . $trace[1]['file'] . ' on line ' . $trace[1]['line'] . ''); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /system/engine/registry.php: -------------------------------------------------------------------------------- 1 | data[$key]) ? $this->data[$key] : null); 7 | } 8 | 9 | public function set($key, $value) { 10 | $this->data[$key] = $value; 11 | } 12 | 13 | public function has($key) { 14 | return isset($this->data[$key]); 15 | } 16 | } -------------------------------------------------------------------------------- /system/engine/resolver.php: -------------------------------------------------------------------------------- 1 | registry = $registry; 29 | } 30 | 31 | public function __get($key) 32 | { 33 | return $this->registry->get($key); 34 | } 35 | 36 | public function __set($key, $value) 37 | { 38 | $this->registry->set($key, $value); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /system/helpers/MySafeException.php: -------------------------------------------------------------------------------- 1 | data[$key] = $value; 7 | } 8 | 9 | public function render($template) { 10 | $file = $template . '.tpl'; 11 | 12 | if (is_file($file)) { 13 | extract($this->data); 14 | 15 | ob_start(); 16 | 17 | require($file); 18 | 19 | return ob_get_clean(); 20 | } 21 | 22 | throw new \Exception('Error: Could not load template ' . $file . '!'); 23 | exit(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /system/startup.php: -------------------------------------------------------------------------------- 1 | set('load', $loader); 20 | $registry->set('currency', new VFA_Currency()); 21 | 22 | $registry->set('request', $request); 23 | 24 | return $registry; 25 | } -------------------------------------------------------------------------------- /system/vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/webonyx/graphql-php/src/deprecated.php', 10 | ); 11 | -------------------------------------------------------------------------------- /system/vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/webonyx/graphql-php/src'), 10 | 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), 11 | ); 12 | -------------------------------------------------------------------------------- /system/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 | 'F' => 19 | array ( 20 | 'Firebase\\JWT\\' => 13, 21 | ), 22 | ); 23 | 24 | public static $prefixDirsPsr4 = array ( 25 | 'GraphQL\\' => 26 | array ( 27 | 0 => __DIR__ . '/..' . '/webonyx/graphql-php/src', 28 | ), 29 | 'Firebase\\JWT\\' => 30 | array ( 31 | 0 => __DIR__ . '/..' . '/firebase/php-jwt/src', 32 | ), 33 | ); 34 | 35 | public static function getInitializer(ClassLoader $loader) 36 | { 37 | return \Closure::bind(function () use ($loader) { 38 | $loader->prefixLengthsPsr4 = ComposerStaticInitacff8c1f4e21d7dfd33bc377346a5f26::$prefixLengthsPsr4; 39 | $loader->prefixDirsPsr4 = ComposerStaticInitacff8c1f4e21d7dfd33bc377346a5f26::$prefixDirsPsr4; 40 | 41 | }, null, ClassLoader::class); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /system/vendor/firebase/php-jwt/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Neuman Vong 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * Neither the name of Neuman Vong nor the names of other 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /system/vendor/firebase/php-jwt/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "firebase/php-jwt", 3 | "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", 4 | "homepage": "https://github.com/firebase/php-jwt", 5 | "authors": [ 6 | { 7 | "name": "Neuman Vong", 8 | "email": "neuman+pear@twilio.com", 9 | "role": "Developer" 10 | }, 11 | { 12 | "name": "Anant Narayanan", 13 | "email": "anant@php.net", 14 | "role": "Developer" 15 | } 16 | ], 17 | "license": "BSD-3-Clause", 18 | "require": { 19 | "php": ">=5.3.0" 20 | }, 21 | "autoload": { 22 | "psr-4": { 23 | "Firebase\\JWT\\": "src" 24 | } 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": " 4.8.35" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /system/vendor/firebase/php-jwt/src/BeforeValidException.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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/vendor/webonyx/graphql-php/src/Schema.php: -------------------------------------------------------------------------------- 1 | value; 48 | } 49 | return null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /system/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/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/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php: -------------------------------------------------------------------------------- 1 | value; 64 | } 65 | return null; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /system/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php: -------------------------------------------------------------------------------- 1 | value; 69 | } 70 | return null; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /system/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/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/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/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/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php: -------------------------------------------------------------------------------- 1 | value; 66 | } 67 | return null; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /system/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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 | -------------------------------------------------------------------------------- /view/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/view/.DS_Store -------------------------------------------------------------------------------- /view/image/icon_admin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /view/image/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/view/image/logo.png -------------------------------------------------------------------------------- /view/javascript/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/view/javascript/.DS_Store -------------------------------------------------------------------------------- /view/javascript/d_pax/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/view/javascript/d_pax/.DS_Store -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /view/javascript/d_pax/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'plugin:vue/recommended' 4 | ], 5 | rules: { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /view/javascript/d_pax/assets/img/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/view/javascript/d_pax/assets/img/profile.png -------------------------------------------------------------------------------- /view/javascript/d_pax/assets/img/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/view/javascript/d_pax/assets/img/rocket.png -------------------------------------------------------------------------------- /view/javascript/d_pax/assets/img/user.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /view/javascript/d_pax/components/banner.vue: -------------------------------------------------------------------------------- 1 | 19 | 72 | -------------------------------------------------------------------------------- /view/javascript/d_pax/components/header/Logo.vue: -------------------------------------------------------------------------------- 1 | 10 | 42 | 43 | { 44 | "text_vuefront": "VueFront" 45 | } 46 | 47 | -------------------------------------------------------------------------------- /view/javascript/d_pax/core/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 64 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /view/javascript/d_pax/layouts/auth.vue: -------------------------------------------------------------------------------- 1 | 25 | 34 | -------------------------------------------------------------------------------- /view/javascript/d_pax/layouts/confirm.vue: -------------------------------------------------------------------------------- 1 | 21 | 30 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /view/javascript/d_pax/locales/en/index.js: -------------------------------------------------------------------------------- 1 | export default {} 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 ({ baseURL, store }, inject) => { 5 | 6 | const apolloClient = new ApolloClient({ 7 | uri: `${baseURL}index.php?rest_route=/vuefront/v1/proxy`, 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 | -------------------------------------------------------------------------------- /view/javascript/d_pax/plugins/bootstrapVue.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import BootstrapVue from 'bootstrap-vue' 3 | 4 | Vue.use(BootstrapVue) 5 | -------------------------------------------------------------------------------- /view/javascript/d_pax/plugins/clipboard.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueClipboard from 'vue-clipboard2' 3 | 4 | Vue.use(VueClipboard) 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /view/javascript/d_pax/plugins/scrollTo.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueScrollTo from 'vue-scrollto' 3 | 4 | Vue.use(VueScrollTo) 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /view/javascript/d_vuefront/img/rocket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vuefront/wordpress/ffd5915092deea0e776bcc6436876a57f93b8b51/view/javascript/d_vuefront/img/rocket.png -------------------------------------------------------------------------------- /view/javascript/d_vuefront/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": { 3 | "id": 179, 4 | "next": null, 5 | "js": [ 6 | "/wp-content/plugins/vuefront/view/javascript/d_vuefront/aa4db611368acc1c390a.bundle.js" 7 | ], 8 | "css": [ 9 | "/wp-content/plugins/vuefront/view/javascript/d_vuefront/main.aa4db611368acc1c390a.css" 10 | ] 11 | } 12 | } -------------------------------------------------------------------------------- /view/stylesheet/menu.css: -------------------------------------------------------------------------------- 1 | .toplevel_page_vuefront.menu-top img { 2 | width: 20px; 3 | height: auto; 4 | } 5 | -------------------------------------------------------------------------------- /view/template/general.tpl: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | --------------------------------------------------------------------------------