@monorise/react 0.0.1-dev.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 (70) hide show
  1. package/dist/actions/app.action.d.ts +46 -0
  2. package/dist/actions/app.action.d.ts.map +1 -0
  3. package/dist/actions/app.action.js +122 -0
  4. package/dist/actions/app.action.js.map +1 -0
  5. package/dist/actions/auth.action.d.ts +21 -0
  6. package/dist/actions/auth.action.d.ts.map +1 -0
  7. package/dist/actions/auth.action.js +62 -0
  8. package/dist/actions/auth.action.js.map +1 -0
  9. package/dist/actions/config.action.d.ts +10 -0
  10. package/dist/actions/config.action.d.ts.map +1 -0
  11. package/dist/actions/config.action.js +31 -0
  12. package/dist/actions/config.action.js.map +1 -0
  13. package/dist/actions/core.action.d.ts +68 -0
  14. package/dist/actions/core.action.d.ts.map +1 -0
  15. package/dist/actions/core.action.js +510 -0
  16. package/dist/actions/core.action.js.map +1 -0
  17. package/dist/index.d.ts +667 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +52 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/lib/api.d.ts +28 -0
  22. package/dist/lib/api.d.ts.map +1 -0
  23. package/dist/lib/api.js +75 -0
  24. package/dist/lib/api.js.map +1 -0
  25. package/dist/lib/constant.d.ts +2 -0
  26. package/dist/lib/constant.d.ts.map +1 -0
  27. package/dist/lib/constant.js +2 -0
  28. package/dist/lib/constant.js.map +1 -0
  29. package/dist/lib/entity.d.ts +10 -0
  30. package/dist/lib/entity.d.ts.map +1 -0
  31. package/dist/lib/entity.js +42 -0
  32. package/dist/lib/entity.js.map +1 -0
  33. package/dist/lib/utils.d.ts +2 -0
  34. package/dist/lib/utils.d.ts.map +1 -0
  35. package/dist/lib/utils.js +8 -0
  36. package/dist/lib/utils.js.map +1 -0
  37. package/dist/services/auth.service.d.ts +21 -0
  38. package/dist/services/auth.service.d.ts.map +1 -0
  39. package/dist/services/auth.service.js +32 -0
  40. package/dist/services/auth.service.js.map +1 -0
  41. package/dist/services/core.service.d.ts +68 -0
  42. package/dist/services/core.service.d.ts.map +1 -0
  43. package/dist/services/core.service.js +159 -0
  44. package/dist/services/core.service.js.map +1 -0
  45. package/dist/services/filestore.service.d.ts +19 -0
  46. package/dist/services/filestore.service.d.ts.map +1 -0
  47. package/dist/services/filestore.service.js +90 -0
  48. package/dist/services/filestore.service.js.map +1 -0
  49. package/dist/store/monorise.store.d.ts +163 -0
  50. package/dist/store/monorise.store.d.ts.map +1 -0
  51. package/dist/store/monorise.store.js +51 -0
  52. package/dist/store/monorise.store.js.map +1 -0
  53. package/dist/tsconfig.tsbuildinfo +1 -0
  54. package/dist/types/api.type.d.ts +28 -0
  55. package/dist/types/api.type.d.ts.map +1 -0
  56. package/dist/types/api.type.js +11 -0
  57. package/dist/types/api.type.js.map +1 -0
  58. package/dist/types/axios.type.d.ts +13 -0
  59. package/dist/types/axios.type.d.ts.map +1 -0
  60. package/dist/types/axios.type.js +3 -0
  61. package/dist/types/axios.type.js.map +1 -0
  62. package/dist/types/monorise.type.d.ts +8 -0
  63. package/dist/types/monorise.type.d.ts.map +1 -0
  64. package/dist/types/monorise.type.js +2 -0
  65. package/dist/types/monorise.type.js.map +1 -0
  66. package/dist/types/mutual.type.d.ts +21 -0
  67. package/dist/types/mutual.type.d.ts.map +1 -0
  68. package/dist/types/mutual.type.js +2 -0
  69. package/dist/types/mutual.type.js.map +1 -0
  70. package/package.json +34 -0
