@nizza/core 0.3.0 → 0.3.1-alpha.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 (59) hide show
  1. package/dist/environments/environment.d.ts +1 -0
  2. package/dist/index.cjs +12 -4
  3. package/dist/index.d.ts +1 -7
  4. package/dist/index.mjs +2832 -1970
  5. package/dist/lib/accounts/atoms/account.d.ts +4 -0
  6. package/dist/lib/accounts/atoms/index.d.ts +1 -0
  7. package/dist/lib/accounts/core/domain/Account.d.ts +35 -0
  8. package/dist/lib/accounts/core/domain/AccountRepository.d.ts +4 -0
  9. package/dist/lib/accounts/core/domain/index.d.ts +4 -0
  10. package/dist/lib/accounts/core/domain/shared/constants.d.ts +40 -0
  11. package/dist/lib/accounts/core/domain/shared/index.d.ts +2 -0
  12. package/dist/lib/accounts/core/domain/types.d.ts +65 -0
  13. package/dist/lib/accounts/core/index.d.ts +6 -0
  14. package/dist/lib/accounts/core/infrastructure/EventRestRepository.d.ts +4 -0
  15. package/dist/lib/accounts/core/infrastructure/index.d.ts +1 -0
  16. package/dist/lib/accounts/core/services/AccountService.d.ts +6 -0
  17. package/dist/lib/accounts/core/services/index.d.ts +1 -0
  18. package/dist/lib/accounts/hooks/index.d.ts +1 -0
  19. package/dist/lib/accounts/hooks/useAccount.d.ts +4 -0
  20. package/dist/lib/accounts/index.d.ts +4 -0
  21. package/dist/lib/accounts/utils/getAccount.d.ts +1 -0
  22. package/dist/lib/accounts/utils/index.d.ts +1 -0
  23. package/dist/lib/constants/products.d.ts +7 -0
  24. package/dist/lib/index.d.ts +8 -0
  25. package/dist/lib/jotai/globalAtomStore.d.ts +33 -0
  26. package/dist/lib/jotai/index.d.ts +1 -0
  27. package/dist/lib/mobx/NizzaStore.d.ts +18 -0
  28. package/dist/lib/{providers → mobx}/StoreProvider.d.ts +2 -2
  29. package/dist/lib/mobx/index.d.ts +3 -0
  30. package/dist/lib/types/api-graphql-types.d.ts +42 -6
  31. package/dist/lib/types/{app-module.d.ts → appModule.d.ts} +1 -1
  32. package/dist/lib/types/index.d.ts +4 -4
  33. package/dist/lib/types/nizza/index.d.ts +4 -0
  34. package/dist/lib/types/nizza/main.d.ts +3 -0
  35. package/dist/lib/types/{nizzaGlobalObject.d.ts → nizza/nizzaGlobalObject.d.ts} +0 -2
  36. package/dist/lib/types/{products/base.d.ts → nizza/product.d.ts} +2 -1
  37. package/dist/lib/types/nizza/productDataSource.d.ts +23 -0
  38. package/dist/lib/types/utils.d.ts +1 -1
  39. package/dist/lib/types/vtex/index.d.ts +2 -0
  40. package/dist/lib/types/vtex/orderForm.d.ts +263 -0
  41. package/dist/lib/types/vtex/product.d.ts +58 -0
  42. package/dist/lib/utils/customFetch.d.ts +2 -0
  43. package/dist/lib/utils/index.d.ts +1 -6
  44. package/dist/package.json +1 -7
  45. package/package.json +1 -7
  46. package/dist/lib/providers/index.d.ts +0 -1
  47. package/dist/lib/stores/NizzaStore.d.ts +0 -12
  48. package/dist/lib/stores/index.d.ts +0 -1
  49. package/dist/lib/types/products/index.d.ts +0 -2
  50. package/dist/lib/types/products/product.d.ts +0 -16
  51. package/dist/lib/utils/Result.d.ts +0 -26
  52. package/dist/lib/utils/apiCall.d.ts +0 -2
  53. package/dist/lib/utils/customStorage/MemoryStorage.d.ts +0 -12
  54. package/dist/lib/utils/customStorage/index.d.ts +0 -9
  55. package/dist/lib/utils/customStorage/utils.d.ts +0 -4
  56. package/dist/lib/utils/fingerprint.d.ts +0 -1
  57. package/dist/lib/utils/lazyLoad.d.ts +0 -7
  58. /package/dist/lib/{utils/mobxHooks.d.ts → mobx/hooks.d.ts} +0 -0
  59. /package/dist/lib/types/{mobx-store.d.ts → mobx.d.ts} +0 -0
