@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.
- package/dist/actions/app.action.d.ts +46 -0
- package/dist/actions/app.action.d.ts.map +1 -0
- package/dist/actions/app.action.js +122 -0
- package/dist/actions/app.action.js.map +1 -0
- package/dist/actions/auth.action.d.ts +21 -0
- package/dist/actions/auth.action.d.ts.map +1 -0
- package/dist/actions/auth.action.js +62 -0
- package/dist/actions/auth.action.js.map +1 -0
- 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 +68 -0
- package/dist/actions/core.action.d.ts.map +1 -0
- package/dist/actions/core.action.js +510 -0
- package/dist/actions/core.action.js.map +1 -0
- package/dist/index.d.ts +667 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +28 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +75 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/constant.d.ts +2 -0
- package/dist/lib/constant.d.ts.map +1 -0
- package/dist/lib/constant.js +2 -0
- package/dist/lib/constant.js.map +1 -0
- package/dist/lib/entity.d.ts +10 -0
- package/dist/lib/entity.d.ts.map +1 -0
- package/dist/lib/entity.js +42 -0
- package/dist/lib/entity.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +8 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/services/auth.service.d.ts +21 -0
- package/dist/services/auth.service.d.ts.map +1 -0
- package/dist/services/auth.service.js +32 -0
- package/dist/services/auth.service.js.map +1 -0
- package/dist/services/core.service.d.ts +68 -0
- package/dist/services/core.service.d.ts.map +1 -0
- package/dist/services/core.service.js +159 -0
- package/dist/services/core.service.js.map +1 -0
- package/dist/services/filestore.service.d.ts +19 -0
- package/dist/services/filestore.service.d.ts.map +1 -0
- package/dist/services/filestore.service.js +90 -0
- package/dist/services/filestore.service.js.map +1 -0
- package/dist/store/monorise.store.d.ts +163 -0
- package/dist/store/monorise.store.d.ts.map +1 -0
- package/dist/store/monorise.store.js +51 -0
- package/dist/store/monorise.store.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/api.type.d.ts +28 -0
- package/dist/types/api.type.d.ts.map +1 -0
- package/dist/types/api.type.js +11 -0
- package/dist/types/api.type.js.map +1 -0
- package/dist/types/axios.type.d.ts +13 -0
- package/dist/types/axios.type.d.ts.map +1 -0
- package/dist/types/axios.type.js +3 -0
- package/dist/types/axios.type.js.map +1 -0
- package/dist/types/monorise.type.d.ts +8 -0
- package/dist/types/monorise.type.d.ts.map +1 -0
- package/dist/types/monorise.type.js +2 -0
- package/dist/types/monorise.type.js.map +1 -0
- package/dist/types/mutual.type.d.ts +21 -0
- package/dist/types/mutual.type.d.ts.map +1 -0
- package/dist/types/mutual.type.js +2 -0
- package/dist/types/mutual.type.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AxiosInterceptor } from '../types/api.type';
|
|
2
|
+
type UploadFileProps = {
|
|
3
|
+
file: File;
|
|
4
|
+
scope: string;
|
|
5
|
+
directory: string;
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
apiBaseUrl?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const initFilestoreService: (axios: AxiosInterceptor) => {
|
|
12
|
+
uploadFile: ({ file, scope, directory, name, }: UploadFileProps) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
13
|
+
deleteFiles: (keys: string[]) => Promise<any>;
|
|
14
|
+
uploadVideo: ({ file, scope, directory, name, }: UploadFileProps) => Promise<any>;
|
|
15
|
+
getJobStatus: (id: string) => Promise<any>;
|
|
16
|
+
setOptions: (opts: Options) => void;
|
|
17
|
+
};
|
|
18
|
+
export default initFilestoreService;
|
|
19
|
+
//# sourceMappingURL=filestore.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filestore.service.d.ts","sourceRoot":"","sources":["../../services/filestore.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,oBAAoB,GAAI,OAAO,gBAAgB;oDAShD,eAAe;wBA0Be,MAAM,EAAE;qDAmBtC,eAAe;uBA4Cc,MAAM;uBAQZ,OAAO;CAclC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const initFilestoreService = (axios) => {
|
|
2
|
+
let options = {};
|
|
3
|
+
const { apiBaseUrl = '/api/file' } = options;
|
|
4
|
+
const uploadFile = async ({ file, scope, directory, name, }) => {
|
|
5
|
+
const { data } = await axios.get(`${apiBaseUrl}/upload`, {
|
|
6
|
+
requestKey: `filestore/presign/file/${name}`,
|
|
7
|
+
isInterruptive: true,
|
|
8
|
+
feedback: {
|
|
9
|
+
loading: 'Preparing upload',
|
|
10
|
+
},
|
|
11
|
+
params: {
|
|
12
|
+
scope,
|
|
13
|
+
directory,
|
|
14
|
+
filename: name,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
return axios.put(data.url, file, {
|
|
18
|
+
requestKey: `filestore/upload/${name}`,
|
|
19
|
+
isInterruptive: true,
|
|
20
|
+
feedback: {
|
|
21
|
+
loading: 'Uploading file',
|
|
22
|
+
},
|
|
23
|
+
headers: {
|
|
24
|
+
'Content-Type': file.type,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const deleteFiles = async (keys) => {
|
|
29
|
+
const { data } = await axios.post('/file/delete', {
|
|
30
|
+
keys,
|
|
31
|
+
}, {
|
|
32
|
+
requestKey: 'filestore/delete',
|
|
33
|
+
});
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
const uploadVideo = async ({ file, scope, directory, name, }) => {
|
|
37
|
+
const { data: presign } = await axios.get(`${apiBaseUrl}/upload`, {
|
|
38
|
+
requestKey: `filestore/presign/video/${name}`,
|
|
39
|
+
isInterruptive: true,
|
|
40
|
+
feedback: {
|
|
41
|
+
loading: 'Preparing upload',
|
|
42
|
+
},
|
|
43
|
+
params: {
|
|
44
|
+
scope,
|
|
45
|
+
directory,
|
|
46
|
+
filename: name,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
await axios.put(presign.url, file, {
|
|
50
|
+
requestKey: `filestore/upload/video/${name}`,
|
|
51
|
+
isInterruptive: true,
|
|
52
|
+
feedback: {
|
|
53
|
+
loading: 'Uploading video',
|
|
54
|
+
},
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': file.type,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
const { data } = await axios.post(`${apiBaseUrl}/video/convert`, {
|
|
60
|
+
scope,
|
|
61
|
+
directory,
|
|
62
|
+
filename: name,
|
|
63
|
+
}, {
|
|
64
|
+
requestKey: 'filestore/convert/video',
|
|
65
|
+
isInterruptive: true,
|
|
66
|
+
feedback: {
|
|
67
|
+
loading: 'Triggering video conversion',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
return data;
|
|
71
|
+
};
|
|
72
|
+
const getJobStatus = async (id) => {
|
|
73
|
+
const { data } = await axios.get(`${apiBaseUrl}/job/${id}`, {
|
|
74
|
+
requestKey: `filestore/get-job/${id}`,
|
|
75
|
+
});
|
|
76
|
+
return data;
|
|
77
|
+
};
|
|
78
|
+
const setOptions = (opts) => {
|
|
79
|
+
options = Object.assign(Object.assign({}, options), opts);
|
|
80
|
+
};
|
|
81
|
+
return {
|
|
82
|
+
uploadFile,
|
|
83
|
+
deleteFiles,
|
|
84
|
+
uploadVideo,
|
|
85
|
+
getJobStatus,
|
|
86
|
+
setOptions,
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export default initFilestoreService;
|
|
90
|
+
//# sourceMappingURL=filestore.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filestore.service.js","sourceRoot":"","sources":["../../services/filestore.service.ts"],"names":[],"mappings":"AAaA,MAAM,oBAAoB,GAAG,CAAC,KAAuB,EAAE,EAAE;IACvD,IAAI,OAAO,GAAY,EAAE,CAAC;IAC1B,MAAM,EAAE,UAAU,GAAG,WAAW,EAAE,GAAG,OAAO,CAAC;IAE7C,MAAM,UAAU,GAAG,KAAK,EAAE,EACxB,IAAI,EACJ,KAAK,EACL,SAAS,EACT,IAAI,GACY,EAAE,EAAE;QACpB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,UAAU,SAAS,EAAE;YACvD,UAAU,EAAE,0BAA0B,IAAI,EAAE;YAC5C,cAAc,EAAE,IAAI;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,kBAAkB;aAC5B;YACD,MAAM,EAAE;gBACN,KAAK;gBACL,SAAS;gBACT,QAAQ,EAAE,IAAI;aACf;SACF,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE;YAC/B,UAAU,EAAE,oBAAoB,IAAI,EAAE;YACtC,cAAc,EAAE,IAAI;YACpB,QAAQ,EAAE;gBACR,OAAO,EAAE,gBAAgB;aAC1B;YACD,OAAO,EAAE;gBACP,cAAc,EAAE,IAAI,CAAC,IAAI;aAC1B;SACF,CAAC,CAAC;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C;IAEF,MAAM,YAAY,GAAG,KAAK,EAAE,EAAU,EAAE,EAAE;QACxC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,UAAU,QAAQ,EAAE,EAAE,EAAE;YAC1D,UAAU,EAAE,qBAAqB,EAAE,EAAE;SACtC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,CAAC,IAAa,EAAE,EAAE;QACnC,OAAO,mCACF,OAAO,GACP,IAAI,CACR,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO;QACL,UAAU;QACV,WAAW;QACX,WAAW;QACX,YAAY;QACZ,UAAU;KACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import type { CreatedEntity, Entity, MonoriseEntityConfig } from '@monorise/base';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { ApplicationRequestError } from '../types/api.type';
|
|
4
|
+
import type { CommonStore } from '../types/monorise.type';
|
|
5
|
+
import type { Mutual } from '../types/mutual.type';
|
|
6
|
+
type Options = {
|
|
7
|
+
modals?: Record<string, React.ComponentType<unknown>>;
|
|
8
|
+
};
|
|
9
|
+
declare const initMonoriseStore: () => {
|
|
10
|
+
setOptions: (opts: Options) => void;
|
|
11
|
+
monoriseStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<{
|
|
12
|
+
app: {
|
|
13
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
14
|
+
loadStack: Map<string, number>;
|
|
15
|
+
intLoadStack: Map<string, number>;
|
|
16
|
+
loadingMessage: string;
|
|
17
|
+
errorStack: Map<string, ApplicationRequestError>;
|
|
18
|
+
modal: {
|
|
19
|
+
name: string | null;
|
|
20
|
+
context?: unknown;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
24
|
+
entity: Record<Entity, CommonStore<CreatedEntity<Entity>>>;
|
|
25
|
+
mutual: Record<string, CommonStore<Mutual>>;
|
|
26
|
+
tag: Record<string, CommonStore<CreatedEntity<Entity>>>;
|
|
27
|
+
auth: {
|
|
28
|
+
isUnauthorized: boolean;
|
|
29
|
+
profile: {
|
|
30
|
+
displayName: string;
|
|
31
|
+
email: string;
|
|
32
|
+
accountId: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}>, "setState"> & {
|
|
36
|
+
setState<A extends string | {
|
|
37
|
+
type: string;
|
|
38
|
+
}>(partial: {
|
|
39
|
+
app: {
|
|
40
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
41
|
+
loadStack: Map<string, number>;
|
|
42
|
+
intLoadStack: Map<string, number>;
|
|
43
|
+
loadingMessage: string;
|
|
44
|
+
errorStack: Map<string, ApplicationRequestError>;
|
|
45
|
+
modal: {
|
|
46
|
+
name: string | null;
|
|
47
|
+
context?: unknown;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
51
|
+
entity: Record<Entity, CommonStore<CreatedEntity<Entity>>>;
|
|
52
|
+
mutual: Record<string, CommonStore<Mutual>>;
|
|
53
|
+
tag: Record<string, CommonStore<CreatedEntity<Entity>>>;
|
|
54
|
+
auth: {
|
|
55
|
+
isUnauthorized: boolean;
|
|
56
|
+
profile: {
|
|
57
|
+
displayName: string;
|
|
58
|
+
email: string;
|
|
59
|
+
accountId: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
} | Partial<{
|
|
63
|
+
app: {
|
|
64
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
65
|
+
loadStack: Map<string, number>;
|
|
66
|
+
intLoadStack: Map<string, number>;
|
|
67
|
+
loadingMessage: string;
|
|
68
|
+
errorStack: Map<string, ApplicationRequestError>;
|
|
69
|
+
modal: {
|
|
70
|
+
name: string | null;
|
|
71
|
+
context?: unknown;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
75
|
+
entity: Record<Entity, CommonStore<CreatedEntity<Entity>>>;
|
|
76
|
+
mutual: Record<string, CommonStore<Mutual>>;
|
|
77
|
+
tag: Record<string, CommonStore<CreatedEntity<Entity>>>;
|
|
78
|
+
auth: {
|
|
79
|
+
isUnauthorized: boolean;
|
|
80
|
+
profile: {
|
|
81
|
+
displayName: string;
|
|
82
|
+
email: string;
|
|
83
|
+
accountId: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}> | ((state: {
|
|
87
|
+
app: {
|
|
88
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
89
|
+
loadStack: Map<string, number>;
|
|
90
|
+
intLoadStack: Map<string, number>;
|
|
91
|
+
loadingMessage: string;
|
|
92
|
+
errorStack: Map<string, ApplicationRequestError>;
|
|
93
|
+
modal: {
|
|
94
|
+
name: string | null;
|
|
95
|
+
context?: unknown;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
99
|
+
entity: Record<Entity, CommonStore<CreatedEntity<Entity>>>;
|
|
100
|
+
mutual: Record<string, CommonStore<Mutual>>;
|
|
101
|
+
tag: Record<string, CommonStore<CreatedEntity<Entity>>>;
|
|
102
|
+
auth: {
|
|
103
|
+
isUnauthorized: boolean;
|
|
104
|
+
profile: {
|
|
105
|
+
displayName: string;
|
|
106
|
+
email: string;
|
|
107
|
+
accountId: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}) => {
|
|
111
|
+
app: {
|
|
112
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
113
|
+
loadStack: Map<string, number>;
|
|
114
|
+
intLoadStack: Map<string, number>;
|
|
115
|
+
loadingMessage: string;
|
|
116
|
+
errorStack: Map<string, ApplicationRequestError>;
|
|
117
|
+
modal: {
|
|
118
|
+
name: string | null;
|
|
119
|
+
context?: unknown;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
123
|
+
entity: Record<Entity, CommonStore<CreatedEntity<Entity>>>;
|
|
124
|
+
mutual: Record<string, CommonStore<Mutual>>;
|
|
125
|
+
tag: Record<string, CommonStore<CreatedEntity<Entity>>>;
|
|
126
|
+
auth: {
|
|
127
|
+
isUnauthorized: boolean;
|
|
128
|
+
profile: {
|
|
129
|
+
displayName: string;
|
|
130
|
+
email: string;
|
|
131
|
+
accountId: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
} | Partial<{
|
|
135
|
+
app: {
|
|
136
|
+
ongoingRequests: Map<string, Promise<unknown>>;
|
|
137
|
+
loadStack: Map<string, number>;
|
|
138
|
+
intLoadStack: Map<string, number>;
|
|
139
|
+
loadingMessage: string;
|
|
140
|
+
errorStack: Map<string, ApplicationRequestError>;
|
|
141
|
+
modal: {
|
|
142
|
+
name: string | null;
|
|
143
|
+
context?: unknown;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
config: Record<Entity, MonoriseEntityConfig>;
|
|
147
|
+
entity: Record<Entity, CommonStore<CreatedEntity<Entity>>>;
|
|
148
|
+
mutual: Record<string, CommonStore<Mutual>>;
|
|
149
|
+
tag: Record<string, CommonStore<CreatedEntity<Entity>>>;
|
|
150
|
+
auth: {
|
|
151
|
+
isUnauthorized: boolean;
|
|
152
|
+
profile: {
|
|
153
|
+
displayName: string;
|
|
154
|
+
email: string;
|
|
155
|
+
accountId: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
}>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
159
|
+
}>;
|
|
160
|
+
};
|
|
161
|
+
export { initMonoriseStore };
|
|
162
|
+
export type MonoriseStore = Awaited<ReturnType<typeof initMonoriseStore>>['monoriseStore'];
|
|
163
|
+
//# sourceMappingURL=monorise.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":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E,MAAM,CAAC,CAAC;gBAClC,cAAc,EAAE,MAAM,CAAC;gBACvB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;gBACjD,KAAK,EAAE;oBACL,IAAI,EAAE,SAAsB,IAAI,CAAC;oBACjC,OAAO,CAAC,UAAqC;iBAC9C,CAAC;aACH;oBACO,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;oBACpC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;oBAClD,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;iBACtC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;kBACjD;gBACJ,cAAc,EAAE,OAAO,CAAC;gBACxB,OAAO,EAAE;oBACP,WAAW,EAAE,MAAM,CAAC;oBACpB,KAAK,EAAE,MAAM,CAAC;oBACd,SAAS,EAAE,MAAM,CAAC;iBACnB,CAAC;aACH;;;CAqCR,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,MAAM,MAAM,aAAa,GAAG,OAAO,CACjC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CACrC,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { enableMapSet } from 'immer';
|
|
2
|
+
import { create } from 'zustand';
|
|
3
|
+
import { devtools } from 'zustand/middleware';
|
|
4
|
+
enableMapSet();
|
|
5
|
+
const configureDevtools = (storeName) => {
|
|
6
|
+
var _a;
|
|
7
|
+
return ({
|
|
8
|
+
name: `${storeName} Store`,
|
|
9
|
+
anonymousActionType: `${storeName.toLowerCase()}/action`,
|
|
10
|
+
enabled: !['prod', 'dev'].includes((_a = process.env.NEXT_PUBLIC_ENVIRONMENT) !== null && _a !== void 0 ? _a : ''),
|
|
11
|
+
serialize: {
|
|
12
|
+
options: {
|
|
13
|
+
map: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const initMonoriseStore = () => {
|
|
19
|
+
let options = {};
|
|
20
|
+
const { modals = {} } = options;
|
|
21
|
+
const monoriseStore = create(devtools(() => ({
|
|
22
|
+
app: {
|
|
23
|
+
ongoingRequests: new Map(),
|
|
24
|
+
loadStack: new Map(),
|
|
25
|
+
intLoadStack: new Map(),
|
|
26
|
+
loadingMessage: '',
|
|
27
|
+
errorStack: new Map(),
|
|
28
|
+
modal: {
|
|
29
|
+
name: null,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
config: {},
|
|
33
|
+
entity: {},
|
|
34
|
+
mutual: {},
|
|
35
|
+
tag: {},
|
|
36
|
+
auth: {
|
|
37
|
+
isUnauthorized: false,
|
|
38
|
+
profile: {
|
|
39
|
+
displayName: '',
|
|
40
|
+
email: '',
|
|
41
|
+
accountId: '',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}), configureDevtools('monorise')));
|
|
45
|
+
const setOptions = (opts) => {
|
|
46
|
+
options = Object.assign(Object.assign({}, options), opts);
|
|
47
|
+
};
|
|
48
|
+
return { setOptions, monoriseStore };
|
|
49
|
+
};
|
|
50
|
+
export { initMonoriseStore };
|
|
51
|
+
//# sourceMappingURL=monorise.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorise.store.js","sourceRoot":"","sources":["../../store/monorise.store.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK9C,YAAY,EAAE,CAAC;AAEf,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAE,EAAE;;IAAC,OAAA,CAAC;QAChD,IAAI,EAAE,GAAG,SAAS,QAAQ;QAC1B,mBAAmB,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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../index.ts","../actions/app.action.ts","../actions/auth.action.ts","../actions/config.action.ts","../actions/core.action.ts","../lib/api.ts","../lib/constant.ts","../lib/entity.ts","../lib/utils.ts","../services/auth.service.ts","../services/core.service.ts","../services/filestore.service.ts","../store/monorise.store.ts","../types/api.type.ts","../types/axios.type.ts","../types/monorise.type.ts","../types/mutual.type.ts"],"version":"5.8.2"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type AxiosRequestConfig, type AxiosResponse } from 'axios';
|
|
2
|
+
export type ApplicationRequestError = {
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
type ExtractModalProps<T> = T extends React.ComponentType<infer P> ? P : void;
|
|
7
|
+
export type ModalProps<M> = {
|
|
8
|
+
[K in keyof M]: ExtractModalProps<M[K]>;
|
|
9
|
+
};
|
|
10
|
+
declare const axios: {
|
|
11
|
+
post: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: AxiosRequestConfig<D>) => Promise<R>;
|
|
12
|
+
put: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: AxiosRequestConfig<D>) => Promise<R>;
|
|
13
|
+
patch: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, data: D, config: AxiosRequestConfig<D>) => Promise<R>;
|
|
14
|
+
delete: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: AxiosRequestConfig<D>) => Promise<R>;
|
|
15
|
+
get: <T = any, R = AxiosResponse<T, any>, D = any>(url: string, config: AxiosRequestConfig<D>) => Promise<R>;
|
|
16
|
+
defaults: Omit<import("axios").AxiosDefaults, "headers"> & {
|
|
17
|
+
headers: import("axios").HeadersDefaults & {
|
|
18
|
+
[key: string]: import("axios").AxiosHeaderValue;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
interceptors: {
|
|
22
|
+
request: import("axios").AxiosInterceptorManager<import("axios").InternalAxiosRequestConfig>;
|
|
23
|
+
response: import("axios").AxiosInterceptorManager<AxiosResponse>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type AxiosInterceptor = typeof axios;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=api.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.type.d.ts","sourceRoot":"","sources":["../../types/api.type.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE7E,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,iBAAiB,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AAG9E,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;KACzB,CAAC,IAAI,MAAM,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC;AAiBF,QAAA,MAAM,KAAK;WAEF,CAAC,QAAQ,CAAC,0BAA0B,CAAC,aACrC,MAAM,QACL,CAAC,UACC,kBAAkB,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,CAAC,CAAC;UACP,CAAC,QAAQ,CAAC,0BAA0B,CAAC,aACpC,MAAM,QACL,CAAC,UACC,kBAAkB,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,CAAC,CAAC;YACL,CAAC,QAAQ,CAAC,0BAA0B,CAAC,aACtC,MAAM,QACL,CAAC,UACC,kBAAkB,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,CAAC,CAAC;aACJ,CAAC,QAAQ,CAAC,0BAA0B,CAAC,aACvC,MAAM,UACH,kBAAkB,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,CAAC,CAAC;UACP,CAAC,QAAQ,CAAC,0BAA0B,CAAC,aACpC,MAAM,UACH,kBAAkB,CAAC,CAAC,CAAC,KAC5B,OAAO,CAAC,CAAC,CAAC;;;;;;;;;;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,OAAO,KAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import request from 'axios';
|
|
2
|
+
// this axios instance is created for the sole purpose of typing
|
|
3
|
+
// why not using typeof initAxiosInterceptor?
|
|
4
|
+
// To break circular dependency
|
|
5
|
+
const axiosInstance = request.create();
|
|
6
|
+
function makeRequest(url, config, data) {
|
|
7
|
+
const promise = axiosInstance.request(Object.assign(Object.assign({}, config), { url, data }));
|
|
8
|
+
return promise;
|
|
9
|
+
}
|
|
10
|
+
const axios = Object.assign(Object.assign({}, axiosInstance), { post: (url, data, config) => makeRequest(url, Object.assign(Object.assign({}, config), { method: 'POST' }), data), put: (url, data, config) => makeRequest(url, Object.assign(Object.assign({}, config), { method: 'PUT' }), data), patch: (url, data, config) => makeRequest(url, Object.assign(Object.assign({}, config), { method: 'PATCH' }), data), delete: (url, config) => makeRequest(url, Object.assign(Object.assign({}, config), { method: 'DELETE' })), get: (url, config) => makeRequest(url, Object.assign(Object.assign({}, config), { method: 'GET' })) });
|
|
11
|
+
//# sourceMappingURL=api.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.type.js","sourceRoot":"","sources":["../../types/api.type.ts"],"names":[],"mappings":"AAAA,OAAO,OAAwD,MAAM,OAAO,CAAC;AAc7E,gEAAgE;AAChE,6CAA6C;AAC7C,+BAA+B;AAE/B,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAEvC,SAAS,WAAW,CAClB,GAAW,EACX,MAA6B,EAC7B,IAAQ;IAER,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,iCAAe,MAAM,KAAE,GAAG,EAAE,IAAI,IAAG,CAAC;IACzE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,KAAK,mCACN,aAAa,KAChB,IAAI,EAAE,CACJ,GAAW,EACX,IAAO,EACP,MAA6B,EACjB,EAAE,CAAC,WAAW,CAAC,GAAG,kCAAO,MAAM,KAAE,MAAM,EAAE,MAAM,KAAI,IAAI,CAAC,EACtE,GAAG,EAAE,CACH,GAAW,EACX,IAAO,EACP,MAA6B,EACjB,EAAE,CAAC,WAAW,CAAC,GAAG,kCAAO,MAAM,KAAE,MAAM,EAAE,KAAK,KAAI,IAAI,CAAC,EACrE,KAAK,EAAE,CACL,GAAW,EACX,IAAO,EACP,MAA6B,EACjB,EAAE,CAAC,WAAW,CAAC,GAAG,kCAAO,MAAM,KAAE,MAAM,EAAE,OAAO,KAAI,IAAI,CAAC,EACvE,MAAM,EAAE,CACN,GAAW,EACX,MAA6B,EACjB,EAAE,CAAC,WAAW,CAAC,GAAG,kCAAO,MAAM,KAAE,MAAM,EAAE,QAAQ,IAAG,EAClE,GAAG,EAAE,CACH,GAAW,EACX,MAA6B,EACjB,EAAE,CAAC,WAAW,CAAC,GAAG,kCAAO,MAAM,KAAE,MAAM,EAAE,KAAK,IAAG,GAChE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import 'axios';
|
|
2
|
+
declare module 'axios' {
|
|
3
|
+
interface AxiosRequestConfig {
|
|
4
|
+
requestKey: string;
|
|
5
|
+
isInterruptive?: boolean;
|
|
6
|
+
feedback?: {
|
|
7
|
+
loading?: string | boolean;
|
|
8
|
+
success?: ((data: any) => string) | string | boolean;
|
|
9
|
+
failure?: string | boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=axios.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios.type.d.ts","sourceRoot":"","sources":["../../types/axios.type.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,CAAC;AAEf,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAiB,kBAAkB;QACjC,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,EAAE;YACT,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;YAC3B,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC;YACrD,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;SAC5B,CAAC;KACH;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios.type.js","sourceRoot":"","sources":["../../types/axios.type.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,OAAO,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorise.type.d.ts","sourceRoot":"","sources":["../../types/monorise.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE5D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;CACzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monorise.type.js","sourceRoot":"","sources":["../../types/monorise.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Entity, EntitySchemaMap } from '@monorise/base';
|
|
2
|
+
type MutualDataWithIndex = {
|
|
3
|
+
index: number;
|
|
4
|
+
};
|
|
5
|
+
interface MutualDataMapping {
|
|
6
|
+
}
|
|
7
|
+
type MutualData<B extends Entity, T extends Entity> = B extends keyof MutualDataMapping ? T extends keyof MutualDataMapping[B] ? MutualDataMapping[B][T] : Record<string, any> : Record<string, any>;
|
|
8
|
+
type Mutual<B extends Entity = Entity, T extends Entity = Entity> = {
|
|
9
|
+
entityId: string;
|
|
10
|
+
entityType: T;
|
|
11
|
+
byEntityId: string;
|
|
12
|
+
byEntityType: B;
|
|
13
|
+
mutualId: string;
|
|
14
|
+
data: T extends keyof EntitySchemaMap ? EntitySchemaMap[T] : never;
|
|
15
|
+
mutualData: MutualData<B, T> | Record<string, any>;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
mutualUpdatedAt: string;
|
|
19
|
+
};
|
|
20
|
+
export type { MutualDataWithIndex, MutualDataMapping, MutualData, Mutual };
|
|
21
|
+
//# sourceMappingURL=mutual.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutual.type.d.ts","sourceRoot":"","sources":["../../types/mutual.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE9D,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAGF,UAAU,iBAAiB;CAAG;AAE9B,KAAK,UAAU,CACb,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,MAAM,IACd,CAAC,SAAS,MAAM,iBAAiB,GACjC,CAAC,SAAS,MAAM,iBAAiB,CAAC,CAAC,CAAC,GAClC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACvB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACrB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAExB,KAAK,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,CAAC,SAAS,MAAM,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IACnE,UAAU,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutual.type.js","sourceRoot":"","sources":["../../types/mutual.type.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@monorise/react",
|
|
3
|
+
"version": "0.0.1-dev.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"directories": {
|
|
8
|
+
"lib": "lib"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc -b"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@monorise/base": "^0.0.1-dev.0",
|
|
18
|
+
"@tabler/icons-react": "^3.30.0",
|
|
19
|
+
"axios": "^1.8.1",
|
|
20
|
+
"immer": "^10.1.1",
|
|
21
|
+
"zustand": "^4.5.2"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/react": "^18",
|
|
25
|
+
"@types/react-dom": "^18"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"react": "^18",
|
|
29
|
+
"react-dom": "^18"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist"
|
|
33
|
+
]
|
|
34
|
+
}
|