@nizza/core 0.3.0-alpha.13 → 0.3.0-alpha.15

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.
@@ -1,13 +1,12 @@
1
1
  import { NizzaConfiguration, NizzaGlobalObjet } from '../types';
2
2
  export declare class NizzaStore implements NizzaGlobalObjet {
3
3
  private static _instance;
4
- private _id;
5
4
  private _config;
5
+ readonly instanceId: string;
6
6
  private constructor();
7
7
  static instance(): NizzaStore;
8
8
  configure(config: NizzaConfiguration): void;
9
- createGlobalObject(): void;
10
- get config(): NizzaConfiguration;
9
+ get config(): NizzaConfiguration | null;
11
10
  private validateRequiredProps;
12
11
  }
13
12
  export declare const nizza: NizzaStore;
@@ -0,0 +1,9 @@
1
+ export interface GqlPagination {
2
+ limit: number;
3
+ cursor: GqlCursor;
4
+ }
5
+ export interface GqlCursor {
6
+ pk: string;
7
+ sk: string;
8
+ [key: string]: string;
9
+ }
@@ -125,6 +125,23 @@ export declare type ErrorGeneral = Error & {
125
125
  statusCode: Scalars['String'];
126
126
  timestamp: Scalars['String'];
127
127
  };
128
+ export declare type EventArray = {
129
+ __typename?: 'EventArray';
130
+ data?: Maybe<Array<EventLiveStreaming>>;
131
+ duration?: Maybe<Scalars['String']>;
132
+ isArray?: Maybe<Scalars['Boolean']>;
133
+ method?: Maybe<Scalars['String']>;
134
+ path?: Maybe<Scalars['String']>;
135
+ };
136
+ export declare type EventLiveStreaming = {
137
+ __typename?: 'EventLiveStreaming';
138
+ account: Scalars['String'];
139
+ createdAt: Scalars['String'];
140
+ eventName: Scalars['String'];
141
+ id: Scalars['String'];
142
+ status: Scalars['String'];
143
+ thumbnailsPath?: Maybe<Scalars['String']>;
144
+ };
128
145
  export declare type FindManySnackVideoInput = {
129
146
  account: Scalars['String'];
130
147
  ids: Array<Scalars['String']>;
@@ -204,6 +221,7 @@ export declare type Query = {
204
221
  getAllSnackVideos: SnackVideoGetAll;
205
222
  getRelationshipSnackVideos: RelationshipSnackVideoArrayResponse;
206
223
  searchCollection: CollectionResultArray;
224
+ searchEvent: SearchEventResult;
207
225
  searchSnackVideos: SnackVideoGetAll;
208
226
  };
209
227
  export declare type QueryFindCollectionArgs = {
@@ -227,6 +245,9 @@ export declare type QueryGetRelationshipSnackVideosArgs = {
227
245
  export declare type QuerySearchCollectionArgs = {
228
246
  data: QueryInput;
229
247
  };
248
+ export declare type QuerySearchEventArgs = {
249
+ data: SearchEventInput;
250
+ };
230
251
  export declare type QuerySearchSnackVideosArgs = {
231
252
  data: SearchInput;
232
253
  };
@@ -266,6 +287,16 @@ export declare type RelationshipSnackVideoArray = {
266
287
  path?: Maybe<Scalars['String']>;
267
288
  };
268
289
  export declare type RelationshipSnackVideoArrayResponse = ErrorGeneral | RelationshipSnackVideoArray;
290
+ export declare type SearchEventInput = {
291
+ account: Scalars['String'];
292
+ cursor?: InputMaybe<Scalars['JSON']>;
293
+ id?: InputMaybe<Scalars['String']>;
294
+ limit?: InputMaybe<Scalars['Float']>;
295
+ page?: InputMaybe<Scalars['Float']>;
296
+ search: Scalars['String'];
297
+ status?: InputMaybe<Scalars['String']>;
298
+ };
299
+ export declare type SearchEventResult = ErrorGeneral | EventArray;
269
300
  export declare type SearchInput = {
270
301
  account: Scalars['String'];
271
302
  cursor?: InputMaybe<Scalars['JSON']>;
@@ -576,6 +607,29 @@ export declare type UpdateCollectionMutation = {
576
607
  timestamp: string;
577
608
  };
578
609
  };
610
+ export declare type SearchMinimalEventsQueryVariables = Exact<{
611
+ data: SearchEventInput;
612
+ }>;
613
+ export declare type SearchMinimalEventsQuery = {
614
+ __typename?: 'Query';
615
+ searchEvent: {
616
+ __typename: 'ErrorGeneral';
617
+ message: string;
618
+ statusCode: string;
619
+ timestamp: string;
620
+ } | {
621
+ __typename: 'EventArray';
622
+ data?: Array<{
623
+ __typename?: 'EventLiveStreaming';
624
+ id: string;
625
+ account: string;
626
+ eventName: string;
627
+ thumbnailsPath?: string | null;
628
+ createdAt: string;
629
+ status: string;
630
+ }> | null;
631
+ };
632
+ };
579
633
  export declare type GetAllSnackVideosQueryVariables = Exact<{
580
634
  data: QueryInput;
581
635
  }>;
@@ -637,6 +691,9 @@ export declare const SearchCollectionsDocument: DocumentNode<SearchCollectionsQu
637
691
  export declare const UpdateCollectionDocument: DocumentNode<UpdateCollectionMutation, Exact<{
638
692
  data: UpdateCollectionInput;
639
693
  }>>;
694
+ export declare const SearchMinimalEventsDocument: DocumentNode<SearchMinimalEventsQuery, Exact<{
695
+ data: SearchEventInput;
696
+ }>>;
640
697
  export declare const GetAllSnackVideosDocument: DocumentNode<GetAllSnackVideosQuery, Exact<{
641
698
  data: QueryInput;
642
699
  }>>;
@@ -1,4 +1,5 @@
1
1
  import * as ApiGraphqlTypes from './api-graphql-types';
2
+ export * from './api-grahql';
2
3
  export * from './app-module';
3
4
  export * from './mobx-store';
4
5
  export * from './nizzaGlobalObject';
@@ -1,6 +1,6 @@
1
1
  import { NizzaProductRepository } from './products';
2
2
  export interface NizzaGlobalObjet {
3
- config: NizzaConfiguration;
3
+ config: NizzaConfiguration | null;
4
4
  configure: (config: NizzaConfiguration) => void;
5
5
  }
6
6
  export interface NizzaConfiguration {
@@ -1,6 +1,7 @@
1
+ export * from './Result';
1
2
  export * from './apiCall';
2
3
  export * from './customStorage';
3
4
  export * from './fingerprint';
4
5
  export * from './helpers';
5
6
  export * from './lazyLoad';
6
- export * from './Result';
7
+ export * from './mobxHooks';
@@ -0,0 +1,23 @@
1
+ import { DependencyList, EffectCallback } from 'react';
2
+ /**
3
+ * This hook is just like the standard MobX autorun function, but it hooks into the React component
4
+ * lifecycle. This means the set up for the autorun only happens once, and it's automatically
5
+ * disposed of when the component unmounts.
6
+ *
7
+ * @param effect The function that's called when the store's properties are changed. This
8
+ * function is called initially when the autorun is initialized.
9
+ * @param deps The non-MobX dependencies that should retrigger the callback.
10
+ */
11
+ export declare function useAutorun(effect: EffectCallback, deps?: DependencyList): void;
12
+ /**
13
+ * This hook is just like the standard MobX reaction function, but it hooks into the React component
14
+ * lifecycle. This means the set up for the reaction only happens once, and it's automatically
15
+ * disposed of when the component unmounts.
16
+ *
17
+ * @param trigger This function determines what data will trigger the effect function to rerun.
18
+ * Only the *accessed* data is important in this function—not the return value.
19
+ * @param effect The function that's called when the store's properties are changed. This
20
+ * function is called initially when the autorun is initialized.
21
+ * @param deps The non-MobX dependencies that should retrigger the callback.
22
+ */
23
+ export declare function useReaction(trigger: () => any, effect: EffectCallback, deps?: DependencyList): void;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nizza/core",
3
- "version": "0.3.0-alpha.13",
3
+ "version": "0.3.0-alpha.15",
4
4
  "type": "module",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.cjs",
@@ -0,0 +1,7 @@
1
+ import { NizzaStore } from '../lib/stores';
2
+
3
+ declare global {
4
+ interface Window {
5
+ nizza: NizzaStore;
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nizza/core",
3
- "version": "0.3.0-alpha.13",
3
+ "version": "0.3.0-alpha.15",
4
4
  "type": "module",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.cjs",