@@ -0,0 +1,4 @@
1
+ import { NizzaAccount } from '../core';
2
+ export declare const accountAtom: import("jotai").PrimitiveAtom<NizzaAccount | null> & {
3
+ init: NizzaAccount | null;
4
+ };
@@ -0,0 +1 @@
1
+ export * from './account';
@@ -0,0 +1,35 @@
1
+ import { IAggregateRoot } from '../../../domain';
2
+ import { AccountContractStatusTypes, AccountContractTypes, AccountPlanDescriptionTypes, AccountTypes } from './shared';
3
+ import { AccountCurrencyConfig, AccountGlobalPage, AccountProps, AccountStripe, ExceededFeatures, RawAccount } from './types';
4
+ export declare class NizzaAccount implements IAggregateRoot, AccountProps {
5
+ readonly root: import("../../../domain").AggregateRoot<NizzaAccount, AccountProps>;
6
+ id: string;
7
+ account: string;
8
+ accountType: AccountTypes;
9
+ username: string;
10
+ currencyConfig: AccountCurrencyConfig;
11
+ contractType: AccountContractTypes;
12
+ nextDateMetricRecord: string;
13
+ spendedMinutes: number;
14
+ unlimitedService: boolean;
15
+ hoursAvailable: number;
16
+ contractStatus: AccountContractStatusTypes;
17
+ createdAt: Date;
18
+ installationDateApp: string;
19
+ cxAccount: string;
20
+ freeService: boolean;
21
+ subscriptionType: null;
22
+ minutesAvailable: number;
23
+ globalPage: AccountGlobalPage;
24
+ stripe: AccountStripe;
25
+ descriptionPlan: AccountPlanDescriptionTypes;
26
+ planType: string;
27
+ selectFreeTrial: boolean;
28
+ exceededFeatures?: ExceededFeatures;
29
+ host: null;
30
+ constructor(props: AccountProps);
31
+ static toDomain(raw: RawAccount): NizzaAccount;
32
+ toPrimitives(): Omit<this, "createdAt" | "root" | "toPrimitives"> & {
33
+ created: string;
34
+ };
35
+ }
@@ -0,0 +1,4 @@
1
+ import { NizzaAccount } from './Account';
2
+ export interface AccountRepository {
3
+ get(name: string): Promise<NizzaAccount | null>;
4
+ }
@@ -0,0 +1,4 @@
1
+ export * from './Account';
2
+ export * from './AccountRepository';
3
+ export * from './shared';
4
+ export * from './types';
@@ -0,0 +1,40 @@
1
+ export declare enum AccountTypes {
2
+ VTEX = "VTEX",
3
+ VTEX_IO = "VTEX-IO",
4
+ VTEX_CMS = "PORTAL-VTEX",
5
+ PLATFORM = "PLATFORM",
6
+ UNKNOWN = "UNKNOWN"
7
+ }
8
+ export declare enum AccountContractTypes {
9
+ PLATFORM = "platform_module",
10
+ /**
11
+ * The following values are used for the VTEX ecosystem
12
+ */
13
+ ADENDA = "subscription_module",
14
+ APP_STORE = "app_store"
15
+ }
16
+ export declare enum AccountContractStatusTypes {
17
+ ACTIVE = "active_contract",
18
+ INACTIVE = "inactive_contract"
19
+ }
20
+ export declare enum AccountSubscriptionTypes {
21
+ LITE = "lite",
22
+ STANDARD = "standard",
23
+ PRO = "pro"
24
+ }
25
+ export declare enum AccountPlanDescriptionTypes {
26
+ LITE = "PLAN_LITE",
27
+ /**
28
+ * It should be "PLAN_STANDARD" but someone made a mistake and
29
+ * it is difficult to change this value without correcting the
30
+ * data in the DB
31
+ */
32
+ STANDARD = "PLAN_ESTANDAR",
33
+ PRO = "PLAN_PRO",
34
+ NONE = "NO_PLAN"
35
+ }
36
+ export declare enum GlobalPageSectionTypes {
37
+ PAST = "past",
38
+ LIVE = "live",
39
+ FUTURE = "future"
40
+ }
@@ -0,0 +1,2 @@
1
+ export * from './constants';
2
+ export * from './errors';
@@ -0,0 +1,65 @@
1
+ import { AccountContractStatusTypes, AccountContractTypes, AccountPlanDescriptionTypes, AccountSubscriptionTypes, AccountTypes, GlobalPageSectionTypes } from './shared';
2
+ export interface BaseProps {
3
+ id: string;
4
+ account: string;
5
+ accountType: AccountTypes;
6
+ username: string;
7
+ currencyConfig: AccountCurrencyConfig;
8
+ contractType: AccountContractTypes;
9
+ nextDateMetricRecord: string;
10
+ spendedMinutes: number;
11
+ unlimitedService: boolean;
12
+ hoursAvailable: number;
13
+ contractStatus: AccountContractStatusTypes;
14
+ installationDateApp: string;
15
+ cxAccount: string;
16
+ freeService: boolean;
17
+ subscriptionType: AccountSubscriptionTypes | null;
18
+ minutesAvailable: number;
19
+ globalPage: AccountGlobalPage;
20
+ stripe?: AccountStripe;
21
+ descriptionPlan: AccountPlanDescriptionTypes;
22
+ planType?: string;
23
+ selectFreeTrial?: boolean;
24
+ exceededFeatures?: ExceededFeatures;
25
+ host: string | null;
26
+ }
27
+ export type AccountProps = BaseProps & {
28
+ createdAt: Date;
29
+ };
30
+ export type RawAccount = BaseProps & {
31
+ createdAt: string;
32
+ };
33
+ type StripeSubscriptionStatus = 'active' | 'canceled' | 'incomplete' | 'incomplete_expired' | 'past_due' | 'trialing' | 'unpaid';
34
+ export interface AccountStripe {
35
+ customerId: string;
36
+ subscriptionId: string;
37
+ subscriptionStatus: StripeSubscriptionStatus;
38
+ }
39
+ export type ExceededFeatures = {
40
+ videoRecording: number;
41
+ viewers: number;
42
+ };
43
+ export interface ExternalCreateSubs {
44
+ name: AccountSubscriptionTypes;
45
+ trialDays?: number;
46
+ returnUrl?: string;
47
+ amount: number;
48
+ currencyCode?: string;
49
+ }
50
+ export type SubscriptionStatus = 'active' | 'cancelled' | 'declined' | 'expired' | 'frozen' | 'pending' | 'accepted';
51
+ export interface ExternalSubscriptionInfo {
52
+ createdAt: string;
53
+ id: string;
54
+ name: string;
55
+ status: SubscriptionStatus;
56
+ }
57
+ export interface AccountCurrencyConfig {
58
+ currency: string;
59
+ currencyCustomDecimalsNumber: number;
60
+ currencyCustomSymbol: string;
61
+ }
62
+ export interface AccountGlobalPage {
63
+ activeSections: GlobalPageSectionTypes[];
64
+ }
65
+ export {};
@@ -0,0 +1,6 @@
1
+ import { AccountService } from './services';
2
+ declare const accountService: AccountService;
3
+ export * from './domain';
4
+ export * from './infrastructure';
5
+ export * from './services';
6
+ export { accountService };
@@ -0,0 +1,4 @@
1
+ import { AccountRepository, NizzaAccount } from '../domain';
2
+ export declare class AccountRestRepository implements AccountRepository {
3
+ get(name: string): Promise<NizzaAccount | null>;
4
+ }
@@ -0,0 +1 @@
1
+ export * from './EventRestRepository';
@@ -0,0 +1,6 @@
1
+ import { AccountRepository } from '../domain';
2
+ export declare class AccountService {
3
+ private accountRepository;
4
+ constructor(accountRepository: AccountRepository);
5
+ get(name: string): Promise<import("@nizza/core").NizzaAccount>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './AccountService';
@@ -0,0 +1 @@
1
+ export * from './useAccount';
@@ -0,0 +1,4 @@
1
+ export declare const useAccount: () => {
2
+ findQuery: import("@tanstack/react-query").UseQueryResult<import("@nizza/core").NizzaAccount, unknown>;
3
+ account: import("@nizza/core").NizzaAccount | null;
4
+ };
@@ -0,0 +1,4 @@
1
+ export * from './atoms';
2
+ export * from './core';
3
+ export * from './hooks';
4
+ export * from './utils';
@@ -0,0 +1 @@
1
+ export declare function getAccount(name: string): Promise<import("../core").NizzaAccount>;
@@ -0,0 +1 @@
1
+ export * from './getAccount';
@@ -1,3 +1,10 @@
1
1
  export declare enum NizzaVariationTypes {
2
2
  COMBO = "Combo"
3
3
  }
4
+ export declare enum NizzaProductRequestOriginTypes {
5
+ CACE = "CACE",
6
+ GLOBAL_PAGE = "globalPage",
7
+ PLATFORM = "platform",
8
+ DEV_LOCAL = "dev:local",
9
+ CUSTOMIZATION = "customization"
10
+ }
@@ -0,0 +1,8 @@
1
+ export * from './accounts';
2
+ export * from './constants';
3
+ export * from './domain';
4
+ export * from './errors';
5
+ export * from './jotai';
6
+ export * from './mobx';
7
+ export * from './types';
8
+ export * from './utils';
@@ -0,0 +1,33 @@
1
+ export declare const globalAtomStore: {
2
+ get: <Value>(atom: import("jotai").Atom<Value>) => Value;
3
+ set: <Value_1, Args extends unknown[], Result>(atom: import("jotai").WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
4
+ sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
5
+ dev_subscribe_store: (l: (type: "state" | "sub" | "unsub") => void) => () => void;
6
+ dev_get_mounted_atoms: () => IterableIterator<import("jotai").Atom<unknown>>;
7
+ dev_get_atom_state: (a: import("jotai").Atom<unknown>) => ({
8
+ d: Map<import("jotai").Atom<unknown>, any & ({
9
+ e: unknown;
10
+ } | {
11
+ v: unknown;
12
+ })>;
13
+ } & ({
14
+ e: unknown;
15
+ } | {
16
+ v: unknown;
17
+ })) | undefined;
18
+ dev_get_mounted: (a: import("jotai").Atom<unknown>) => {
19
+ l: Set<() => void>;
20
+ t: Set<import("jotai").Atom<unknown>>;
21
+ u?: (() => void) | undefined;
22
+ } | undefined;
23
+ dev_restore_atoms: (values: Iterable<readonly [import("jotai").Atom<unknown>, unknown]>) => void;
24
+ } | {
25
+ get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
26
+ set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: import("jotai").WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
27
+ sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
28
+ dev_subscribe_store?: undefined;
29
+ dev_get_mounted_atoms?: undefined;
30
+ dev_get_atom_state?: undefined;
31
+ dev_get_mounted?: undefined;
32
+ dev_restore_atoms?: undefined;
33
+ };
@@ -0,0 +1 @@
1
+ export * from './globalAtomStore';
@@ -0,0 +1,18 @@
1
+ import { NizzaConfiguration, NizzaGlobalObjet, NizzaProductDataSource } from '../types';
2
+ import { NizzaAccount } from '../accounts';
3
+ export declare class NizzaStore implements NizzaGlobalObjet {
4
+ private static _instance;
5
+ private _config;
6
+ private _account;
7
+ private _productDataSource;
8
+ readonly instanceId: string;
9
+ private constructor();
10
+ static instance(): NizzaStore;
11
+ configure(config: NizzaConfiguration): Promise<void>;
12
+ get account(): NizzaAccount;
13
+ get productDataSource(): NizzaProductDataSource | null;
14
+ get config(): NizzaConfiguration | null;
15
+ setProductDataSource(dataSource: NizzaProductDataSource): void;
16
+ private validateRequiredProps;
17
+ }
18
+ export declare const nizza: NizzaStore;
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { AppModuleStoreList, StoreClass } from '../types';
3
3
  interface Props {
4
4
  stores: AppModuleStoreList;
5
- children?: React.ReactNode;
5
+ children?: ReactNode;
6
6
  }
7
7
  export declare const StoreProvider: FC<Props>;
8
8
  export declare function useStore<T>(identifier: StoreClass<T>): T;
@@ -0,0 +1,3 @@
1
+ export * from './NizzaStore';
2
+ export * from './StoreProvider';
3
+ export * from './hooks';
@@ -296,9 +296,9 @@ export type RelateEntitySnackVideo = ActionSnackVideoSuccess | ErrorGeneral;
296
296
  export type RelateToProductsSnackVideoInput = {
297
297
  account: Scalars['String'];
298
298
  name: Scalars['String'];
299
+ order: Scalars['Float'];
299
300
  productsId: Array<Scalars['String']>;
300
- shortId: Scalars['String'];
301
- url: Scalars['String'];
301
+ snackVideoId: Scalars['String'];
302
302
  };
303
303
  export type RelationshipSnackVideo = {
304
304
  __typename?: 'RelationshipSnackVideo';
@@ -307,7 +307,7 @@ export type RelationshipSnackVideo = {
307
307
  entity: Scalars['String'];
308
308
  modified: Scalars['String'];
309
309
  name: Scalars['String'];
310
- shortId: Scalars['String'];
310
+ snackVideoId: Scalars['String'];
311
311
  sourceEntity: Scalars['String'];
312
312
  url: Scalars['String'];
313
313
  };
@@ -340,12 +340,15 @@ export type SearchInput = {
340
340
  };
341
341
  export type SnackVideo = {
342
342
  __typename?: 'SnackVideo';
343
+ account: Scalars['String'];
344
+ created?: Maybe<Scalars['String']>;
343
345
  duration: Scalars['Float'];
344
346
  eventId: Scalars['String'];
345
347
  eventName: Scalars['String'];
346
348
  id: Scalars['String'];
347
349
  name: Scalars['String'];
348
350
  thumbnailUrl: Scalars['String'];
351
+ transmitionType?: Maybe<Scalars['String']>;
349
352
  uploadProgress: Scalars['Float'];
350
353
  url: Scalars['String'];
351
354
  };
@@ -373,16 +376,17 @@ export type SnackVideoCreatedWithCursor = {
373
376
  export type SnackVideoGetAll = ErrorGeneral | SnackVideoCreatedArray;
374
377
  export type SnackVideoRelationshipInput = {
375
378
  account: Scalars['String'];
376
- shortId: Scalars['String'];
379
+ snackVideoId: Scalars['String'];
377
380
  };
378
381
  export type SnackVideoRelationshipKeys = {
379
382
  account: Scalars['String'];
380
383
  attributeId: Scalars['String'];
381
- shortId: Scalars['String'];
384
+ snackVideoId: Scalars['String'];
382
385
  sourceEntity: Scalars['String'];
383
386
  };
384
387
  export type SnackVideosCreated = {
385
388
  __typename?: 'SnackVideosCreated';
389
+ account: Scalars['String'];
386
390
  created: Scalars['String'];
387
391
  duration: Scalars['Float'];
388
392
  entity: Scalars['String'];
@@ -392,6 +396,7 @@ export type SnackVideosCreated = {
392
396
  modified: Scalars['String'];
393
397
  name: Scalars['String'];
394
398
  thumbnailUrl: Scalars['String'];
399
+ transmitionType?: Maybe<Scalars['String']>;
395
400
  uploadProgress: Scalars['Float'];
396
401
  url: Scalars['String'];
397
402
  };
@@ -706,6 +711,32 @@ export type CreateSnackVideoBatchMutation = {
706
711
  }> | null;
707
712
  };
708
713
  };
714
+ export type FindManySnackVideosQueryVariables = Exact<{
715
+ data: FindManySnackVideoInput;
716
+ }>;
717
+ export type FindManySnackVideosQuery = {
718
+ __typename?: 'Query';
719
+ findManySnackVideos: {
720
+ __typename: 'ErrorGeneral';
721
+ message: string;
722
+ statusCode: string;
723
+ timestamp: string;
724
+ } | {
725
+ __typename: 'SnackVideoArray';
726
+ data?: Array<{
727
+ __typename?: 'SnackVideo';
728
+ id: string;
729
+ name: string;
730
+ url: string;
731
+ thumbnailUrl: string;
732
+ uploadProgress: number;
733
+ duration: number;
734
+ eventId: string;
735
+ eventName: string;
736
+ transmitionType?: string | null;
737
+ }> | null;
738
+ };
739
+ };
709
740
  export type GetAllSnackVideosQueryVariables = Exact<{
710
741
  data: QueryInput;
711
742
  }>;
@@ -731,6 +762,8 @@ export type GetAllSnackVideosQuery = {
731
762
  duration: number;
732
763
  eventId: string;
733
764
  eventName: string;
765
+ created: string;
766
+ transmitionType?: string | null;
734
767
  }> | null;
735
768
  } | null;
736
769
  };
@@ -784,7 +817,7 @@ export type FindByProductSnackVideoQuery = {
784
817
  url: string;
785
818
  thumbnailUrl: string;
786
819
  duration: number;
787
- uploadProgress: number;
820
+ transmitionType?: string | null;
788
821
  }> | null;
789
822
  };
