@soppiya/app-bridge 1.2.9 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export * from "./log";
@@ -0,0 +1 @@
1
+ export * from "./log/index.js";
@@ -0,0 +1,2 @@
1
+ export * from "./mutation";
2
+ export * from "./query";
@@ -0,0 +1,2 @@
1
+ export * from "./mutation.js";
2
+ export * from "./query.js";
@@ -0,0 +1,3 @@
1
+ export declare const createLogMutation: import("@graphql-typed-document-node/core").TypedDocumentNode<import("../../../shared/graphql/graphql").AddLogMutation, import("../../../shared/graphql/graphql").Exact<{
2
+ input: import("../../../shared/graphql/graphql").CreateLogInput;
3
+ }>>;
@@ -0,0 +1,24 @@
1
+ import { graphql } from "../../../shared/graphql/index.js";
2
+ const createLogMutation = graphql(`
3
+ mutation AddLog($input: CreateLogInput!) {
4
+ addLog(input: $input) {
5
+ _id
6
+ action
7
+ createdAt
8
+ comment
9
+ user {
10
+ _id
11
+ first_name
12
+ last_name
13
+ }
14
+ app {
15
+ _id
16
+ app {
17
+ _id
18
+ title
19
+ }
20
+ }
21
+ }
22
+ }
23
+ `);
24
+ export { createLogMutation };
@@ -0,0 +1,10 @@
1
+ export declare const logsQuery: import("@graphql-typed-document-node/core").TypedDocumentNode<import("../../../shared/graphql/graphql").LogsQuery, import("../../../shared/graphql/graphql").Exact<{
2
+ after?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").Scalars["ID"]["input"]>;
3
+ before?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").Scalars["ID"]["input"]>;
4
+ first?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").Scalars["Int"]["input"]>;
5
+ last?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").Scalars["Int"]["input"]>;
6
+ query?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").Scalars["String"]["input"]>;
7
+ reverse?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").Scalars["Boolean"]["input"]>;
8
+ sortKey?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").LogSortKeys>;
9
+ filterKeys?: import("../../../shared/graphql/graphql").InputMaybe<import("../../../shared/graphql/graphql").LogFilterKeys>;
10
+ }>>;
@@ -0,0 +1,52 @@
1
+ import { graphql } from "../../../shared/graphql/index.js";
2
+ const logsQuery = graphql(`
3
+ query Logs(
4
+ $after: ID
5
+ $before: ID
6
+ $first: Int
7
+ $last: Int
8
+ $query: String
9
+ $reverse: Boolean
10
+ $sortKey: LogSortKeys
11
+ $filterKeys: LogFilterKeys
12
+ ) {
13
+ logs(
14
+ after: $after
15
+ before: $before
16
+ first: $first
17
+ last: $last
18
+ query: $query
19
+ reverse: $reverse
20
+ sortKey: $sortKey
21
+ filterKeys: $filterKeys
22
+ ) {
23
+ pageInfo {
24
+ endCursor
25
+ hasNextPage
26
+ hasPreviousPage
27
+ startCursor
28
+ }
29
+ edges {
30
+ node {
31
+ _id
32
+ action
33
+ createdAt
34
+ comment
35
+ user {
36
+ _id
37
+ first_name
38
+ last_name
39
+ }
40
+ app {
41
+ _id
42
+ app {
43
+ _id
44
+ title
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ `);
52
+ export { logsQuery };
@@ -0,0 +1 @@
1
+ export { default as Logs } from "./ui/Logs";
@@ -0,0 +1,2 @@
1
+ import Logs from "./ui/Logs.js";
2
+ export { Logs };
@@ -0,0 +1,2 @@
1
+ export * from "./useCreateLog";
2
+ export * from "./useGetLogs";
@@ -0,0 +1,2 @@
1
+ export * from "./useCreateLog.js";
2
+ export * from "./useGetLogs.js";
@@ -0,0 +1,7 @@
1
+ import { useMutation } from "@apollo/client/react";
2
+ export declare const useCreateLog: () => {
3
+ createLog: useMutation.MutationFunction<import("../../../shared/graphql/graphql").AddLogMutation, {
4
+ input: import("../../../shared/graphql/graphql").CreateLogInput;
5
+ }, import("@apollo/client").ApolloCache>;
6
+ isCreatingLog: boolean;
7
+ };
@@ -0,0 +1,14 @@
1
+ import { useMutation } from "@apollo/client/react";
2
+ import { createLogMutation } from "../api/index.js";
3
+ const useCreateLog = ()=>{
4
+ const [createLog, { loading: isCreatingLog }] = useMutation(createLogMutation, {
5
+ refetchQueries: [
6
+ "Logs"
7
+ ]
8
+ });
9
+ return {
10
+ createLog,
11
+ isCreatingLog
12
+ };
13
+ };
14
+ export { useCreateLog };
@@ -0,0 +1,44 @@
1
+ import type { LogsQueryVariables } from "../../../shared/graphql/graphql";
2
+ type UseGetLogsProps = {
3
+ skip?: boolean;
4
+ } & LogsQueryVariables;
5
+ export declare const useGetLogs: (props?: UseGetLogsProps) => {
6
+ logs: {
7
+ __typename: "Log";
8
+ _id?: string | null;
9
+ action?: import("../../../shared/graphql/graphql").LogActions | null;
10
+ createdAt?: string | null;
11
+ comment?: string | null;
12
+ user?: {
13
+ __typename: "User";
14
+ _id?: string | null;
15
+ first_name?: string | null;
16
+ last_name?: string | null;
17
+ } | null;
18
+ app?: {
19
+ __typename: "App";
20
+ _id?: string | null;
21
+ app?: {
22
+ __typename: "_App";
23
+ _id?: string | null;
24
+ title?: string | null;
25
+ } | null;
26
+ } | null;
27
+ }[];
28
+ formattedLogs: {
29
+ _id: string;
30
+ action: import("../../../shared/graphql/graphql").LogActions;
31
+ user: string;
32
+ comment: string;
33
+ createdAt: string;
34
+ }[];
35
+ pageInfo: {
36
+ __typename: "PageInfo";
37
+ endCursor?: string | null;
38
+ hasNextPage?: boolean | null;
39
+ hasPreviousPage?: boolean | null;
40
+ startCursor?: string | null;
41
+ } | null | undefined;
42
+ isLoadingLogs: boolean;
43
+ };
44
+ export {};
@@ -0,0 +1,35 @@
1
+ import { useQuery } from "@apollo/client/react";
2
+ import { filter } from "@soppiya/lib";
3
+ import moment from "moment";
4
+ import { useMemo } from "react";
5
+ import { logsQuery } from "../api/index.js";
6
+ const useGetLogs = (props = {})=>{
7
+ const { skip, ...variables } = props;
8
+ const { data, loading: isLoadingLogs } = useQuery(logsQuery, {
9
+ variables,
10
+ skip
11
+ });
12
+ const logs = useMemo(()=>filter.node(data?.logs?.edges), [
13
+ data
14
+ ]);
15
+ const pageInfo = data?.logs?.pageInfo;
16
+ const formattedLogs = useMemo(()=>logs.map((log)=>({
17
+ _id: log._id,
18
+ action: log.action,
19
+ user: log.user ? [
20
+ log.user.first_name,
21
+ log.user.last_name
22
+ ].filter(Boolean).join(" ") : `${log.app?.app?.title}`,
23
+ comment: log.comment,
24
+ createdAt: moment(Number(log.createdAt)).format("ddd, MMM Do YYYY, h:mm:ss a")
25
+ })), [
26
+ logs
27
+ ]);
28
+ return {
29
+ logs,
30
+ formattedLogs,
31
+ pageInfo,
32
+ isLoadingLogs
33
+ };
34
+ };
35
+ export { useGetLogs };
@@ -0,0 +1,7 @@
1
+ import type { LogResources } from "../../../shared/graphql/graphql";
2
+ type CreateLogProps = {
3
+ target: string;
4
+ resource: LogResources;
5
+ };
6
+ export declare const CreateLog: ({ target, resource }: CreateLogProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,46 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { CombinedGraphQLErrors } from "@apollo/client";
3
+ import { BlockStack, Button, InlineStack, Textarea } from "@soppiya/elementus";
4
+ import { useState } from "react";
5
+ import { toast } from "react-toastify";
6
+ import { useCreateLog } from "../model/index.js";
7
+ const CreateLog = ({ target, resource })=>{
8
+ const [comment, setComment] = useState("");
9
+ const { createLog, isCreatingLog } = useCreateLog();
10
+ const handleCreateLog = async ()=>{
11
+ try {
12
+ await createLog({
13
+ variables: {
14
+ input: {
15
+ comment,
16
+ target,
17
+ resource
18
+ }
19
+ }
20
+ });
21
+ setComment("");
22
+ } catch (error) {
23
+ if (CombinedGraphQLErrors.is(error)) toast.error(error.message);
24
+ }
25
+ };
26
+ return /*#__PURE__*/ jsxs(BlockStack, {
27
+ gapY: 50,
28
+ children: [
29
+ /*#__PURE__*/ jsx(Textarea, {
30
+ size: "lg",
31
+ value: comment,
32
+ onChange: (event)=>setComment(event.target.value)
33
+ }),
34
+ /*#__PURE__*/ jsx(InlineStack, {
35
+ justifyContent: "end",
36
+ children: /*#__PURE__*/ jsx(Button, {
37
+ disabled: !comment,
38
+ loading: isCreatingLog,
39
+ onClick: handleCreateLog,
40
+ children: "Comment"
41
+ })
42
+ })
43
+ ]
44
+ });
45
+ };
46
+ export { CreateLog };
@@ -0,0 +1,7 @@
1
+ import { LogResources } from "../../../shared/graphql/graphql";
2
+ interface LogsProps {
3
+ resource: keyof typeof LogResources;
4
+ target: string;
5
+ }
6
+ declare const Logs: ({ resource, target }: LogsProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default Logs;
@@ -0,0 +1,93 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { LogResources, LogSortKeys } from "../../../shared/graphql/graphql.js";
3
+ import { BlockStack, Box, Card, CursorPagination, InlineStack, Text } from "@soppiya/elementus";
4
+ import { useQueryState } from "@soppiya/lib";
5
+ import { useGetLogs } from "../model/index.js";
6
+ import { CreateLog } from "./CreateLog.js";
7
+ const LOG_CONFIG = {
8
+ filterKeys: [
9
+ "resources",
10
+ "targets"
11
+ ],
12
+ defaultSortKey: LogSortKeys._id,
13
+ defaultReverse: true,
14
+ defaultPageSize: 2
15
+ };
16
+ const Logs = ({ resource, target })=>{
17
+ const { state, variables, nextPage, prevPage } = useQueryState(LOG_CONFIG);
18
+ const { formattedLogs, pageInfo } = useGetLogs({
19
+ ...variables,
20
+ filterKeys: {
21
+ resources: [
22
+ resource
23
+ ],
24
+ targets: [
25
+ target
26
+ ]
27
+ },
28
+ skip: !resource || !target
29
+ });
30
+ return /*#__PURE__*/ jsx(Card, {
31
+ padding: 70,
32
+ children: /*#__PURE__*/ jsxs(BlockStack, {
33
+ gapY: 70,
34
+ children: [
35
+ /*#__PURE__*/ jsx(Text, {
36
+ size: "md",
37
+ weight: "semibold",
38
+ children: "Logs"
39
+ }),
40
+ /*#__PURE__*/ jsx(CreateLog, {
41
+ resource: LogResources.product,
42
+ target: target
43
+ }),
44
+ /*#__PURE__*/ jsx(BlockStack, {
45
+ children: formattedLogs.map((log, i)=>/*#__PURE__*/ jsx(BlockStack, {
46
+ className: `relative after:absolute after:content-[''] after:h-full after:w-0.5 after:bg-[#98c6cd] after:left-0 after:top-0 pl-4 ${0 === i ? "pt-0" : "pt-3"}`,
47
+ gapY: 80,
48
+ children: /*#__PURE__*/ jsxs(BlockStack, {
49
+ className: "relative",
50
+ children: [
51
+ /*#__PURE__*/ jsxs(Text, {
52
+ size: "md",
53
+ color: "secondary",
54
+ children: [
55
+ log.action,
56
+ "d by ",
57
+ log.user,
58
+ " (",
59
+ log.createdAt,
60
+ ")"
61
+ ]
62
+ }),
63
+ log.comment ? /*#__PURE__*/ jsx(BlockStack, {
64
+ className: "bg-[#f7f7f7]! p-2 mt-1.5",
65
+ radius: 5,
66
+ children: /*#__PURE__*/ jsx(Text, {
67
+ size: "md",
68
+ color: "secondary",
69
+ children: log.comment
70
+ })
71
+ }) : null,
72
+ /*#__PURE__*/ jsx(Box, {
73
+ className: "absolute w-3.5 h-3.5 z-30 border-2 top-0.75 border-[#00a0ac]! -left-5.5 after:absolute after:z-9 after:content-[''] after:bg-[#00a0ac] rounded-full after:rounded-full after:w-2 after:h-2 after:top-1/2 after:-translate-y-1/2 flex justify-center items-center"
74
+ })
75
+ ]
76
+ })
77
+ }, log._id))
78
+ }),
79
+ /*#__PURE__*/ jsx(InlineStack, {
80
+ justifyContent: "center",
81
+ children: /*#__PURE__*/ jsx(CursorPagination, {
82
+ direction: state.page.direction,
83
+ pageInfo: pageInfo,
84
+ onNextPage: nextPage,
85
+ onPrevPage: prevPage
86
+ })
87
+ })
88
+ ]
89
+ })
90
+ });
91
+ };
92
+ const ui_Logs = Logs;
93
+ export { ui_Logs as default };
@@ -1,3 +1,3 @@
1
1
  export declare const useSoppiyaBridge: () => {
2
- navigate: any;
2
+ navigate: (to: string) => void;
3
3
  };
@@ -1,5 +1,8 @@
1
1
  const useSoppiyaBridge = ()=>{
2
- const navigate = window.navigate;
2
+ const navigate = (to)=>{
3
+ if (window.navigate) window.navigate(to);
4
+ else window.location.href = to;
5
+ };
3
6
  return {
4
7
  navigate
5
8
  };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import "./styles.css";
2
2
  export * from "./components";
3
+ export * from "./features";
3
4
  export * from "./hooks";
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  import "./styles.css";
2
2
  export * from "./components/index.js";
3
+ export * from "./features/index.js";
3
4
  export * from "./hooks/index.js";
@@ -1,5 +1,5 @@
1
- import * as types from './graphql';
2
- import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
1
+ import type { TypedDocumentNode as DocumentNode } from "@graphql-typed-document-node/core";
2
+ import * as types from "./graphql";
3
3
  /**
4
4
  * Map of all GraphQL operations in the project.
5
5
  *
@@ -31,6 +31,8 @@ type Documents = {
31
31
  "query _regions($filterKeys: _RegionFilterKeys, $query: String, $after: ID, $before: ID, $first: Int, $last: Int) {\n _regions(filterKeys: $filterKeys, query: $query, after: $after, before: $before, first: $first, last: $last) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n name\n }\n }\n }\n}": typeof types._RegionsDocument;
32
32
  "\n query CustomerSegments(\n $after: ID\n $before: ID\n $first: Int\n $last: Int\n $query: String\n $filterKeys: CustomerSegmentFilterKeys\n ) {\n customerSegments(\n after: $after\n before: $before\n first: $first\n last: $last\n query: $query\n filterKeys: $filterKeys\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n }\n }\n }\n }\n": typeof types.CustomerSegmentsDocument;
33
33
  "\n query Variants($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: VariantFilterKeys) {\n variants(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n option1\n option2\n option3\n image {\n _id\n url\n }\n product {\n _id\n title\n }\n }\n }\n }\n }\n": typeof types.VariantsDocument;
34
+ "\n mutation AddLog($input: CreateLogInput!) {\n addLog(input: $input) {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n": typeof types.AddLogDocument;
35
+ "\n query Logs(\n $after: ID\n $before: ID\n $first: Int\n $last: Int\n $query: String\n $reverse: Boolean\n $sortKey: LogSortKeys\n $filterKeys: LogFilterKeys\n ) {\n logs(\n after: $after\n before: $before\n first: $first\n last: $last\n query: $query\n reverse: $reverse\n sortKey: $sortKey\n filterKeys: $filterKeys\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n }\n }\n": typeof types.LogsDocument;
34
36
  };
35
37
  declare const documents: Documents;
36
38
  /**
@@ -122,5 +124,13 @@ export declare function graphql(source: "\n query CustomerSegments(\n $after
122
124
  * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
123
125
  */
124
126
  export declare function graphql(source: "\n query Variants($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: VariantFilterKeys) {\n variants(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n option1\n option2\n option3\n image {\n _id\n url\n }\n product {\n _id\n title\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query Variants($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: VariantFilterKeys) {\n variants(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n option1\n option2\n option3\n image {\n _id\n url\n }\n product {\n _id\n title\n }\n }\n }\n }\n }\n"];
127
+ /**
128
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
129
+ */
130
+ export declare function graphql(source: "\n mutation AddLog($input: CreateLogInput!) {\n addLog(input: $input) {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n"): (typeof documents)["\n mutation AddLog($input: CreateLogInput!) {\n addLog(input: $input) {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n"];
131
+ /**
132
+ * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
133
+ */
134
+ export declare function graphql(source: "\n query Logs(\n $after: ID\n $before: ID\n $first: Int\n $last: Int\n $query: String\n $reverse: Boolean\n $sortKey: LogSortKeys\n $filterKeys: LogFilterKeys\n ) {\n logs(\n after: $after\n before: $before\n first: $first\n last: $last\n query: $query\n reverse: $reverse\n sortKey: $sortKey\n filterKeys: $filterKeys\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query Logs(\n $after: ID\n $before: ID\n $first: Int\n $last: Int\n $query: String\n $reverse: Boolean\n $sortKey: LogSortKeys\n $filterKeys: LogFilterKeys\n ) {\n logs(\n after: $after\n before: $before\n first: $first\n last: $last\n query: $query\n reverse: $reverse\n sortKey: $sortKey\n filterKeys: $filterKeys\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n }\n }\n"];
125
135
  export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
126
136
  export {};
@@ -1,4 +1,4 @@
1
- import { AddMediasDocument, ArticlesDocument, BlogsDocument, CollectionsDocument, CustomerSegmentsDocument, CustomersDocument, DeleteMediasDocument, LinklistsDocument, MediaUsageDocument, MediasDocument, MetafieldsDocument, MetaobjectEntriesDocument, MetaobjectsDocument, PagesDocument, ProductsDocument, StoragePlanDocument, VariantsDocument, _CountriesDocument, _RegionsDocument } from "./graphql.js";
1
+ import { AddLogDocument, AddMediasDocument, ArticlesDocument, BlogsDocument, CollectionsDocument, CustomerSegmentsDocument, CustomersDocument, DeleteMediasDocument, LinklistsDocument, LogsDocument, MediaUsageDocument, MediasDocument, MetafieldsDocument, MetaobjectEntriesDocument, MetaobjectsDocument, PagesDocument, ProductsDocument, StoragePlanDocument, VariantsDocument, _CountriesDocument, _RegionsDocument } from "./graphql.js";
2
2
  const documents = {
3
3
  "query Articles($filterKeys: ArticleFilterKeys, $after: ID, $before: ID, $first: Int, $last: Int, $query: String) {\n articles(filterKeys: $filterKeys, after: $after, before: $before, first: $first, last: $last, query: $query) {\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n}": ArticlesDocument,
4
4
  "query Blogs($filterKeys: BlogFilterKeys, $after: ID, $before: ID, $first: Int, $last: Int, $query: String) {\n blogs(filterKeys: $filterKeys, after: $after, before: $before, first: $first, last: $last, query: $query) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n }\n}": BlogsDocument,
@@ -18,7 +18,9 @@ const documents = {
18
18
  "\n query Products($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: ProductFilterKeys) {\n products(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n }\n }\n": ProductsDocument,
19
19
  "query _regions($filterKeys: _RegionFilterKeys, $query: String, $after: ID, $before: ID, $first: Int, $last: Int) {\n _regions(filterKeys: $filterKeys, query: $query, after: $after, before: $before, first: $first, last: $last) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n name\n }\n }\n }\n}": _RegionsDocument,
20
20
  "\n query CustomerSegments(\n $after: ID\n $before: ID\n $first: Int\n $last: Int\n $query: String\n $filterKeys: CustomerSegmentFilterKeys\n ) {\n customerSegments(\n after: $after\n before: $before\n first: $first\n last: $last\n query: $query\n filterKeys: $filterKeys\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n }\n }\n }\n }\n": CustomerSegmentsDocument,
21
- "\n query Variants($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: VariantFilterKeys) {\n variants(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n option1\n option2\n option3\n image {\n _id\n url\n }\n product {\n _id\n title\n }\n }\n }\n }\n }\n": VariantsDocument
21
+ "\n query Variants($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: VariantFilterKeys) {\n variants(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n option1\n option2\n option3\n image {\n _id\n url\n }\n product {\n _id\n title\n }\n }\n }\n }\n }\n": VariantsDocument,
22
+ "\n mutation AddLog($input: CreateLogInput!) {\n addLog(input: $input) {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n": AddLogDocument,
23
+ "\n query Logs(\n $after: ID\n $before: ID\n $first: Int\n $last: Int\n $query: String\n $reverse: Boolean\n $sortKey: LogSortKeys\n $filterKeys: LogFilterKeys\n ) {\n logs(\n after: $after\n before: $before\n first: $first\n last: $last\n query: $query\n reverse: $reverse\n sortKey: $sortKey\n filterKeys: $filterKeys\n ) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n action\n createdAt\n comment\n user {\n _id\n first_name\n last_name\n }\n app {\n _id\n app {\n _id\n title\n }\n }\n }\n }\n }\n }\n": LogsDocument
22
24
  };
23
25
  function graphql(source) {
24
26
  return documents[source] ?? {};