@monorise/react 1.0.12 → 3.0.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 (64) hide show
  1. package/dist/actions/auth.action.d.ts +4 -1
  2. package/dist/actions/auth.action.d.ts.map +1 -1
  3. package/dist/actions/auth.action.js +7 -6
  4. package/dist/actions/auth.action.js.map +1 -1
  5. package/dist/actions/core.action.d.ts +163 -12
  6. package/dist/actions/core.action.d.ts.map +1 -1
  7. package/dist/actions/core.action.js +592 -168
  8. package/dist/actions/core.action.js.map +1 -1
  9. package/dist/index.d.ts +456 -30
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/api.d.ts +15 -5
  14. package/dist/lib/api.d.ts.map +1 -1
  15. package/dist/lib/api.js +12 -6
  16. package/dist/lib/api.js.map +1 -1
  17. package/dist/lib/utils.d.ts +8 -0
  18. package/dist/lib/utils.d.ts.map +1 -1
  19. package/dist/lib/utils.js +24 -0
  20. package/dist/lib/utils.js.map +1 -1
  21. package/dist/services/core.service.d.ts +9 -1
  22. package/dist/services/core.service.d.ts.map +1 -1
  23. package/dist/services/core.service.js +32 -20
  24. package/dist/services/core.service.js.map +1 -1
  25. package/dist/services/filestore.service.d.ts +4 -1
  26. package/dist/services/filestore.service.d.ts.map +1 -1
  27. package/dist/services/filestore.service.js +49 -4
  28. package/dist/services/filestore.service.js.map +1 -1
  29. package/dist/store/monorise.store.d.ts +6 -0
  30. package/dist/store/monorise.store.d.ts.map +1 -1
  31. package/dist/store/monorise.store.js +1 -0
  32. package/dist/store/monorise.store.js.map +1 -1
  33. package/dist/tsconfig.tsbuildinfo +1 -0
  34. package/dist/types/api.type.d.ts +2 -0
  35. package/dist/types/api.type.d.ts.map +1 -1
  36. package/dist/types/api.type.js.map +1 -1
  37. package/package.json +20 -10
  38. package/actions/app.action.ts +0 -218
  39. package/actions/auth.action.ts +0 -94
  40. package/actions/config.action.ts +0 -51
  41. package/actions/core.action.ts +0 -940
  42. package/dist/index.esm.js +0 -1601
  43. package/dist/index.jsx +0 -48
  44. package/dist/index.jsx.map +0 -1
  45. package/dist/lib/api.jsx +0 -70
  46. package/dist/lib/api.jsx.map +0 -1
  47. package/dist/lib/config.d.ts +0 -5
  48. package/dist/lib/config.d.ts.map +0 -1
  49. package/dist/lib/config.js +0 -24
  50. package/dist/lib/config.js.map +0 -1
  51. package/index.ts +0 -194
  52. package/lib/api.ts +0 -150
  53. package/lib/constant.ts +0 -1
  54. package/lib/entity.ts +0 -76
  55. package/lib/utils.ts +0 -12
  56. package/services/auth.service.ts +0 -65
  57. package/services/core.service.ts +0 -415
  58. package/services/filestore.service.ts +0 -136
  59. package/store/monorise.store.ts +0 -105
  60. package/tsconfig.json +0 -118
  61. package/types/api.type.ts +0 -57
  62. package/types/axios.type.ts +0 -14
  63. package/types/monorise.type.ts +0 -8
  64. package/types/mutual.type.ts +0 -32
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { Entity, MonoriseEntityConfig } from '@monorise/base';
2
2
  import type { AxiosResponse } from 'axios';
3
+ import { getEntityRequestKey, getMutualRequestKey, getTagRequestKey, getUniqueFieldRequestKey } from './lib/utils';
3
4
  import { Mutual, MutualData, MutualDataMapping, MutualDataWithIndex } from './types/mutual.type';
