@evenicanpm/storefront-graphql-codegen 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.
Files changed (138) hide show
  1. package/README.md +9 -0
  2. package/codegen.ts +26 -0
  3. package/documents/Account/index.ts +1 -0
  4. package/documents/Account/interfaces.ts +124 -0
  5. package/documents/Account/read.ts +22 -0
  6. package/documents/Account/readList.ts +28 -0
  7. package/documents/Account/update.ts +12 -0
  8. package/documents/Address/addressType.ts +12 -0
  9. package/documents/Address/countries.ts +27 -0
  10. package/documents/Address/create.ts +12 -0
  11. package/documents/Address/delete.ts +7 -0
  12. package/documents/Address/fragments.ts +56 -0
  13. package/documents/Address/index.ts +2 -0
  14. package/documents/Address/interfaces.ts +41 -0
  15. package/documents/Address/update.ts +12 -0
  16. package/documents/Cart/add.ts +64 -0
  17. package/documents/Cart/checkoutRead.ts +88 -0
  18. package/documents/Cart/checkoutSubmit.ts +18 -0
  19. package/documents/Cart/createCartAddress.ts +12 -0
  20. package/documents/Cart/deleteLine.ts +64 -0
  21. package/documents/Cart/fragments.ts +204 -0
  22. package/documents/Cart/interfaces.ts +56 -0
  23. package/documents/Cart/read.ts +44 -0
  24. package/documents/Cart/setOrderEmail.ts +9 -0
  25. package/documents/Cart/shippingMethodRead.ts +44 -0
  26. package/documents/Cart/shippingMethodUpdate.ts +64 -0
  27. package/documents/Cart/submit.ts +18 -0
  28. package/documents/Cart/updateCartAddress.ts +9 -0
  29. package/documents/Cart/updateLine.ts +64 -0
  30. package/documents/Catalog/create.ts +15 -0
  31. package/documents/Catalog/delete.ts +9 -0
  32. package/documents/Catalog/deleteProducts.ts +10 -0
  33. package/documents/Catalog/fragments.ts +80 -0
  34. package/documents/Catalog/interfaces.ts +34 -0
  35. package/documents/Catalog/linkMedia/create.ts +20 -0
  36. package/documents/Catalog/linkMedia/delete.ts +9 -0
  37. package/documents/Catalog/linkMedia/update.ts +11 -0
  38. package/documents/Catalog/linkProduct.ts +12 -0
  39. package/documents/Catalog/list.ts +23 -0
  40. package/documents/Catalog/read.ts +56 -0
  41. package/documents/Catalog/removeProduct.ts +11 -0
  42. package/documents/Catalog/save.ts +17 -0
  43. package/documents/Catalog/statusList.ts +12 -0
  44. package/documents/Catalog/update.ts +15 -0
  45. package/documents/Category/fragments.ts +54 -0
  46. package/documents/Category/interfaces.ts +18 -0
  47. package/documents/Category/list.ts +55 -0
  48. package/documents/MediaLibrary/File/create.ts +44 -0
  49. package/documents/MediaLibrary/File/delete.ts +12 -0
  50. package/documents/MediaLibrary/File/read.ts +36 -0
  51. package/documents/MediaLibrary/File/update.ts +43 -0
  52. package/documents/MediaLibrary/Folder/create.ts +24 -0
  53. package/documents/MediaLibrary/Folder/delete.ts +11 -0
  54. package/documents/MediaLibrary/Folder/read.ts +101 -0
  55. package/documents/MediaLibrary/Folder/update.ts +10 -0
  56. package/documents/MediaLibrary/move.ts +44 -0
  57. package/documents/MediaLibrary/search.ts +84 -0
  58. package/documents/Order/fragments.ts +116 -0
  59. package/documents/Order/index.ts +2 -0
  60. package/documents/Order/interfaces.ts +30 -0
  61. package/documents/Order/list.ts +129 -0
  62. package/documents/Order/read.ts +44 -0
  63. package/documents/Product/facets.ts +34 -0
  64. package/documents/Product/fragments.ts +167 -0
  65. package/documents/Product/getAll.ts +77 -0
  66. package/documents/Product/interfaces.ts +45 -0
  67. package/documents/Product/list.ts +248 -0
  68. package/documents/Product/read.ts +70 -0
  69. package/documents/Product/search.ts +170 -0
  70. package/documents/Review/create.ts +22 -0
  71. package/documents/ServerCache/productIndex.ts +11 -0
  72. package/documents/Session/Customer/init.ts +12 -0
  73. package/documents/Session/Customer/logout.ts +11 -0
  74. package/documents/Session/Customer/read.ts +15 -0
  75. package/documents/Session/fragments.ts +69 -0
  76. package/documents/Session/index.ts +8 -0
  77. package/documents/Session/interfaces.ts +11 -0
  78. package/documents/Session/login.ts +36 -0
  79. package/documents/Session/logout.ts +11 -0
  80. package/documents/Session/read.ts +43 -0
  81. package/documents/Settings/ClearCache/clearcache.ts +10 -0
  82. package/documents/Settings/SystemInformation/index.ts +1 -0
  83. package/documents/Settings/SystemInformation/interfaces.ts +16 -0
  84. package/documents/Settings/SystemInformation/system-information.ts +20 -0
  85. package/documents/Settings/aliases.ts +96 -0
  86. package/documents/Settings/claims.ts +124 -0
  87. package/documents/Settings/contacts.ts +133 -0
  88. package/documents/Settings/index.ts +12 -0
  89. package/documents/Settings/indexes.ts +73 -0
  90. package/documents/Settings/roles.ts +93 -0
  91. package/documents/Settings/settingsGroup.ts +266 -0
  92. package/documents/Settings/users.ts +19 -0
  93. package/documents/Settings/words.ts +115 -0
  94. package/documents/Theme/create.ts +46 -0
  95. package/documents/Theme/delete.ts +9 -0
  96. package/documents/Theme/interfaces.ts +63 -0
  97. package/documents/Theme/read.ts +83 -0
  98. package/documents/User/changePassword.ts +11 -0
  99. package/documents/User/counts.ts +8 -0
  100. package/documents/User/fragments.ts +61 -0
  101. package/documents/User/index.ts +2 -0
  102. package/documents/User/interfaces.ts +29 -0
  103. package/documents/User/read.ts +44 -0
  104. package/documents/User/register.ts +11 -0
  105. package/documents/User/resetPassword.ts +11 -0
  106. package/documents/User/update.ts +44 -0
  107. package/documents/WishList/add.ts +10 -0
  108. package/documents/WishList/create.ts +12 -0
  109. package/documents/WishList/delete.ts +7 -0
  110. package/documents/WishList/deleteLine.ts +7 -0
  111. package/documents/WishList/fragments.ts +98 -0
  112. package/documents/WishList/index.ts +2 -0
  113. package/documents/WishList/interfaces.ts +68 -0
  114. package/documents/WishList/list.ts +136 -0
  115. package/documents/WishList/read.ts +44 -0
  116. package/documents/base/interfaces.ts +34 -0
  117. package/documents/base/logger.ts +20 -0
  118. package/documents/base/pageInfoFragments.ts +25 -0
  119. package/documents/base/refresh-token.ts +15 -0
  120. package/documents/core/Logger/create.ts +64 -0
  121. package/documents/core/Logger/delete.ts +14 -0
  122. package/documents/core/Logger/fragments.ts +55 -0
  123. package/documents/core/Logger/index.ts +2 -0
  124. package/documents/core/Logger/interfaces.ts +39 -0
  125. package/documents/core/Logger/list.ts +56 -0
  126. package/documents/core/Logger/read.ts +44 -0
  127. package/documents/core/Logger/update.ts +64 -0
  128. package/documents/core/SampleData/create.ts +76 -0
  129. package/documents/core/SampleData/delete.ts +14 -0
  130. package/documents/core/SampleData/fragments.ts +48 -0
  131. package/documents/core/SampleData/index.ts +7 -0
  132. package/documents/core/SampleData/interfaces.ts +11 -0
  133. package/documents/core/SampleData/list.ts +233 -0
  134. package/documents/core/SampleData/read.ts +44 -0
  135. package/documents/core/SampleData/update.ts +76 -0
  136. package/documents/core/index.ts +2 -0
  137. package/documents/messages/messages.ts +21 -0
  138. package/package.json +22 -0
