@evenicanpm/admin-graphql-codegen 1.0.0 → 1.1.0

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.
package/codegen.ts CHANGED
@@ -4,6 +4,7 @@ const config: CodegenConfig = {
4
4
  schema: "https://api.e4.local/graphql",
5
5
  documents: [
6
6
  "./documents/**/*.ts",
7
+ "../admin-integrate/documents/**/*.ts",
7
8
  "!./documents/core/**",
8
9
  "!./documents/base/**",
9
10
  ],
@@ -1,4 +1,20 @@
1
- import { gql } from "graphql-request";
1
+ import gql from "graphql-tag";
2
+
3
+ const GET_ALIAS = gql`
4
+ query alias($name: String!) {
5
+ alias(name: $name) {
6
+ alias
7
+ index
8
+ lastIndexed
9
+ indexDetails {
10
+ health
11
+ status
12
+ docsCount
13
+ storeSize
14
+ }
15
+ }
16
+ }
17
+ `;
2
18
 
3
19
  const GET_ALIASES = gql`
4
20
  query aliases {
@@ -15,3 +31,66 @@ const GET_ALIASES = gql`
15
31
  }
16
32
  }
17
33
  `;
34
+
35
+ const MAPPING_BY_ALIAS = gql`
36
+ query mapping($alias: String!) {
37
+ indexFieldTypes {
38
+ key
39
+ value
40
+ }
41
+ mapping(alias: $alias) {
42
+ id
43
+ parentId
44
+ fieldName
45
+ displayName
46
+ fieldType
47
+ searchable
48
+ facetable
49
+ sortable
50
+ suggestable
51
+ isKey
52
+ sort
53
+ }
54
+ }
55
+ `;
56
+
57
+ const BULK_MAPPPING = gql`
58
+ mutation bulkMapping(
59
+ $alias: String!
60
+ $createMappings: [MappingFieldInput!]!
61
+ $updateMappings: [MappingFieldInput!]!
62
+ $deleteMappings: [DeleteMappingFieldInput!]!
63
+ ) {
64
+ createMappings(alias: $alias, mapping: $createMappings) {
65
+ id
66
+ parentId
67
+ fieldName
68
+ fieldType
69
+ displayName
70
+ isKey
71
+ sort
72
+ searchable
73
+ facetable
74
+ sortable
75
+ suggestable
76
+ }
77
+
78
+ updateMappings(mapping: $updateMappings) {
79
+ id
80
+ parentId
81
+ fieldName
82
+ fieldType
83
+ displayName
84
+ isKey
85
+ sort
86
+ searchable
87
+ facetable
88
+ sortable
89
+ suggestable
90
+ }
91
+
92
+ deleteMappingFields(ids: $deleteMappings) {
93
+ id
94
+ }
95
+ }
96
+ `;
@@ -0,0 +1,73 @@
1
+ import gql from "graphql-tag";
2
+
3
+ const GET_INDEXES = gql`
4
+ query indexes {
5
+ indexes {
6
+ id
7
+ health
8
+ index
9
+ docsCount
10
+ storeSize
11
+ }
12
+ }
13
+ `;
14
+
15
+ const GET_INDEX_HISTORY = gql`
16
+ query indexHistory($alias: String, $status: String) {
17
+ indexHistory(alias: $alias, status: $status) {
18
+ id
19
+ index
20
+ status
21
+ isActiveIndex
22
+ executionTime
23
+ errorCount
24
+ indexedItemsCount
25
+ endTime
26
+ }
27
+ }
28
+ `;
29
+
30
+ const REINDEX_INDEX_HISTORY = gql`
31
+ mutation reindex($index: String!) {
32
+ reindex(index: $index) {
33
+ index
34
+ id
35
+ status
36
+ }
37
+ }
38
+ `;
39
+
40
+ const SWAP_INDEX = gql`
41
+ mutation swapIndex($newIndex: String, $oldIndex: String) {
42
+ swapIndex(newIndex: $newIndex, oldIndex: $oldIndex) {
43
+ # alias,
44
+ # index,
45
+ # filter,
46
+ # is_write_index,
47
+ # lastIndexed
48
+ code
49
+ success
50
+ indexExecution {
51
+ id
52
+ index
53
+ executionTime
54
+ status
55
+ startTime
56
+ endTime
57
+ alias
58
+ isActiveIndex
59
+ }
60
+ searchAlias {
61
+ index
62
+ indexDetails {
63
+ status
64
+ index
65
+ health
66
+ docsCount
67
+ docsDeleted
68
+ storeSize
69
+ }
70
+ }
71
+ }
72
+ }
73
+ `;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@evenicanpm/admin-graphql-codegen",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "",
7
7
  "license": "ISC",
8
- "gitHead": "2a4307173bbfb888c935e45b3aca3c6227861368",
8
+ "gitHead": "0c9180f24435b0361dfc05ccba4a1f0e7ad19a7a",
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
11
11
  "codegen:insecure": "NODE_TLS_REJECT_UNAUTHORIZED=0 npm run codegen",