@whizzes/wsfc 0.0.1-early-dev-8 → 0.0.1-early-dev-10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whizzes/wsfc",
3
- "version": "0.0.1-early-dev-8",
3
+ "version": "0.0.1-early-dev-10",
4
4
  "main": "./src/index.ts",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./src/index.d.ts",
@@ -0,0 +1,9 @@
1
+ query CategoriesList($channel: ChannelCode!) {
2
+ categories(channelCode: $channel) {
3
+ edges {
4
+ node {
5
+ ...CategoriesListFields
6
+ }
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,11 @@
1
+ fragment CategoriesListFields on Category {
2
+ channelCode
3
+ id
4
+ name
5
+ description
6
+ path
7
+ position
8
+ isActive
9
+ createdAt
10
+ updatedAt
11
+ }
@@ -0,0 +1 @@
1
+ export { CategoryService } from './service';
@@ -0,0 +1,31 @@
1
+ import { WizardGraphQLClient } from "../../client";
2
+ import { CategoriesListDocument } from "../../types";
3
+
4
+ import type { Client } from "@urql/core";
5
+ import type { CategoriesListFieldsFragment } from "../../types";
6
+
7
+ export class CategoryService extends WizardGraphQLClient<unknown> {
8
+ private channel: string;
9
+
10
+ constructor(urqlClient: Client, channel: string) {
11
+ super(urqlClient);
12
+
13
+ this.channel = channel;
14
+ }
15
+
16
+ async listCategories(): Promise<CategoriesListFieldsFragment[]> {
17
+ const response = await this.client
18
+ .query(CategoriesListDocument, {
19
+ channel: this.channel,
20
+ })
21
+ .toPromise();
22
+
23
+ this.unwrapError(response, "categories");
24
+
25
+ return (
26
+ response.data?.categories?.edges?.map(
27
+ (edge: { node: CategoriesListFieldsFragment }) => edge.node,
28
+ ) || []
29
+ );
30
+ }
31
+ }
@@ -5,21 +5,20 @@ import {
5
5
 
6
6
  import type { Client } from '@urql/core';
7
7
  import type {
8
- ProductErrorCode,
9
8
  ProductsListFieldsFragment
10
9
  } from '../../types';
11
10
 
12
- export class ProductService extends WizardGraphQLClient<ProductErrorCode> {
13
- constructor(urqlClient: Client) {
11
+ export class ProductService extends WizardGraphQLClient<unknown> {
12
+ private channel: string;
13
+
14
+ constructor(urqlClient: Client, channel: string) {
14
15
  super(urqlClient);
15
16
  }
16
17
 
17
- async listProducts(
18
- channel: string,
19
- ): Promise<ProductsListFieldsFragment[]> {
18
+ async listProducts(): Promise<ProductsListFieldsFragment[]> {
20
19
  const response = await this.client
21
20
  .query(ProductsListDocument, {
22
- channel
21
+ channel: this.channel
23
22
  })
24
23
  .toPromise();
25
24
 
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './core/product';
2
2
 
3
+ import { CategoryService } from './core/category';
3
4
  import { ProductService } from './core/product';
4
5
 
5
6
  import type { Client as URQLClient } from '@urql/core';
@@ -7,11 +8,13 @@ import type { Client as URQLClient } from '@urql/core';
7
8
  export class WizardStorefrontClient {
8
9
  readonly baseURL: URL;
9
10
  readonly urqlClient: URQLClient;
11
+ readonly category: CategoryService;
10
12
  readonly product: ProductService;
11
13
 
12
- constructor(baseURL: URL, graphQLClient: URQLClient) {
14
+ constructor(baseURL: URL, graphQLClient: URQLClient, channelCode: string) {
13
15
  this.baseURL = baseURL;
14
16
  this.urqlClient = graphQLClient;
15
- this.product = new ProductService(graphQLClient);
17
+ this.category = new CategoryService(graphQLClient, channelCode);
18
+ this.product = new ProductService(graphQLClient, channelCode);
16
19
  }
17
20
  }
@@ -18,45 +18,17 @@ export type Scalars = {
18
18
  ChannelCode: { input: any; output: any; }
19
19
  DateTime: { input: any; output: any; }
20
20
  Decimal: { input: any; output: any; }
21
- Email: { input: any; output: any; }
22
- JsonSchema: { input: any; output: any; }
23
21
  JsonString: { input: any; output: any; }
24
22
  Slug: { input: any; output: any; }
25
23
  UUID: { input: any; output: any; }
26
- Upload: { input: any; output: any; }
27
24
  };
28
25
 
29
- export type ActorType = {
30
- __typename?: 'ActorType';
31
- actorId: Scalars['String']['output'];
32
- actorType: ActorTypeKind;
33
- };
34
-
35
- export enum ActorTypeKind {
36
- Admin = 'ADMIN',
37
- Customer = 'CUSTOMER',
38
- Integration = 'INTEGRATION',
39
- Service = 'SERVICE',
40
- Storefront = 'STOREFRONT'
41
- }
42
-
43
- export type AuthError = {
44
- __typename?: 'AuthError';
45
- code: AuthErrorCode;
46
- message: Scalars['String']['output'];
47
- };
48
-
49
- export enum AuthErrorCode {
50
- InvalidCredentials = 'INVALID_CREDENTIALS',
51
- Unauthorized = 'UNAUTHORIZED',
52
- Unknown = 'UNKNOWN'
53
- }
54
-
55
26
  /** Platform Category belonging to a Channel. */
56
27
  export type Category = {
57
28
  __typename?: 'Category';
58
29
  channelCode: Scalars['ChannelCode']['output'];
59
30
  createdAt: Scalars['DateTime']['output'];
31
+ description: Scalars['JsonString']['output'];
60
32
  id: Scalars['UUID']['output'];
61
33
  isActive: Scalars['Boolean']['output'];
62
34
  name: Scalars['String']['output'];
@@ -77,24 +49,6 @@ export type CategoryConnection = {
77
49
  totalPages: Scalars['Int']['output'];
78
50
  };
79
51
 
80
- export type CategoryCreate = {
81
- __typename?: 'CategoryCreate';
82
- category?: Maybe<Category>;
83
- error?: Maybe<CategoryError>;
84
- };
85
-
86
- export type CategoryCreateInput = {
87
- isActive: Scalars['Boolean']['input'];
88
- name: Scalars['String']['input'];
89
- path: Array<Scalars['CategoryLabel']['input']>;
90
- position: Scalars['Int']['input'];
91
- };
92
-
93
- export type CategoryDelete = {
94
- __typename?: 'CategoryDelete';
95
- error?: Maybe<CategoryError>;
96
- };
97
-
98
52
  /** An edge in a connection. */
99
53
  export type CategoryEdge = {
100
54
  __typename?: 'CategoryEdge';
@@ -104,236 +58,10 @@ export type CategoryEdge = {
104
58
  node: Category;
105
59
  };
106
60
 
107
- export type CategoryError = {
108
- __typename?: 'CategoryError';
109
- code: CategoryErrorCode;
110
- message: Scalars['String']['output'];
111
- };
112
-
113
- export enum CategoryErrorCode {
114
- DatabaseError = 'DATABASE_ERROR'
115
- }
116
-
117
- /** A user's Channel Role */
118
- export type ChannelRole = {
119
- __typename?: 'ChannelRole';
120
- channel: Scalars['ChannelCode']['output'];
121
- role: Role;
122
- };
123
-
124
- export type CmsError = {
125
- __typename?: 'CmsError';
126
- code: CmsErrorCode;
127
- message: Scalars['String']['output'];
128
- };
129
-
130
- export enum CmsErrorCode {
131
- CollectionContentTypeMismatch = 'COLLECTION_CONTENT_TYPE_MISMATCH',
132
- EntryCollectionMismatch = 'ENTRY_COLLECTION_MISMATCH',
133
- EntryValidationError = 'ENTRY_VALIDATION_ERROR',
134
- FieldAlreadyExists = 'FIELD_ALREADY_EXISTS',
135
- SerdeError = 'SERDE_ERROR',
136
- Unknown = 'UNKNOWN'
137
- }
138
-
139
- /** CMS Content-Type */
140
- export type ContentType = {
141
- __typename?: 'ContentType';
142
- channelCode: Scalars['ChannelCode']['output'];
143
- createdAt: Scalars['DateTime']['output'];
144
- name: Scalars['String']['output'];
145
- schema: Scalars['JsonSchema']['output'];
146
- slug: Scalars['Slug']['output'];
147
- updatedAt: Scalars['DateTime']['output'];
148
- };
149
-
150
- export type ContentTypeConnection = {
151
- __typename?: 'ContentTypeConnection';
152
- /** A list of edges. */
153
- edges: Array<ContentTypeEdge>;
154
- /** A list of nodes. */
155
- nodes: Array<ContentType>;
156
- /** Information to aid in pagination. */
157
- pageInfo: PageInfo;
158
- totalCount: Scalars['Int']['output'];
159
- totalPages: Scalars['Int']['output'];
160
- };
161
-
162
- export type ContentTypeCreate = {
163
- __typename?: 'ContentTypeCreate';
164
- contentType?: Maybe<ContentType>;
165
- error?: Maybe<CmsError>;
166
- };
167
-
168
- export type ContentTypeCreateInput = {
169
- name: Scalars['String']['input'];
170
- schema: Scalars['JsonSchema']['input'];
171
- slug: Scalars['Slug']['input'];
172
- };
173
-
174
- /** An edge in a connection. */
175
- export type ContentTypeEdge = {
176
- __typename?: 'ContentTypeEdge';
177
- /** A cursor for use in pagination */
178
- cursor: Scalars['String']['output'];
179
- /** The item at the end of the edge */
180
- node: ContentType;
181
- };
182
-
183
- /** Platform Customer belonging to a Channel. */
184
- export type Customer = {
185
- __typename?: 'Customer';
186
- channelCode: Scalars['ChannelCode']['output'];
187
- createdAt: Scalars['DateTime']['output'];
188
- deletedAt?: Maybe<Scalars['DateTime']['output']>;
189
- email?: Maybe<Scalars['Email']['output']>;
190
- id: Scalars['UUID']['output'];
191
- name: Scalars['String']['output'];
192
- phoneNumber?: Maybe<Scalars['String']['output']>;
193
- surname?: Maybe<Scalars['String']['output']>;
194
- updatedAt: Scalars['DateTime']['output'];
195
- };
196
-
197
- export type CustomerConnection = {
198
- __typename?: 'CustomerConnection';
199
- /** A list of edges. */
200
- edges: Array<CustomerEdge>;
201
- /** A list of nodes. */
202
- nodes: Array<Customer>;
203
- /** Information to aid in pagination. */
204
- pageInfo: PageInfo;
205
- totalCount: Scalars['Int']['output'];
206
- totalPages: Scalars['Int']['output'];
207
- };
208
-
209
- export type CustomerCreate = {
210
- __typename?: 'CustomerCreate';
211
- customer?: Maybe<Customer>;
212
- error?: Maybe<CustomerError>;
213
- };
214
-
215
- export type CustomerCreateInput = {
216
- email: Scalars['Email']['input'];
217
- name: Scalars['String']['input'];
218
- phone?: InputMaybe<Scalars['String']['input']>;
219
- surname?: InputMaybe<Scalars['String']['input']>;
220
- };
221
-
222
- /** An edge in a connection. */
223
- export type CustomerEdge = {
224
- __typename?: 'CustomerEdge';
225
- /** A cursor for use in pagination */
226
- cursor: Scalars['String']['output'];
227
- /** The item at the end of the edge */
228
- node: Customer;
229
- };
230
-
231
- export type CustomerError = {
232
- __typename?: 'CustomerError';
233
- code: CustomerErrorCode;
234
- message: Scalars['String']['output'];
235
- };
236
-
237
- export enum CustomerErrorCode {
238
- DatabaseError = 'DATABASE_ERROR'
239
- }
240
-
241
- export type EntriesFilterInput = {
242
- collectionSlug: Scalars['Slug']['input'];
243
- };
244
-
245
- /** CMS Entry */
246
- export type Entry = {
247
- __typename?: 'Entry';
248
- channelCode: Scalars['ChannelCode']['output'];
249
- collectionSlug: Scalars['Slug']['output'];
250
- createdAt: Scalars['DateTime']['output'];
251
- id: Scalars['UUID']['output'];
252
- updatedAt: Scalars['DateTime']['output'];
253
- value: Scalars['JsonString']['output'];
254
- };
255
-
256
- /** CMS Collection */
257
- export type EntryCollection = {
258
- __typename?: 'EntryCollection';
259
- channelCode: Scalars['ChannelCode']['output'];
260
- contentTypeSlug: Scalars['Slug']['output'];
261
- createdAt: Scalars['DateTime']['output'];
262
- description?: Maybe<Scalars['String']['output']>;
263
- name: Scalars['String']['output'];
264
- slug: Scalars['Slug']['output'];
265
- updatedAt: Scalars['DateTime']['output'];
266
- };
267
-
268
- export type EntryCollectionConnection = {
269
- __typename?: 'EntryCollectionConnection';
270
- /** A list of edges. */
271
- edges: Array<EntryCollectionEdge>;
272
- /** A list of nodes. */
273
- nodes: Array<EntryCollection>;
274
- /** Information to aid in pagination. */
275
- pageInfo: PageInfo;
276
- totalCount: Scalars['Int']['output'];
277
- totalPages: Scalars['Int']['output'];
278
- };
279
-
280
- export type EntryCollectionCreate = {
281
- __typename?: 'EntryCollectionCreate';
282
- collection?: Maybe<EntryCollection>;
283
- error?: Maybe<CmsError>;
284
- };
285
-
286
- export type EntryCollectionCreateInput = {
287
- contentTypeSlug: Scalars['Slug']['input'];
288
- description?: InputMaybe<Scalars['String']['input']>;
289
- name: Scalars['String']['input'];
290
- slug: Scalars['Slug']['input'];
291
- };
292
-
293
- /** An edge in a connection. */
294
- export type EntryCollectionEdge = {
295
- __typename?: 'EntryCollectionEdge';
296
- /** A cursor for use in pagination */
297
- cursor: Scalars['String']['output'];
298
- /** The item at the end of the edge */
299
- node: EntryCollection;
300
- };
301
-
302
- export type EntryConnection = {
303
- __typename?: 'EntryConnection';
304
- /** A list of edges. */
305
- edges: Array<EntryEdge>;
306
- /** A list of nodes. */
307
- nodes: Array<Entry>;
308
- /** Information to aid in pagination. */
309
- pageInfo: PageInfo;
310
- totalCount: Scalars['Int']['output'];
311
- totalPages: Scalars['Int']['output'];
312
- };
313
-
314
- export type EntryCreate = {
315
- __typename?: 'EntryCreate';
316
- entry?: Maybe<Entry>;
317
- error?: Maybe<CmsError>;
318
- };
319
-
320
- export type EntryCreateInput = {
321
- collectionSlug: Scalars['Slug']['input'];
322
- value: Scalars['JsonString']['input'];
323
- };
324
-
325
- /** An edge in a connection. */
326
- export type EntryEdge = {
327
- __typename?: 'EntryEdge';
328
- /** A cursor for use in pagination */
329
- cursor: Scalars['String']['output'];
330
- /** The item at the end of the edge */
331
- node: Entry;
332
- };
333
-
334
61
  /** Platform Image */
335
62
  export type Image = {
336
63
  __typename?: 'Image';
64
+ alt?: Maybe<Scalars['String']['output']>;
337
65
  channelCode: Scalars['ChannelCode']['output'];
338
66
  createdAt: Scalars['DateTime']['output'];
339
67
  height: Scalars['Int']['output'];
@@ -379,22 +107,6 @@ export enum Iso4217 {
379
107
  Ved = 'VED'
380
108
  }
381
109
 
382
- export type MagicLinkSend = {
383
- __typename?: 'MagicLinkSend';
384
- error?: Maybe<AuthError>;
385
- };
386
-
387
- export type MagicLinkVerify = {
388
- __typename?: 'MagicLinkVerify';
389
- error?: Maybe<AuthError>;
390
- };
391
-
392
- export type Me = {
393
- __typename?: 'Me';
394
- error?: Maybe<AuthError>;
395
- user?: Maybe<User>;
396
- };
397
-
398
110
  /**
399
111
  * Image file MIME Types
400
112
  *
@@ -415,289 +127,6 @@ export enum MimeType {
415
127
  Webp = 'WEBP'
416
128
  }
417
129
 
418
- export type Mutation = {
419
- __typename?: 'Mutation';
420
- /** Creates a Category */
421
- categoryCreate: CategoryCreate;
422
- /** Deletes a Category */
423
- categoryDelete: CategoryDelete;
424
- /** Creates a CMS Content-Type */
425
- contentTypeCreate: ContentTypeCreate;
426
- /** Creates a Customer */
427
- customerCreate: CustomerCreate;
428
- /** Creates a CMS Entry Collection */
429
- entryCollectionCreate: EntryCollectionCreate;
430
- /** Creates a CMS Entry */
431
- entryCreate: EntryCreate;
432
- magicLinkSend: MagicLinkSend;
433
- magicLinkVerify: MagicLinkVerify;
434
- /**
435
- * Creates a order.
436
- * This order is created with a default status of `Cart`.
437
- */
438
- orderCreate: OrderCreate;
439
- /** Update the customer of an order. */
440
- orderCustomerUpdate: OrderCustomerUpdate;
441
- /** Add line item to an order. */
442
- orderLineItemAdd: OrderLineItemAdd;
443
- /** Appends a Category to a Product */
444
- productCategoryAppend: ProductCategoryAppend;
445
- /** Creates a Product */
446
- productCreate: ProductCreate;
447
- /** Updates a Product */
448
- productUpdate: ProductUpdate;
449
- /**
450
- * start checkout process
451
- * This will update the order status to `Address` or `Payment` depending on the order type.
452
- */
453
- startCheckout: OrderStartCheckout;
454
- /** List Users */
455
- userCreate: UserCreate;
456
- /** Uploads an Image and attaches it to a Product Variant */
457
- variantImageUpload: VariantImageUpload;
458
- /** Creates a price for a Product Variant */
459
- variantPriceCreate: VariantPriceCreate;
460
- };
461
-
462
-
463
- export type MutationCategoryCreateArgs = {
464
- channel: Scalars['ChannelCode']['input'];
465
- input: CategoryCreateInput;
466
- };
467
-
468
-
469
- export type MutationCategoryDeleteArgs = {
470
- channel: Scalars['ChannelCode']['input'];
471
- path: Array<Scalars['CategoryLabel']['input']>;
472
- };
473
-
474
-
475
- export type MutationContentTypeCreateArgs = {
476
- channel: Scalars['ChannelCode']['input'];
477
- input: ContentTypeCreateInput;
478
- };
479
-
480
-
481
- export type MutationCustomerCreateArgs = {
482
- channel: Scalars['ChannelCode']['input'];
483
- input: CustomerCreateInput;
484
- };
485
-
486
-
487
- export type MutationEntryCollectionCreateArgs = {
488
- channel: Scalars['ChannelCode']['input'];
489
- input: EntryCollectionCreateInput;
490
- };
491
-
492
-
493
- export type MutationEntryCreateArgs = {
494
- channel: Scalars['ChannelCode']['input'];
495
- input: EntryCreateInput;
496
- };
497
-
498
-
499
- export type MutationMagicLinkSendArgs = {
500
- email: Scalars['Email']['input'];
501
- };
502
-
503
-
504
- export type MutationMagicLinkVerifyArgs = {
505
- email: Scalars['Email']['input'];
506
- token: Scalars['String']['input'];
507
- };
508
-
509
-
510
- export type MutationOrderCreateArgs = {
511
- channel: Scalars['ChannelCode']['input'];
512
- input: OrderCreateInput;
513
- };
514
-
515
-
516
- export type MutationOrderCustomerUpdateArgs = {
517
- channel: Scalars['ChannelCode']['input'];
518
- input: OrderCustomerUpdateInput;
519
- };
520
-
521
-
522
- export type MutationOrderLineItemAddArgs = {
523
- channel: Scalars['ChannelCode']['input'];
524
- input: OrderLineItemAddInput;
525
- };
526
-
527
-
528
- export type MutationProductCategoryAppendArgs = {
529
- channel: Scalars['ChannelCode']['input'];
530
- input: ProductCategoryAppendInput;
531
- };
532
-
533
-
534
- export type MutationProductCreateArgs = {
535
- channel: Scalars['ChannelCode']['input'];
536
- input: ProductCreateInput;
537
- };
538
-
539
-
540
- export type MutationProductUpdateArgs = {
541
- channel: Scalars['ChannelCode']['input'];
542
- id: Scalars['UUID']['input'];
543
- input: ProductUpdateInput;
544
- };
545
-
546
-
547
- export type MutationStartCheckoutArgs = {
548
- channel: Scalars['ChannelCode']['input'];
549
- input: OrderStartCheckoutInput;
550
- };
551
-
552
-
553
- export type MutationUserCreateArgs = {
554
- channelCode: Scalars['ChannelCode']['input'];
555
- };
556
-
557
-
558
- export type MutationVariantImageUploadArgs = {
559
- channel: Scalars['ChannelCode']['input'];
560
- input: VariantImageUploadInput;
561
- };
562
-
563
-
564
- export type MutationVariantPriceCreateArgs = {
565
- channel: Scalars['ChannelCode']['input'];
566
- input: VariantPriceCreateInput;
567
- };
568
-
569
- /** Platform Order belonging to a Channel. */
570
- export type Order = {
571
- __typename?: 'Order';
572
- channelCode: Scalars['ChannelCode']['output'];
573
- createdAt: Scalars['DateTime']['output'];
574
- customer: Customer;
575
- customerId?: Maybe<Scalars['UUID']['output']>;
576
- id: Scalars['UUID']['output'];
577
- lineItems: Array<OrderLineItem>;
578
- orderEvents: Array<OrderEvent>;
579
- orderNumber: Scalars['Int']['output'];
580
- state: OrderState;
581
- total: Scalars['Decimal']['output'];
582
- updatedAt: Scalars['DateTime']['output'];
583
- };
584
-
585
- export enum OrderAction {
586
- AddAddress = 'ADD_ADDRESS',
587
- AddPayment = 'ADD_PAYMENT',
588
- Advance = 'ADVANCE',
589
- CancelOrder = 'CANCEL_ORDER',
590
- ConfirmOrder = 'CONFIRM_ORDER',
591
- Revert = 'REVERT',
592
- SelectDelivery = 'SELECT_DELIVERY',
593
- StartCheckout = 'START_CHECKOUT'
594
- }
595
-
596
- export type OrderConnection = {
597
- __typename?: 'OrderConnection';
598
- /** A list of edges. */
599
- edges: Array<OrderEdge>;
600
- /** A list of nodes. */
601
- nodes: Array<Order>;
602
- /** Information to aid in pagination. */
603
- pageInfo: PageInfo;
604
- totalCount: Scalars['Int']['output'];
605
- totalPages: Scalars['Int']['output'];
606
- };
607
-
608
- export type OrderCreate = {
609
- __typename?: 'OrderCreate';
610
- error?: Maybe<OrderError>;
611
- order?: Maybe<Order>;
612
- };
613
-
614
- export type OrderCreateInput = {
615
- customerId?: InputMaybe<Scalars['UUID']['input']>;
616
- };
617
-
618
- export type OrderCustomerUpdate = {
619
- __typename?: 'OrderCustomerUpdate';
620
- error?: Maybe<OrderError>;
621
- order?: Maybe<Order>;
622
- };
623
-
624
- export type OrderCustomerUpdateInput = {
625
- customerId: Scalars['UUID']['input'];
626
- orderId: Scalars['UUID']['input'];
627
- };
628
-
629
- /** An edge in a connection. */
630
- export type OrderEdge = {
631
- __typename?: 'OrderEdge';
632
- /** A cursor for use in pagination */
633
- cursor: Scalars['String']['output'];
634
- /** The item at the end of the edge */
635
- node: Order;
636
- };
637
-
638
- export type OrderError = {
639
- __typename?: 'OrderError';
640
- code: OrderErrorCode;
641
- message: Scalars['String']['output'];
642
- };
643
-
644
- export enum OrderErrorCode {
645
- DatabaseError = 'DATABASE_ERROR'
646
- }
647
-
648
- export type OrderEvent = {
649
- __typename?: 'OrderEvent';
650
- action: OrderAction;
651
- actor?: Maybe<ActorType>;
652
- eventTimestamp: Scalars['DateTime']['output'];
653
- };
654
-
655
- export type OrderLineItem = {
656
- __typename?: 'OrderLineItem';
657
- channelCode: Scalars['ChannelCode']['output'];
658
- createdAt: Scalars['DateTime']['output'];
659
- id: Scalars['UUID']['output'];
660
- orderId: Scalars['UUID']['output'];
661
- quantity: Scalars['Int']['output'];
662
- totalPrice: Scalars['Decimal']['output'];
663
- unitPrice: Scalars['Decimal']['output'];
664
- updatedAt: Scalars['DateTime']['output'];
665
- variant: Variant;
666
- variantId: Scalars['UUID']['output'];
667
- };
668
-
669
- export type OrderLineItemAdd = {
670
- __typename?: 'OrderLineItemAdd';
671
- error?: Maybe<OrderError>;
672
- orderLineItem?: Maybe<OrderLineItem>;
673
- };
674
-
675
- export type OrderLineItemAddInput = {
676
- orderId: Scalars['UUID']['input'];
677
- quantity: Scalars['Int']['input'];
678
- variantId: Scalars['UUID']['input'];
679
- };
680
-
681
- export type OrderStartCheckout = {
682
- __typename?: 'OrderStartCheckout';
683
- error?: Maybe<OrderError>;
684
- order?: Maybe<Order>;
685
- };
686
-
687
- export type OrderStartCheckoutInput = {
688
- orderId: Scalars['UUID']['input'];
689
- };
690
-
691
- export enum OrderState {
692
- Address = 'ADDRESS',
693
- Cancel = 'CANCEL',
694
- Cart = 'CART',
695
- Complete = 'COMPLETE',
696
- Confirm = 'CONFIRM',
697
- Delivery = 'DELIVERY',
698
- Payment = 'PAYMENT'
699
- }
700
-
701
130
  /** Information about pagination in a connection */
702
131
  export type PageInfo = {
703
132
  __typename?: 'PageInfo';
@@ -738,16 +167,6 @@ export type Product = {
738
167
  updatedAt: Scalars['DateTime']['output'];
739
168
  };
740
169
 
741
- export type ProductCategoryAppend = {
742
- __typename?: 'ProductCategoryAppend';
743
- error?: Maybe<ProductError>;
744
- };
745
-
746
- export type ProductCategoryAppendInput = {
747
- categoryId: Scalars['UUID']['input'];
748
- productId: Scalars['UUID']['input'];
749
- };
750
-
751
170
  export type ProductConnection = {
752
171
  __typename?: 'ProductConnection';
753
172
  /** A list of edges. */
@@ -760,16 +179,6 @@ export type ProductConnection = {
760
179
  totalPages: Scalars['Int']['output'];
761
180
  };
762
181
 
763
- export type ProductCreate = {
764
- __typename?: 'ProductCreate';
765
- error?: Maybe<ProductError>;
766
- product?: Maybe<Product>;
767
- };
768
-
769
- export type ProductCreateInput = {
770
- name: Scalars['String']['input'];
771
- };
772
-
773
182
  /** An edge in a connection. */
774
183
  export type ProductEdge = {
775
184
  __typename?: 'ProductEdge';
@@ -779,49 +188,12 @@ export type ProductEdge = {
779
188
  node: Product;
780
189
  };
781
190
 
782
- export type ProductError = {
783
- __typename?: 'ProductError';
784
- code: ProductErrorCode;
785
- message: Scalars['String']['output'];
786
- };
787
-
788
- export enum ProductErrorCode {
789
- DatabaseError = 'DATABASE_ERROR'
790
- }
791
-
792
- export type ProductUpdate = {
793
- __typename?: 'ProductUpdate';
794
- error?: Maybe<ProductError>;
795
- product?: Maybe<Product>;
796
- };
797
-
798
- export type ProductUpdateInput = {
799
- description?: InputMaybe<Scalars['JsonString']['input']>;
800
- metadata?: InputMaybe<Scalars['JsonString']['input']>;
801
- name?: InputMaybe<Scalars['String']['input']>;
802
- position?: InputMaybe<Scalars['Int']['input']>;
803
- slug?: InputMaybe<Scalars['Slug']['input']>;
804
- };
805
-
806
191
  export type Query = {
807
192
  __typename?: 'Query';
808
193
  /** Retrieves Categories */
809
194
  categories: CategoryConnection;
810
- /** Retrieves CMS Content Types */
811
- contentTypes: ContentTypeConnection;
812
- /** Retrieves Customers */
813
- customers: CustomerConnection;
814
- /** Retrieves CMS Entries */
815
- entries: EntryConnection;
816
- /** Retrieves CMS Entry Collections */
817
- entryCollections: EntryCollectionConnection;
818
- me: Me;
819
- /** Retrieves Orders */
820
- orders: OrderConnection;
821
195
  /** Retrieves Products */
822
196
  products: ProductConnection;
823
- /** List Users */
824
- users: Scalars['String']['output'];
825
197
  };
826
198
 
827
199
 
@@ -834,52 +206,6 @@ export type QueryCategoriesArgs = {
834
206
  };
835
207
 
836
208
 
837
- export type QueryContentTypesArgs = {
838
- after?: InputMaybe<Scalars['String']['input']>;
839
- before?: InputMaybe<Scalars['String']['input']>;
840
- channelCode: Scalars['ChannelCode']['input'];
841
- first?: InputMaybe<Scalars['Int']['input']>;
842
- last?: InputMaybe<Scalars['Int']['input']>;
843
- };
844
-
845
-
846
- export type QueryCustomersArgs = {
847
- after?: InputMaybe<Scalars['String']['input']>;
848
- before?: InputMaybe<Scalars['String']['input']>;
849
- channelCode: Scalars['ChannelCode']['input'];
850
- first?: InputMaybe<Scalars['Int']['input']>;
851
- last?: InputMaybe<Scalars['Int']['input']>;
852
- };
853
-
854
-
855
- export type QueryEntriesArgs = {
856
- after?: InputMaybe<Scalars['String']['input']>;
857
- before?: InputMaybe<Scalars['String']['input']>;
858
- channelCode: Scalars['ChannelCode']['input'];
859
- filter: EntriesFilterInput;
860
- first?: InputMaybe<Scalars['Int']['input']>;
861
- last?: InputMaybe<Scalars['Int']['input']>;
862
- };
863
-
864
-
865
- export type QueryEntryCollectionsArgs = {
866
- after?: InputMaybe<Scalars['String']['input']>;
867
- before?: InputMaybe<Scalars['String']['input']>;
868
- channelCode: Scalars['ChannelCode']['input'];
869
- first?: InputMaybe<Scalars['Int']['input']>;
870
- last?: InputMaybe<Scalars['Int']['input']>;
871
- };
872
-
873
-
874
- export type QueryOrdersArgs = {
875
- after?: InputMaybe<Scalars['String']['input']>;
876
- before?: InputMaybe<Scalars['String']['input']>;
877
- channelCode: Scalars['ChannelCode']['input'];
878
- first?: InputMaybe<Scalars['Int']['input']>;
879
- last?: InputMaybe<Scalars['Int']['input']>;
880
- };
881
-
882
-
883
209
  export type QueryProductsArgs = {
884
210
  after?: InputMaybe<Scalars['String']['input']>;
885
211
  before?: InputMaybe<Scalars['String']['input']>;
@@ -888,62 +214,17 @@ export type QueryProductsArgs = {
888
214
  last?: InputMaybe<Scalars['Int']['input']>;
889
215
  };
890
216
 
891
-
892
- export type QueryUsersArgs = {
893
- channelCode: Scalars['ChannelCode']['input'];
894
- };
895
-
896
- /**
897
- * Channel Role is a role that a user can have in a channel.
898
- * The roles are:
899
- * - Owner
900
- * - Admin
901
- * - Staff
902
- */
903
- export enum Role {
904
- Admin = 'ADMIN',
905
- Owner = 'OWNER',
906
- Staff = 'STAFF'
907
- }
908
-
909
217
  export enum UseCase {
910
218
  /** Profile Picture for a user instance */
911
219
  Avatar = 'AVATAR',
220
+ /** Image associated to a CMS resource */
221
+ Cms = 'CMS',
912
222
  /** Logo associated to a brand */
913
223
  Logo = 'LOGO',
914
224
  /** Image associated to a product variant */
915
225
  ProductVariant = 'PRODUCT_VARIANT'
916
226
  }
917
227
 
918
- /** Wizard Platform User */
919
- export type User = {
920
- __typename?: 'User';
921
- channels: Array<ChannelRole>;
922
- createdAt: Scalars['DateTime']['output'];
923
- deletedAt?: Maybe<Scalars['DateTime']['output']>;
924
- email: Scalars['Email']['output'];
925
- id: Scalars['UUID']['output'];
926
- name: Scalars['String']['output'];
927
- surname: Scalars['String']['output'];
928
- updatedAt: Scalars['DateTime']['output'];
929
- };
930
-
931
- export type UserCreate = {
932
- __typename?: 'UserCreate';
933
- error?: Maybe<UserError>;
934
- user?: Maybe<User>;
935
- };
936
-
937
- export type UserError = {
938
- __typename?: 'UserError';
939
- code: UserErrorCode;
940
- message: Scalars['String']['output'];
941
- };
942
-
943
- export enum UserErrorCode {
944
- DatabaseError = 'DATABASE_ERROR'
945
- }
946
-
947
228
  /** Platform Product Variant */
948
229
  export type Variant = {
949
230
  __typename?: 'Variant';
@@ -959,39 +240,14 @@ export type Variant = {
959
240
  updatedAt: Scalars['DateTime']['output'];
960
241
  };
961
242
 
962
- export type VariantError = {
963
- __typename?: 'VariantError';
964
- code: VariantErrorCode;
965
- message: Scalars['String']['output'];
966
- };
967
-
968
- export enum VariantErrorCode {
969
- DatabaseError = 'DATABASE_ERROR',
970
- ImageUploadError = 'IMAGE_UPLOAD_ERROR'
971
- }
243
+ export type CategoriesListQueryVariables = Exact<{
244
+ channel: Scalars['ChannelCode']['input'];
245
+ }>;
972
246
 
973
- export type VariantImageUpload = {
974
- __typename?: 'VariantImageUpload';
975
- error?: Maybe<VariantError>;
976
- image?: Maybe<Image>;
977
- };
978
247
 
979
- export type VariantImageUploadInput = {
980
- file: Scalars['Upload']['input'];
981
- variantId: Scalars['UUID']['input'];
982
- };
248
+ export type CategoriesListQuery = { __typename?: 'Query', categories: { __typename?: 'CategoryConnection', edges: Array<{ __typename?: 'CategoryEdge', node: { __typename?: 'Category', channelCode: any, id: any, name: string, description: any, path: Array<any>, position: number, isActive: boolean, createdAt: any, updatedAt: any } }> } };
983
249
 
984
- export type VariantPriceCreate = {
985
- __typename?: 'VariantPriceCreate';
986
- error?: Maybe<VariantError>;
987
- price?: Maybe<Price>;
988
- };
989
-
990
- export type VariantPriceCreateInput = {
991
- currency: Iso4217;
992
- price: Scalars['Decimal']['input'];
993
- variantId: Scalars['UUID']['input'];
994
- };
250
+ export type CategoriesListFieldsFragment = { __typename?: 'Category', channelCode: any, id: any, name: string, description: any, path: Array<any>, position: number, isActive: boolean, createdAt: any, updatedAt: any };
995
251
 
996
252
  export type ProductsListQueryVariables = Exact<{
997
253
  channel: Scalars['ChannelCode']['input'];
@@ -1002,6 +258,19 @@ export type ProductsListQuery = { __typename?: 'Query', products: { __typename?:
1002
258
 
1003
259
  export type ProductsListFieldsFragment = { __typename?: 'Product', channelCode: any, id: any, name: string, slug: any, description: any, metadata?: any | null, defaultVariantId: any, position: number, defaultVariant: { __typename?: 'Variant', id: any, channelCode: any, sku?: string | null, productId: any, requiresShipping: boolean, images: Array<{ __typename?: 'Image', id: any, channelCode: any, height: number, width: number, url: string, thumbnailUrl?: string | null, size: number, mimeType: MimeType, useCase: UseCase, createdAt: any, updatedAt: any }>, prices: Array<{ __typename?: 'Price', variantId: any, channelCode: any, currency: Iso4217, price: any }> }, categories: Array<{ __typename?: 'Category', id: any, name: string, path: Array<any>, position: number, isActive: boolean, createdAt: any, updatedAt: any }> };
1004
260
 
261
+ export const CategoriesListFieldsFragmentDoc = gql`
262
+ fragment CategoriesListFields on Category {
263
+ channelCode
264
+ id
265
+ name
266
+ description
267
+ path
268
+ position
269
+ isActive
270
+ createdAt
271
+ updatedAt
272
+ }
273
+ `;
1005
274
  export const ProductsListFieldsFragmentDoc = gql`
1006
275
  fragment ProductsListFields on Product {
1007
276
  channelCode
@@ -1049,6 +318,17 @@ export const ProductsListFieldsFragmentDoc = gql`
1049
318
  }
1050
319
  }
1051
320
  `;
321
+ export const CategoriesListDocument = gql`
322
+ query CategoriesList($channel: ChannelCode!) {
323
+ categories(channelCode: $channel) {
324
+ edges {
325
+ node {
326
+ ...CategoriesListFields
327
+ }
328
+ }
329
+ }
330
+ }
331
+ ${CategoriesListFieldsFragmentDoc}`;
1052
332
  export const ProductsListDocument = gql`
1053
333
  query ProductsList($channel: ChannelCode!) {
1054
334
  products(channelCode: $channel) {