4
5
  type Options<T extends Record<string, React.ComponentType<any>>> = {
5
6
  authBaseUrl?: string;
@@ -12,25 +13,115 @@ type Options<T extends Record<string, React.ComponentType<any>>> = {
12
13
  onApiSuccess?: <T>(response: AxiosResponse<T>, feedbackSuccess: ((data: AxiosResponse<T>['data']) => React.ReactNode) | string | boolean) => void;
13
14
  };
14
15
  declare const Monorise: {
15
- listMoreEntities: <T extends Entity>(entityType: T, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
16
- createEntity: <T extends Entity>(entityType: T, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<import("@monorise/base").CreatedEntity<T>>;
17
- upsertEntity: <T extends Entity>(entityType: T, id: string, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
18
- editEntity: <T extends Entity>(entityType: T, id: string, entity: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
19
- deleteEntity: <T extends Entity>(entityType: T, id: string, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
16
+ listMoreEntities: <T extends Entity>(entityType: T, opts?: import("./services/core.service").CommonOptions) => Promise<{
17
+ error: Error & {
18
+ originalError?: unknown;
19
+ };
20
+ } | undefined>;
21
+ createEntity: <T extends Entity>(entityType: T, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<{
22
+ data: import("@monorise/base").CreatedEntity<T>;
23
+ error?: undefined;
24
+ } | {
25
+ error: Error & {
26
+ originalError?: unknown;
27
+ };
28
+ data?: undefined;
29
+ }>;
30
+ upsertEntity: <T extends Entity>(entityType: T, id: string, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<{
31
+ data: import("@monorise/base").CreatedEntity<T>;
32
+ error?: undefined;
33
+ } | {
34
+ error: Error & {
35
+ originalError?: unknown;
36
+ };
37
+ data?: undefined;
38
+ }>;
39
+ getEntity: <T extends Entity>(entityType: T, id: string, opts?: import("./services/core.service").CommonOptions) => Promise<{
40
+ data?: import("@monorise/base").CreatedEntity<T>;
41
+ error?: import("./types/api.type").ApplicationRequestError | (Error & {
42
+ originalError?: unknown;
43
+ });
44
+ }>;
45
+ editEntity: <T extends Entity>(entityType: T, id: string, entity: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<{
46
+ data: import("@monorise/base").CreatedEntity<T>;
47
+ error?: undefined;
48
+ } | {
49
+ error: Error & {
50
+ originalError?: unknown;
51
+ };
52
+ data?: undefined;
53
+ }>;
54
+ deleteEntity: <T extends Entity>(entityType: T, id: string, opts?: import("./services/core.service").CommonOptions) => Promise<{
55
+ data: {
56
+ entityId: string;
57
+ };
58
+ error?: undefined;
59
+ } | {
60
+ error: Error & {
61
+ originalError?: unknown;
62
+ };
63
+ data?: undefined;
64
+ }>;
20
65
  getMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string | null, entityId: string, opts?: import("./services/core.service").CommonOptions & {
21
66
  defaultMutualData?: Record<string, any>;
22
- }) => Promise<Mutual<B, T> | undefined>;
67
+ }) => Promise<{
68
+ error: import("./types/api.type").ApplicationRequestError;
69
+ data?: undefined;
70
+ } | {
71
+ data: Mutual<B, T>;
72
+ error?: undefined;
73
+ } | {
74
+ error: Error & {
75
+ originalError?: unknown;
76
+ };
77
+ data?: undefined;
78
+ }>;
23
79
  updateLocalEntity: <T extends Entity>(entityType: Entity, entityId: string, data?: Partial<import("@monorise/base").DraftEntity<T>>) => Promise<void>;
24
- createMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
80
+ createMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<{
81
+ data: Mutual<B, T>;
82
+ error?: undefined;
83
+ } | {
84
+ error: Error & {
85
+ originalError?: unknown;
86
+ };
87
+ data?: undefined;
88
+ }>;
89
+ createLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, mutualData: MutualData<B, T>, data: import("@monorise/base").EntitySchemaMap[T] | Record<string, any>) => Promise<void>;
25
90
  upsertLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, mutualData: MutualData<B, T>, data?: import("@monorise/base").EntitySchemaMap[T] | Record<string, any>) => Promise<void>;
26
- editMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
27
- deleteMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId?: string, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
91
+ editMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<{
92
+ data: Mutual<B, T>;
93
+ error?: undefined;
94
+ } | {
95
+ error: Error & {
96
+ originalError?: unknown;
97
+ };
98
+ data?: undefined;
99
+ }>;
100
+ deleteMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId?: string, opts?: import("./services/core.service").CommonOptions) => Promise<{
101
+ data: any;
102
+ error?: undefined;
103
+ } | {
104
+ error: Error & {
105
+ originalError?: unknown;
106
+ };
107
+ data?: undefined;
108
+ }>;
28
109
  deleteLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string) => void;
29
110
  useEntity: <T extends Entity>(entityType: T, id?: string, opts?: import("./services/core.service").CommonOptions) => {
30
111
  entity: import("@monorise/base").CreatedEntity<T> | undefined;
31
112
  isLoading: boolean;
32
113
  error?: import("./types/api.type").ApplicationRequestError;
33
114
  requestKey: string;
115
+ isFirstFetched?: boolean;
116
+ refetch: () => Promise<import("@monorise/base").CreatedEntity<T> | undefined>;
117
+ };
118
+ useEntityByUniqueField: <T extends Entity>(entityType: T, fieldName: string, value?: string, opts?: import("./services/core.service").CommonOptions) => {
119
+ entity: import("@monorise/base").CreatedEntity<T> | undefined;
120
+ isLoading: boolean;
121
+ error?: import("./types/api.type").ApplicationRequestError;
122
+ requestKey: string;
123
+ isFirstFetched?: boolean;
124
+ refetch: () => Promise<import("@monorise/base").CreatedEntity<T> | undefined>;
34
125
  };
35
126
  useEntities: <T extends Entity>(entityType: T, params?: {
36
127
  skRange?: {
@@ -38,7 +129,9 @@ declare const Monorise: {
38
129
  end: string;
39
130
  };
40
131
  all?: boolean;
41
- }, opts?: import("./services/core.service").CommonOptions) => {
132
+ }, opts?: import("./services/core.service").CommonOptions & {
133
+ searchInterval?: number;
134
+ }) => {
42
135
  isLoading: boolean;
43
136
  entities?: import("@monorise/base").CreatedEntity<T>[];
44
137
  entitiesMap: Map<string, import("@monorise/base").CreatedEntity<T>>;
@@ -48,6 +141,10 @@ declare const Monorise: {
48
141
  value: string;
49
142
  onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
50
143
  };
144
+ lastKey?: string;
145
+ isFirstFetched?: boolean;
146
+ listMore: () => void;
147
+ refetch: () => void;
51
148
  };
52
149
  useMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId: string | null, id: string, opts?: import("./services/core.service").CommonOptions & {
53
150
  defaultMutualData?: Record<string, any>;
@@ -63,11 +160,66 @@ declare const Monorise: {
63
160
  isLoading: boolean;
64
161
  requestKey: string;
65
162
  error?: import("./types/api.type").ApplicationRequestError;
163
+ isFirstFetched?: boolean;
164
+ lastKey?: string;
165
+ listMore?: () => void;
66
166
  };
67
- listEntitiesByTag: <T extends Entity>(entityType: T, tagName: string, opts?: import("./services/core.service").CommonOptions & {
167
+ useTaggedEntities: <T extends Entity>(entityType: T, tagName: string, opts?: import("./services/core.service").CommonOptions & {
68
168
  params?: import("./services/core.service").ListEntitiesByTagParams;
69
- }) => Promise<void>;
169
+ }) => {
170
+ entities: import("@monorise/base").CreatedEntity<T>[];
171
+ entitiesMap: Map<string, import("@monorise/base").CreatedEntity<T>>;
172
+ isLoading: boolean;
173
+ requestKey: string;
174
+ error: import("./types/api.type").ApplicationRequestError | undefined;
175
+ isFirstFetched: boolean;
176
+ lastKey: string;
177
+ refetch: () => Promise<{
178
+ error: import("./types/api.type").ApplicationRequestError;
179
+ data?: undefined;
180
+ } | {
181
+ data: {
182
+ entities: import("@monorise/base").CreatedEntity<Entity>[];
183
+ lastKey: null;
184
+ };
185
+ error?: undefined;
186
+ } | {
187
+ data: {
188
+ entities: import("@monorise/base").CreatedEntity<T>[];
189
+ lastKey: string;
190
+ };
191
+ error?: undefined;
192
+ } | {
193
+ error: Error & {
194
+ originalError?: unknown;
195
+ };
196
+ data?: undefined;
197
+ } | undefined>;
198
+ listMore: () => Promise<{
199
+ error: import("./types/api.type").ApplicationRequestError;
200
+ data?: undefined;
201
+ } | {
202
+ data: {
203
+ entities: import("@monorise/base").CreatedEntity<Entity>[];
204
+ lastKey: null;
205
+ };
206
+ error?: undefined;
207
+ } | {
208
+ data: {
209
+ entities: import("@monorise/base").CreatedEntity<T>[];
210
+ lastKey: string;
211
+ };
212
+ error?: undefined;
213
+ } | {
214
+ error: Error & {
215
+ originalError?: unknown;
216
+ };
217
+ data?: undefined;
218
+ } | undefined>;
219
+ };
70
220
  useEntityState: <T extends Entity>(entityType: T) => Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>[T];
221
+ updateLocalTaggedEntity: <T extends Entity>(entityType: T, entityId: string, tagName: string, data?: Partial<import("@monorise/base").DraftEntity<T>>, params?: import("./services/core.service").ListEntitiesByTagParams) => void;
222
+ deleteLocalTaggedEntity: <T extends Entity>(entityType: T, entityId: string, tagName: string, params?: import("./services/core.service").ListEntitiesByTagParams) => void;
71
223
  requestLogin: (entityType: Entity, payload: {
72
224
  email: string;
73
225
  }) => Promise<any>;
@@ -78,7 +230,10 @@ declare const Monorise: {
78
230
  impersonatorId?: string;
79
231
  };
80
232
  getProfile: () => Promise<void>;
81
- useIsUnauthorized: () => boolean;
233
+ useIsUnauthorized: () => {
234
+ isUnauthorized: boolean;
235
+ isLoading: boolean;
236
+ };
82
237
  setIsUnauthorized: (isUnauthorized: boolean) => void;
83
238
  logout: () => void;
84
239
  startLoading: <T>({ requestKey, isInterruptive, message, request, }: {
@@ -143,6 +298,7 @@ declare const Monorise: {
143
298
  email: string;
144
299
  accountId: string;
145
300
  };
301
+ isLoading: boolean;
146
302
  };
147
303
  }>, "setState"> & {
148
304
  setState<A extends string | {
@@ -170,6 +326,7 @@ declare const Monorise: {
170
326
  email: string;
171
327
  accountId: string;
172
328
  };
329
+ isLoading: boolean;
173
330
  };
174
331
  } | Partial<{
175
332
  app: {
@@ -194,6 +351,7 @@ declare const Monorise: {
194
351
  email: string;
195
352
  accountId: string;
196
353
  };
354
+ isLoading: boolean;
197
355
  };
198
356
  }> | ((state: {
199
357
  app: {
@@ -218,6 +376,7 @@ declare const Monorise: {
218
376
  email: string;
219
377
  accountId: string;
220
378
  };
379
+ isLoading: boolean;
221
380
  };
222
381
  }) => {
223
382
  app: {
@@ -242,6 +401,7 @@ declare const Monorise: {
242
401
  email: string;
243
402
  accountId: string;
244
403
  };
404
+ isLoading: boolean;
245
405
  };
246
406
  } | Partial<{
247
407
  app: {
@@ -266,15 +426,57 @@ declare const Monorise: {
266
426
  email: string;
267
427
  accountId: string;
268
428
  };
429
+ isLoading: boolean;
269
430
  };
270
431
  }>), replace?: boolean | undefined, action?: A | undefined): void;
271
432
  }>;
272
433
  axios: {
273
- post: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
274
- put: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
275
- patch: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
276
- delete: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
277
- get: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
434
+ post: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D> & {
435
+ requestKey: string;
436
+ isInterruptive?: boolean;
437
+ feedback?: {
438
+ loading?: string | boolean;
439
+ success?: ((data: any) => string) | string | boolean;
440
+ failure?: string | boolean;
441
+ };
442
+ }) => Promise<R>;
443
+ put: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D> & {
444
+ requestKey: string;
445
+ isInterruptive?: boolean;
446
+ feedback?: {
447
+ loading?: string | boolean;
448
+ success?: ((data: any) => string) | string | boolean;
449
+ failure?: string | boolean;
450
+ };
451
+ }) => Promise<R>;
452
+ patch: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D> & {
453
+ requestKey: string;
454
+ isInterruptive?: boolean;
455
+ feedback?: {
456
+ loading?: string | boolean;
457
+ success?: ((data: any) => string) | string | boolean;
458
+ failure?: string | boolean;
459
+ };
460
+ }) => Promise<R>;
461
+ delete: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D> & {
462
+ requestKey: string;
463
+ isInterruptive?: boolean;
464
+ feedback?: {
465
+ loading?: string | boolean;
466
+ success?: ((data: any) => string) | string | boolean;
467
+ failure?: string | boolean;
468
+ };
469
+ }) => Promise<R>;
470
+ get: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D> & {
471
+ requestKey: string;
472
+ isInterruptive?: boolean;
473
+ feedback?: {
474
+ loading?: string | boolean;
475
+ success?: ((data: any) => string) | string | boolean;
476
+ failure?: string | boolean;
477
+ };
478
+ }) => Promise<R>;
479
+ create(config?: import("axios").CreateAxiosDefaults): import("axios").AxiosInstance;
278
480
  defaults: Omit<import("axios").AxiosDefaults, "headers"> & {
279
481
  headers: import("axios").HeadersDefaults & {
280
482
  [key: string]: import("axios").AxiosHeaderValue;
@@ -300,11 +502,13 @@ declare const Monorise: {
300
502
  }) => void;
301
503
  };
