Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add mutation for installing new app. Add query for ongoing installations

Maciej Korycinskib5c9e89bb9e1
diff --git a/saleor/app/app_manifest_sample.json b/saleor/app/app_manifest_sample.json
new file mode 100644
index 0000000000..ec35237c90
--- /dev/null
+++ b/saleor/app/app_manifest_sample.json
@@ -0,0 +1,13 @@
+{
+ "name": "app",
+ "version": "1.0.0",
+ "about_app": "Lorem ipsum",
+ "data_privacy": "Lorem ipsum",
+ "data_privacy_url": "http://localhost:3000/app-data-privacy",
+ "homepage_url": "http://localhost:3000/homepage",
+ "support_url": "http://localhost:3000/support",
+ "configuration_url": "htpp://localhost:3000/configuration",
+ "app_url": "http://localhost:3000/app",
+ "token_target_url": "http://localhost:3000/register",
+ "identificator": "app1"
+}
diff --git a/saleor/app/installation_utils.py b/saleor/app/installation_utils.py
new file mode 100644
index 0000000000..b08ccf6a8f
--- /dev/null
+++ b/saleor/app/installation_utils.py
@@ -0,0 +1,53 @@
+from typing import Iterable
+
+import requests
+from django.contrib.auth.models import Permission
+from django.contrib.sites.models import Site
+from django.core.validators import URLValidator
+from django.db import transaction
+
+from .models import App
+from .types import AppType
+
+REQUEST_TIMEOUT = 30
+
+
+def send_app_token(target_url: str, token: str):
+ domain = Site.objects.get_current().domain
+ headers = {"x-saleor-domain": domain, "Content-Type": "application/json"}
+ json_data = {"auth_token": token}
+ response = requests.post(
+ target_url, json=json_data, headers=headers, timeout=REQUEST_TIMEOUT
+ )
+ response.raise_for_status()
+
+
+def validate_manifest_fields(manifest_data):
+ pass
+
+
+def install_app(manifest_url: str, required_permissions: Iterable[Permission]):
+ manifest_data = requests.get(manifest_url, timeout=REQUEST_TIMEOUT).json()
+ validate_manifest_fields(manifest_data)
+
+ token_target_url = manifest_data.get("token_target_url")
+ url_validator = URLValidator()
+ url_validator(token_target_url)
+
+ app = App.objects.create(
+ name=manifest_data.get("name"),
+ identificator=manifest_data.get("identificator"),
+ about_app=manifest_data.get("about_app"),
+ data_privacy=manifest_data.get("data_privacy"),
+ data_privacy_url=manifest_data.get("data_privacy_url"),
+ homepage_url=manifest_data.get("homepage_url"),
+ support_url=manifest_data.get("support_url"),
+ configuration_url=manifest_data.get("configuration_url"),
+ app_url=manifest_data.get("app_url"),
+ type=AppType.FROM_MARKETPLACE,
+ )
+ app.permissions.set(required_permissions)
+ token = app.tokens.create(name="Default token")
+ send_app_token(target_url=token_target_url, token=token.auth_token)
+ return app
diff --git a/saleor/app/migrations/0002_auto_20200430_0701.py b/saleor/app/migrations/0002_auto_20200430_0701.py
new file mode 100644
index 0000000000..33065fcf00
--- /dev/null
+++ b/saleor/app/migrations/0002_auto_20200430_0701.py
@@ -0,0 +1,100 @@
+# Generated by Django 3.0.5 on 2020-04-30 12:01
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("auth", "0011_update_proxy_permissions"),
+ ("app", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="app", name="about_app", field=models.TextField(blank=True),
+ ),
+ migrations.AddField(
+ model_name="app", name="app_url", field=models.URLField(blank=True),
+ ),
+ migrations.AddField(
+ model_name="app",
+ name="configuration_url",
+ field=models.URLField(blank=True),
+ ),
+ migrations.AddField(
+ model_name="app", name="data_privacy", field=models.TextField(blank=True),
+ ),
+ migrations.AddField(
+ model_name="app",
+ name="data_privacy_url",
+ field=models.URLField(blank=True),
+ ),
+ migrations.AddField(
+ model_name="app", name="homepage_url", field=models.URLField(blank=True),
+ ),
+ migrations.AddField(
+ model_name="app",
+ name="identificator",
+ field=models.CharField(default="Default", max_length=256),
+ preserve_default=False,
+ ),
+ migrations.AddField(
+ model_name="app", name="support_url", field=models.URLField(blank=True),
+ ),
+ migrations.AddField(
+ model_name="app",
+ name="type",
+ field=models.CharField(
+ choices=[
+ ("custom", "custom"),
+ ("from_marketplace", "from_marketplace"),
+ ],
+ default="custom",
+ max_length=60,
+ ),
+ ),
+ migrations.CreateModel(
+ name="AppJob",
+ fields=[
+ (
+ "id",
+ models.AutoField(
+ auto_created=True,
+ primary_key=True,
+ serialize=False,
+ verbose_name="ID",
+ ),
+ ),
+ (
+ "status",
+ models.CharField(
+ choices=[
+ ("pending", "Pending"),
+ ("success", "Success"),
+ ("failed", "Failed"),
+ ("deleted", "Deleted"),
+ ],
+ default="pending",
+ max_length=50,
+ ),
+ ),
+ ("message", models.CharField(blank=True, max_length=255, null=True)),
+ ("created_at", models.DateTimeField(auto_now_add=True)),
+ ("updated_at", models.DateTimeField(auto_now=True)),
+ ("name", models.CharField(max_length=60)),
+ ("manifest_url", models.URLField()),
+ (
+ "permissions",
+ models.ManyToManyField(
+ blank=True,
+ help_text="Specific permissions which will be assigned to app.",
+ related_name="app_job_set",
+ related_query_name="app_job",
+ to="auth.Permission",
+ ),
+ ),
+ ],
+ options={"abstract": False},
+ ),
+ ]
diff --git a/saleor/app/models.py b/saleor/app/models.py
index 2ed3b93fb4..0d9a295b26 100644
--- a/saleor/app/models.py
+++ b/saleor/app/models.py
@@ -4,14 +4,19 @@ from django.contrib.auth.models import Permission
from django.db import models
from oauthlib.common import generate_token
-from ..core.models import ModelWithMetadata
+from ..core.models import Job, ModelWithMetadata
from ..core.permissions import AppPermission
+from .types import AppType
class App(ModelWithMetadata):
name = models.CharField(max_length=60)
created = models.DateTimeField(auto_now_add=True)
is_active = models.BooleanField(default=True)
+ type = models.CharField(
+ choices=AppType.CHOICES, default=AppType.CUSTOM, max_length=60
+ )
+ identificator = models.CharField(max_length=256)
permissions = models.ManyToManyField(
Permission,
blank=True,
@@ -19,6 +24,13 @@ class App(ModelWithMetadata):
related_name="app_set",
related_query_name="app",
)
+ about_app = models.TextField(blank=True)
+ data_privacy = models.TextField(blank=True)
+ data_privacy_url = models.URLField(blank=True)
+ homepage_url = models.URLField(blank=True)
+ support_url = models.URLField(blank=True)
+ configuration_url = models.URLField(blank=True)
+ app_url = models.URLField(blank=True)
class Meta:
ordering = ("name", "pk")
@@ -61,3 +73,15 @@ class AppToken(models.Model):
app = models.ForeignKey(App, on_delete=models.CASCADE, related_name="tokens")
name = models.CharField(blank=True, default="", max_length=128)
auth_token = models.CharField(default=generate_token, unique=True, max_length=30)
+
+
+class AppJob(Job):
+ name = models.CharField(max_length=60)
+ manifest_url = models.URLField()
+ permissions = models.ManyToManyField(
+ Permission,
+ blank=True,
+ help_text="Specific permissions which will be assigned to app.",
+ related_name="app_job_set",
+ related_query_name="app_job",
+ )
diff --git a/saleor/app/tasks.py b/saleor/app/tasks.py
new file mode 100644
index 0000000000..f362566b0a
--- /dev/null
+++ b/saleor/app/tasks.py
@@ -0,0 +1,28 @@
+from django.core.exceptions import ValidationError
+from requests import RequestException
+
+from .. import celeryconf
+from ..core import JobStatus
+from .installation_utils import install_app
+from .models import AppJob
+
+
+def install_app_task(job_id):
+ app_job = AppJob.objects.get(id=job_id)
+ try:
+ install_app(app_job.manifest_url, app_job.permissions.all())
+ app_job.delete()
+ return
+ except ValidationError:
+ app_job.message = (
+ "token_target_url has inccorrect format. Contact with app support."
+ )
+ except RequestException:
+ app_job.message = (
+ "Failed to connect to app. Try later or contact with app support."
+ )
+ except Exception:
+ app_job.message = "Unknow error. Concact with app support."
+ app_job.status = JobStatus.FAILED
+ app_job.save()
diff --git a/saleor/app/types.py b/saleor/app/types.py
new file mode 100644
index 0000000000..603ca5ceca
--- /dev/null
+++ b/saleor/app/types.py
@@ -0,0 +1,5 @@
+class AppType:
+ CUSTOM = "custom"
+ FROM_MARKETPLACE = "from_marketplace"
+
+ CHOICES = [(CUSTOM, "custom"), (FROM_MARKETPLACE, "from_marketplace")]
diff --git a/saleor/core/models.py b/saleor/core/models.py
index 0a66284891..4cffdc89ec 100644
--- a/saleor/core/models.py
+++ b/saleor/core/models.py
@@ -119,6 +119,7 @@ class Job(models.Model):
status = models.CharField(
max_length=50, choices=JobStatus.CHOICES, default=JobStatus.PENDING
)
+ message = models.CharField(max_length=255, blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
diff --git a/saleor/graphql/app/enums.py b/saleor/graphql/app/enums.py
new file mode 100644
index 0000000000..1e1eab193e
--- /dev/null
+++ b/saleor/graphql/app/enums.py
@@ -0,0 +1,4 @@
+from ...app.types import AppType
+from ..core.enums import to_enum
+
+AppTypeEnum = to_enum(AppType)
diff --git a/saleor/graphql/app/mutations.py b/saleor/graphql/app/mutations.py
index aa57e73142..688bb991f1 100644
--- a/saleor/graphql/app/mutations.py
+++ b/saleor/graphql/app/mutations.py
@@ -1,15 +1,18 @@
import graphene
from django.core.exceptions import ValidationError
+from django.core.validators import URLValidator
from ...app import models
from ...app.error_codes import AppErrorCode
+from ...app.tasks import install_app_task
from ...core.permissions import AppPermission, get_permissions
-from ..account.utils import can_manage_app, get_out_of_scope_permissions
+from ..account.utils import can_manage_app
from ..core.enums import PermissionEnum
from ..core.mutations import ModelDeleteMutation, ModelMutation
from ..core.types.common import AppError
from ..utils import get_user_or_app_from_context, requestor_is_superuser
from .types import App, AppToken
+from .utils import ensure_can_manage_permissions
class AppInput(graphene.InputObjectType):
@@ -126,27 +129,9 @@ class AppCreate(ModelMutation):
requestor = get_user_or_app_from_context(info.context)
permissions = cleaned_input.pop("permissions")
cleaned_input["permissions"] = get_permissions(permissions)
- cls.ensure_can_manage_permissions(requestor, permissions)
+ ensure_can_manage_permissions(requestor, permissions)
return cleaned_input
- @classmethod
- def ensure_can_manage_permissions(cls, requestor, permission_items):
- """Check if requestor can manage permissions from input.
-
- Requestor cannot manage permissions witch he doesn't have.
- """
- if requestor_is_superuser(requestor):
- return
- missing_permissions = get_out_of_scope_permissions(requestor, permission_items)
- if missing_permissions:
- # add error
- error_msg = "You can't add permission that you don't have."
- code = AppErrorCode.OUT_OF_SCOPE_PERMISSION.value
- params = {"permissions": missing_permissions}
- raise ValidationError(
- {"permissions": ValidationError(error_msg, code=code, params=params)}
- )
-
@classmethod
def save(cls, info, instance, cleaned_input):
instance.save()
@@ -192,7 +177,7 @@ class AppUpdate(ModelMutation):
if "permissions" in cleaned_input:
permissions = cleaned_input.pop("permissions")
cleaned_input["permissions"] = get_permissions(permissions)
- AppCreate.ensure_can_manage_permissions(requestor, permissions)
+ ensure_can_manage_permissions(requestor, permissions)
return cleaned_input
@@ -220,3 +205,55 @@ class AppDelete(ModelDeleteMutation):
msg = "You can't delete this app."
code = AppErrorCode.OUT_OF_SCOPE_APP.value
raise ValidationError({"id": ValidationError(msg, code=code)})
+
+
+class InstallAppInput(graphene.InputObjectType):
+ name = graphene.String(description="Name of the app to register.")
+ manifest_url = graphene.String(description="Url to app's manifest in JSON format.")
+ permissions = graphene.List(
+ PermissionEnum,
+ description="List of permission code names to assign to this app.",
+ )
+
+
+class InstallApp(ModelMutation):
+ class Arguments:
+ input = InstallAppInput(
+ required=True, description="Fields required to install a new app.",
+ )
+
+ class Meta:
+ description = "Install new app by using app manifest."
+ model = models.AppJob
+ permissions = (AppPermission.MANAGE_APPS,)
+ error_type_class = AppError
+ error_type_field = "app_errors"
+
+ @classmethod
+ def clean_manifest_url(self, url):
+ url_validator = URLValidator()
+ try:
+ url_validator(url)
+ except (ValidationError, AttributeError):
+ msg = "Enter a valid URL."
+ code = AppErrorCode.INVALID.value
+ raise ValidationError({"manifest_url": ValidationError(msg, code=code)})
+
+ @classmethod
+ def clean_input(cls, info, instance, data, input_cls=None):
+ manifest_url = data.get("manifest_url")
+ cls.clean_manifest_url(manifest_url)
+
+ cleaned_input = super().clean_input(info, instance, data, input_cls)
+
+ # clean and prepare permissions
+ if "permissions" in cleaned_input:
+ requestor = get_user_or_app_from_context(info.context)
+ permissions = cleaned_input.pop("permissions")
+ cleaned_input["permissions"] = get_permissions(permissions)
+ ensure_can_manage_permissions(requestor, permissions)
+ return cleaned_input
+
+ @classmethod
+ def post_save_action(cls, info, instance, cleaned_input):
+ install_app_task.delay(instance.pk)
diff --git a/saleor/graphql/app/schema.py b/saleor/graphql/app/schema.py
index cb3930ea13..d95f5dbac0 100644
--- a/saleor/graphql/app/schema.py
+++ b/saleor/graphql/app/schema.py
@@ -1,14 +1,21 @@
import graphene
from ...core.permissions import AppPermission
-from ..core.fields import FilterInputConnectionField
+from ..core.fields import FilterInputConnectionField, PrefetchingConnectionField
from ..core.types import FilterInputObjectType
from ..decorators import permission_required
from .filters import AppFilter
-from .mutations import AppCreate, AppDelete, AppTokenCreate, AppTokenDelete, AppUpdate
+from .mutations import (
+ AppCreate,
+ AppDelete,
+ AppTokenCreate,
+ AppTokenDelete,
+ AppUpdate,
+ InstallApp,
+)
from .resolvers import resolve_apps
from .sorters import AppSortingInput
-from .types import App
+from .types import App, OngoingAppInstallation
class AppFilterInput(FilterInputObjectType):
@@ -17,6 +24,9 @@ class AppFilterInput(FilterInputObjectType):
class AppQueries(graphene.ObjectType):
+ ongoing_apps_installations = PrefetchingConnectionField(
+ OngoingAppInstallation, description="List of all ongoing apps installations"
+ )
apps = FilterInputConnectionField(
App,
filter=AppFilterInput(description="Filtering options for apps."),
@@ -45,3 +55,5 @@ class AppMutations(graphene.ObjectType):
app_token_create = AppTokenCreate.Field()
app_token_delete = AppTokenDelete.Field()
+
+ install_app = InstallApp.Field()
diff --git a/saleor/graphql/app/types.py b/saleor/graphql/app/types.py
index 45dd36fb9d..349b352f09 100644
--- a/saleor/graphql/app/types.py
+++ b/saleor/graphql/app/types.py
@@ -5,10 +5,12 @@ from ...app import models
from ...core.permissions import AppPermission
from ..core.connection import CountableDjangoObjectType
from ..core.types import Permission
+from ..core.types.common import Job
from ..meta.deprecated.resolvers import resolve_meta, resolve_private_meta
from ..meta.types import ObjectWithMetadata
from ..utils import format_permissions_for_display
from ..webhook.types import Webhook
+from .enums import AppTypeEnum
class AppToken(CountableDjangoObjectType):
@@ -39,12 +41,27 @@ class App(CountableDjangoObjectType):
description="Determine if app will be set active or not."
)
name = graphene.String(description="Name of the app.")
-
+ type = AppTypeEnum(description="Type of the app.")
tokens = graphene.List(AppToken, description="Last 4 characters of the tokens.")
webhooks = graphene.List(
Webhook, description="List of webhooks assigned to this app."
)
+ about_app = graphene.String(description="Description of this app.")
+
+ data_privacy = graphene.String(
+ description="Description of the data privacy defined for this app."
+ )
+ data_privacy_url = graphene.String(
+ description="Url to details about the privacy policy on the app owner page."
+ )
+ homepage_url = graphene.String(description="Homepage of the app.")
+ support_url = graphene.String(description="Support page for the app.")
+ configuration_url = graphene.String(
+ description="Url to iframe with the configuration for the app."
+ )
+ app_url = graphene.String(description="Url to iframe with the app.")
+
class Meta:
description = "Represents app data."
interfaces = [graphene.relay.Node, ObjectWithMetadata]
@@ -86,3 +103,20 @@ class App(CountableDjangoObjectType):
@staticmethod
def resolve_webhooks(root: models.App, _info):
return root.webhooks.all()
+
+
+class OngoingAppInstallation(CountableDjangoObjectType):
+ class Meta:
+ model = models.AppJob
+ description = "Represents ongoing installation of app."
+ interface = (Job,)
+ permissions = (AppPermission.MANAGE_APPS,)
+ only_fields = [
+ "id",
+ "status",
+ "created_at",
+ "updated_at",
+ "name",
+ "manifest_url",
+ "message",
+ ]
diff --git a/saleor/graphql/app/utils.py b/saleor/graphql/app/utils.py
new file mode 100644
index 0000000000..08891ed412
--- /dev/null
+++ b/saleor/graphql/app/utils.py
@@ -0,0 +1,24 @@
+from django.core.exceptions import ValidationError
+
+from ..account.utils import get_out_of_scope_permissions
+from ..core.enums import AppErrorCode
+from ..utils import requestor_is_superuser
+
+
+def ensure_can_manage_permissions(requestor, permission_items):
+ """Check if requestor can manage permissions from input.
+
+ Requestor cannot manage permissions witch he doesn't have. It raises
+ ValidationError when requestor doesn't have required permissions.
+ """
+ if requestor_is_superuser(requestor):
+ return
+ missing_permissions = get_out_of_scope_permissions(requestor, permission_items)
+ if missing_permissions:
+ # add error
+ error_msg = "You can't add permission that you don't have."
+ code = AppErrorCode.OUT_OF_SCOPE_PERMISSION.value
+ params = {"permissions": missing_permissions}
+ raise ValidationError(
+ {"permissions": ValidationError(error_msg, code=code, params=params)}
+ )
diff --git a/saleor/graphql/core/mutations.py b/saleor/graphql/core/mutations.py
index 799feb6ed8..e10e8a2261 100644
--- a/saleor/graphql/core/mutations.py
+++ b/saleor/graphql/core/mutations.py
@@ -464,6 +464,10 @@ class ModelMutation(BaseMutation):
instance = cls._meta.model()
return instance
+ @classmethod
+ def post_save_action(cls, info, instance, cleaned_input):
+ """Perform an action after saving an object and its m2m."""
+
@classmethod
def perform_mutation(cls, _root, info, **data):
"""Perform model mutation.
@@ -480,6 +484,7 @@ class ModelMutation(BaseMutation):
cls.clean_instance(info, instance)
cls.save(info, instance, cleaned_input)
cls._save_m2m(info, instance, cleaned_input)
+ cls.post_save_action(info, instance, cleaned_input)
return cls.success_response(instance)
diff --git a/saleor/graphql/core/types/common.py b/saleor/graphql/core/types/common.py
index 5c3a37b5f6..b9a489b1c8 100644
--- a/saleor/graphql/core/types/common.py
+++ b/saleor/graphql/core/types/common.py
@@ -289,3 +289,4 @@ class Job(graphene.Interface):
updated_at = graphene.DateTime(
description="Date time of job last update in ISO 8601 format.", required=True
)
+ message = graphene.String(description="Job message.")
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 98993d3bb0..56925a6b7a 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -201,7 +201,15 @@ type App implements Node & ObjectWithMetadata {
metadata: [MetadataItem]!
privateMeta: [MetaStore]! @deprecated(reason: "Use the `privetaMetadata` field. This field will be removed after 2020-07-31.")
meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
+ type: AppTypeEnum
webhooks: [Webhook]
+ aboutApp: String
+ dataPrivacy: String
+ dataPrivacyUrl: String
+ homepageUrl: String
+ supportUrl: String
+ configurationUrl: String
+ appUrl: String
}
type AppCountableConnection {
@@ -256,6 +264,13 @@ input AppInput {
permissions: [PermissionEnum]
}
+enum AppJobStatus {
+ PENDING
+ SUCCESS
+ FAILED
+ DELETED
+}
+
enum AppSortField {
NAME
CREATION_DATE
@@ -290,6 +305,11 @@ input AppTokenInput {
app: ID!
}
+enum AppTypeEnum {
+ CUSTOM
+ FROM_MARKETPLACE
+}
+
type AppUpdate {
errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
appErrors: [AppError!]!
@@ -1933,6 +1953,18 @@ type Image {
alt: String
}
+type InstallApp {
+ errors: [Error!]! @deprecated(reason: "Use typed errors with error codes. This field will be removed after 2020-07-31.")
+ appErrors: [AppError!]!
+ appJob: OngoingAppInstallation
+}
+
+input InstallAppInput {
+ name: String
+ manifestUrl: String
+ permissions: [PermissionEnum]
+}
+
input IntRangeInput {
gte: Int
lte: Int
@@ -2465,6 +2497,7 @@ type Mutation {
appDelete(id: ID!): AppDelete
appTokenCreate(input: AppTokenInput!): AppTokenCreate
appTokenDelete(id: ID!): AppTokenDelete
+ installApp(input: InstallAppInput!): InstallApp
requestPasswordReset(email: String!, redirectUrl: String!): RequestPasswordReset
confirmAccount(email: String!, token: String!): ConfirmAccount
setPassword(token: String!, email: String!, password: String!): SetPassword
@@ -2536,6 +2569,27 @@ interface ObjectWithMetadata {
meta: [MetaStore]! @deprecated(reason: "Use the `metadata` field. This field will be removed after 2020-07-31.")
}
+type OngoingAppInstallation {
+ id: ID!
+ status: AppJobStatus!
+ message: String
+ createdAt: DateTime!
+ updatedAt: DateTime!
+ name: String!
+ manifestUrl: String!
+}
+
+type OngoingAppInstallationCountableConnection {
+ pageInfo: PageInfo!
+ edges: [OngoingAppInstallationCountableEdge!]!
+ totalCount: Int
+}
+
+type OngoingAppInstallationCountableEdge {
+ node: OngoingAppInstallation!
+ cursor: String!
+}
+
type Order implements Node & ObjectWithMetadata {
id: ID!
created: DateTime!
@@ -3920,6 +3974,7 @@ type Query {
checkouts(before: String, after: String, first: Int, last: Int): CheckoutCountableConnection
checkoutLine(id: ID): CheckoutLine
checkoutLines(before: String, after: String, first: Int, last: Int): CheckoutLineCountableConnection
+ ongoingAppsInstallations(before: String, after: String, first: Int, last: Int): OngoingAppInstallationCountableConnection
apps(filter: AppFilterInput, sortBy: AppSortingInput, before: String, after: String, first: Int, last: Int): AppCountableConnection
app(id: ID!): App
addressValidationRules(countryCode: CountryCode!, countryArea: String, city: String, cityArea: String): AddressValidationData