@@ -0,0 +1,667 @@
1
+ import type { Entity, MonoriseEntityConfig } from '@monorise/base';
2
+ import type { AxiosResponse } from 'axios';
3
+ import { Mutual, MutualData, MutualDataMapping, MutualDataWithIndex } from './types/mutual.type';
4
+ type Options<T extends Record<string, React.ComponentType<any>>> = {
5
+ authBaseUrl?: string;
6
+ filestoreBaseUrl?: string;
7
+ entityBaseUrl?: string;
8
+ mutualBaseUrl?: string;
9
+ tagBaseUrl?: string;
10
+ modals?: T;
11
+ entityConfig: Record<Entity, MonoriseEntityConfig>;
12
+ onApiSuccess?: <T>(response: AxiosResponse<T>, feedbackSuccess: ((data: AxiosResponse<T>['data']) => React.ReactNode) | string | boolean) => void;
13
+ };
14
+ 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>;
20
+ getMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string | null, entityId: string, opts?: import("./services/core.service").CommonOptions & {
21
+ defaultMutualData?: Record<string, any>;
22
+ }) => Promise<Mutual<B, T> | undefined>;
23
+ 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>;
25
+ 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>;
28
+ deleteLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string) => void;
29
+ useEntity: <T extends Entity>(entityType: T, id?: string, opts?: import("./services/core.service").CommonOptions) => {
30
+ entity: import("@monorise/base").CreatedEntity<T> | undefined;
31
+ isLoading: boolean;
32
+ error?: import("./types/api.type").ApplicationRequestError;
33
+ requestKey: string;
34
+ };
35
+ useEntities: <T extends Entity>(entityType: T, params?: {
36
+ skRange?: {
37
+ start: string;
38
+ end: string;
39
+ };
40
+ all?: boolean;
41
+ }, opts?: import("./services/core.service").CommonOptions) => {
42
+ isLoading: boolean;
43
+ entities?: import("@monorise/base").CreatedEntity<T>[];
44
+ entitiesMap: Map<string, import("@monorise/base").CreatedEntity<T>>;
45
+ error?: import("./types/api.type").ApplicationRequestError;
46
+ requestKey: string;
47
+ searchField: {
48
+ value: string;
49
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
50
+ };
51
+ };
52
+ useMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId: string | null, id: string, opts?: import("./services/core.service").CommonOptions & {
53
+ defaultMutualData?: Record<string, any>;
54
+ }) => {
55
+ mutual?: Mutual<B, T>;
56
+ isLoading: boolean;
57
+ error?: import("./types/api.type").ApplicationRequestError;
58
+ requestKey: string;
59
+ };
60
+ useMutuals: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId?: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => {
61
+ mutuals: Mutual<B, T>[];
62
+ mutualsMap: Map<string, Mutual<B, T>>;
63
+ isLoading: boolean;
64
+ requestKey: string;
65
+ error?: import("./types/api.type").ApplicationRequestError;
66
+ };
67
+ listEntitiesByTag: <T extends Entity>(entityType: T, tagName: string, opts?: import("./services/core.service").CommonOptions & {
68
+ params?: import("./services/core.service").ListEntitiesByTagParams;
69
+ }) => Promise<void>;
70
+ useEntityState: <T extends Entity>(entityType: T) => Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>[T];
71
+ requestLogin: (entityType: Entity, payload: {
72
+ email: string;
73
+ }) => Promise<any>;
74
+ useProfile: <T extends Record<string, unknown>>() => T & {
75
+ displayName: string;
76
+ email: string;
77
+ accountId: string;
78
+ impersonatorId?: string;
79
+ };
80
+ getProfile: () => Promise<void>;
81
+ useIsUnauthorized: () => boolean;
82
+ setIsUnauthorized: (isUnauthorized: boolean) => void;
83
+ logout: () => void;
84
+ startLoading: <T>({ requestKey, isInterruptive, message, request, }: {
85
+ requestKey: string;
86
+ isInterruptive?: boolean;
87
+ message?: string | boolean;
88
+ request: Promise<T>;
89
+ }) => void;
90
+ endLoading: ({ requestKey, isInterruptive }: {
91
+ requestKey: string;
92
+ isInterruptive?: boolean;
93
+ }) => void;
94
+ setError: ({ requestKey, error }: {
95
+ requestKey: string;
96
+ error: import("./types/api.type").ApplicationRequestError;
97
+ }) => void;
98
+ getError: (requestKey: string) => import("./types/api.type").ApplicationRequestError | undefined;
99
+ clearError: (requestKey: string) => void;
100
+ openModal: (modal: {
101
+ name: string;
102
+ context?: unknown;
103
+ }) => void;
104
+ closeModal: () => void;
105
+ checkIsLoading: (requestKey?: string) => boolean;
106
+ useLoadStore: (requestKey?: string) => boolean;
107
+ useInterruptiveLoadStore: () => {
108
+ isLoading: boolean;
109
+ message: string;
110
+ };
111
+ useErrorStore: (requestKey: string) => import("./types/api.type").ApplicationRequestError | undefined;
112
+ useModalStore: () => {
113
+ name: string | null;
114
+ context?: unknown;
115
+ };
116
+ setOptions: (opts: {
117
+ modals?: Record<string, React.ComponentType<unknown>>;
118
+ }) => void;
119
+ setConfig: (config: Record<Entity, MonoriseEntityConfig>) => void;
120
+ getConfig: () => Record<Entity, MonoriseEntityConfig<Entity, import("zod").ZodRawShape, import("zod").ZodRawShape, import("zod").ZodRawShape, undefined, undefined>>;
121
+ useConfig: () => Record<Entity, MonoriseEntityConfig<Entity, import("zod").ZodRawShape, import("zod").ZodRawShape, import("zod").ZodRawShape, undefined, undefined>>;
122
+ config: <T extends Record<string, React.ComponentType<any>>>(opts: Options<T>) => void;
123
+ store: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<{
124
+ app: {
125
+ ongoingRequests: Map<string, Promise<unknown>>;
126
+ loadStack: Map<string, number>;
127
+ intLoadStack: Map<string, number>;
128
+ loadingMessage: string;
129
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
130
+ modal: {
131
+ name: string | null;
132
+ context?: unknown;
133
+ };
134
+ };
135
+ config: Record<Entity, MonoriseEntityConfig>;
136
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
137
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
138
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
139
+ auth: {
140
+ isUnauthorized: boolean;
141
+ profile: {
142
+ displayName: string;
143
+ email: string;
144
+ accountId: string;
145
+ };
146
+ };
147
+ }>, "setState"> & {
148
+ setState<A extends string | {
149
+ type: string;
150
+ }>(partial: {
151
+ app: {
152
+ ongoingRequests: Map<string, Promise<unknown>>;
153
+ loadStack: Map<string, number>;
154
+ intLoadStack: Map<string, number>;
155
+ loadingMessage: string;
156
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
157
+ modal: {
158
+ name: string | null;
159
+ context?: unknown;
160
+ };
161
+ };
162
+ config: Record<Entity, MonoriseEntityConfig>;
163
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
164
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
165
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
166
+ auth: {
167
+ isUnauthorized: boolean;
168
+ profile: {
169
+ displayName: string;
170
+ email: string;
171
+ accountId: string;
172
+ };
173
+ };
174
+ } | Partial<{
175
+ app: {
176
+ ongoingRequests: Map<string, Promise<unknown>>;
177
+ loadStack: Map<string, number>;
178
+ intLoadStack: Map<string, number>;
179
+ loadingMessage: string;
180
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
181
+ modal: {
182
+ name: string | null;
183
+ context?: unknown;
184
+ };
185
+ };
186
+ config: Record<Entity, MonoriseEntityConfig>;
187
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
188
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
189
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
190
+ auth: {
191
+ isUnauthorized: boolean;
192
+ profile: {
193
+ displayName: string;
194
+ email: string;
195
+ accountId: string;
196
+ };
197
+ };
198
+ }> | ((state: {
199
+ app: {
200
+ ongoingRequests: Map<string, Promise<unknown>>;
201
+ loadStack: Map<string, number>;
202
+ intLoadStack: Map<string, number>;
203
+ loadingMessage: string;
204
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
205
+ modal: {
206
+ name: string | null;
207
+ context?: unknown;
208
+ };
209
+ };
210
+ config: Record<Entity, MonoriseEntityConfig>;
211
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
212
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
213
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
214
+ auth: {
215
+ isUnauthorized: boolean;
216
+ profile: {
217
+ displayName: string;
218
+ email: string;
219
+ accountId: string;
220
+ };
221
+ };
222
+ }) => {
223
+ app: {
224
+ ongoingRequests: Map<string, Promise<unknown>>;
225
+ loadStack: Map<string, number>;
226
+ intLoadStack: Map<string, number>;
227
+ loadingMessage: string;
228
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
229
+ modal: {
230
+ name: string | null;
231
+ context?: unknown;
232
+ };
233
+ };
234
+ config: Record<Entity, MonoriseEntityConfig>;
235
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
236
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
237
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
238
+ auth: {
239
+ isUnauthorized: boolean;
240
+ profile: {
241
+ displayName: string;
242
+ email: string;
243
+ accountId: string;
244
+ };
245
+ };
246
+ } | Partial<{
247
+ app: {
248
+ ongoingRequests: Map<string, Promise<unknown>>;
249
+ loadStack: Map<string, number>;
250
+ intLoadStack: Map<string, number>;
251
+ loadingMessage: string;
252
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
253
+ modal: {
254
+ name: string | null;
255
+ context?: unknown;
256
+ };
257
+ };
258
+ config: Record<Entity, MonoriseEntityConfig>;
259
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
260
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
261
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
262
+ auth: {
263
+ isUnauthorized: boolean;
264
+ profile: {
265
+ displayName: string;
266
+ email: string;
267
+ accountId: string;
268
+ };
269
+ };
270
+ }>), replace?: boolean | undefined, action?: A | undefined): void;
271
+ }>;
272
+ 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>;
278
+ defaults: Omit<import("axios").AxiosDefaults, "headers"> & {
279
+ headers: import("axios").HeadersDefaults & {
280
+ [key: string]: import("axios").AxiosHeaderValue;
281
+ };
282
+ };
283
+ interceptors: {
284
+ request: import("axios").AxiosInterceptorManager<import("axios").InternalAxiosRequestConfig>;
285
+ response: import("axios").AxiosInterceptorManager<AxiosResponse>;
286
+ };
287
+ };
288
+ authService: {
289
+ requestLoginMagicLink: (entityType: Entity, payload: {
290
+ email: string;
291
+ }) => Promise<AxiosResponse<any, any>>;
292
+ getSessionProfile: <T extends Record<string, unknown>>() => Promise<AxiosResponse<T & {
293
+ displayName: string;
294
+ email: string;
295
+ accountId: string;
296
+ }, any>>;
297
+ logout: () => Promise<AxiosResponse<any, any>>;
298
+ setOptions: (opts: {
299
+ apiBaseUrl?: string;
300
+ }) => void;
301
+ };
302
+ filestoreService: {
303
+ uploadFile: ({ file, scope, directory, name, }: {
304
+ file: File;
305
+ scope: string;
306
+ directory: string;
307
+ name: string;
308
+ }) => Promise<AxiosResponse<any, any>>;
309
+ deleteFiles: (keys: string[]) => Promise<any>;
310
+ uploadVideo: ({ file, scope, directory, name, }: {
311
+ file: File;
312
+ scope: string;
313
+ directory: string;
314
+ name: string;
315
+ }) => Promise<any>;
316
+ getJobStatus: (id: string) => Promise<any>;
317
+ setOptions: (opts: {
318
+ apiBaseUrl?: string;
319
+ }) => void;
320
+ };
321
+ coreService: {
322
+ makeEntityService: <T extends Entity>(entityType: T) => {
323
+ listEntities: (payload: {
324
+ limit?: number;
325
+ lastKey?: string;
326
+ start?: string;
327
+ end?: string;
328
+ }, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<{
329
+ data: import("@monorise/base").CreatedEntity<T>[];
330
+ lastKey?: string;
331
+ totalCount: number;
332
+ }, any>>;
333
+ searchEntities: (query: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<{
334
+ data: import("@monorise/base").CreatedEntity<T>[];
335
+ }, any>>;
336
+ listEntitiesByTag: (tagName: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<{
337
+ entities: import("@monorise/base").CreatedEntity<T>[];
338
+ lastKey: string;
339
+ }, any>>;
340
+ getEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
341
+ createEntity: (values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
342
+ upsertEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
343
+ editEntity: (id: string, values: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
344
+ updateEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
345
+ deleteEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<any, any>>;
346
+ };
347
+ makeMutualService: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T) => {
348
+ listEntitiesByEntity: (byEntityId: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => Promise<AxiosResponse<{
349
+ entities: Mutual<B, T>[];
350
+ lastKey: string;
351
+ }, any>>;
352
+ getMutual: (byEntityId: string, entityId: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<Mutual<B, T>, any>>;
353
+ createMutual: (byEntityId: string, entityId: string, payload: MutualData<B, T> | Record<string, unknown>, opts?: {}) => Promise<AxiosResponse<Mutual<B, T>, any>>;
354
+ editMutual: (byEntityId: string, entityId: string, payload: MutualData<B, T> | Record<string, unknown>, opts?: {}) => Promise<AxiosResponse<Mutual<B, T>, any>>;
355
+ deleteMutual: (byEntityId: string, entityId: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<any, any>>;
356
+ };
357
+ setOptions: (opts: {
358
+ entityApiBaseUrl?: string;
359
+ mutualApiBaseUrl?: string;
360
+ tagApiBaseUrl?: string;
361
+ }) => void;
362
+ };
363
+ };
364
+ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<{
365
+ app: {
366
+ ongoingRequests: Map<string, Promise<unknown>>;
367
+ loadStack: Map<string, number>;
368
+ intLoadStack: Map<string, number>;
369
+ loadingMessage: string;
370
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
371
+ modal: {
372
+ name: string | null;
373
+ context?: unknown;
374
+ };
375
+ };
376
+ config: Record<Entity, MonoriseEntityConfig>;
377
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
378
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
379
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
380
+ auth: {
381
+ isUnauthorized: boolean;
382
+ profile: {
383
+ displayName: string;
384
+ email: string;
385
+ accountId: string;
386
+ };
387
+ };
388
+ }>, "setState"> & {
389
+ setState<A extends string | {
390
+ type: string;
391
+ }>(partial: {
392
+ app: {
393
+ ongoingRequests: Map<string, Promise<unknown>>;
394
+ loadStack: Map<string, number>;
395
+ intLoadStack: Map<string, number>;
396
+ loadingMessage: string;
397
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
398
+ modal: {
399
+ name: string | null;
400
+ context?: unknown;
401
+ };
402
+ };
403
+ config: Record<Entity, MonoriseEntityConfig>;
404
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
405
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
406
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
407
+ auth: {
408
+ isUnauthorized: boolean;
409
+ profile: {
410
+ displayName: string;
411
+ email: string;
412
+ accountId: string;
413
+ };
414
+ };
415
+ } | Partial<{
416
+ app: {
417
+ ongoingRequests: Map<string, Promise<unknown>>;
418
+ loadStack: Map<string, number>;
419
+ intLoadStack: Map<string, number>;
420
+ loadingMessage: string;
421
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
422
+ modal: {
423
+ name: string | null;
424
+ context?: unknown;
425
+ };
426
+ };
427
+ config: Record<Entity, MonoriseEntityConfig>;
428
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
429
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
430
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
431
+ auth: {
432
+ isUnauthorized: boolean;
433
+ profile: {
434
+ displayName: string;
435
+ email: string;
436
+ accountId: string;
437
+ };
438
+ };
439
+ }> | ((state: {
440
+ app: {
441
+ ongoingRequests: Map<string, Promise<unknown>>;
442
+ loadStack: Map<string, number>;
443
+ intLoadStack: Map<string, number>;
444
+ loadingMessage: string;
445
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
446
+ modal: {
447
+ name: string | null;
448
+ context?: unknown;
449
+ };
450
+ };
451
+ config: Record<Entity, MonoriseEntityConfig>;
452
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
453
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
454
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
455
+ auth: {
456
+ isUnauthorized: boolean;
457
+ profile: {
458
+ displayName: string;
459
+ email: string;
460
+ accountId: string;
461
+ };
462
+ };
463
+ }) => {
464
+ app: {
465
+ ongoingRequests: Map<string, Promise<unknown>>;
466
+ loadStack: Map<string, number>;
467
+ intLoadStack: Map<string, number>;
468
+ loadingMessage: string;
469
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
470
+ modal: {
471
+ name: string | null;
472
+ context?: unknown;
473
+ };
474
+ };
475
+ config: Record<Entity, MonoriseEntityConfig>;
476
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
477
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
478
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
479
+ auth: {
480
+ isUnauthorized: boolean;
481
+ profile: {
482
+ displayName: string;
483
+ email: string;
484
+ accountId: string;
485
+ };
486
+ };
487
+ } | Partial<{
488
+ app: {
489
+ ongoingRequests: Map<string, Promise<unknown>>;
490
+ loadStack: Map<string, number>;
491
+ intLoadStack: Map<string, number>;
492
+ loadingMessage: string;
493
+ errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
494
+ modal: {
495
+ name: string | null;
496
+ context?: unknown;
497
+ };
498
+ };
499
+ config: Record<Entity, MonoriseEntityConfig>;
500
+ entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
501
+ mutual: Record<string, import("./types/monorise.type").CommonStore<Mutual>>;
502
+ tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
503
+ auth: {
504
+ isUnauthorized: boolean;
505
+ profile: {
506
+ displayName: string;
507
+ email: string;
508
+ accountId: string;
509
+ };
510
+ };
511
+ }>), replace?: boolean | undefined, action?: A | undefined): void;
512
+ }>, 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>;
518
+ defaults: Omit<import("axios").AxiosDefaults, "headers"> & {
519
+ headers: import("axios").HeadersDefaults & {
520
+ [key: string]: import("axios").AxiosHeaderValue;
521
+ };
522
+ };
523
+ interceptors: {
524
+ request: import("axios").AxiosInterceptorManager<import("axios").InternalAxiosRequestConfig>;
525
+ response: import("axios").AxiosInterceptorManager<AxiosResponse>;
526
+ };
527
+ }, authService: {
528
+ requestLoginMagicLink: (entityType: Entity, payload: {
529
+ email: string;
530
+ }) => Promise<AxiosResponse<any, any>>;
531
+ getSessionProfile: <T extends Record<string, unknown>>() => Promise<AxiosResponse<T & {
532
+ displayName: string;
533
+ email: string;
534
+ accountId: string;
535
+ }, any>>;
536
+ logout: () => Promise<AxiosResponse<any, any>>;
537
+ setOptions: (opts: {
538
+ apiBaseUrl?: string;
539
+ }) => void;
540
+ }, filestoreService: {
541
+ uploadFile: ({ file, scope, directory, name, }: {
542
+ file: File;
543
+ scope: string;
544
+ directory: string;
545
+ name: string;
546
+ }) => Promise<AxiosResponse<any, any>>;
547
+ deleteFiles: (keys: string[]) => Promise<any>;
548
+ uploadVideo: ({ file, scope, directory, name, }: {
549
+ file: File;
550
+ scope: string;
551
+ directory: string;
552
+ name: string;
553
+ }) => Promise<any>;
554
+ getJobStatus: (id: string) => Promise<any>;
555
+ setOptions: (opts: {
556
+ apiBaseUrl?: string;
557
+ }) => void;
558
+ }, coreService: {
559
+ makeEntityService: <T extends Entity>(entityType: T) => {
560
+ listEntities: (payload: {
561
+ limit?: number;
562
+ lastKey?: string;
563
+ start?: string;
564
+ end?: string;
565
+ }, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<{
566
+ data: import("@monorise/base").CreatedEntity<T>[];
567
+ lastKey?: string;
568
+ totalCount: number;
569
+ }, any>>;
570
+ searchEntities: (query: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<{
571
+ data: import("@monorise/base").CreatedEntity<T>[];
572
+ }, any>>;
573
+ listEntitiesByTag: (tagName: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<{
574
+ entities: import("@monorise/base").CreatedEntity<T>[];
575
+ lastKey: string;
576
+ }, any>>;
577
+ getEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
578
+ createEntity: (values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
579
+ upsertEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
580
+ editEntity: (id: string, values: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
581
+ updateEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
582
+ deleteEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<any, any>>;
583
+ };
584
+ makeMutualService: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T) => {
585
+ listEntitiesByEntity: (byEntityId: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => Promise<AxiosResponse<{
586
+ entities: Mutual<B, T>[];
587
+ lastKey: string;
588
+ }, any>>;
589
+ getMutual: (byEntityId: string, entityId: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<Mutual<B, T>, any>>;
590
+ createMutual: (byEntityId: string, entityId: string, payload: MutualData<B, T> | Record<string, unknown>, opts?: {}) => Promise<AxiosResponse<Mutual<B, T>, any>>;
591
+ editMutual: (byEntityId: string, entityId: string, payload: MutualData<B, T> | Record<string, unknown>, opts?: {}) => Promise<AxiosResponse<Mutual<B, T>, any>>;
592
+ deleteMutual: (byEntityId: string, entityId: string, opts?: import("./services/core.service").CommonOptions) => Promise<AxiosResponse<any, any>>;
593
+ };
594
+ setOptions: (opts: {
595
+ entityApiBaseUrl?: string;
596
+ mutualApiBaseUrl?: string;
597
+ tagApiBaseUrl?: string;
598
+ }) => void;
599
+ }, setConfig: (config: Record<Entity, MonoriseEntityConfig>) => void, getConfig: () => Record<Entity, MonoriseEntityConfig<Entity, import("zod").ZodRawShape, import("zod").ZodRawShape, import("zod").ZodRawShape, undefined, undefined>>, useConfig: () => Record<Entity, MonoriseEntityConfig<Entity, import("zod").ZodRawShape, import("zod").ZodRawShape, import("zod").ZodRawShape, undefined, undefined>>, startLoading: <T>({ requestKey, isInterruptive, message, request, }: {
600
+ requestKey: string;
601
+ isInterruptive?: boolean;
602
+ message?: string | boolean;
603
+ request: Promise<T>;
604
+ }) => void, endLoading: ({ requestKey, isInterruptive }: {
605
+ requestKey: string;
606
+ isInterruptive?: boolean;
607
+ }) => void, setError: ({ requestKey, error }: {
608
+ requestKey: string;
609
+ error: import("./types/api.type").ApplicationRequestError;
610
+ }) => void, getError: (requestKey: string) => import("./types/api.type").ApplicationRequestError | undefined, clearError: (requestKey: string) => void, openModal: (modal: {
611
+ name: string;
612
+ context?: unknown;
613
+ }) => void, closeModal: () => void, useLoadStore: (requestKey?: string) => boolean, useInterruptiveLoadStore: () => {
614
+ isLoading: boolean;
615
+ message: string;
616
+ }, useErrorStore: (requestKey: string) => import("./types/api.type").ApplicationRequestError | undefined, useModalStore: () => {
617
+ name: string | null;
618
+ context?: unknown;
619
+ }, requestLogin: (entityType: Entity, payload: {
620
+ email: string;
621
+ }) => Promise<any>, useProfile: <T extends Record<string, unknown>>() => T & {
622
+ displayName: string;
623
+ email: string;
624
+ accountId: string;
625
+ 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 & {
627
+ 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) => {
629
+ entity: import("@monorise/base").CreatedEntity<T> | undefined;
630
+ isLoading: boolean;
631
+ error?: import("./types/api.type").ApplicationRequestError;
632
+ requestKey: string;
633
+ }, useEntities: <T extends Entity>(entityType: T, params?: {
634
+ skRange?: {
635
+ start: string;
636
+ end: string;
637
+ };
638
+ all?: boolean;
639
+ }, opts?: import("./services/core.service").CommonOptions) => {
640
+ isLoading: boolean;
641
+ entities?: import("@monorise/base").CreatedEntity<T>[];
642
+ entitiesMap: Map<string, import("@monorise/base").CreatedEntity<T>>;
643
+ error?: import("./types/api.type").ApplicationRequestError;
644
+ requestKey: string;
645
+ searchField: {
646
+ value: string;
647
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
648
+ };
649
+ }, useMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId: string | null, id: string, opts?: import("./services/core.service").CommonOptions & {
650
+ defaultMutualData?: Record<string, any>;
651
+ }) => {
652
+ mutual?: Mutual<B, T>;
653
+ isLoading: boolean;
654
+ error?: import("./types/api.type").ApplicationRequestError;
655
+ requestKey: string;
656
+ }, useMutuals: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId?: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => {
657
+ mutuals: Mutual<B, T>[];
658
+ mutualsMap: Map<string, Mutual<B, T>>;
659
+ isLoading: boolean;
660
+ requestKey: string;
661
+ 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, };
664
+ export default Monorise;
665
+ export { MutualDataWithIndex, MutualDataMapping, MutualData, Mutual };
666
+ export type { CreatedEntity, DraftEntity, Entity, EntitySchemaMap, } from '@monorise/base';
667
+ //# sourceMappingURL=index.d.ts.map