@@ -0,0 +1,43 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ import {
4
+ SESSION_FRAGMENT_XS,
5
+ SESSION_FRAGMENT_SM,
6
+ SESSION_FRAGMENT_MANAGEMENT_WITH_CLAIMS,
7
+ } from "./fragments";
8
+
9
+ const SESSION_READ_XS = gql`
10
+ ${SESSION_FRAGMENT_XS}
11
+ query e4ReadSessionXS(
12
+ $withCart: Boolean = false
13
+ $withSobo: Boolean = false
14
+ ) {
15
+ sessionRead(withCart: $withCart, withSobo: $withSobo) {
16
+ ...SessionFragmentXS
17
+ }
18
+ }
19
+ `;
20
+
21
+ const SESSION_READ_SM = gql`
22
+ ${SESSION_FRAGMENT_SM}
23
+ query e4ReadSessionSM(
24
+ $withCart: Boolean = false
25
+ $withSobo: Boolean = false
26
+ ) {
27
+ sessionRead(withCart: $withCart, withSobo: $withSobo) {
28
+ ...SessionFragmentSM
29
+ }
30
+ }
31
+ `;
32
+
33
+ const SESSION_READ_MD = gql`
34
+ ${SESSION_FRAGMENT_MANAGEMENT_WITH_CLAIMS}
35
+ query e4ReadSessionMD(
36
+ $withCart: Boolean = false
37
+ $withSobo: Boolean = false
38
+ ) {
39
+ sessionRead(withCart: $withCart, withSobo: $withSobo) {
40
+ ...SessionFragmentManagementWithClaims
41
+ }
42
+ }
43
+ `;
@@ -0,0 +1,10 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ const CLEAR_CACHE = gql`
4
+ mutation clearCache {
5
+ clearCache {
6
+ prefix
7
+ count
8
+ }
9
+ }
10
+ `;
@@ -0,0 +1 @@
1
+ export * from "./interfaces";
@@ -0,0 +1,16 @@
1
+ export interface App {
2
+ plugins: [Plugin];
3
+ version: string;
4
+ environment: string;
5
+ }
6
+
7
+ export interface Plugin {
8
+ description: String;
9
+ displayName: String;
10
+ icon: String;
11
+ npmPackageName: String;
12
+ provider: String;
13
+ required: Boolean;
14
+ version: String;
15
+ launchedAt: String;
16
+ }
@@ -0,0 +1,20 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ const APP_INFO = gql`
4
+ query e4SystemInformation {
5
+ app {
6
+ plugins {
7
+ npmPackageName
8
+ version
9
+ displayName
10
+ icon
11
+ description
12
+ required
13
+ provider
14
+ }
15
+ version
16
+ environment
17
+ launchedAt
18
+ }
19
+ }
20
+ `;
@@ -0,0 +1,96 @@
1
+ import { gql } from "graphql-request";
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
+ `;
18
+
19
+ const GET_ALIASES = gql`
20
+ query aliases {
21
+ aliases {
22
+ alias
23
+ index
24
+ indexDetails {
25
+ id
26
+ health
27
+ index
28
+ docsCount
29
+ storeSize
30
+ }
31
+ }
32
+ }
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,124 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ interface ClaimTypeInput {
4
+ id: string | null;
5
+ name: string | null;
6
+ type: string | null;
7
+ }
8
+
9
+ const GET_CLAIM_TYPES = gql`
10
+ query claimTypes($type: String!) {
11
+ claimTypes(type: $type) {
12
+ id
13
+ type
14
+ name
15
+ }
16
+ }
17
+ `;
18
+
19
+ const CREATE_CLAIM_TYPE = gql`
20
+ mutation createClaimType($input: ClaimTypeInput) {
21
+ createClaimType(input: $input) {
22
+ id
23
+ type
24
+ name
25
+ }
26
+ }
27
+ `;
28
+
29
+ const DELETE_CLAIM_TYPE = gql`
30
+ mutation deleteClaimType($input: ClaimTypeInput) {
31
+ deleteClaimType(input: $input) {
32
+ id
33
+ type
34
+ name
35
+ }
36
+ }
37
+ `;
38
+
39
+ const CLAIMS_BY_ROLEID = gql`
40
+ query claimsByRoleId($roleId: String!) {
41
+ claims {
42
+ id
43
+ actionId
44
+ action
45
+ subjectId
46
+ subject
47
+ isCan
48
+ isPassThrough
49
+ claimType
50
+ }
51
+
52
+ claimsByRoleId(roleId: $roleId) {
53
+ id
54
+ actionId
55
+ action
56
+ subjectId
57
+ subject
58
+ isCan
59
+ isPassThrough
60
+ claimType
61
+ roleClaimId
62
+ }
63
+ }
64
+ `;
65
+
66
+ const GET_CLAIMS = gql`
67
+ query claims {
68
+ claims {
69
+ id
70
+ actionId
71
+ action
72
+ subjectId
73
+ subject
74
+ isCan
75
+ isPassThrough
76
+ claimType
77
+ }
78
+ }
79
+ `;
80
+
81
+ const CREATE_CLAIM = gql`
82
+ mutation createClaim($input: ClaimInput!) {
83
+ createClaim(input: $input) {
84
+ id
85
+ actionId
86
+ action
87
+ subjectId
88
+ subject
89
+ isCan
90
+ isPassThrough
91
+ claimType
92
+ }
93
+ }
94
+ `;
95
+
96
+ const DELETE_CLAIM = gql`
97
+ mutation deleteClaim($input: ClaimInput) {
98
+ deleteClaim(input: $input) {
99
+ id
100
+ }
101
+ }
102
+ `;
103
+
104
+ const CREATE_ROLE_CLAIM = gql`
105
+ mutation createRoleClaim($input: RoleClaimInput!) {
106
+ createRoleClaim(input: $input) {
107
+ id
108
+ roleId
109
+ claimId
110
+ claimValue
111
+ }
112
+ }
113
+ `;
114
+
115
+ const DELETE_ROLE_CLAIM = gql`
116
+ mutation deleteRoleClaim($input: RoleClaimInput!) {
117
+ deleteRoleClaim(input: $input) {
118
+ id
119
+ roleId
120
+ claimId
121
+ claimValue
122
+ }
123
+ }
124
+ `;
@@ -0,0 +1,133 @@
1
+ import { gql } from "graphql-request";
2
+ import addressFragment from "@evenicanpm/e4-shared-client-graphql/base/addressFragment";
3
+
4
+ const CONTACTS_BY_TYPE_ROLE = gql`
5
+ query contactsByTypeRole($type: Int!, $roleId: String) {
6
+ contactsByType(type: $type) {
7
+ nodes {
8
+ id
9
+ aspNetUserId
10
+ firstName
11
+ lastName
12
+ avatar
13
+ email
14
+ contactTypeId
15
+ contactStatusId
16
+ }
17
+ }
18
+
19
+ contactsByTypeRole(type: $type, roleId: $roleId) {
20
+ id
21
+ aspNetUserId
22
+ firstName
23
+ lastName
24
+ avatar
25
+ email
26
+ contactTypeId
27
+ contactStatusId
28
+ }
29
+ }
30
+ `;
31
+
32
+ const CONTACTS_BY_TYPE = gql`
33
+ query contactsByType($type: Int!, $filter: CollectionRequestInput) {
34
+ contactsByType(type: $type, filter: $filter) {
35
+ pageInfo {
36
+ resultsReturned
37
+ currentPage
38
+ top
39
+ skip
40
+ }
41
+ nodes {
42
+ id
43
+ firstName
44
+ lastName
45
+ email
46
+ avatar
47
+ defaultBillingAddress {
48
+ ...AddressFragment
49
+ }
50
+ }
51
+ recordCount
52
+ }
53
+ }
54
+ ${addressFragment}
55
+ `;
56
+
57
+ const CONTACT_DETAIL = gql`
58
+ query contact($id: String!) {
59
+ contact(id: $id) {
60
+ id
61
+ firstName
62
+ lastName
63
+ email
64
+ avatar
65
+ defaultBillingAddress {
66
+ ...AddressFragment
67
+ }
68
+ roles {
69
+ id
70
+ name
71
+ description
72
+ }
73
+ }
74
+ }
75
+ ${addressFragment}
76
+ `;
77
+
78
+ const UPDATE_CONTACT = gql`
79
+ mutation updateContact($contact: UpdateContactInput) {
80
+ updateContact(contact: $contact) {
81
+ id
82
+ accountId
83
+ code
84
+ email
85
+ contactId
86
+ defaultBillingAddressId
87
+ defaultShippingAddressId
88
+ firstName
89
+ fullName
90
+ lastName
91
+ }
92
+ }
93
+ `;
94
+
95
+ const GET_ROLES_BY_CONTACTS = gql`
96
+ query rolesByContact($id: String!) {
97
+ roles {
98
+ id
99
+ name
100
+ normalizedName
101
+ description
102
+ autoAssign
103
+ }
104
+
105
+ contact(id: $id) {
106
+ id
107
+ aspNetUserId
108
+ roles {
109
+ id
110
+ name
111
+ description
112
+ }
113
+ }
114
+ }
115
+ `;
116
+
117
+ const ADD_CONTACT_TO_ROLE = gql`
118
+ mutation assignUserContactToRole($input: UserRoleInput!) {
119
+ assignUserToRole(input: $input) {
120
+ userId
121
+ roleId
122
+ }
123
+ }
124
+ `;
125
+
126
+ const REMOVE_CONTACT_FROM_ROLE = gql`
127
+ mutation removeContactFromRole($input: UserRoleInput!) {
128
+ removeUserFromRole(input: $input) {
129
+ userId
130
+ roleId
131
+ }
132
+ }
133
+ `;
@@ -0,0 +1,12 @@
1
+ export * from "./aliases";
2
+ export * from "./indexes";
3
+ export * from "./words";
4
+
5
+ import "./aliases";
6
+ import "./claims";
7
+ import "./contacts";
8
+ import "./indexes";
9
+ import "./roles";
10
+ import "./settingsGroup";
11
+ import "./users";
12
+ import "./words";
@@ -0,0 +1,73 @@
1
+ import { gql } from "graphql-request";
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
+ `;
@@ -0,0 +1,93 @@
1
+ import { gql } from "graphql-request";
2
+
3
+ interface Role {
4
+ id: string | null;
5
+ name: string | null;
6
+ description: string | null;
7
+ autoAssign: number | null;
8
+ }
9
+
10
+ interface CreateRoleInput {
11
+ id: string | null;
12
+ name: string | null;
13
+ description: string | null;
14
+ autoAssign: number | null;
15
+ assignToExistingUsers: boolean | null;
16
+ }
17
+
18
+ const GET_ROLES = gql`
19
+ query roles($filter: CollectionRequestInput) {
20
+ roles(filter: $filter) {
21
+ id
22
+ name
23
+ normalizedName
24
+ description
25
+ autoAssign
26
+ claims {
27
+ id
28
+ actionId
29
+ action
30
+ subjectId
31
+ subject
32
+ isCan
33
+ isPassThrough
34
+ claimType
35
+ }
36
+ }
37
+ }
38
+ `;
39
+
40
+ const GET_ROLE = gql`
41
+ query role($id: ID!) {
42
+ role(id: $id) {
43
+ id
44
+ name
45
+ description
46
+ autoAssign
47
+ claims {
48
+ id
49
+ actionId
50
+ action
51
+ subjectId
52
+ subject
53
+ isPassThrough
54
+ claimType
55
+ roleClaimId
56
+ isCan
57
+ }
58
+ }
59
+ }
60
+ `;
61
+
62
+ const UPDATE_ROLE = gql`
63
+ mutation updateRole($role: CreateRoleInput!) {
64
+ updateRole(input: $role) {
65
+ id
66
+ name
67
+ description
68
+ autoAssign
69
+ }
70
+ }
71
+ `;
72
+
73
+ const DELETE_ROLE = gql`
74
+ mutation removeRole($role: RemoveRoleInput!) {
75
+ removeRole(input: $role) {
76
+ id
77
+ name
78
+ description
79
+ autoAssign
80
+ }
81
+ }
82
+ `;
83
+
84
+ const CREATE_ROLE = gql`
85
+ mutation createRole($role: CreateRoleInput!) {
86
+ createRole(input: $role) {
87
+ id
88
+ name
89
+ description
90
+ autoAssign
91
+ }
92
+ }
93
+ `;