302
504
  filestoreService: {
303
- uploadFile: ({ file, scope, directory, name, }: {
505
+ uploadFile: ({ file, scope, directory, name, disableLoading, onProgress, }: {
304
506
  file: File;
305
507
  scope: string;
306
508
  directory: string;
307
509
  name: string;
510
+ disableLoading?: boolean;
511
+ onProgress?: (progress: number) => void;
308
512
  }) => Promise<AxiosResponse<any, any>>;
309
513
  deleteFiles: (keys: string[]) => Promise<any>;
310
514
  uploadVideo: ({ file, scope, directory, name, }: {
@@ -312,6 +516,16 @@ declare const Monorise: {
312
516
  scope: string;
313
517
  directory: string;
314
518
  name: string;
519
+ disableLoading?: boolean;
520
+ onProgress?: (progress: number) => void;
521
+ }) => Promise<any>;
522
+ uploadAudio: ({ file, scope, directory, name, }: {
523
+ file: File;
524
+ scope: string;
525
+ directory: string;
526
+ name: string;
527
+ disableLoading?: boolean;
528
+ onProgress?: (progress: number) => void;
315
529
  }) => Promise<any>;
316
530
  getJobStatus: (id: string) => Promise<any>;
317
531
  setOptions: (opts: {
@@ -338,6 +552,7 @@ declare const Monorise: {
338
552
  lastKey: string;
339
553
  }, any>>;
340
554
  getEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
555
+ getEntityByUniqueField: (fieldName: string, value: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
341
556
  createEntity: (values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
342
557
  upsertEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
343
558
  editEntity: (id: string, values: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
@@ -384,6 +599,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
384
599
  email: string;
385
600
  accountId: string;
386
601
  };
602
+ isLoading: boolean;
387
603
  };
388
604
  }>, "setState"> & {
389
605
  setState<A extends string | {
@@ -411,6 +627,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
411
627
  email: string;
412
628
  accountId: string;
413
629
  };
630
+ isLoading: boolean;
414
631
  };
415
632
  } | Partial<{
416
633
  app: {
@@ -435,6 +652,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
435
652
  email: string;
436
653
  accountId: string;
437
654
  };
655
+ isLoading: boolean;
438
656
  };
439
657
  }> | ((state: {
440
658
  app: {
@@ -459,6 +677,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
459
677
  email: string;
460
678
  accountId: string;
461
679
  };
680
+ isLoading: boolean;
462
681
  };
463
682
  }) => {
464
683
  app: {
@@ -483,6 +702,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
483
702
  email: string;
484
703
  accountId: string;
485
704
  };
705
+ isLoading: boolean;
486
706
  };
487
707
  } | Partial<{
488
708
  app: {
@@ -507,14 +727,56 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
507
727
  email: string;
508
728
  accountId: string;
509
729
  };
730
+ isLoading: boolean;
510
731
  };
511
732
  }>), replace?: boolean | undefined, action?: A | undefined): void;
