@nizza/core 0.3.0-alpha.0 → 0.3.0-alpha.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.
@@ -1,4 +1,3 @@
1
1
  export * from './AggregateRoot';
2
2
  export * from './BaseMobxStore';
3
- export * from './errors';
4
3
  export * from './ValueObject';
@@ -5,3 +5,6 @@ export declare class UnexpectedError extends DomainError {
5
5
  export declare class AccountInvalidError extends DomainError {
6
6
  constructor();
7
7
  }
8
+ export declare class InvalidNizzaGlobalObjectError extends DomainError {
9
+ constructor(prop: string);
10
+ }
@@ -1,8 +1,7 @@
1
1
  import { FC } from 'react';
2
- import { BaseStore, StoreClass, StoreFactory } from '../types';
2
+ import { AppModuleStoreList, StoreClass } from '../types';
3
3
  interface Props {
4
- instances?: BaseStore[];
5
- stores: (StoreClass | StoreFactory)[];
4
+ stores: AppModuleStoreList;
6
5
  children?: React.ReactNode;
7
6
  }
8
7
  export declare const StoreProvider: FC<Props>;
@@ -1,8 +1,11 @@
1
1
  import { NizzaConfiguration, NizzaGlobalObjet } from '../types';
2
2
  export declare class NizzaStore implements NizzaGlobalObjet {
3
+ private _id;
3
4
  private _config;
4
5
  constructor();
5
6
  configure(config: NizzaConfiguration): void;
7
+ createGlobalObject(): void;
6
8
  get config(): NizzaConfiguration;
9
+ private validateRequiredProps;
7
10
  }
8
11
  export declare const nizza: NizzaStore;
@@ -22,6 +22,15 @@ export declare type Scalars = {
22
22
  DateTime: any;
23
23
  JSON: any;
24
24
  };
25
+ export declare type ActionSnackVideoSuccess = {
26
+ __typename?: 'ActionSnackVideoSuccess';
27
+ message: Scalars['String'];
28
+ };
29
+ export declare type Clip = {
30
+ endTime: Scalars['String'];
31
+ name: Scalars['String'];
32
+ startTime: Scalars['String'];
33
+ };
25
34
  export declare type Collection = {
26
35
  __typename?: 'Collection';
27
36
  account?: Maybe<Scalars['String']>;
@@ -60,6 +69,12 @@ export declare type CreateCollectionInput = {
60
69
  name: Scalars['String'];
61
70
  status?: InputMaybe<Status>;
62
71
  };
72
+ export declare type CreateSnackVideoInput = {
73
+ account: Scalars['String'];
74
+ clips: Array<Clip>;
75
+ idEvent: Scalars['String'];
76
+ };
77
+ export declare type CreateSnackVideoResult = ErrorGeneral | SnackVideoArray;
63
78
  export declare type CustomPlayer = {
64
79
  __typename?: 'CustomPlayer';
65
80
  account: Scalars['String'];
@@ -110,6 +125,11 @@ export declare type ErrorGeneral = Error & {
110
125
  statusCode: Scalars['String'];
111
126
  timestamp: Scalars['String'];
112
127
  };
128
+ export declare type FindManySnackVideoInput = {
129
+ account: Scalars['String'];
130
+ ids: Array<Scalars['String']>;
131
+ };
132
+ export declare type FindManySnackVideoResult = ErrorGeneral | SnackVideoArray;
113
133
  export declare type ManageCollectionProductInInput = {
114
134
  account: Scalars['String'];
115
135
  id: Scalars['String'];
@@ -122,22 +142,35 @@ export declare enum Methods {
122
142
  }
123
143
  export declare type Mutation = {
124
144
  __typename?: 'Mutation';
145
+ appendProductsSnackVideo: RelateEntitySnackVideo;
125
146
  createCollection: CollectionResult;
147
+ createSnackVideos: CreateSnackVideoResult;
126
148
  deleteAllCustomPlayer: CustomPlayerResult;
127
149
  deleteCollection: CollectionResult;
150
+ deleteRelationshipSnackVideo: RelateEntitySnackVideo;
128
151
  manageCollectionProduct: CollectionResult;
129
152
  updateCollection: CollectionResult;
130
153
  updateCustomPlayer: CustomPlayerResult;
154
+ updateProgressSnackVideo: UpdateProgressSnackVideosResult;
155
+ };
156
+ export declare type MutationAppendProductsSnackVideoArgs = {
157
+ data: RelateToProductsSnackVideoInput;
131
158
  };
132
159
  export declare type MutationCreateCollectionArgs = {
133
160
  data: CreateCollectionInput;
134
161
  };
162
+ export declare type MutationCreateSnackVideosArgs = {
163
+ data: CreateSnackVideoInput;
164
+ };
135
165
  export declare type MutationDeleteAllCustomPlayerArgs = {
136
166
  data: CustomPlayerInputAccount;
137
167
  };
138
168
  export declare type MutationDeleteCollectionArgs = {
139
169
  data: QueryInput;
140
170
  };
171
+ export declare type MutationDeleteRelationshipSnackVideoArgs = {
172
+ data: SnackVideoRelationshipKeys;
173
+ };
141
174
  export declare type MutationManageCollectionProductArgs = {
142
175
  data: ManageCollectionProductInInput;
143
176
  };
@@ -147,6 +180,9 @@ export declare type MutationUpdateCollectionArgs = {
147
180
  export declare type MutationUpdateCustomPlayerArgs = {
148
181
  data: CustomPlayerInput;
149
182
  };
183
+ export declare type MutationUpdateProgressSnackVideoArgs = {
184
+ data: UpdateProgressSnackVideosInput;
185
+ };
150
186
  export declare type Product = {
151
187
  __typename?: 'Product';
152
188
  account: Scalars['String'];
@@ -162,29 +198,139 @@ export declare type Product = {
162
198
  export declare type Query = {
163
199
  __typename?: 'Query';
164
200
  findCollection: CollectionResult;
201
+ findManySnackVideos: FindManySnackVideoResult;
165
202
  getAllCollection: CollectionResultArray;
166
203
  getAllCustomPlayer: CustomPlayerResultArray;
204
+ getAllSnackVideos: SnackVideoGetAll;
205
+ getRelationshipSnackVideos: RelationshipSnackVideoArrayResponse;
167
206
  searchCollection: CollectionResultArray;
207
+ searchSnackVideos: SnackVideoGetAll;
168
208
  };
169
209
  export declare type QueryFindCollectionArgs = {
170
210
  data: QueryInput;
171
211
  };
212
+ export declare type QueryFindManySnackVideosArgs = {
213
+ data: FindManySnackVideoInput;
214
+ };
172
215
  export declare type QueryGetAllCollectionArgs = {
173
216
  data: QueryInput;
174
217
  };
175
218
  export declare type QueryGetAllCustomPlayerArgs = {
176
219
  data: QueryInput;
177
220
  };
221
+ export declare type QueryGetAllSnackVideosArgs = {
222
+ data: QueryInput;
223
+ };
224
+ export declare type QueryGetRelationshipSnackVideosArgs = {
225
+ data: SnackVideoRelationshipInput;
226
+ };
178
227
  export declare type QuerySearchCollectionArgs = {
179
228
  data: QueryInput;
180
229
  };
230
+ export declare type QuerySearchSnackVideosArgs = {
231
+ data: SearchInput;
232
+ };
181
233
  export declare type QueryInput = {
182
234
  account: Scalars['String'];
235
+ cursor?: InputMaybe<Scalars['JSON']>;
183
236
  id?: InputMaybe<Scalars['String']>;
184
237
  limit?: InputMaybe<Scalars['Float']>;
185
238
  page?: InputMaybe<Scalars['Float']>;
186
239
  search?: InputMaybe<Scalars['String']>;
187
240
  };
241
+ export declare type RelateEntitySnackVideo = ActionSnackVideoSuccess | ErrorGeneral;
242
+ export declare type RelateToProductsSnackVideoInput = {
243
+ account: Scalars['String'];
244
+ name: Scalars['String'];
245
+ productsId: Array<Scalars['String']>;
246
+ shortId: Scalars['String'];
247
+ url: Scalars['String'];
248
+ };
249
+ export declare type RelationshipSnackVideo = {
250
+ __typename?: 'RelationshipSnackVideo';
251
+ attributeId: Scalars['String'];
252
+ created: Scalars['String'];
253
+ entity: Scalars['String'];
254
+ modified: Scalars['String'];
255
+ name: Scalars['String'];
256
+ shortId: Scalars['String'];
257
+ sourceEntity: Scalars['String'];
258
+ url: Scalars['String'];
259
+ };
260
+ export declare type RelationshipSnackVideoArray = {
261
+ __typename?: 'RelationshipSnackVideoArray';
262
+ data?: Maybe<Array<RelationshipSnackVideo>>;
263
+ duration?: Maybe<Scalars['String']>;
264
+ isArray?: Maybe<Scalars['Boolean']>;
265
+ method?: Maybe<Scalars['String']>;
266
+ path?: Maybe<Scalars['String']>;
267
+ };
268
+ export declare type RelationshipSnackVideoArrayResponse = ErrorGeneral | RelationshipSnackVideoArray;
269
+ export declare type SearchInput = {
270
+ account: Scalars['String'];
271
+ cursor?: InputMaybe<Scalars['JSON']>;
272
+ id?: InputMaybe<Scalars['String']>;
273
+ limit?: InputMaybe<Scalars['Float']>;
274
+ page?: InputMaybe<Scalars['Float']>;
275
+ search: Scalars['String'];
276
+ };
277
+ export declare type SnackVideo = {
278
+ __typename?: 'SnackVideo';
279
+ duration: Scalars['Float'];
280
+ eventId: Scalars['String'];
281
+ eventName: Scalars['String'];
282
+ id: Scalars['String'];
283
+ name: Scalars['String'];
284
+ thumbnailUrl: Scalars['String'];
285
+ uploadProgress: Scalars['Float'];
286
+ url: Scalars['String'];
287
+ };
288
+ export declare type SnackVideoArray = {
289
+ __typename?: 'SnackVideoArray';
290
+ data?: Maybe<Array<SnackVideo>>;
291
+ duration?: Maybe<Scalars['String']>;
292
+ isArray?: Maybe<Scalars['Boolean']>;
293
+ method?: Maybe<Scalars['String']>;
294
+ path?: Maybe<Scalars['String']>;
295
+ };
296
+ export declare type SnackVideoCreatedArray = {
297
+ __typename?: 'SnackVideoCreatedArray';
298
+ data?: Maybe<SnackVideoCreatedWithCursor>;
299
+ duration?: Maybe<Scalars['String']>;
300
+ isArray?: Maybe<Scalars['Boolean']>;
301
+ method?: Maybe<Scalars['String']>;
302
+ path?: Maybe<Scalars['String']>;
303
+ };
304
+ export declare type SnackVideoCreatedWithCursor = {
305
+ __typename?: 'SnackVideoCreatedWithCursor';
306
+ cursor?: Maybe<Scalars['JSON']>;
307
+ snackVideos?: Maybe<Array<SnackVideosCreated>>;
308
+ };
309
+ export declare type SnackVideoGetAll = ErrorGeneral | SnackVideoCreatedArray;
310
+ export declare type SnackVideoRelationshipInput = {
311
+ account: Scalars['String'];
312
+ shortId: Scalars['String'];
313
+ };
314
+ export declare type SnackVideoRelationshipKeys = {
315
+ account: Scalars['String'];
316
+ attributeId: Scalars['String'];
317
+ shortId: Scalars['String'];
318
+ sourceEntity: Scalars['String'];
319
+ };
320
+ export declare type SnackVideosCreated = {
321
+ __typename?: 'SnackVideosCreated';
322
+ created: Scalars['String'];
323
+ duration: Scalars['Float'];
324
+ entity: Scalars['String'];
325
+ eventId: Scalars['String'];
326
+ eventName: Scalars['String'];
327
+ id: Scalars['String'];
328
+ modified: Scalars['String'];
329
+ name: Scalars['String'];
330
+ thumbnailUrl: Scalars['String'];
331
+ uploadProgress: Scalars['Float'];
332
+ url: Scalars['String'];
333
+ };
188
334
  export declare enum Status {
189
335
  Active = "active",
190
336
  Inactive = "inactive"
@@ -196,6 +342,26 @@ export declare type UpdateCollectionInput = {
196
342
  name?: InputMaybe<Scalars['String']>;
197
343
  status?: InputMaybe<Status>;
198
344
  };
345
+ export declare type UpdateProgressSnackVideos = {
346
+ __typename?: 'UpdateProgressSnackVideos';
347
+ account: Scalars['String'];
348
+ id: Scalars['String'];
349
+ progress: Scalars['Float'];
350
+ };
351
+ export declare type UpdateProgressSnackVideosData = {
352
+ __typename?: 'UpdateProgressSnackVideosData';
353
+ data?: Maybe<UpdateProgressSnackVideos>;
354
+ duration?: Maybe<Scalars['String']>;
355
+ isArray?: Maybe<Scalars['Boolean']>;
356
+ method?: Maybe<Scalars['String']>;
357
+ path?: Maybe<Scalars['String']>;
358
+ };
359
+ export declare type UpdateProgressSnackVideosInput = {
360
+ account: Scalars['String'];
361
+ id: Scalars['String'];
362
+ progress: Scalars['Float'];
363
+ };
364
+ export declare type UpdateProgressSnackVideosResult = ErrorGeneral | UpdateProgressSnackVideosData;
199
365
  export declare type DeleteAllCustomizationMutationVariables = Exact<{
200
366
  data: CustomPlayerInputAccount;
201
367
  }>;
@@ -410,6 +576,37 @@ export declare type UpdateCollectionMutation = {
410
576
  timestamp: string;
411
577
  };
412
578
  };
579
+ export declare type GetAllSnackVideosQueryVariables = Exact<{
580
+ data: QueryInput;
581
+ }>;
582
+ export declare type GetAllSnackVideosQuery = {
583
+ __typename?: 'Query';
584
+ getAllSnackVideos: {
585
+ __typename: 'ErrorGeneral';
586
+ message: string;
587
+ statusCode: string;
588
+ timestamp: string;
589
+ } | {
590
+ __typename: 'SnackVideoCreatedArray';
591
+ data?: {
592
+ __typename?: 'SnackVideoCreatedWithCursor';
593
+ cursor?: any | null;
594
+ snackVideos?: Array<{
595
+ __typename?: 'SnackVideosCreated';
596
+ id: string;
597
+ name: string;
598
+ url: string;
599
+ thumbnailUrl: string;
600
+ uploadProgress: number;
601
+ duration: number;
602
+ eventId: string;
603
+ eventName: string;
604
+ created: string;
605
+ modified: string;
606
+ }> | null;
607
+ } | null;
608
+ };
609
+ };
413
610
  export declare const DeleteAllCustomizationDocument: DocumentNode<DeleteAllCustomizationMutation, Exact<{
414
611
  data: CustomPlayerInputAccount;
415
612
  }>>;
@@ -440,3 +637,6 @@ export declare const SearchCollectionsDocument: DocumentNode<SearchCollectionsQu
440
637
  export declare const UpdateCollectionDocument: DocumentNode<UpdateCollectionMutation, Exact<{
441
638
  data: UpdateCollectionInput;
442
639
  }>>;
640
+ export declare const GetAllSnackVideosDocument: DocumentNode<GetAllSnackVideosQuery, Exact<{
641
+ data: QueryInput;
642
+ }>>;
@@ -1,10 +1,17 @@
1
1
  import { RouteProps } from 'react-router-dom';
2
- import { StoreClass, StoreFactory } from './mobx-store';
3
- import { BaseStore } from './utils';
4
- export interface AppModule<T extends BaseStore> {
2
+ import { StoreClass } from './mobx-store';
3
+ declare type Store<T extends {
4
+ new (): InstanceType<T>;
5
+ }> = Readonly<{
6
+ readonly class: T;
7
+ readonly value: InstanceType<T>;
8
+ }>;
9
+ export declare type AppModuleStoreList = Store<any>[];
10
+ export interface AppModule {
5
11
  key: string;
6
12
  label: string;
7
- routeProps: RouteProps;
8
- instance: T;
9
- stores?: (StoreClass | StoreFactory)[];
13
+ route?: RouteProps;
14
+ stores?: AppModuleStoreList;
10
15
  }
16
+ export declare function createStore<T extends StoreClass>(store: T): Store<T>;
17
+ export {};
@@ -1,7 +1,5 @@
1
1
  import environment from '../../environments/environment';
2
2
  export declare type Constructor<T = any> = new (...args: any[]) => T;
3
- export declare abstract class BaseStore {
4
- }
5
3
  export interface ApiV1Response<T = any> {
6
4
  success: boolean;
7
5
  message: string;
@@ -20,3 +18,6 @@ export interface ApiCall extends RequestInit {
20
18
  raw?: boolean;
21
19
  }
22
20
  export declare type Environment<T> = typeof environment & T;
21
+ export declare type RequiredKeys<T> = {
22
+ [K in keyof T]-?: {} extends Pick<T, K> ? never : K;
23
+ }[keyof T];
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import React, { ComponentProps, ReactNode } from 'react';
2
2
  interface Opts {
3
- fallback: React.ReactNode;
3
+ fallback: ReactNode;
4
4
  }
5
5
  declare type Unpromisify<T> = T extends Promise<infer P> ? P : never;
6
6
  export declare const lazyLoad: <T extends Promise<any>, U extends React.ComponentType<any>>(importFunc: () => T, selectorFunc?: ((s: Unpromisify<T>) => U) | undefined, opts?: Opts) => (props: React.ComponentProps<U>) => JSX.Element;
package/dist/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@nizza/core",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.0-alpha.10",
4
4
  "type": "module",
5
- "main": "dist/index.es.js",
6
- "module": "dist/index.es.js",
7
- "types": "dist/index.d.ts",
8
5
  "source": "src/index.ts",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
9
  "files": [
10
10
  "dist"
11
11
  ],
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@nizza/core",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.0-alpha.10",
4
4
  "type": "module",
5
- "main": "dist/index.es.js",
6
- "module": "dist/index.es.js",
7
- "types": "dist/index.d.ts",
8
5
  "source": "src/index.ts",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
9
  "files": [
10
10
  "dist"
11
11
  ],
File without changes
File without changes