790
823
  };
@@ -827,6 +860,9 @@ export declare const SearchMinimalEventsDocument: DocumentNode<SearchMinimalEven
827
860
  export declare const CreateSnackVideoBatchDocument: DocumentNode<CreateSnackVideoBatchMutation, Exact<{
828
861
  data: CreateSnackVideoInput;
829
862
  }>>;
863
+ export declare const FindManySnackVideosDocument: DocumentNode<FindManySnackVideosQuery, Exact<{
864
+ data: FindManySnackVideoInput;
865
+ }>>;
830
866
  export declare const GetAllSnackVideosDocument: DocumentNode<GetAllSnackVideosQuery, Exact<{
831
867
  data: QueryInput;
832
868
  }>>;
@@ -1,5 +1,5 @@
1
1
  import { RouteProps } from 'react-router-dom';
2
- import { StoreClass } from './mobx-store';
2
+ import { StoreClass } from './mobx';
3
3
  type Store<T extends {
4
4
  new (): InstanceType<T>;
5
5
  }> = Readonly<{
@@ -1,8 +1,8 @@
1
1
  import * as ApiGraphqlTypes from './api-graphql-types';
2
2
  export * from './api';
3
- export * from './app-module';
4
- export * from './mobx-store';
5
- export * from './nizzaGlobalObject';
6
- export * from './products';
3
+ export * from './appModule';
4
+ export * from './mobx';
5
+ export * from './nizza';
7
6
  export * from './utils';
7
+ export * from './vtex';
8
8
  export { ApiGraphqlTypes };
@@ -0,0 +1,4 @@
1
+ export * from './main';
2
+ export * from './nizzaGlobalObject';
3
+ export * from './product';
4
+ export * from './productDataSource';
@@ -0,0 +1,3 @@
1
+ import { NizzaProduct } from './product';
2
+ export type NizzaAddToCartHandler = <T extends NizzaProduct>(product: T) => Promise<void>;
3
+ export type NizzaSetUTMHandler = (utm: string) => Promise<void>;
@@ -1,11 +1,9 @@
1
- import { NizzaProductRepository } from './products';
2
1
  export interface NizzaGlobalObjet {
3
2
  config: NizzaConfiguration | null;
4
3
  configure: (config: NizzaConfiguration) => void;
5
4
  }
6
5
  export interface NizzaConfiguration {
7
6
  account: string;
8
- productRepository?: NizzaProductRepository;
9
7
  }
10
8
  export interface NizzaCredentials {
11
9
  }
@@ -16,6 +16,7 @@ export interface NizzaProduct {
16
16
  addToCartLink: string;
17
17
  pdpLink: string;
18
18
  items?: NizzaItem[];
19
+ sellerId?: string;
19
20
  variationSelector?: NizzaVariationSelector[];
20
21
  }
21
22
  export interface NizzaItem {
@@ -31,7 +32,7 @@ export interface NizzaVariationSelector {
31
32
  values: NizzaVariationValues[];
32
33
  }
33
34
  export interface NizzaVariationField {
34
- id: number;
35
+ id: string;
35
36
  name: string;
36
37
  type: NizzaVariationTypes;
37
38
  isActive: boolean;
@@ -0,0 +1,23 @@
1
+ import { NizzaProductRequestOriginTypes } from '../../constants';
2
+ import { NizzaProduct } from './product';
3
+ export type NizzaProductDataSourceConfig = {
4
+ origin?: NizzaProductRequestOriginTypes;
5
+ accountApplyTax?: boolean;
6
+ defaultLimit?: number;
7
+ };
8
+ export type NizzaGetProductHandlerInput = {
9
+ productId: string;
10
+ };
11
+ export type NizzaGetProductListHandlerInput = {
12
+ collectionId?: string;
13
+ search?: string;
14
+ page?: number;
15
+ limit?: number;
16
+ };
17
+ export type NizzaGetProductHandler = (input: NizzaGetProductHandlerInput) => Promise<NizzaProduct | null>;
18
+ export type NizzaGetProductListHandler = (input?: NizzaGetProductListHandlerInput) => Promise<NizzaProduct[]>;
19
+ export interface NizzaProductDataSource {
20
+ readonly config?: NizzaProductDataSourceConfig;
21
+ getProduct: NizzaGetProductHandler;
22
+ getProductList: NizzaGetProductListHandler;
23
+ }
@@ -13,7 +13,7 @@ export interface ApiV2Response<T = any> {
13
13
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
14
14
  }
15
15
  export type Primitive = string | boolean | number;
16
- export interface ApiCall extends RequestInit {
16
+ export interface CustomFetchConfig extends RequestInit {
17
17
  url: RequestInfo;
18
18
  raw?: boolean;
19
19
  }
@@ -0,0 +1,2 @@
1
+ export * from './orderForm';
2
+ export * from './product';