@stonecrop/graphql-client 0.2.24 → 0.2.25

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,49 @@
1
+ import { gql } from 'graphql-request';
2
+ const typeDefs = gql `
3
+ type Doctype {
4
+ id: ID!
5
+ name: String!
6
+ workflow: String!
7
+ schema: String!
8
+ actions: String!
9
+ }
10
+
11
+ type DoctypeField {
12
+ id: ID!
13
+ label: String!
14
+ fieldtype: String
15
+ component: String
16
+ required: Boolean
17
+ readonly: Boolean
18
+ }
19
+
20
+ type DoctypeWorkflow {
21
+ name: String!
22
+ machine: StateMachine!
23
+ }
24
+
25
+ type StateMachine {
26
+ id: ID!
27
+ }
28
+
29
+ type DoctypeAction {
30
+ eventName: String!
31
+ callback: String
32
+ }
33
+
34
+ type Query {
35
+ getMeta(doctype: String!): Doctype # ∪ error
36
+ getRecords(doctype: String!, filters: [String]): [String] # ∪ error
37
+ getRecord(doctype: String!, id: ID!): String # ∪ error
38
+ }
39
+
40
+ type Mutation {
41
+ runAction(doctype: String!, id: [ID!]!, functionName: String!): [String!]! # ∪ error
42
+ }
43
+
44
+ schema {
45
+ query: Query
46
+ mutation: Mutation
47
+ }
48
+ `;
49
+ export default typeDefs;
@@ -0,0 +1,28 @@
1
+ import type { Meta } from '@/types';
2
+ import type { MetaParser } from '@/types';
3
+ import type { MetaResponse } from '@/types';
4
+ import { queries } from './queries';
5
+ import typeDefs from './gql/schema';
6
+
7
+ export { Meta }
8
+
9
+ export { MetaParser }
10
+
11
+ export { MetaResponse }
12
+
13
+ /**
14
+ * Get meta information for a doctype
15
+ * @param doctype - The doctype to get meta information for
16
+ * @param url - The URL to send the request to
17
+ * @returns The meta information for the doctype
18
+ * @public
19
+ */
20
+ export declare const methods: {
21
+ getMeta: (doctype: string, url?: string) => Promise<MetaResponse>;
22
+ };
23
+
24
+ export { queries }
25
+
26
+ export { typeDefs }
27
+
28
+ export { }