@evenicanpm/storefront-graphql-codegen 1.2.1 → 1.4.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
@@ -1,7 +1,7 @@
1
1
  import type { CodegenConfig } from "@graphql-codegen/cli";
2
2
 
3
3
  const config: CodegenConfig = {
4
- schema: "https://api.e4.local/graphql",
4
+ schema: `${process.env.NEXT_PUBLIC_E4_API_ENDPOINT}/graphql`,
5
5
  documents: [
6
6
  "./documents/**/*.ts",
7
7
  "!./documents/core/**",
@@ -1,5 +1,5 @@
1
- import { Product } from "@evenicanpm/e4-shared-client-graphql/Product/interfaces";
2
1
  import { Address } from "@evenicanpm/e4-shared-client-graphql/Address/interfaces";
2
+ import { Product } from "@evenicanpm/e4-shared-client-graphql/Product/interfaces";
3
3
 
4
4
  export interface Image {
5
5
  id: string;
@@ -8,27 +8,27 @@ export interface Category {
8
8
  id?: any;
9
9
  rootId?: any;
10
10
  parentId?: any;
11
- name?: String;
12
- displayName?: String;
13
- code?: String;
11
+ name?: string;
12
+ displayName?: string;
13
+ code?: string;
14
14
  tier?: any;
15
15
  isLink?: any;
16
16
  categoryStatus?: any;
17
- extendedFields?: String;
17
+ extendedFields?: string;
18
18
  sort?: any;
19
- breadcrumbs?: String;
20
- breadcrumbIds?: String;
21
- seoCrumb?: String;
22
- created?: String;
19
+ breadcrumbs?: string;
20
+ breadcrumbIds?: string;
21
+ seoCrumb?: string;
22
+ created?: string;
23
23
  count?: any;
24
24
  hasChildren?: any;
25
25
  children?: [Category];
26
- _action?: String;
26
+ _action?: string;
27
27
  }
28
28
 
29
- export interface deleteItemFromCategoryInput {
29
+ export interface DeleteItemFromCategoryInput {
30
30
  categoryId?: any;
31
31
  productId?: any;
32
32
  sort?: any;
33
- _action?: String;
33
+ _action?: string;
34
34
  }
@@ -1,5 +1,4 @@
1
1
  import { gql } from "graphql-request";
2
- import _get from "lodash/get";
3
2
  import { categoryFragment, categoryStatusFragment } from "./fragments";
4
3
 
5
4
  const CATEGORY_LIST = gql`
@@ -1,5 +1,4 @@
1
1
  import { gql } from "graphql-request";
2
- import _get from "lodash/get";
3
2
  import { categoryFragment, categoryStatusFragment } from "./fragments";
4
3
 
5
4
  const CATEGORY_READ = gql`
@@ -1,5 +1,4 @@
1
1
  import { gql } from "graphql-request";
2
- import _get from "lodash/get";
3
2
  import { categoryStatusFragment } from "./fragments";
4
3
 
5
4
  const CATEGORY_STATUS_LIST = gql`
@@ -1,6 +1,5 @@
1
1
  import { gql } from "graphql-request";
2
-
3
- import { PRODUCT_FRAGMENT_MD, PRODUCT_FRAGMENT_LG } from "../Product/fragments";
2
+ import { PRODUCT_FRAGMENT_LG } from "../Product/fragments";
4
3
  import { ADDRESS_FRAGMENT } from "../Address/fragments";
5
4
 
6
5
  export const ORDER_FRAGMENT_XS = gql`
@@ -1,7 +1,5 @@
1
1
  import { gql } from "graphql-request";
2
2
 
3
- // GraphQL
4
- // import { PAGE_INFO } from "../base/fragments";
5
3
  import {
6
4
  ORDER_FRAGMENT_XS,
7
5
  ORDER_FRAGMENT_SM,
@@ -1,5 +1,5 @@
1
- import { Category, Breadcrumb } from "../Category/interfaces";
2
-
1
+ import type { Category } from "../Category/interfaces";
2
+ export type { Category, Breadcrumb } from "../Category/interfaces";
3
3
  export interface Product {
4
4
  id: string;
5
5
  code?: string;
@@ -41,5 +41,3 @@ export interface Product {
41
41
  uom?: any;
42
42
  isInWishList?: boolean;
43
43
  }
44
-
45
- export type { Category, Breadcrumb };
@@ -3,8 +3,7 @@ import {
3
3
  PRODUCT_FRAGMENT_XS,
4
4
  PRODUCT_FRAGMENT_SM,
5
5
  PRODUCT_FRAGMENT_MD,
6
- PRODUCT_FRAGMENT_LG,
7
- REVIEW_FRAGMENT,
6
+ PRODUCT_FRAGMENT_LG
8
7
  } from "./fragments";
9
8
 
10
9
  const PRODUCT_READ_XS = gql`
@@ -54,17 +53,3 @@ const PRODUCT_READ_LG = gql`
54
53
  }
55
54
  }
56
55
  `;
57
-
58
- // const PRODUCT_READ_W_REVIEWS = gql`
59
- // ${PRODUCT_FRAGMENT_MD}
60
- // ${REVIEW_FRAGMENT}
61
- // query e4ProductReadMD(
62
- // $id: String!
63
- // $productLookupType: ProductLookupType! = CODE
64
- // ) {
65
- // product(id: $id, productLookupType: $productLookupType) {
66
- // ...ProductFragmentMD
67
- // ...ProductReview
68
- // }
69
- // }
70
- // `;
@@ -1,6 +1,6 @@
1
1
  import { gql } from "graphql-request";
2
2
 
3
- import { CART_FRAGMENT_MD, CART_FRAGMENT_LG } from "../Cart/fragments";
3
+ import { CART_FRAGMENT_LG } from "../Cart/fragments";
4
4
 
5
5
  export const SESSION_FRAGMENT_XS = gql`
6
6
  fragment SessionFragmentXS on Session {
@@ -1,6 +1,6 @@
1
1
  import { gql } from "graphql-request";
2
2
 
3
- import { SESSION_FRAGMENT_XS, SESSION_FRAGMENT_SM } from "./fragments";
3
+ import { SESSION_FRAGMENT_SM, SESSION_FRAGMENT_XS } from "./fragments";
4
4
 
5
5
  const SESSION_LOGIN_XS = gql`
6
6
  ${SESSION_FRAGMENT_XS}
@@ -5,12 +5,12 @@ export interface App {
5
5
  }
6
6
 
7
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;
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
16
  }
@@ -162,7 +162,7 @@ const SELECTED_THEME = gql`
162
162
  `;
163
163
 
164
164
  /**
165
- * FIXME: Currently using Developer created interfaces for datachecking
165
+ * Currently using Developer created interfaces for datachecking
166
166
  * Upgrade to generated types
167
167
  */
168
168
 
@@ -173,7 +173,7 @@ export interface SettingGroup {
173
173
  settings: Settings;
174
174
  }
175
175
 
176
- export interface settingsGroup {
176
+ export interface SettingsGroup {
177
177
  code: string;
178
178
  id: string;
179
179
  name: string;
@@ -205,13 +205,13 @@ export interface SettingData {
205
205
  themeListList?: ThemeInputBase[];
206
206
  }
207
207
 
208
- export interface getAllOrderAddressTypes {
208
+ export interface GetAllOrderAddressTypes {
209
209
  id: string;
210
210
  displayName: string;
211
211
  name: string;
212
212
  }
213
213
 
214
- export interface getAllOrderTransactStatus {
214
+ export interface GetAllOrderTransactStatus {
215
215
  id: string;
216
216
  code: string;
217
217
  name: string;
@@ -224,7 +224,7 @@ export interface TransactStatus {
224
224
  }
225
225
 
226
226
  export interface TransactStatusEdge {
227
- cursor: String;
227
+ cursor: string;
228
228
  node: TransactStatus;
229
229
  }
230
230
 
@@ -235,7 +235,7 @@ export interface TransactStatusWrapper {
235
235
  recordCount: number;
236
236
  }
237
237
  export interface AddressTypeEdge {
238
- cursor: String;
238
+ cursor: string;
239
239
  node: any;
240
240
  }
241
241
 
@@ -1,4 +1,5 @@
1
- import { Address } from "../Address";
1
+ import type { Address } from "../Address";
2
+ export type { Address } from "../Address";
2
3
 
3
4
  export interface Me {
4
5
  id: string;
@@ -25,5 +26,3 @@ export interface RegistrationInput {
25
26
  address?: Address | null;
26
27
  orderNumber?: string | null;
27
28
  }
28
-
29
- export type { Address };
@@ -1,6 +1,4 @@
1
1
  import { gql } from "graphql-request";
2
-
3
- import { PAGE_INFO } from "../base/pageInfoFragments";
4
2
  import { PRODUCT_FRAGMENT_MD, PRODUCT_FRAGMENT_LG } from "../Product/fragments";
5
3
 
6
4
  export const WISHLIST_FRAGMENT_XS = gql`
@@ -23,7 +23,7 @@ export interface AddToWishlistInput {
23
23
  unitOfMeasureId?: string;
24
24
  }
25
25
 
26
- export interface deleteItemFromWishlistInput {
26
+ export interface DeleteItemFromWishlistInput {
27
27
  wishlistId: string;
28
28
  productId: string;
29
29
  quantityRequested?: number;
@@ -87,7 +87,6 @@ export const SAMPLE_DATA_LIST_LG_PN = gql`
87
87
 
88
88
  // ENDLESS
89
89
  export const SAMPLE_DATA_LIST_XS_EL = gql`
90
- <<<<<<< HEAD
91
90
  ${PAGE_INFO_ENDLESS}
92
91
  ${SAMPLE_DATA_FRAGMENT_XS}
93
92
  query e4SampleDataListXS_Endless(
@@ -161,73 +160,4 @@ export const SAMPLE_DATA_LIST_LG_EL = gql`
161
160
  }
162
161
  }
163
162
  }
164
- =======
165
- ${PAGE_INFO_ENDLESS}
166
- ${SAMPLE_DATA_FRAGMENT_XS}
167
- query e4SampleDataListXS_Endless($input: SampleDataInputList, $withExtendedFields: Boolean = false) {
168
- sampleDataList(input: $input, withExtendedFields: $withExtendedFields) {
169
- recordCount
170
- pageInfo {
171
- ...PageInfoEndless
172
- }
173
- nodes {
174
- ...SampleDataFragmentXS
175
- }
176
- }
177
- }
178
- `;
179
-
180
- export const SAMPLE_DATA_LIST_SM_EL = gql`
181
- ${PAGE_INFO_ENDLESS}
182
- ${SAMPLE_DATA_FRAGMENT_SM}
183
- query e4SampleDataListSM_Endless(
184
- $input: SampleDataInputList
185
- $withExtendedFields: Boolean = false
186
- ) {
187
- sampleDataList(input: $input, withExtendedFields: $withExtendedFields) {
188
- recordCount
189
- pageInfo {
190
- ...PageInfoEndless
191
- }
192
- nodes {
193
- ...SampleDataFragmentSM
194
- }
195
- }
196
- }
197
- `;
198
-
199
- export const SAMPLE_DATA_LIST_MD_EL = gql`
200
- ${PAGE_INFO_ENDLESS}
201
- ${SAMPLE_DATA_FRAGMENT_MD}
202
- query e4SampleDataListMD_Endless(
203
- $input: SampleDataInputList
204
- $withExtendedFields: Boolean = false
205
- ) {
206
- sampleDataList(input: $input, withExtendedFields: $withExtendedFields) {
207
- recordCount
208
- pageInfo {
209
- ...PageInfoEndless
210
- }
211
- nodes {
212
- ...SampleDataFragmentMD
213
- }
214
- }
215
- }
216
- `;
217
-
218
- export const SAMPLE_DATA_LIST_LG_EL = gql`
219
- ${PAGE_INFO_ENDLESS}
220
- ${SAMPLE_DATA_FRAGMENT_LG}
221
- query e4SampleDataListLG_Endless($input: SampleDataInputList, $withExtendedFields: Boolean = false) {
222
- sampleDataList(input: $input, withExtendedFields: $withExtendedFields) {
223
- recordCount
224
- pageInfo {
225
- ...PageInfoEndless
226
- }
227
- nodes {
228
- ...SampleDataFragmentLG
229
- }
230
- }
231
- }
232
- >>>>>>> develop
233
163
  `;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@evenicanpm/storefront-graphql-codegen",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "",
7
7
  "license": "ISC",
8
- "gitHead": "05e037ddd9e776f5f41bbd487d16a1c1bb2a179b",
8
+ "gitHead": "0614726ec6b7ce9564706514a6b756b390a13e96",
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",
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "node",
6
+
7
+ "esModuleInterop": true,
8
+ "allowSyntheticDefaultImports": true,
9
+
10
+ "strict": false,
11
+ "skipLibCheck": true,
12
+
13
+ "noEmit": true,
14
+ "types": ["node"]
15
+ },
16
+ "include": ["codegen.ts", "documents/**/*.ts"]
17
+ }
@@ -1,11 +0,0 @@
1
- import { gql } from "graphql-request";
2
-
3
- // const SERVER_CACHE_PRODUCT_INDEX = gql`
4
- // mutation reindex {
5
- // reindex {
6
- // index
7
- // id
8
- // status
9
- // }
10
- // }
11
- // `;