512
733
  }>, axios: {
513
- post: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
514
- put: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
515
- patch: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
516
- delete: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
517
- get: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
734
+ post: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D> & {
735
+ requestKey: string;
736
+ isInterruptive?: boolean;
737
+ feedback?: {
738
+ loading?: string | boolean;
739
+ success?: ((data: any) => string) | string | boolean;
740
+ failure?: string | boolean;
741
+ };
742
+ }) => Promise<R>;
743
+ put: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D> & {
744
+ requestKey: string;
745
+ isInterruptive?: boolean;
746
+ feedback?: {
747
+ loading?: string | boolean;
748
+ success?: ((data: any) => string) | string | boolean;
749
+ failure?: string | boolean;
750
+ };
751
+ }) => Promise<R>;
752
+ patch: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D> & {
753
+ requestKey: string;
754
+ isInterruptive?: boolean;
755
+ feedback?: {
756
+ loading?: string | boolean;
757
+ success?: ((data: any) => string) | string | boolean;
758
+ failure?: string | boolean;
759
+ };
760
+ }) => Promise<R>;
761
+ delete: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D> & {
762
+ requestKey: string;
763
+ isInterruptive?: boolean;
764
+ feedback?: {
765
+ loading?: string | boolean;
766
+ success?: ((data: any) => string) | string | boolean;
767
+ failure?: string | boolean;
768
+ };
769
+ }) => Promise<R>;
770
+ get: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D> & {
771
+ requestKey: string;
772
+ isInterruptive?: boolean;
773
+ feedback?: {
774
+ loading?: string | boolean;
775
+ success?: ((data: any) => string) | string | boolean;
776
+ failure?: string | boolean;
777
+ };
778
+ }) => Promise<R>;
779
+ create(config?: import("axios").CreateAxiosDefaults): import("axios").AxiosInstance;
518
780
  defaults: Omit<import("axios").AxiosDefaults, "headers"> & {
519
781
  headers: import("axios").HeadersDefaults & {
520
782
  [key: string]: import("axios").AxiosHeaderValue;
@@ -538,11 +800,13 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
538
800
  apiBaseUrl?: string;
539
801
  }) => void;
