jamespot-front-business 1.1.0 → 1.1.4
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/CHANGELOG.md +24 -0
- package/README-internal.md +4 -0
- package/dist/cjs.js +298 -17
- package/dist/cjs.js.map +1 -1
- package/dist/esm.js +296 -18
- package/dist/esm.js.map +1 -1
- package/dist/types.d.ts +154 -23
- package/package.json +50 -50
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
2
|
-
import { EntityState, Action, Dispatch as Dispatch$1 } from '@reduxjs/toolkit';
|
|
2
|
+
import { EntityState, Action, Dispatch as Dispatch$1, PayloadAction } from '@reduxjs/toolkit';
|
|
3
3
|
import * as _reduxjs_toolkit_dist_tsHelpers from '@reduxjs/toolkit/dist/tsHelpers';
|
|
4
4
|
import * as jamespot_user_api from 'jamespot-user-api';
|
|
5
|
-
import { Application as Application$1, JamespotUserApi, ReservationList, BookableAssetList, AssetReservationConfiguration, Model as Model$1 } from 'jamespot-user-api';
|
|
5
|
+
import { Application as Application$1, JamespotUserApi, ReservationList, BookableAssetList, AssetReservationConfiguration, Model as Model$1, JLandMap, JLicenseAvailable, jUserList } from 'jamespot-user-api';
|
|
6
6
|
import * as redux from 'redux';
|
|
7
7
|
import { Dispatch } from 'redux';
|
|
8
|
-
import
|
|
8
|
+
import * as immer_dist_internal from 'immer/dist/internal';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type ApplicationRootState = {
|
|
11
11
|
entities: {
|
|
12
12
|
applications: EntityState<Application$1>;
|
|
13
13
|
};
|
|
@@ -44,17 +44,17 @@ declare const Application: {
|
|
|
44
44
|
selectors: _reduxjs_toolkit.EntitySelectors<Application$1, ApplicationRootState>;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
dispatch:
|
|
47
|
+
type RootState = Partial<AssetReservationRootState | ApplicationRootState | ModelRootState | ToastRootState>;
|
|
48
|
+
type RootDispatch = Dispatch<Action>;
|
|
49
|
+
type ThunkApiConfig<T> = {
|
|
50
|
+
dispatch: any;
|
|
51
51
|
state: RootState & T;
|
|
52
52
|
extra: {
|
|
53
53
|
jApi: JamespotUserApi;
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
type ReservationForm = {
|
|
58
58
|
date: string;
|
|
59
59
|
hourStart: string;
|
|
60
60
|
hourEnd: string;
|
|
@@ -62,11 +62,11 @@ declare type ReservationForm = {
|
|
|
62
62
|
description?: string;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
type Loading = {
|
|
66
66
|
loading: 'idle' | 'pending';
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
type ReservationState = Loading & {
|
|
70
70
|
entities: ReservationList[];
|
|
71
71
|
nbResults: number;
|
|
72
72
|
form: ReservationForm;
|
|
@@ -75,7 +75,7 @@ interface ReservationRootState {
|
|
|
75
75
|
reservation: ReservationState;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
type BookableAssetState = Loading & {
|
|
79
79
|
entities: BookableAssetList[];
|
|
80
80
|
nbResults: number;
|
|
81
81
|
};
|
|
@@ -83,12 +83,12 @@ interface BookableAssetRootState {
|
|
|
83
83
|
bookableAsset: BookableAssetState;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
type Configuration = AssetReservationConfiguration & Loading;
|
|
87
87
|
interface ConfigurationRootState {
|
|
88
88
|
configuration: Configuration;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
type AssetReservationRootState = {
|
|
92
92
|
assetReservation: BookableAssetRootState & ConfigurationRootState & ReservationRootState;
|
|
93
93
|
};
|
|
94
94
|
declare const AssetReservation: {
|
|
@@ -102,7 +102,7 @@ declare const AssetReservation: {
|
|
|
102
102
|
};
|
|
103
103
|
actions: {
|
|
104
104
|
fetchBookableAsset: _reduxjs_toolkit.AsyncThunk<jamespot_user_api.ApiPagingResults<jamespot_user_api.BookableAssetList, string[]>, void, {
|
|
105
|
-
dispatch:
|
|
105
|
+
dispatch: any;
|
|
106
106
|
state: RootState & BookableAssetRootState;
|
|
107
107
|
extra: {
|
|
108
108
|
jApi: jamespot_user_api.JamespotUserApi;
|
|
@@ -114,7 +114,7 @@ declare const AssetReservation: {
|
|
|
114
114
|
rejectedMeta?: unknown;
|
|
115
115
|
}>;
|
|
116
116
|
fetchConfiguration: _reduxjs_toolkit.AsyncThunk<jamespot_user_api.ApiWrapper<jamespot_user_api.AssetReservationConfiguration, string[]>, void, {
|
|
117
|
-
dispatch:
|
|
117
|
+
dispatch: any;
|
|
118
118
|
state: RootState & jamespot_user_api.AssetReservationConfiguration & Loading;
|
|
119
119
|
extra: {
|
|
120
120
|
jApi: jamespot_user_api.JamespotUserApi;
|
|
@@ -126,7 +126,7 @@ declare const AssetReservation: {
|
|
|
126
126
|
rejectedMeta?: unknown;
|
|
127
127
|
}>;
|
|
128
128
|
fetchReservation: _reduxjs_toolkit.AsyncThunk<jamespot_user_api.ApiPagingResults<jamespot_user_api.ReservationList, jamespot_user_api.BaseMessages>, "history" | undefined, {
|
|
129
|
-
dispatch:
|
|
129
|
+
dispatch: any;
|
|
130
130
|
state: RootState & ReservationRootState;
|
|
131
131
|
extra: {
|
|
132
132
|
jApi: jamespot_user_api.JamespotUserApi;
|
|
@@ -151,7 +151,7 @@ declare const AssetReservation: {
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
type ModelRootState = {
|
|
155
155
|
entities: {
|
|
156
156
|
models: EntityState<Model$1>;
|
|
157
157
|
};
|
|
@@ -188,11 +188,11 @@ declare const Model: {
|
|
|
188
188
|
selectors: _reduxjs_toolkit.EntitySelectors<Model$1<string>, ModelRootState>;
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
type ToastType = 'success' | 'warning' | 'error';
|
|
192
|
+
type ToastRootState = {
|
|
193
193
|
toasts: EntityState<ToastEntity>;
|
|
194
194
|
};
|
|
195
|
-
|
|
195
|
+
type ToastEntity = {
|
|
196
196
|
id: string;
|
|
197
197
|
label: string;
|
|
198
198
|
description?: string;
|
|
@@ -205,7 +205,7 @@ declare const actions: {
|
|
|
205
205
|
warning: (toast: Toast, timeout?: number) => (dispatch: Dispatch$1) => string;
|
|
206
206
|
error: (toast: Toast, timeout?: number) => (dispatch: Dispatch$1) => string;
|
|
207
207
|
};
|
|
208
|
-
|
|
208
|
+
type Toast = {
|
|
209
209
|
id?: string;
|
|
210
210
|
label: string;
|
|
211
211
|
description?: string;
|
|
@@ -238,4 +238,135 @@ declare const Toast: {
|
|
|
238
238
|
selectors: _reduxjs_toolkit.EntitySelectors<ToastEntity, ToastRootState>;
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
type JLandMapFront = JLandMap & {
|
|
242
|
+
urlToJland?: string;
|
|
243
|
+
};
|
|
244
|
+
type JLandState = {
|
|
245
|
+
maps: Array<JLandMapFront>;
|
|
246
|
+
availableLicenses: JLicenseAvailable;
|
|
247
|
+
loading: 'idle' | 'pending';
|
|
248
|
+
loadingAvailableLicenses: 'idle' | 'pending';
|
|
249
|
+
loadingLicenseOperation: {
|
|
250
|
+
[key: number]: 'idle' | 'pending' | undefined;
|
|
251
|
+
};
|
|
252
|
+
loadingMapDeletion: 'idle' | 'pending';
|
|
253
|
+
};
|
|
254
|
+
type JLandRootState = {
|
|
255
|
+
jland: JLandState;
|
|
256
|
+
};
|
|
257
|
+
declare const jland: {
|
|
258
|
+
slice: _reduxjs_toolkit.Slice<{
|
|
259
|
+
maps: JLandMapFront[];
|
|
260
|
+
availableLicenses: JLicenseAvailable;
|
|
261
|
+
loading: "idle" | "pending";
|
|
262
|
+
loadingAvailableLicenses: "idle" | "pending";
|
|
263
|
+
loadingLicenseOperation: {
|
|
264
|
+
[key: number]: "idle" | "pending" | undefined;
|
|
265
|
+
};
|
|
266
|
+
loadingMapDeletion: "idle" | "pending";
|
|
267
|
+
}, {}, "jland">;
|
|
268
|
+
actions: {
|
|
269
|
+
assignLicense: _reduxjs_toolkit.AsyncThunk<boolean | undefined, {
|
|
270
|
+
map: JLandMapFront;
|
|
271
|
+
retrieveAllMaps: boolean;
|
|
272
|
+
}, {
|
|
273
|
+
dispatch: any;
|
|
274
|
+
state: RootState & JLandRootState;
|
|
275
|
+
extra: {
|
|
276
|
+
jApi: jamespot_user_api.JamespotUserApi;
|
|
277
|
+
};
|
|
278
|
+
rejectValue?: unknown;
|
|
279
|
+
serializedErrorType?: unknown;
|
|
280
|
+
pendingMeta?: unknown;
|
|
281
|
+
fulfilledMeta?: unknown;
|
|
282
|
+
rejectedMeta?: unknown;
|
|
283
|
+
}>;
|
|
284
|
+
unassignLicense: _reduxjs_toolkit.AsyncThunk<boolean | undefined, {
|
|
285
|
+
map: JLandMapFront;
|
|
286
|
+
retrieveAllMaps: boolean;
|
|
287
|
+
}, {
|
|
288
|
+
dispatch: any;
|
|
289
|
+
state: RootState & JLandRootState;
|
|
290
|
+
extra: {
|
|
291
|
+
jApi: jamespot_user_api.JamespotUserApi;
|
|
292
|
+
};
|
|
293
|
+
rejectValue?: unknown;
|
|
294
|
+
serializedErrorType?: unknown;
|
|
295
|
+
pendingMeta?: unknown;
|
|
296
|
+
fulfilledMeta?: unknown;
|
|
297
|
+
rejectedMeta?: unknown;
|
|
298
|
+
}>;
|
|
299
|
+
deleteJlandMap: _reduxjs_toolkit.AsyncThunk<boolean | undefined, {
|
|
300
|
+
map: JLandMapFront;
|
|
301
|
+
retrieveAllMaps: boolean;
|
|
302
|
+
}, {
|
|
303
|
+
dispatch: any;
|
|
304
|
+
state: RootState & JLandRootState;
|
|
305
|
+
extra: {
|
|
306
|
+
jApi: jamespot_user_api.JamespotUserApi;
|
|
307
|
+
};
|
|
308
|
+
rejectValue?: unknown;
|
|
309
|
+
serializedErrorType?: unknown;
|
|
310
|
+
pendingMeta?: unknown;
|
|
311
|
+
fulfilledMeta?: unknown;
|
|
312
|
+
rejectedMeta?: unknown;
|
|
313
|
+
}>;
|
|
314
|
+
fetchJLandMaps: _reduxjs_toolkit.AsyncThunk<JLandMapFront[] | undefined, {
|
|
315
|
+
jlandUrlBase: string;
|
|
316
|
+
retrieveAllMaps: boolean;
|
|
317
|
+
}, {
|
|
318
|
+
dispatch: any;
|
|
319
|
+
state: RootState & JLandRootState;
|
|
320
|
+
extra: {
|
|
321
|
+
jApi: jamespot_user_api.JamespotUserApi;
|
|
322
|
+
};
|
|
323
|
+
rejectValue?: unknown;
|
|
324
|
+
serializedErrorType?: unknown;
|
|
325
|
+
pendingMeta?: unknown;
|
|
326
|
+
fulfilledMeta?: unknown;
|
|
327
|
+
rejectedMeta?: unknown;
|
|
328
|
+
}>;
|
|
329
|
+
fetchJLandAvailableLicenses: _reduxjs_toolkit.AsyncThunk<JLicenseAvailable | undefined, void, {
|
|
330
|
+
dispatch: any;
|
|
331
|
+
state: RootState & JLandRootState;
|
|
332
|
+
extra: {
|
|
333
|
+
jApi: jamespot_user_api.JamespotUserApi;
|
|
334
|
+
};
|
|
335
|
+
rejectValue?: unknown;
|
|
336
|
+
serializedErrorType?: unknown;
|
|
337
|
+
pendingMeta?: unknown;
|
|
338
|
+
fulfilledMeta?: unknown;
|
|
339
|
+
rejectedMeta?: unknown;
|
|
340
|
+
}>;
|
|
341
|
+
};
|
|
342
|
+
selectors: {
|
|
343
|
+
selectJLandMaps: (state: JLandRootState) => JLandMapFront[];
|
|
344
|
+
selectJLandAvailableLicenses: (state: JLandRootState) => JLicenseAvailable;
|
|
345
|
+
};
|
|
346
|
+
utils: {
|
|
347
|
+
buildUrlToJland: (map: JLandMap, hostname: string, urlBase: string) => string;
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
type UserCurrentRootState = {
|
|
352
|
+
userCurrent: jUserList;
|
|
353
|
+
};
|
|
354
|
+
declare const slice: _reduxjs_toolkit.Slice<jUserList, {
|
|
355
|
+
init: (_: immer_dist_internal.WritableDraft<jUserList>, { payload }: PayloadAction<jUserList>) => jUserList;
|
|
356
|
+
}, "userCurrent">;
|
|
357
|
+
declare const UserCurrent: {
|
|
358
|
+
slice: _reduxjs_toolkit.Slice<jUserList, {
|
|
359
|
+
init: (_: immer_dist_internal.WritableDraft<jUserList>, { payload }: PayloadAction<jUserList>) => jUserList;
|
|
360
|
+
}, "userCurrent">;
|
|
361
|
+
actions: {
|
|
362
|
+
init: _reduxjs_toolkit.ActionCreatorWithPayload<jUserList, "userCurrent/init">;
|
|
363
|
+
};
|
|
364
|
+
selectors: {
|
|
365
|
+
get: (state: UserCurrentRootState) => jUserList;
|
|
366
|
+
};
|
|
367
|
+
utils: {
|
|
368
|
+
isAdmin: (userCurrent: jUserList) => boolean;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
export { Application, ApplicationRootState, AssetReservation, AssetReservationRootState, JLandMapFront, JLandRootState, JLandState, Model, ModelRootState, ReservationForm, RootDispatch, RootState, ThunkApiConfig, Toast, ToastRootState, UserCurrent, UserCurrentRootState, actions, jland, slice };
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
2
|
+
"name": "jamespot-front-business",
|
|
3
|
+
"version": "1.1.4",
|
|
4
|
+
"description": "typescript utils",
|
|
5
|
+
"main": "dist/cjs.js",
|
|
6
|
+
"module": "dist/esm.js",
|
|
7
|
+
"types": "dist/types.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "rollup -c",
|
|
10
|
+
"watch": "rollup -c -w",
|
|
11
|
+
"format": "prettier --write --plugin-search-dir=. .",
|
|
12
|
+
"lint": "eslint --ignore-path .gitignore .",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"test:one": "jest --coverage=0"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+ssh://git@github.com/Jamespot/jamespot-front-business.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"typescript",
|
|
22
|
+
"jamespot",
|
|
23
|
+
"api",
|
|
24
|
+
"redux"
|
|
25
|
+
],
|
|
26
|
+
"author": "Jamespot",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@changesets/cli": "^2.24.3",
|
|
29
|
+
"@rollup/plugin-commonjs": "^22.0.2",
|
|
30
|
+
"@rollup/plugin-typescript": "^8.3.3",
|
|
31
|
+
"@types/jest": "^28.1.4",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
33
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
34
|
+
"eslint": "^8.19.0",
|
|
35
|
+
"eslint-config-prettier": "^8.5.0",
|
|
36
|
+
"jest": "^28.1.2",
|
|
37
|
+
"jest-environment-jsdom": "^29.0.1",
|
|
38
|
+
"prettier": "^2.7.1",
|
|
39
|
+
"rollup": "^2.75.7",
|
|
40
|
+
"rollup-plugin-dts": "^4.2.2",
|
|
41
|
+
"ts-jest": "^28.0.5",
|
|
42
|
+
"tslib": "^2.4.0",
|
|
43
|
+
"typescript": "^4.7.4"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@reduxjs/toolkit": "1.9.0",
|
|
47
|
+
"jamespot-user-api": "^1.0.90",
|
|
48
|
+
"react-redux": "7.2.9",
|
|
49
|
+
"redux": "4.2.0"
|
|
50
|
+
}
|
|
51
|
+
}
|