2020-07-22 10:54:15 +00:00
|
|
|
import {
|
2022-03-09 08:56:55 +00:00
|
|
|
AppFetchMutation,
|
|
|
|
AppQuery,
|
|
|
|
AppsInstallationsQuery,
|
|
|
|
AppsListQuery,
|
2020-07-22 10:54:15 +00:00
|
|
|
AppTypeEnum,
|
|
|
|
JobStatusEnum,
|
2022-06-21 09:36:55 +00:00
|
|
|
PermissionEnum,
|
2022-03-09 08:56:55 +00:00
|
|
|
} from "@saleor/graphql";
|
2020-07-22 10:54:15 +00:00
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const appsList: AppsListQuery["apps"]["edges"] = [
|
2020-07-22 10:54:15 +00:00
|
|
|
{
|
|
|
|
__typename: "AppCountableEdge",
|
|
|
|
node: {
|
|
|
|
__typename: "App",
|
|
|
|
id: "QXBwOjE3Ng==",
|
|
|
|
isActive: true,
|
|
|
|
name: "app",
|
2022-04-27 10:41:03 +00:00
|
|
|
type: AppTypeEnum.THIRDPARTY,
|
2022-05-31 15:18:15 +00:00
|
|
|
appUrl: null,
|
2022-06-29 08:08:46 +00:00
|
|
|
manifestUrl: "http://localhost:3000/api/manifest",
|
2022-05-31 15:18:15 +00:00
|
|
|
permissions: [
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_USERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage customers.",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-07-22 10:54:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
__typename: "AppCountableEdge",
|
|
|
|
node: {
|
|
|
|
__typename: "App",
|
|
|
|
id: "QXBwOjE3Ng==",
|
|
|
|
isActive: false,
|
|
|
|
name: "app1",
|
2022-04-27 10:41:03 +00:00
|
|
|
type: AppTypeEnum.THIRDPARTY,
|
2022-05-31 15:18:15 +00:00
|
|
|
appUrl: "http://localhost:3000",
|
2022-06-29 08:08:46 +00:00
|
|
|
manifestUrl: "http://localhost:3000/api/manifest",
|
2022-05-31 15:18:15 +00:00
|
|
|
permissions: [
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_ORDERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage orders.",
|
2022-05-31 15:18:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_USERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage customers.",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2020-07-22 10:54:15 +00:00
|
|
|
];
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const customAppsList: AppsListQuery["apps"]["edges"] = [
|
2020-07-22 10:54:15 +00:00
|
|
|
{
|
|
|
|
__typename: "AppCountableEdge",
|
|
|
|
node: {
|
|
|
|
__typename: "App",
|
|
|
|
id: "QXBwOjE3Ng==",
|
|
|
|
isActive: true,
|
|
|
|
name: "app custom",
|
2022-04-27 10:41:03 +00:00
|
|
|
type: AppTypeEnum.LOCAL,
|
2022-05-31 15:18:15 +00:00
|
|
|
appUrl: null,
|
2022-06-29 08:08:46 +00:00
|
|
|
manifestUrl: null,
|
2022-05-31 15:18:15 +00:00
|
|
|
permissions: [
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_ORDERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage orders.",
|
2022-05-31 15:18:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_USERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage customers.",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2020-07-22 10:54:15 +00:00
|
|
|
];
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const appsInProgress: AppsInstallationsQuery["appsInstallations"] = [
|
2020-07-22 10:54:15 +00:00
|
|
|
{
|
|
|
|
__typename: "AppInstallation",
|
|
|
|
appName: "app",
|
|
|
|
id: "QXBwSW5zdGFsbGF0aW9uOjk2",
|
|
|
|
manifestUrl: "http://localhost:3000/manifest",
|
|
|
|
message: "Failed to connect to app. Try later or contact with app support.",
|
2022-06-21 09:36:55 +00:00
|
|
|
status: JobStatusEnum.FAILED,
|
2020-07-22 10:54:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
__typename: "AppInstallation",
|
|
|
|
appName: "app pending",
|
|
|
|
id: "QXBwSW5zdGFsbGF0aW9uOjk2",
|
|
|
|
manifestUrl: "http://localhost:3000/manifest",
|
|
|
|
message: "Pending.",
|
2022-06-21 09:36:55 +00:00
|
|
|
status: JobStatusEnum.PENDING,
|
2020-07-22 10:54:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
__typename: "AppInstallation",
|
|
|
|
appName: "app success",
|
|
|
|
id: "QXBwSW5zdGFsbGF0aW9uOjk2",
|
|
|
|
manifestUrl: "http://localhost:3000/manifest",
|
|
|
|
message: "Success.",
|
2022-06-21 09:36:55 +00:00
|
|
|
status: JobStatusEnum.SUCCESS,
|
|
|
|
},
|
2020-07-22 10:54:15 +00:00
|
|
|
];
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const appDetails: AppQuery["app"] = {
|
2020-07-22 10:54:15 +00:00
|
|
|
__typename: "App",
|
|
|
|
aboutApp: "Lorem ipsum",
|
|
|
|
accessToken: "token",
|
|
|
|
appUrl: "http://localhost:8888/app",
|
2022-06-29 08:08:46 +00:00
|
|
|
manifestUrl: "http://localhost:8888/api/manifest",
|
2020-07-22 10:54:15 +00:00
|
|
|
configurationUrl: "htpp://localhost:8888/configuration",
|
|
|
|
created: "2020-06-02T12:24:26.818138+00:00",
|
|
|
|
dataPrivacy: "Lorem ipsum",
|
|
|
|
dataPrivacyUrl: "http://localhost:8888/app-data-privacy",
|
|
|
|
homepageUrl: "http://localhost:8888/homepage",
|
|
|
|
id: "QXBwOjE4MQ==",
|
|
|
|
isActive: true,
|
|
|
|
metadata: [],
|
|
|
|
name: "app1",
|
|
|
|
permissions: [
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_ORDERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage orders.",
|
2020-07-22 10:54:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_USERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage customers.",
|
|
|
|
},
|
2020-07-22 10:54:15 +00:00
|
|
|
],
|
|
|
|
privateMetadata: [],
|
|
|
|
supportUrl: "http://localhost:8888/support",
|
|
|
|
tokens: [],
|
|
|
|
type: AppTypeEnum.THIRDPARTY,
|
|
|
|
version: "1.0.0",
|
2022-06-21 09:36:55 +00:00
|
|
|
webhooks: [],
|
2020-07-22 10:54:15 +00:00
|
|
|
};
|
|
|
|
|
2022-03-09 08:56:55 +00:00
|
|
|
export const installApp: AppFetchMutation["appFetchManifest"]["manifest"] = {
|
2020-07-22 10:54:15 +00:00
|
|
|
__typename: "Manifest",
|
|
|
|
about: "Lorem ipsum",
|
|
|
|
appUrl: null,
|
|
|
|
configurationUrl: null,
|
|
|
|
dataPrivacy: null,
|
|
|
|
dataPrivacyUrl: null,
|
|
|
|
homepageUrl: null,
|
|
|
|
identifier: "app",
|
|
|
|
name: "app",
|
|
|
|
permissions: [
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_USERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage users",
|
2020-07-22 10:54:15 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
__typename: "Permission",
|
|
|
|
code: PermissionEnum.MANAGE_ORDERS,
|
2022-06-21 09:36:55 +00:00
|
|
|
name: "Manage orders",
|
|
|
|
},
|
2020-07-22 10:54:15 +00:00
|
|
|
],
|
|
|
|
supportUrl: null,
|
|
|
|
tokenTargetUrl: null,
|
2022-06-21 09:36:55 +00:00
|
|
|
version: "1.0",
|
2020-07-22 10:54:15 +00:00
|
|
|
};
|