540
802
  }, filestoreService: {
541
- uploadFile: ({ file, scope, directory, name, }: {
803
+ uploadFile: ({ file, scope, directory, name, disableLoading, onProgress, }: {
542
804
  file: File;
543
805
  scope: string;
544
806
  directory: string;
545
807
  name: string;
808
+ disableLoading?: boolean;
809
+ onProgress?: (progress: number) => void;
546
810
  }) => Promise<AxiosResponse<any, any>>;
547
811
  deleteFiles: (keys: string[]) => Promise<any>;
548
812
  uploadVideo: ({ file, scope, directory, name, }: {
@@ -550,6 +814,16 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
550
814
  scope: string;
551
815
  directory: string;
552
816
  name: string;
817
+ disableLoading?: boolean;
818
+ onProgress?: (progress: number) => void;
819
+ }) => Promise<any>;
820
+ uploadAudio: ({ file, scope, directory, name, }: {
821
+ file: File;
822
+ scope: string;
823
+ directory: string;
824
+ name: string;
825
+ disableLoading?: boolean;
826
+ onProgress?: (progress: number) => void;
553
827
  }) => Promise<any>;
554
828
  getJobStatus: (id: string) => Promise<any>;
555
829
  setOptions: (opts: {
@@ -575,6 +849,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
575
849
  lastKey: string;
576
850
  }, any>>;
577
851
  getEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
852
+ getEntityByUniqueField: (fieldName: string, value: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
578
853
  createEntity: (values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
579
854
  upsertEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
580
855
  editEntity: (id: string, values: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
@@ -623,20 +898,107 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
623
898
  email: string;
624
899
  accountId: string;
625
900
  impersonatorId?: string;
626
- }, getProfile: () => Promise<void>, useIsUnauthorized: () => boolean, setIsUnauthorized: (isUnauthorized: boolean) => void, logout: () => void, listMoreEntities: <T extends Entity>(entityType: T, opts?: import("./services/core.service").CommonOptions) => Promise<void>, createEntity: <T extends Entity>(entityType: T, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<import("@monorise/base").CreatedEntity<T>>, upsertEntity: <T extends Entity>(entityType: T, id: string, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<void>, editEntity: <T extends Entity>(entityType: T, id: string, entity: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<void>, updateLocalEntity: <T extends Entity>(entityType: Entity, entityId: string, data?: Partial<import("@monorise/base").DraftEntity<T>>) => Promise<void>, deleteEntity: <T extends Entity>(entityType: T, id: string, opts?: import("./services/core.service").CommonOptions) => Promise<void>, getMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string | null, entityId: string, opts?: import("./services/core.service").CommonOptions & {
901
+ }, getProfile: () => Promise<void>, useIsUnauthorized: () => {
902
+ isUnauthorized: boolean;
903
+ isLoading: boolean;
904
+ }, setIsUnauthorized: (isUnauthorized: boolean) => void, logout: () => void, listMoreEntities: <T extends Entity>(entityType: T, opts?: import("./services/core.service").CommonOptions) => Promise<{
905
+ error: Error & {
906
+ originalError?: unknown;
907
+ };
908
+ } | undefined>, createEntity: <T extends Entity>(entityType: T, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<{
909
+ data: import("@monorise/base").CreatedEntity<T>;
910
+ error?: undefined;
911
+ } | {
912
+ error: Error & {
913
+ originalError?: unknown;
914
+ };
915
+ data?: undefined;
916
+ }>, upsertEntity: <T extends Entity>(entityType: T, id: string, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<{
917
+ data: import("@monorise/base").CreatedEntity<T>;
918
+ error?: undefined;
919
+ } | {
920
+ error: Error & {
921
+ originalError?: unknown;
922
+ };
923
+ data?: undefined;
924
+ }>, editEntity: <T extends Entity>(entityType: T, id: string, entity: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<{
925
+ data: import("@monorise/base").CreatedEntity<T>;
926
+ error?: undefined;
927
+ } | {
928
+ error: Error & {
929
+ originalError?: unknown;
930
+ };
931
+ data?: undefined;
932
+ }>, updateLocalEntity: <T extends Entity>(entityType: Entity, entityId: string, data?: Partial<import("@monorise/base").DraftEntity<T>>) => Promise<void>, deleteEntity: <T extends Entity>(entityType: T, id: string, opts?: import("./services/core.service").CommonOptions) => Promise<{
933
+ data: {
934
+ entityId: string;
935
+ };
936
+ error?: undefined;
937
+ } | {
938
+ error: Error & {
939
+ originalError?: unknown;
940
+ };
941
+ data?: undefined;
942
+ }>, getMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string | null, entityId: string, opts?: import("./services/core.service").CommonOptions & {
627
943
  defaultMutualData?: Record<string, any>;
628
- }) => Promise<Mutual<B, T> | undefined>, createMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<void>, upsertLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, mutualData: MutualData<B, T>, data?: import("@monorise/base").EntitySchemaMap[T] | Record<string, any>) => Promise<void>, editMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<void>, deleteMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId?: string, opts?: import("./services/core.service").CommonOptions) => Promise<void>, deleteLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string) => void, useEntity: <T extends Entity>(entityType: T, id?: string, opts?: import("./services/core.service").CommonOptions) => {
944
+ }) => Promise<{
945
+ error: import("./types/api.type").ApplicationRequestError;
946
+ data?: undefined;
947
+ } | {
948
+ data: Mutual<B, T>;
949
+ error?: undefined;
950
+ } | {
951
+ error: Error & {
952
+ originalError?: unknown;
953
+ };
954
+ data?: undefined;
955
+ }>, createMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<{
956
+ data: Mutual<B, T>;
957
+ error?: undefined;
958
+ } | {
959
+ error: Error & {
960
+ originalError?: unknown;
961
+ };
962
+ data?: undefined;
963
+ }>, createLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, mutualData: MutualData<B, T>, data: import("@monorise/base").EntitySchemaMap[T] | Record<string, any>) => Promise<void>, upsertLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, mutualData: MutualData<B, T>, data?: import("@monorise/base").EntitySchemaMap[T] | Record<string, any>) => Promise<void>, editMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<{
964
+ data: Mutual<B, T>;
965
+ error?: undefined;
966
+ } | {
967
+ error: Error & {
968
+ originalError?: unknown;
969
+ };
970
+ data?: undefined;
971
+ }>, deleteMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId?: string, opts?: import("./services/core.service").CommonOptions) => Promise<{
972
+ data: any;
973
+ error?: undefined;
974
+ } | {
975
+ error: Error & {
976
+ originalError?: unknown;
977
+ };
978
+ data?: undefined;
979
+ }>, deleteLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string) => void, useEntity: <T extends Entity>(entityType: T, id?: string, opts?: import("./services/core.service").CommonOptions) => {
980
+ entity: import("@monorise/base").CreatedEntity<T> | undefined;
981
+ isLoading: boolean;
982
+ error?: import("./types/api.type").ApplicationRequestError;
983
+ requestKey: string;
984
+ isFirstFetched?: boolean;
985
+ refetch: () => Promise<import("@monorise/base").CreatedEntity<T> | undefined>;
986
+ }, useEntityByUniqueField: <T extends Entity>(entityType: T, fieldName: string, value?: string, opts?: import("./services/core.service").CommonOptions) => {
629
987
  entity: import("@monorise/base").CreatedEntity<T> | undefined;
630
988
  isLoading: boolean;
631
989
  error?: import("./types/api.type").ApplicationRequestError;
632
990
  requestKey: string;
991
+ isFirstFetched?: boolean;
992
+ refetch: () => Promise<import("@monorise/base").CreatedEntity<T> | undefined>;
633
993
  }, useEntities: <T extends Entity>(entityType: T, params?: {
634
994
  skRange?: {
635
995
  start: string;
636
996
  end: string;
637
997
  };
638
998
  all?: boolean;
639
- }, opts?: import("./services/core.service").CommonOptions) => {
999
+ }, opts?: import("./services/core.service").CommonOptions & {
1000
+ searchInterval?: number;
1001
+ }) => {
640
1002
  isLoading: boolean;
641
1003
  entities?: import("@monorise/base").CreatedEntity<T>[];
642
1004
  entitiesMap: Map<string, import("@monorise/base").CreatedEntity<T>>;
@@ -646,6 +1008,10 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
646
1008
  value: string;
647
1009
  onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
648
1010
  };
1011
+ lastKey?: string;
1012
+ isFirstFetched?: boolean;
1013
+ listMore: () => void;
1014
+ refetch: () => void;
649
1015
  }, useMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId: string | null, id: string, opts?: import("./services/core.service").CommonOptions & {
650
1016
  defaultMutualData?: Record<string, any>;
651
1017
  }) => {
@@ -659,8 +1025,68 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
659
1025
  isLoading: boolean;
660
1026
  requestKey: string;
661
1027
  error?: import("./types/api.type").ApplicationRequestError;
662
- }, useEntityState: <T extends Entity>(entityType: T) => Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>[T];
663
- export { store, axios, authService, filestoreService, coreService, setConfig, getConfig, useConfig, startLoading, endLoading, setError, getError, clearError, openModal, closeModal, useLoadStore, useInterruptiveLoadStore, useErrorStore, useModalStore, requestLogin, useProfile, getProfile, useIsUnauthorized, setIsUnauthorized, logout, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, upsertLocalMutual, editMutual, deleteMutual, deleteLocalMutual, useEntity, useEntities, useMutual, useMutuals, useEntityState, };
1028
+ isFirstFetched?: boolean;
1029
+ lastKey?: string;
1030
+ listMore?: () => void;
1031
+ }, useTaggedEntities: <T extends Entity>(entityType: T, tagName: string, opts?: import("./services/core.service").CommonOptions & {
1032
+ params?: import("./services/core.service").ListEntitiesByTagParams;
1033
+ }) => {
1034
+ entities: import("@monorise/base").CreatedEntity<T>[];
1035
+ entitiesMap: Map<string, import("@monorise/base").CreatedEntity<T>>;
1036
+ isLoading: boolean;
1037
+ requestKey: string;
1038
+ error: import("./types/api.type").ApplicationRequestError | undefined;
1039
+ isFirstFetched: boolean;
1040
+ lastKey: string;
1041
+ refetch: () => Promise<{
1042
+ error: import("./types/api.type").ApplicationRequestError;
1043
+ data?: undefined;
1044
+ } | {
1045
+ data: {
1046
+ entities: import("@monorise/base").CreatedEntity<Entity>[];
1047
+ lastKey: null;
1048
+ };
1049
+ error?: undefined;
1050
+ } | {
1051
+ data: {
1052
+ entities: import("@monorise/base").CreatedEntity<T>[];
1053
+ lastKey: string;
1054
+ };
1055
+ error?: undefined;
1056
+ } | {
1057
+ error: Error & {
1058
+ originalError?: unknown;
1059
+ };
1060
+ data?: undefined;
1061
+ } | undefined>;
1062
+ listMore: () => Promise<{
1063
+ error: import("./types/api.type").ApplicationRequestError;
1064
+ data?: undefined;
1065
+ } | {
1066
+ data: {
1067
+ entities: import("@monorise/base").CreatedEntity<Entity>[];
1068
+ lastKey: null;
1069
+ };
1070
+ error?: undefined;
1071
+ } | {
1072
+ data: {
1073
+ entities: import("@monorise/base").CreatedEntity<T>[];
1074
+ lastKey: string;
1075
+ };
1076
+ error?: undefined;
1077
+ } | {
1078
+ error: Error & {
1079
+ originalError?: unknown;
1080
+ };
1081
+ data?: undefined;
1082
+ } | undefined>;
1083
+ }, useEntityState: <T extends Entity>(entityType: T) => Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>[T], getEntity: <T extends Entity>(entityType: T, id: string, opts?: import("./services/core.service").CommonOptions) => Promise<{
1084
+ data?: import("@monorise/base").CreatedEntity<T>;
1085
+ error?: import("./types/api.type").ApplicationRequestError | (Error & {
1086
+ originalError?: unknown;
1087
+ });
1088
+ }>, updateLocalTaggedEntity: <T extends Entity>(entityType: T, entityId: string, tagName: string, data?: Partial<import("@monorise/base").DraftEntity<T>>, params?: import("./services/core.service").ListEntitiesByTagParams) => void, deleteLocalTaggedEntity: <T extends Entity>(entityType: T, entityId: string, tagName: string, params?: import("./services/core.service").ListEntitiesByTagParams) => void;
1089
+ export { store, axios, authService, filestoreService, coreService, setConfig, getConfig, useConfig, startLoading, endLoading, setError, getError, clearError, openModal, closeModal, useLoadStore, useInterruptiveLoadStore, useErrorStore, useModalStore, requestLogin, useProfile, getProfile, useIsUnauthorized, setIsUnauthorized, logout, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, createLocalMutual, upsertLocalMutual, editMutual, deleteMutual, deleteLocalMutual, useEntity, useEntityByUniqueField, useEntities, useMutual, useMutuals, useTaggedEntities, useEntityState, getEntityRequestKey, getMutualRequestKey, getTagRequestKey, getUniqueFieldRequestKey, getEntity, updateLocalTaggedEntity, deleteLocalTaggedEntity, };
664
1090
  export default Monorise;
665
1091
  export { MutualDataWithIndex, MutualDataMapping, MutualData, Mutual };
666
1092
  export type { CreatedEntity, DraftEntity, Entity, EntitySchemaMap, } from '@monorise/base';