@monorise/react 1.0.1 → 1.0.2
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.
- package/dist/actions/config.action.d.ts +10 -0
- package/dist/actions/config.action.d.ts.map +1 -0
- package/dist/actions/config.action.js +31 -0
- package/dist/actions/config.action.js.map +1 -0
- package/dist/actions/core.action.d.ts.map +1 -1
- package/dist/actions/core.action.js +2 -3
- package/dist/actions/core.action.js.map +1 -1
- package/dist/index.d.ts +388 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/index.jsx +48 -0
- package/dist/index.jsx.map +1 -0
- package/dist/services/core.service.d.ts +2 -1
- package/dist/services/core.service.d.ts.map +1 -1
- package/dist/services/core.service.js +9 -10
- package/dist/services/core.service.js.map +1 -1
- package/dist/store/monorise.store.d.ts +9 -3
- package/dist/store/monorise.store.d.ts.map +1 -1
- package/dist/store/monorise.store.js +3 -11
- package/dist/store/monorise.store.js.map +1 -1
- package/index.ts +18 -4
- package/package.json +6 -4
- package/actions/app.action.ts +0 -218
- package/actions/auth.action.ts +0 -71
- package/actions/core.action.ts +0 -878
- package/lib/api.tsx +0 -132
- package/lib/config.ts +0 -36
- package/lib/constant.ts +0 -1
- package/lib/entity.ts +0 -81
- package/lib/utils.ts +0 -12
- package/services/auth.service.ts +0 -59
- package/services/core.service.ts +0 -416
- package/services/filestore.service.ts +0 -136
- package/store/monorise.store.ts +0 -111
- package/types/api.type.ts +0 -57
- package/types/axios.type.ts +0 -14
- package/types/monorise.type.ts +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,360 @@
|
|
|
1
|
+
import type { Entity, MonoriseEntityConfig } from '@monorise/base';
|
|
2
|
+
type Options<T extends Record<string, React.ComponentType<any>>> = {
|
|
3
|
+
authBaseUrl?: string;
|
|
4
|
+
filestoreBaseUrl?: string;
|
|
5
|
+
entityBaseUrl?: string;
|
|
6
|
+
mutualBaseUrl?: string;
|
|
7
|
+
tagBaseUrl?: string;
|
|
8
|
+
modals?: T;
|
|
9
|
+
entityConfig: Record<Entity, MonoriseEntityConfig>;
|
|
10
|
+
};
|
|
11
|
+
declare const Monorise: {
|
|
12
|
+
listMoreEntities: <T extends Entity>(entityType: T, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
|
|
13
|
+
createEntity: <T extends Entity>(entityType: T, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<import("@monorise/base").CreatedEntity<T>>;
|
|
14
|
+
upsertEntity: <T extends Entity>(entityType: T, id: string, entity: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
|
|
15
|
+
editEntity: <T extends Entity>(entityType: T, id: string, entity: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
|
|
16
|
+
deleteEntity: <T extends Entity>(entityType: T, id: string, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
|
|
17
|
+
getMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string | null, entityId: string, opts?: import("./services/core.service").CommonOptions & {
|
|
18
|
+
defaultMutualData?: Record<string, any>;
|
|
19
|
+
}) => Promise<import("@monorise/base").Mutual<B, T> | undefined>;
|
|
20
|
+
updateLocalEntity: <T extends Entity>(entityType: Entity, entityId: string, data?: Partial<import("@monorise/base").DraftEntity<T>>) => Promise<void>;
|
|
21
|
+
createMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: import("@monorise/base").MutualData<B, T> | Record<string, any>, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
|
|
22
|
+
upsertLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, mutualData: import("@monorise/base").MutualData<B, T>, data?: import("@monorise/base").EntitySchemaMap[T] | Record<string, any>) => Promise<void>;
|
|
23
|
+
deleteMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId?: string, opts?: import("./services/core.service").CommonOptions) => Promise<void>;
|
|
24
|
+
deleteLocalMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string) => void;
|
|
25
|
+
useEntity: <T extends Entity>(entityType: T, id?: string, opts?: import("./services/core.service").CommonOptions) => {
|
|
26
|
+
entity: import("@monorise/base").CreatedEntity<T> | undefined;
|
|
27
|
+
isLoading: boolean;
|
|
28
|
+
error?: import("./types/api.type").ApplicationRequestError;
|
|
29
|
+
requestKey: string;
|
|
30
|
+
};
|
|
31
|
+
useEntities: <T extends Entity>(entityType: T, params?: {
|
|
32
|
+
skRange?: {
|
|
33
|
+
start: string;
|
|
34
|
+
end: string;
|
|
35
|
+
};
|
|
36
|
+
all?: boolean;
|
|
37
|
+
}, opts?: import("./services/core.service").CommonOptions) => {
|
|
38
|
+
isLoading: boolean;
|
|
39
|
+
entities?: import("@monorise/base").CreatedEntity<T>[];
|
|
40
|
+
entitiesMap: Map<string, import("@monorise/base").CreatedEntity<T>>;
|
|
41
|
+
error?: import("./types/api.type").ApplicationRequestError;
|
|
42
|
+
requestKey: string;
|
|
43
|
+
searchField: {
|
|
44
|
+
value: string;
|
|
45
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
useMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId: string | null, id: string, opts?: import("./services/core.service").CommonOptions & {
|
|
49
|
+
defaultMutualData?: Record<string, any>;
|
|
50
|
+
}) => {
|
|
51
|
+
mutual?: import("@monorise/base").Mutual<B, T>;
|
|
52
|
+
isLoading: boolean;
|
|
53
|
+
error?: import("./types/api.type").ApplicationRequestError;
|
|
54
|
+
requestKey: string;
|
|
55
|
+
};
|
|
56
|
+
useMutuals: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId?: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => {
|
|
57
|
+
mutuals: import("@monorise/base").Mutual<B, T>[];
|
|
58
|
+
mutualsMap: Map<string, import("@monorise/base").Mutual<B, T>>;
|
|
59
|
+
isLoading: boolean;
|
|
60
|
+
requestKey: string;
|
|
61
|
+
error?: import("./types/api.type").ApplicationRequestError;
|
|
62
|
+
};
|
|
63
|
+
listEntitiesByTag: <T extends Entity>(entityType: T, tagName: string, opts?: import("./services/core.service").CommonOptions & {
|
|
64
|
+
params?: import("./services/core.service").ListEntitiesByTagParams;
|
|
65
|
+
}) => Promise<void>;
|
|
66
|
+
useEntityState: <T extends Entity>(entityType: T) => Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>[T];
|
|
67
|
+
requestLogin: (entityType: Entity, payload: {
|
|
68
|
+
email: string;
|
|
69
|
+
}) => Promise<any>;
|
|
70
|
+
useProfile: <T extends Record<string, unknown>>() => T & {
|
|
71
|
+
displayName: string;
|
|
72
|
+
email: string;
|
|
73
|
+
accountId: string;
|
|
74
|
+
impersonatorId?: string;
|
|
75
|
+
};
|
|
76
|
+
getProfile: () => Promise<void>;
|
|
77
|
+
useIsUnauthorized: () => boolean;
|
|
78
|
+
setIsUnauthorized: (isUnauthorized: boolean) => void;
|
|
79
|
+
startLoading: <T>({ requestKey, isInterruptive, message, request, }: {
|
|
80
|
+
requestKey: string;
|
|
81
|
+
isInterruptive?: boolean;
|
|
82
|
+
message?: string | boolean;
|
|
83
|
+
request: Promise<T>;
|
|
84
|
+
}) => void;
|
|
85
|
+
endLoading: ({ requestKey, isInterruptive }: {
|
|
86
|
+
requestKey: string;
|
|
87
|
+
isInterruptive?: boolean;
|
|
88
|
+
}) => void;
|
|
89
|
+
setError: ({ requestKey, error }: {
|
|
90
|
+
requestKey: string;
|
|
91
|
+
error: import("./types/api.type").ApplicationRequestError;
|
|
92
|
+
}) => void;
|
|
93
|
+
getError: (requestKey: string) => import("./types/api.type").ApplicationRequestError | undefined;
|
|
94
|
+
clearError: (requestKey: string) => void;
|
|
95
|
+
openModal: (modal: {
|
|
96
|
+
name: string;
|
|
97
|
+
context?: unknown;
|
|
98
|
+
}) => void;
|
|
99
|
+
closeModal: () => void;
|
|
100
|
+
checkIsLoading: (requestKey?: string) => boolean;
|
|
101
|
+
useLoadStore: (requestKey?: string) => boolean;
|
|
102
|
+
useInterruptiveLoadStore: () => {
|
|
103
|
+
isLoading: boolean;
|
|
104
|
+
message: string;
|
|
105
|
+
};
|
|
106
|
+
useErrorStore: (requestKey: string) => import("./types/api.type").ApplicationRequestError | undefined;
|
|
107
|
+
useModalStore: () => {
|
|
108
|
+
name: string | null;
|
|
109
|
+
context?: unknown;
|
|
110
|
+
};
|
|
111
|
+
setOptions: (opts: {
|
|
112
|
+
modals?: Record<string, React.ComponentType<unknown>>;
|
|
113
|
+
}) => void;
|
|
114
|
+
setConfig: (config: Record<Entity, MonoriseEntityConfig>) => void;
|
|
115
|
+
getConfig: () => Record<Entity, MonoriseEntityConfig<Entity, import("zod").ZodRawShape, import("zod").ZodRawShape, import("zod").ZodRawShape, undefined, undefined>>;
|
|
116
|
+
useConfig: () => Record<Entity, MonoriseEntityConfig<Entity, import("zod").ZodRawShape, import("zod").ZodRawShape, import("zod").ZodRawShape, undefined, undefined>>;
|
|
117
|
+
config: <T extends Record<string, React.ComponentType<any>>>(opts: Options<T>) => void;
|
|
118
|
+
store: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<{
|
|
119
|
+
app: {
|
|
120
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
121
|
+
loadStack: Map<string, number>;
|
|
122
|
+
intLoadStack: Map<string, number>;
|
|
123
|
+
loadingMessage: string;
|
|
124
|
+
errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
|
|
125
|
+
modal: {
|
|
126
|
+
name: string | null;
|
|
127
|
+
context?: unknown;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
131
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
132
|
+
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
133
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
134
|
+
auth: {
|
|
135
|
+
isUnauthorized: boolean;
|
|
136
|
+
profile: {
|
|
137
|
+
displayName: string;
|
|
138
|
+
email: string;
|
|
139
|
+
accountId: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
}>, "setState"> & {
|
|
143
|
+
setState<A extends string | {
|
|
144
|
+
type: string;
|
|
145
|
+
}>(partial: {
|
|
146
|
+
app: {
|
|
147
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
148
|
+
loadStack: Map<string, number>;
|
|
149
|
+
intLoadStack: Map<string, number>;
|
|
150
|
+
loadingMessage: string;
|
|
151
|
+
errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
|
|
152
|
+
modal: {
|
|
153
|
+
name: string | null;
|
|
154
|
+
context?: unknown;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
158
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
159
|
+
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
160
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
161
|
+
auth: {
|
|
162
|
+
isUnauthorized: boolean;
|
|
163
|
+
profile: {
|
|
164
|
+
displayName: string;
|
|
165
|
+
email: string;
|
|
166
|
+
accountId: string;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
} | Partial<{
|
|
170
|
+
app: {
|
|
171
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
172
|
+
loadStack: Map<string, number>;
|
|
173
|
+
intLoadStack: Map<string, number>;
|
|
174
|
+
loadingMessage: string;
|
|
175
|
+
errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
|
|
176
|
+
modal: {
|
|
177
|
+
name: string | null;
|
|
178
|
+
context?: unknown;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
182
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
183
|
+
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
184
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
185
|
+
auth: {
|
|
186
|
+
isUnauthorized: boolean;
|
|
187
|
+
profile: {
|
|
188
|
+
displayName: string;
|
|
189
|
+
email: string;
|
|
190
|
+
accountId: string;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
}> | ((state: {
|
|
194
|
+
app: {
|
|
195
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
196
|
+
loadStack: Map<string, number>;
|
|
197
|
+
intLoadStack: Map<string, number>;
|
|
198
|
+
loadingMessage: string;
|
|
199
|
+
errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
|
|
200
|
+
modal: {
|
|
201
|
+
name: string | null;
|
|
202
|
+
context?: unknown;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
206
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
207
|
+
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
208
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
209
|
+
auth: {
|
|
210
|
+
isUnauthorized: boolean;
|
|
211
|
+
profile: {
|
|
212
|
+
displayName: string;
|
|
213
|
+
email: string;
|
|
214
|
+
accountId: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
}) => {
|
|
218
|
+
app: {
|
|
219
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
220
|
+
loadStack: Map<string, number>;
|
|
221
|
+
intLoadStack: Map<string, number>;
|
|
222
|
+
loadingMessage: string;
|
|
223
|
+
errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
|
|
224
|
+
modal: {
|
|
225
|
+
name: string | null;
|
|
226
|
+
context?: unknown;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
230
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
231
|
+
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
232
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
233
|
+
auth: {
|
|
234
|
+
isUnauthorized: boolean;
|
|
235
|
+
profile: {
|
|
236
|
+
displayName: string;
|
|
237
|
+
email: string;
|
|
238
|
+
accountId: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
} | Partial<{
|
|
242
|
+
app: {
|
|
243
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
244
|
+
loadStack: Map<string, number>;
|
|
245
|
+
intLoadStack: Map<string, number>;
|
|
246
|
+
loadingMessage: string;
|
|
247
|
+
errorStack: Map<string, import("./types/api.type").ApplicationRequestError>;
|
|
248
|
+
modal: {
|
|
249
|
+
name: string | null;
|
|
250
|
+
context?: unknown;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
254
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
255
|
+
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
256
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
257
|
+
auth: {
|
|
258
|
+
isUnauthorized: boolean;
|
|
259
|
+
profile: {
|
|
260
|
+
displayName: string;
|
|
261
|
+
email: string;
|
|
262
|
+
accountId: string;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
}>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
266
|
+
}>;
|
|
267
|
+
axios: {
|
|
268
|
+
post: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
|
|
269
|
+
put: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
|
|
270
|
+
patch: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, data: D, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
|
|
271
|
+
delete: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
|
|
272
|
+
get: <T = any, R = import("axios").AxiosResponse<T, any>, D = any>(url: string, config: import("axios").AxiosRequestConfig<D>) => Promise<R>;
|
|
273
|
+
defaults: Omit<import("axios").AxiosDefaults, "headers"> & {
|
|
274
|
+
headers: import("axios").HeadersDefaults & {
|
|
275
|
+
[key: string]: import("axios").AxiosHeaderValue;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
interceptors: {
|
|
279
|
+
request: import("axios").AxiosInterceptorManager<import("axios").InternalAxiosRequestConfig>;
|
|
280
|
+
response: import("axios").AxiosInterceptorManager<import("axios").AxiosResponse>;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
authService: {
|
|
284
|
+
requestLoginMagicLink: (entityType: Entity, payload: {
|
|
285
|
+
email: string;
|
|
286
|
+
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
287
|
+
getSessionProfile: <T extends Record<string, unknown>>() => Promise<import("axios").AxiosResponse<T & {
|
|
288
|
+
displayName: string;
|
|
289
|
+
email: string;
|
|
290
|
+
accountId: string;
|
|
291
|
+
}, any>>;
|
|
292
|
+
setOptions: (opts: {
|
|
293
|
+
apiBaseUrl?: string;
|
|
294
|
+
}) => void;
|
|
295
|
+
};
|
|
296
|
+
filestoreService: {
|
|
297
|
+
uploadFile: ({ file, scope, directory, name, }: {
|
|
298
|
+
file: File;
|
|
299
|
+
scope: string;
|
|
300
|
+
directory: string;
|
|
301
|
+
name: string;
|
|
302
|
+
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
303
|
+
deleteFiles: (keys: string[]) => Promise<any>;
|
|
304
|
+
uploadVideo: ({ file, scope, directory, name, }: {
|
|
305
|
+
file: File;
|
|
306
|
+
scope: string;
|
|
307
|
+
directory: string;
|
|
308
|
+
name: string;
|
|
309
|
+
}) => Promise<any>;
|
|
310
|
+
getJobStatus: (id: string) => Promise<any>;
|
|
311
|
+
setOptions: (opts: {
|
|
312
|
+
apiBaseUrl?: string;
|
|
313
|
+
}) => void;
|
|
314
|
+
};
|
|
315
|
+
coreService: {
|
|
316
|
+
makeEntityService: <T extends Entity>(entityType: T) => {
|
|
317
|
+
listEntities: (payload: {
|
|
318
|
+
limit?: number;
|
|
319
|
+
lastKey?: string;
|
|
320
|
+
start?: string;
|
|
321
|
+
end?: string;
|
|
322
|
+
}, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<{
|
|
323
|
+
data: import("@monorise/base").CreatedEntity<T>[];
|
|
324
|
+
lastKey?: string;
|
|
325
|
+
totalCount: number;
|
|
326
|
+
}, any>>;
|
|
327
|
+
searchEntities: (query: string, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<{
|
|
328
|
+
data: import("@monorise/base").CreatedEntity<T>[];
|
|
329
|
+
}, any>>;
|
|
330
|
+
listEntitiesByTag: (tagName: string, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<{
|
|
331
|
+
entities: import("@monorise/base").CreatedEntity<T>[];
|
|
332
|
+
lastKey: string;
|
|
333
|
+
}, any>>;
|
|
334
|
+
getEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
|
|
335
|
+
createEntity: (values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
|
|
336
|
+
upsertEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
|
|
337
|
+
editEntity: (id: string, values: Partial<import("@monorise/base").DraftEntity<T>>, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
|
|
338
|
+
updateEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
|
|
339
|
+
deleteEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
340
|
+
};
|
|
341
|
+
makeMutualService: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T) => {
|
|
342
|
+
listEntitiesByEntity: (byEntityId: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => Promise<import("axios").AxiosResponse<{
|
|
343
|
+
entities: import("@monorise/base").Mutual<B, T>[];
|
|
344
|
+
lastKey: string;
|
|
345
|
+
}, any>>;
|
|
346
|
+
getMutual: (byEntityId: string, entityId: string, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<import("@monorise/base").Mutual<B, T>, any>>;
|
|
347
|
+
createMutual: (byEntityId: string, entityId: string, payload: import("@monorise/base").MutualData<B, T> | Record<string, unknown>, opts?: {}) => Promise<import("axios").AxiosResponse<import("@monorise/base").Mutual<B, T>, any>>;
|
|
348
|
+
editMutual: (byEntityId: string, entityId: string, payload: import("@monorise/base").MutualData<B, T> | Record<string, unknown>, opts?: {}) => Promise<import("axios").AxiosResponse<import("@monorise/base").Mutual<B, T>, any>>;
|
|
349
|
+
deleteMutual: (byEntityId: string, entityId: string, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
350
|
+
};
|
|
351
|
+
setOptions: (opts: {
|
|
352
|
+
entityApiBaseUrl?: string;
|
|
353
|
+
mutualApiBaseUrl?: string;
|
|
354
|
+
tagApiBaseUrl?: string;
|
|
355
|
+
}) => void;
|
|
356
|
+
};
|
|
357
|
+
};
|
|
1
358
|
declare const store: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<{
|
|
2
359
|
app: {
|
|
3
360
|
ongoingRequests: Map<string, Promise<unknown>>;
|
|
@@ -10,9 +367,10 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
10
367
|
context?: unknown;
|
|
11
368
|
};
|
|
12
369
|
};
|
|
13
|
-
|
|
370
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
371
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
14
372
|
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
15
|
-
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<
|
|
373
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
16
374
|
auth: {
|
|
17
375
|
isUnauthorized: boolean;
|
|
18
376
|
profile: {
|
|
@@ -36,9 +394,10 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
36
394
|
context?: unknown;
|
|
37
395
|
};
|
|
38
396
|
};
|
|
39
|
-
|
|
397
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
398
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
40
399
|
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
41
|
-
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<
|
|
400
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
42
401
|
auth: {
|
|
43
402
|
isUnauthorized: boolean;
|
|
44
403
|
profile: {
|
|
@@ -59,9 +418,10 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
59
418
|
context?: unknown;
|
|
60
419
|
};
|
|
61
420
|
};
|
|
62
|
-
|
|
421
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
422
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
63
423
|
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
64
|
-
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<
|
|
424
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
65
425
|
auth: {
|
|
66
426
|
isUnauthorized: boolean;
|
|
67
427
|
profile: {
|
|
@@ -82,9 +442,10 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
82
442
|
context?: unknown;
|
|
83
443
|
};
|
|
84
444
|
};
|
|
85
|
-
|
|
445
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
446
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
86
447
|
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
87
|
-
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<
|
|
448
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
88
449
|
auth: {
|
|
89
450
|
isUnauthorized: boolean;
|
|
90
451
|
profile: {
|
|
@@ -105,9 +466,10 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
105
466
|
context?: unknown;
|
|
106
467
|
};
|
|
107
468
|
};
|
|
108
|
-
|
|
469
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
470
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
109
471
|
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
110
|
-
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<
|
|
472
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
111
473
|
auth: {
|
|
112
474
|
isUnauthorized: boolean;
|
|
113
475
|
profile: {
|
|
@@ -128,9 +490,10 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
128
490
|
context?: unknown;
|
|
129
491
|
};
|
|
130
492
|
};
|
|
131
|
-
|
|
493
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
494
|
+
entity: Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
132
495
|
mutual: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").Mutual>>;
|
|
133
|
-
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<
|
|
496
|
+
tag: Record<string, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>;
|
|
134
497
|
auth: {
|
|
135
498
|
isUnauthorized: boolean;
|
|
136
499
|
profile: {
|
|
@@ -156,7 +519,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
156
519
|
response: import("axios").AxiosInterceptorManager<import("axios").AxiosResponse>;
|
|
157
520
|
};
|
|
158
521
|
}, authService: {
|
|
159
|
-
requestLoginMagicLink: (entityType:
|
|
522
|
+
requestLoginMagicLink: (entityType: Entity, payload: {
|
|
160
523
|
email: string;
|
|
161
524
|
}) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
162
525
|
getSessionProfile: <T extends Record<string, unknown>>() => Promise<import("axios").AxiosResponse<T & {
|
|
@@ -186,7 +549,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
186
549
|
apiBaseUrl?: string;
|
|
187
550
|
}) => void;
|
|
188
551
|
}, coreService: {
|
|
189
|
-
makeEntityService: <T extends
|
|
552
|
+
makeEntityService: <T extends Entity>(entityType: T) => {
|
|
190
553
|
listEntities: (payload: {
|
|
191
554
|
limit?: number;
|
|
192
555
|
lastKey?: string;
|
|
@@ -211,7 +574,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
211
574
|
updateEntity: (id: string, values: import("@monorise/base").DraftEntity<T>, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<import("@monorise/base").CreatedEntity<T>, any>>;
|
|
212
575
|
deleteEntity: (id: string, opts?: import("./services/core.service").CommonOptions) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
213
576
|
};
|
|
214
|
-
makeMutualService: <B extends
|
|
577
|
+
makeMutualService: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T) => {
|
|
215
578
|
listEntitiesByEntity: (byEntityId: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => Promise<import("axios").AxiosResponse<{
|
|
216
579
|
entities: import("@monorise/base").Mutual<B, T>[];
|
|
217
580
|
lastKey: string;
|
|
@@ -226,7 +589,7 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
226
589
|
mutualApiBaseUrl?: string;
|
|
227
590
|
tagApiBaseUrl?: string;
|
|
228
591
|
}) => void;
|
|
229
|
-
}, startLoading: <T>({ requestKey, isInterruptive, message, request, }: {
|
|
592
|
+
}, 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, }: {
|
|
230
593
|
requestKey: string;
|
|
231
594
|
isInterruptive?: boolean;
|
|
232
595
|
message?: string | boolean;
|
|
@@ -246,21 +609,21 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
246
609
|
}, useErrorStore: (requestKey: string) => import("./types/api.type").ApplicationRequestError | undefined, useModalStore: () => {
|
|
247
610
|
name: string | null;
|
|
248
611
|
context?: unknown;
|
|
249
|
-
}, requestLogin: (entityType:
|
|
612
|
+
}, requestLogin: (entityType: Entity, payload: {
|
|
250
613
|
email: string;
|
|
251
614
|
}) => Promise<any>, useProfile: <T extends Record<string, unknown>>() => T & {
|
|
252
615
|
displayName: string;
|
|
253
616
|
email: string;
|
|
254
617
|
accountId: string;
|
|
255
618
|
impersonatorId?: string;
|
|
256
|
-
}, getProfile: () => Promise<void>, useIsUnauthorized: () => boolean, setIsUnauthorized: (isUnauthorized: boolean) => void, listMoreEntities: <T extends
|
|
619
|
+
}, getProfile: () => Promise<void>, useIsUnauthorized: () => boolean, setIsUnauthorized: (isUnauthorized: boolean) => 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 & {
|
|
257
620
|
defaultMutualData?: Record<string, any>;
|
|
258
|
-
}) => Promise<import("@monorise/base").Mutual<B, T> | undefined>, createMutual: <B extends
|
|
621
|
+
}) => Promise<import("@monorise/base").Mutual<B, T> | undefined>, createMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byEntityId: string, entityId: string, payload?: import("@monorise/base").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: import("@monorise/base").MutualData<B, T>, data?: import("@monorise/base").EntitySchemaMap[T] | Record<string, any>) => 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) => {
|
|
259
622
|
entity: import("@monorise/base").CreatedEntity<T> | undefined;
|
|
260
623
|
isLoading: boolean;
|
|
261
624
|
error?: import("./types/api.type").ApplicationRequestError;
|
|
262
625
|
requestKey: string;
|
|
263
|
-
}, useEntities: <T extends
|
|
626
|
+
}, useEntities: <T extends Entity>(entityType: T, params?: {
|
|
264
627
|
skRange?: {
|
|
265
628
|
start: string;
|
|
266
629
|
end: string;
|
|
@@ -276,19 +639,20 @@ declare const store: import("zustand").UseBoundStore<Omit<import("zustand").Stor
|
|
|
276
639
|
value: string;
|
|
277
640
|
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
278
641
|
};
|
|
279
|
-
}, useMutual: <B extends
|
|
642
|
+
}, useMutual: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId: string | null, id: string, opts?: import("./services/core.service").CommonOptions & {
|
|
280
643
|
defaultMutualData?: Record<string, any>;
|
|
281
644
|
}) => {
|
|
282
645
|
mutual?: import("@monorise/base").Mutual<B, T>;
|
|
283
646
|
isLoading: boolean;
|
|
284
647
|
error?: import("./types/api.type").ApplicationRequestError;
|
|
285
648
|
requestKey: string;
|
|
286
|
-
}, useMutuals: <B extends
|
|
649
|
+
}, useMutuals: <B extends Entity, T extends Entity>(byEntityType: B, entityType: T, byId?: string, opts?: import("./services/core.service").CommonOptions, chainEntityQuery?: string) => {
|
|
287
650
|
mutuals: import("@monorise/base").Mutual<B, T>[];
|
|
288
651
|
mutualsMap: Map<string, import("@monorise/base").Mutual<B, T>>;
|
|
289
652
|
isLoading: boolean;
|
|
290
653
|
requestKey: string;
|
|
291
654
|
error?: import("./types/api.type").ApplicationRequestError;
|
|
292
|
-
}, useEntityState: <T extends
|
|
293
|
-
export { store, axios, authService, filestoreService, coreService, startLoading, endLoading, setError, getError, clearError, openModal, closeModal, useLoadStore, useInterruptiveLoadStore, useErrorStore, useModalStore, requestLogin, useProfile, getProfile, useIsUnauthorized, setIsUnauthorized, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, upsertLocalMutual, deleteMutual, deleteLocalMutual, useEntity, useEntities, useMutual, useMutuals, useEntityState, };
|
|
655
|
+
}, useEntityState: <T extends Entity>(entityType: T) => Record<Entity, import("./types/monorise.type").CommonStore<import("@monorise/base").CreatedEntity<Entity>>>[T];
|
|
656
|
+
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, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, upsertLocalMutual, deleteMutual, deleteLocalMutual, useEntity, useEntities, useMutual, useMutuals, useEntityState, };
|
|
657
|
+
export default Monorise;
|
|
294
658
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { initAppActions } from './actions/app.action';
|
|
2
2
|
import { initAuthActions } from './actions/auth.action';
|
|
3
|
+
import { initConfigActions } from './actions/config.action';
|
|
3
4
|
import { initCoreActions } from './actions/core.action';
|
|
4
5
|
import { initAxiosInterceptor, injectAxiosInterceptor } from './lib/api';
|
|
5
6
|
import initAuthService from './services/auth.service';
|
|
6
7
|
import initCoreService from './services/core.service';
|
|
7
8
|
import initFilestoreService from './services/filestore.service';
|
|
8
9
|
import { initMonoriseStore } from './store/monorise.store';
|
|
9
|
-
const initMonorise =
|
|
10
|
-
const { monoriseStore: store, setOptions: setMonoriseOptions } =
|
|
10
|
+
const initMonorise = () => {
|
|
11
|
+
const { monoriseStore: store, setOptions: setMonoriseOptions } = initMonoriseStore();
|
|
11
12
|
const appActions = initAppActions(store);
|
|
13
|
+
const configActions = initConfigActions(store);
|
|
12
14
|
const axios = initAxiosInterceptor(store, appActions);
|
|
13
15
|
const authService = initAuthService(axios);
|
|
14
16
|
const filestoreService = initFilestoreService(axios);
|
|
15
|
-
const coreService = initCoreService(axios);
|
|
17
|
+
const coreService = initCoreService(store, axios);
|
|
16
18
|
const authActions = initAuthActions(store, authService);
|
|
17
19
|
const coreActions = initCoreActions(store, appActions, coreService);
|
|
18
20
|
injectAxiosInterceptor(appActions, authActions, axios);
|
|
@@ -20,6 +22,7 @@ const initMonorise = async () => {
|
|
|
20
22
|
setMonoriseOptions({
|
|
21
23
|
modals: opts.modals,
|
|
22
24
|
});
|
|
25
|
+
configActions.setConfig(opts.entityConfig);
|
|
23
26
|
authService.setOptions({
|
|
24
27
|
apiBaseUrl: opts.authBaseUrl,
|
|
25
28
|
});
|
|
@@ -32,14 +35,15 @@ const initMonorise = async () => {
|
|
|
32
35
|
tagApiBaseUrl: opts.tagBaseUrl,
|
|
33
36
|
});
|
|
34
37
|
};
|
|
35
|
-
return Object.assign(Object.assign(Object.assign({ config,
|
|
38
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ config,
|
|
36
39
|
store,
|
|
37
40
|
axios,
|
|
38
41
|
authService,
|
|
39
42
|
filestoreService,
|
|
40
|
-
coreService }, appActions), authActions), coreActions);
|
|
43
|
+
coreService }, configActions), appActions), authActions), coreActions);
|
|
41
44
|
};
|
|
42
|
-
const Monorise =
|
|
43
|
-
const { store, axios, authService, filestoreService, coreService, startLoading, endLoading, setError, getError, clearError, openModal, closeModal, useLoadStore, useInterruptiveLoadStore, useErrorStore, useModalStore, requestLogin, useProfile, getProfile, useIsUnauthorized, setIsUnauthorized, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, upsertLocalMutual, deleteMutual, deleteLocalMutual, useEntity, useEntities, useMutual, useMutuals, useEntityState, } = Monorise;
|
|
44
|
-
export { store, axios, authService, filestoreService, coreService, startLoading, endLoading, setError, getError, clearError, openModal, closeModal, useLoadStore, useInterruptiveLoadStore, useErrorStore, useModalStore, requestLogin, useProfile, getProfile, useIsUnauthorized, setIsUnauthorized, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, upsertLocalMutual, deleteMutual, deleteLocalMutual, useEntity, useEntities, useMutual, useMutuals, useEntityState, };
|
|
45
|
+
const Monorise = initMonorise();
|
|
46
|
+
const { store, axios, authService, filestoreService, coreService, setConfig, getConfig, useConfig, startLoading, endLoading, setError, getError, clearError, openModal, closeModal, useLoadStore, useInterruptiveLoadStore, useErrorStore, useModalStore, requestLogin, useProfile, getProfile, useIsUnauthorized, setIsUnauthorized, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, upsertLocalMutual, deleteMutual, deleteLocalMutual, useEntity, useEntities, useMutual, useMutuals, useEntityState, } = Monorise;
|
|
47
|
+
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, listMoreEntities, createEntity, upsertEntity, editEntity, updateLocalEntity, deleteEntity, getMutual, createMutual, upsertLocalMutual, deleteMutual, deleteLocalMutual, useEntity, useEntities, useMutual, useMutuals, useEntityState, };
|
|
48
|
+
export default Monorise;
|
|
45
49
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,eAAe,MAAM,yBAAyB,CAAC;AACtD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAY3D,MAAM,YAAY,GAAG,GAAG,EAAE;IACxB,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,GAC5D,iBAAiB,EAAE,CAAC;IACtB,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,aAAa,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAEtD,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACrD,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAElD,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACxD,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;IAEpE,sBAAsB,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAEvD,MAAM,MAAM,GAAG,CACb,IAAgB,EAChB,EAAE;QACF,kBAAkB,CAAC;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;QACH,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,WAAW,CAAC,UAAU,CAAC;YACrB,UAAU,EAAE,IAAI,CAAC,WAAW;SAC7B,CAAC,CAAC;QACH,gBAAgB,CAAC,UAAU,CAAC;YAC1B,UAAU,EAAE,IAAI,CAAC,gBAAgB;SAClC,CAAC,CAAC;QACH,WAAW,CAAC,UAAU,CAAC;YACrB,gBAAgB,EAAE,IAAI,CAAC,aAAa;YACpC,gBAAgB,EAAE,IAAI,CAAC,aAAa;YACpC,aAAa,EAAE,IAAI,CAAC,UAAU;SAC/B,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,iEACE,MAAM;QACN,KAAK;QACL,KAAK;QACL,WAAW;QACX,gBAAgB;QAChB,WAAW,IACR,aAAa,GACb,UAAU,GACV,WAAW,GACX,WAAW,EACd;AACJ,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;AAEhC,MAAM,EACJ,KAAK,EACL,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,GACf,GAAG,QAAQ,CAAC;AAEb,OAAO,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,wBAAwB,EACxB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,SAAS,EACT,UAAU,EACV,cAAc,GACf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|