jamespot-user-api 1.0.13 → 1.0.43
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/documentation/.nojekyll +1 -0
- package/documentation/assets/highlight.css +50 -0
- package/documentation/assets/icons.css +1043 -0
- package/documentation/assets/icons.png +0 -0
- package/documentation/assets/icons@2x.png +0 -0
- package/documentation/assets/main.js +52 -0
- package/documentation/assets/search.js +1 -0
- package/documentation/assets/style.css +1413 -0
- package/documentation/assets/widgets.png +0 -0
- package/documentation/assets/widgets@2x.png +0 -0
- package/documentation/classes/JApplication.html +1 -0
- package/documentation/classes/JApplicationApi.html +30 -0
- package/documentation/classes/JArticleApi.html +1 -0
- package/documentation/classes/JAudienceApi.html +4 -0
- package/documentation/classes/JBaseApi.html +1 -0
- package/documentation/classes/JBaseObject.html +4 -0
- package/documentation/classes/JBookmark.html +1 -0
- package/documentation/classes/JBookmarkApi.html +1 -0
- package/documentation/classes/JCommunityApi.html +1 -0
- package/documentation/classes/JConcept.html +1 -0
- package/documentation/classes/JConceptApi.html +7 -0
- package/documentation/classes/JDiapazoneApi.html +1 -0
- package/documentation/classes/JFileApi.html +1 -0
- package/documentation/classes/JFilebankApi.html +1 -0
- package/documentation/classes/JGroupApi.html +12 -0
- package/documentation/classes/JLandApi.html +1 -0
- package/documentation/classes/JMessengerApi.html +1 -0
- package/documentation/classes/JSearchApi.html +18 -0
- package/documentation/classes/JUser.html +1 -0
- package/documentation/classes/JUserApi.html +17 -0
- package/documentation/classes/JWedocApi.html +1 -0
- package/documentation/classes/JamespotUserApi.html +6 -0
- package/documentation/classes/Network.html +1 -0
- package/documentation/enums/JApplicationStatus.html +1 -0
- package/documentation/index.html +79 -0
- package/documentation/interfaces/ApiError.html +1 -0
- package/documentation/interfaces/ApiWrapper.html +1 -0
- package/documentation/interfaces/AseiGroups.html +1 -0
- package/documentation/interfaces/AseiInstitution.html +1 -0
- package/documentation/interfaces/AseiRights.html +1 -0
- package/documentation/interfaces/AseiTicket.html +1 -0
- package/documentation/interfaces/BaseAutocomplete.html +1 -0
- package/documentation/interfaces/BaseMessage.html +1 -0
- package/documentation/interfaces/Category.html +1 -0
- package/documentation/interfaces/CreateGroup.html +1 -0
- package/documentation/interfaces/FileBankProps.html +1 -0
- package/documentation/interfaces/FileOption.html +1 -0
- package/documentation/interfaces/FolderProps.html +1 -0
- package/documentation/interfaces/ListFilterSpec.html +1 -0
- package/documentation/interfaces/OF.html +1 -0
- package/documentation/interfaces/PagingResults.html +1 -0
- package/documentation/interfaces/Result.html +1 -0
- package/documentation/interfaces/RootFolderProps.html +1 -0
- package/documentation/interfaces/SearchCategoryModel.html +1 -0
- package/documentation/interfaces/SearchConfig.html +1 -0
- package/documentation/interfaces/SearchFacetModel.html +1 -0
- package/documentation/interfaces/SearchFacetValueModel.html +1 -0
- package/documentation/interfaces/SearchQuery.html +1 -0
- package/documentation/interfaces/SearchQueryFilterModel.html +6 -0
- package/documentation/interfaces/SearchQueryOption.html +4 -0
- package/documentation/interfaces/SearchQueryResult.html +1 -0
- package/documentation/interfaces/SearchQuerySortModel.html +5 -0
- package/documentation/interfaces/SearchResultCatProps.html +1 -0
- package/documentation/interfaces/SearchResultProps.html +1 -0
- package/documentation/interfaces/SpotProps.html +1 -0
- package/documentation/interfaces/Taxonomy.html +1 -0
- package/documentation/interfaces/TaxonomyCreate.html +1 -0
- package/documentation/interfaces/TmpApplication.html +1 -0
- package/documentation/interfaces/TmpUser.html +1 -0
- package/documentation/interfaces/UserModel.html +1 -0
- package/documentation/modules.html +1 -0
- package/lib/jamespot-user-api.js +1 -1
- package/lib/jamespot-user-api.js.map +1 -1
- package/lib/src/apis/application.d.ts +60 -0
- package/lib/src/apis/article.d.ts +38 -0
- package/lib/src/apis/asei.d.ts +25 -0
- package/lib/src/apis/audience.d.ts +9 -0
- package/lib/src/apis/base.d.ts +5 -0
- package/lib/src/apis/bookmark.d.ts +21 -0
- package/lib/src/apis/community.d.ts +9 -0
- package/lib/src/apis/concept.d.ts +10 -0
- package/lib/src/apis/diapazone.d.ts +8 -0
- package/lib/src/apis/file.d.ts +5 -0
- package/lib/src/apis/filebank.d.ts +34 -0
- package/lib/src/apis/group.d.ts +16 -0
- package/lib/src/apis/index.d.ts +17 -0
- package/lib/src/apis/jamespotUserApi.d.ts +47 -0
- package/lib/src/apis/jland.d.ts +24 -0
- package/lib/src/apis/messenger.d.ts +6 -0
- package/lib/src/apis/search.d.ts +47 -0
- package/lib/src/apis/taxonomy.d.ts +9 -0
- package/lib/src/apis/user.d.ts +27 -0
- package/lib/src/apis/wedoc.d.ts +32 -0
- package/lib/src/classes/JApplication.d.ts +16 -0
- package/lib/src/classes/JBaseObject.d.ts +15 -0
- package/lib/src/classes/JBookmark.d.ts +16 -0
- package/lib/src/classes/JConcept.d.ts +3 -0
- package/lib/src/classes/JDiapazone.d.ts +16 -0
- package/lib/src/classes/JFile.d.ts +13 -0
- package/lib/src/classes/JUser.d.ts +4 -0
- package/lib/src/classes/index.d.ts +5 -0
- package/lib/src/index.d.ts +13 -0
- package/lib/src/indexMock.d.ts +9 -0
- package/lib/src/mock/windowMock.d.ts +9 -0
- package/lib/src/types/asei.d.ts +28 -0
- package/lib/src/types/autocomplete.d.ts +16 -0
- package/lib/src/types/group.d.ts +22 -0
- package/lib/src/types/index.d.ts +7 -0
- package/lib/src/types/listWrapper.d.ts +6 -0
- package/lib/src/types/search.d.ts +96 -0
- package/lib/src/types/taxonomy.d.ts +46 -0
- package/lib/src/types/user.d.ts +14 -0
- package/lib/src/types/utils.d.ts +56 -0
- package/lib/src/util/network.d.ts +23 -0
- package/package.json +1 -1
- package/src/apis/application.ts +132 -0
- package/src/apis/article.ts +74 -0
- package/src/apis/asei.ts +73 -0
- package/src/apis/audience.ts +18 -0
- package/src/apis/base.ts +9 -0
- package/src/apis/bookmark.ts +110 -0
- package/src/apis/community.ts +20 -0
- package/src/apis/concept.ts +31 -0
- package/src/apis/diapazone.ts +65 -0
- package/src/apis/file.ts +14 -0
- package/src/apis/filebank.ts +50 -0
- package/src/apis/group.ts +48 -0
- package/src/apis/index.ts +17 -0
- package/src/apis/jamespotUserApi.ts +69 -0
- package/src/apis/jland.ts +51 -0
- package/src/apis/messenger.ts +25 -0
- package/src/apis/search.ts +85 -0
- package/src/apis/taxonomy.ts +30 -0
- package/src/apis/user.ts +53 -0
- package/src/apis/wedoc.ts +77 -0
- package/src/classes/JApplication.ts +55 -0
- package/src/classes/JBaseObject.ts +64 -0
- package/src/classes/JBookmark.ts +44 -0
- package/src/classes/JConcept.ts +3 -0
- package/src/classes/JDiapazone.ts +42 -0
- package/src/classes/JFile.ts +37 -0
- package/src/classes/JUser.ts +7 -0
- package/src/classes/index.ts +5 -0
- package/src/index.ts +21 -0
- package/src/indexMock.ts +17 -0
- package/src/mock/data/autocomplete/audience/data.json +191 -0
- package/src/mock/data/autocomplete/community/data.json +47 -0
- package/src/mock/data/autocomplete/taxonomy/data.json +35 -0
- package/src/mock/data/autocomplete/user/data.json +107 -0
- package/src/mock/data/bookmarks/addBookmark/data.json +54 -0
- package/src/mock/data/bookmarks/addLink/data.json +63 -0
- package/src/mock/data/bookmarks/bookmarkList/data.json +271 -0
- package/src/mock/data/bookmarks/delete/data.json +12 -0
- package/src/mock/data/community/sendRequest/data.json +12 -0
- package/src/mock/data/file/create/data.json +18 -0
- package/src/mock/data/messenger/newMessage/data.json +47 -0
- package/src/mock/data/misc/tokenCSRF/data.json +7 -0
- package/src/mock/data/search/getConfig/data.json +318 -0
- package/src/mock/data/search/lastQueries/data.json +7 -0
- package/src/mock/data/search/proposition/data.json +125 -0
- package/src/mock/data/spot/create/data.json +7 -0
- package/src/mock/data/spot/get-available-widget/data.json +56 -0
- package/src/mock/data/spot/get-categories/data.json +28 -0
- package/src/mock/data/user/signIn/data.json +197 -0
- package/src/mock/windowMock.ts +113 -0
- package/src/types/asei.ts +33 -0
- package/src/types/autocomplete.ts +17 -0
- package/src/types/group.ts +27 -0
- package/src/types/index.ts +7 -0
- package/src/types/listWrapper.ts +6 -0
- package/src/types/search.ts +105 -0
- package/src/types/taxonomy.ts +47 -0
- package/src/types/user.ts +14 -0
- package/src/types/utils.ts +66 -0
- package/src/util/network.ts +96 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"o": "user",
|
|
3
|
+
"f": "signIn",
|
|
4
|
+
"error": 0,
|
|
5
|
+
"messages": [],
|
|
6
|
+
"result": {
|
|
7
|
+
"id": "25",
|
|
8
|
+
"idUser": "25",
|
|
9
|
+
"type": "user",
|
|
10
|
+
"active": "1",
|
|
11
|
+
"title": "Maxime.Dupont",
|
|
12
|
+
"dateCreation": "<span class=\u0027pointer\u0027 tooltip=\u002707/06/2021 16:05:10\u0027>07/06/2021</span>",
|
|
13
|
+
"dateModified": "<span class=\u0027pointer\u0027 tooltip=\u002729/06/2021 14:15:35\u0027>29/06/2021</span>",
|
|
14
|
+
"level": "Administrateur",
|
|
15
|
+
"image": null,
|
|
16
|
+
"lastConnection": "<span class=\u0027pointer\u0027 tooltip=\u002703/09/2021 09:26:48\u0027>Aujourd\u0027hui 09:38</span>",
|
|
17
|
+
"firstname": "Maxime",
|
|
18
|
+
"lastname": "Dupont",
|
|
19
|
+
"phoneNumber": "",
|
|
20
|
+
"mobileNumber": "",
|
|
21
|
+
"company": "",
|
|
22
|
+
"function": "",
|
|
23
|
+
"department": "",
|
|
24
|
+
"country": "",
|
|
25
|
+
"timeZone": "Europe/Paris",
|
|
26
|
+
"language": "Fran\u00e7ais",
|
|
27
|
+
"mail": "<a href=\u0022mailto:maxime.dupont@jamespot.com\u0022 class=\u0022\u0022 >maxime.dupont@jamespot.com</a>",
|
|
28
|
+
"visioconference": "<table class=\u0022w100\u0022>\r\n </table>",
|
|
29
|
+
"tag_2": "",
|
|
30
|
+
"idMainCommunity": "",
|
|
31
|
+
"userBanner": "",
|
|
32
|
+
"_socialActions": [],
|
|
33
|
+
"uri": "user/25",
|
|
34
|
+
"_fields": [
|
|
35
|
+
{
|
|
36
|
+
"name": "title",
|
|
37
|
+
"label": "Pseudo",
|
|
38
|
+
"type": "text"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "dateCreation",
|
|
42
|
+
"label": "Date de cr\u00e9ation",
|
|
43
|
+
"type": "date"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "dateModified",
|
|
47
|
+
"label": "Date de modification",
|
|
48
|
+
"type": "date"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "level",
|
|
52
|
+
"label": "Niveau",
|
|
53
|
+
"type": "select"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "image",
|
|
57
|
+
"label": "Votre photo",
|
|
58
|
+
"type": null
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "active",
|
|
62
|
+
"label": "Actif",
|
|
63
|
+
"type": null
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "lastConnection",
|
|
67
|
+
"label": "lastConnection",
|
|
68
|
+
"type": "date"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "firstname",
|
|
72
|
+
"label": "Pr\u00e9nom",
|
|
73
|
+
"type": "text"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "lastname",
|
|
77
|
+
"label": "Nom",
|
|
78
|
+
"type": "text"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "phoneNumber",
|
|
82
|
+
"label": "T\u00e9l.",
|
|
83
|
+
"type": "text"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "mobileNumber",
|
|
87
|
+
"label": "T\u00e9l. mobile",
|
|
88
|
+
"type": "text"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "company",
|
|
92
|
+
"label": "Soci\u00e9t\u00e9",
|
|
93
|
+
"type": "text"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "function",
|
|
97
|
+
"label": "Fonction",
|
|
98
|
+
"type": "text"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "department",
|
|
102
|
+
"label": "D\u00e9partement",
|
|
103
|
+
"type": "text"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "country",
|
|
107
|
+
"label": "Pays",
|
|
108
|
+
"type": "select"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "timeZone",
|
|
112
|
+
"label": "Fuseau horaire",
|
|
113
|
+
"type": "select"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "language",
|
|
117
|
+
"label": "Langue",
|
|
118
|
+
"type": "select"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "mail",
|
|
122
|
+
"label": "Mail",
|
|
123
|
+
"type": "email"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "visioconference",
|
|
127
|
+
"label": "Visioconf\u00e9rence",
|
|
128
|
+
"type": "multiattribute"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "tag_2",
|
|
132
|
+
"label": "Comp\u00e9tences",
|
|
133
|
+
"type": "taxonomy"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "idMainCommunity",
|
|
137
|
+
"label": "COMMUNITY_User_Main_Community",
|
|
138
|
+
"type": "text"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "userBanner",
|
|
142
|
+
"label": "Banni\u00e8re",
|
|
143
|
+
"type": "file"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "visioconference",
|
|
147
|
+
"label": "Visioconf\u00e9rence",
|
|
148
|
+
"type": "multiattribute"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "tag_2",
|
|
152
|
+
"label": "Comp\u00e9tences",
|
|
153
|
+
"type": "taxonomy"
|
|
154
|
+
}
|
|
155
|
+
],
|
|
156
|
+
"mainType": "user",
|
|
157
|
+
"_cssColor": "#a4acaf",
|
|
158
|
+
"_cssClass": "user",
|
|
159
|
+
"_right": {
|
|
160
|
+
"create": false,
|
|
161
|
+
"read": true,
|
|
162
|
+
"publish": true,
|
|
163
|
+
"administrate": false,
|
|
164
|
+
"update": true,
|
|
165
|
+
"delete": true,
|
|
166
|
+
"comment": false
|
|
167
|
+
},
|
|
168
|
+
"_values": {
|
|
169
|
+
"title": "Maxime.Dupont",
|
|
170
|
+
"dateCreation": "2021-06-07 16:05:10",
|
|
171
|
+
"dateModified": "2021-06-29 14:15:35",
|
|
172
|
+
"level": 9,
|
|
173
|
+
"image": null,
|
|
174
|
+
"active": 1,
|
|
175
|
+
"lastConnection": 1630654008,
|
|
176
|
+
"firstname": "Maxime",
|
|
177
|
+
"lastname": "Dupont",
|
|
178
|
+
"phoneNumber": "",
|
|
179
|
+
"mobileNumber": "",
|
|
180
|
+
"company": "",
|
|
181
|
+
"function": "",
|
|
182
|
+
"department": "",
|
|
183
|
+
"country": "",
|
|
184
|
+
"timeZone": "Europe/Paris",
|
|
185
|
+
"language": "fr",
|
|
186
|
+
"mail": "maxime.dupont@jamespot.com",
|
|
187
|
+
"visioconference": "[]",
|
|
188
|
+
"tag_2": null,
|
|
189
|
+
"idMainCommunity": null,
|
|
190
|
+
"userBanner": null
|
|
191
|
+
},
|
|
192
|
+
"_timezone": {
|
|
193
|
+
"dateCreation": "2021-06-07 16:05:10"
|
|
194
|
+
},
|
|
195
|
+
"_url": "/user/25"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as addLink from './data/bookmarks/addLink/data.json';
|
|
2
|
+
import * as addBookmark from './data/bookmarks/addBookmark/data.json';
|
|
3
|
+
import * as autocompleteAudience from './data/autocomplete/audience/data.json';
|
|
4
|
+
import * as autocompleteCommunity from './data/autocomplete/community/data.json';
|
|
5
|
+
import * as autocompleteTaxonomy from './data/autocomplete/taxonomy/data.json';
|
|
6
|
+
import * as autocompleteUser from './data/autocomplete/user/data.json';
|
|
7
|
+
import * as bookmarkList from './data/bookmarks/bookmarkList/data.json';
|
|
8
|
+
import * as communitySendRequest from './data/community/sendRequest/data.json';
|
|
9
|
+
import * as deleteBookmark from './data/bookmarks/delete/data.json';
|
|
10
|
+
import * as fileCreate from './data/file/create/data.json';
|
|
11
|
+
import * as messengerNewMessage from './data/messenger/newMessage/data.json';
|
|
12
|
+
import * as searchGetConfig from './data/search/getConfig/data.json';
|
|
13
|
+
import * as searchProposition from './data/search/proposition/data.json';
|
|
14
|
+
import * as spotCreate from './data/spot/create/data.json';
|
|
15
|
+
import * as spotGetAvailableWidget from './data/spot/get-available-widget/data.json';
|
|
16
|
+
import * as spotGetCategories from './data/spot/get-categories/data.json';
|
|
17
|
+
import * as tokenCSRF from './data/misc/tokenCSRF/data.json';
|
|
18
|
+
import * as userSignIn from './data/user/signIn/data.json';
|
|
19
|
+
|
|
20
|
+
function getDefault(data: { default?: object }): object {
|
|
21
|
+
return data.default || data;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class WindowMock {
|
|
25
|
+
private readonly data: Record<string, Record<string, object>>;
|
|
26
|
+
public location: { protocol: string; host: string };
|
|
27
|
+
|
|
28
|
+
public constructor() {
|
|
29
|
+
this.data = {
|
|
30
|
+
autocomplete: {
|
|
31
|
+
audience: (body: { q: string }) => {
|
|
32
|
+
const { result, ...otherRes } = getDefault(autocompleteAudience) as {
|
|
33
|
+
result: Array<{ title: string }>;
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
result: result.filter((jAudience) => new RegExp(body.q).test(jAudience.title)),
|
|
37
|
+
...otherRes,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
taxonomy: autocompleteTaxonomy,
|
|
41
|
+
user: autocompleteUser,
|
|
42
|
+
community: (body: { q: string }) => {
|
|
43
|
+
const { result, ...otherRes } = getDefault(autocompleteCommunity) as {
|
|
44
|
+
result: Array<{ title: string }>;
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
result: result.filter((jAudience) => new RegExp(body.q).test(jAudience.title)),
|
|
48
|
+
...otherRes,
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
community: {
|
|
53
|
+
sendRequest: communitySendRequest,
|
|
54
|
+
},
|
|
55
|
+
custom: {
|
|
56
|
+
actionAdd: (body: { type: 'bookmarkLink'; targetId: number; targetType: string; format: 'list' }) => {
|
|
57
|
+
if (body.type === 'bookmarkLink' && body.format === 'list') return addLink;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
file: {
|
|
61
|
+
create: fileCreate,
|
|
62
|
+
},
|
|
63
|
+
messenger: {
|
|
64
|
+
newMessage: messengerNewMessage,
|
|
65
|
+
},
|
|
66
|
+
misc: {
|
|
67
|
+
tokenCSRF,
|
|
68
|
+
},
|
|
69
|
+
object: {
|
|
70
|
+
list: (body: {
|
|
71
|
+
namespace: 'bookmarks';
|
|
72
|
+
view: 'list';
|
|
73
|
+
limit: 2;
|
|
74
|
+
orders: [{ name: 'id'; sort: 'desc' }];
|
|
75
|
+
}) => {
|
|
76
|
+
if (body.namespace === 'bookmarks' && body.view === 'list') return bookmarkList;
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
spot: {
|
|
80
|
+
create: spotCreate,
|
|
81
|
+
['get-available-widget']: spotGetAvailableWidget,
|
|
82
|
+
['get-categories']: spotGetCategories,
|
|
83
|
+
},
|
|
84
|
+
search: {
|
|
85
|
+
getConfig: searchGetConfig,
|
|
86
|
+
proposition: searchProposition,
|
|
87
|
+
},
|
|
88
|
+
bookmarks: {
|
|
89
|
+
add: addBookmark,
|
|
90
|
+
delete: deleteBookmark,
|
|
91
|
+
},
|
|
92
|
+
user: {
|
|
93
|
+
signIn: userSignIn,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
this.location = {
|
|
97
|
+
protocol: 'http',
|
|
98
|
+
host: 'localhost:3022',
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public fetch(url: string, requestInit: RequestInit): Promise<Response> {
|
|
103
|
+
const body = JSON.parse(requestInit.body as string);
|
|
104
|
+
const { o, f } = body;
|
|
105
|
+
let result = o in this.data && f in this.data[o] ? this.data[o][f] : [];
|
|
106
|
+
result = getDefault(result);
|
|
107
|
+
if (typeof result === 'function') result = result(body);
|
|
108
|
+
if (!result || Array.isArray(result) || Array.length === 0) console.error('CA MARCHE PAS');
|
|
109
|
+
return new Promise(function (resolve) {
|
|
110
|
+
setTimeout(() => resolve({ json: () => result } as Response), 1000);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Little, Rights } from './utils';
|
|
2
|
+
|
|
3
|
+
export type AseiTicketStatus = 'created' | 'validated' | 'handled';
|
|
4
|
+
|
|
5
|
+
export interface AseiTicket extends Little {
|
|
6
|
+
_right: Rights;
|
|
7
|
+
_user: Little;
|
|
8
|
+
aseiClearanceTicketValidator: Little[];
|
|
9
|
+
aseiClearanceTicketInstitution: Little[];
|
|
10
|
+
processContext: null;
|
|
11
|
+
aseiClearanceTicketType: string;
|
|
12
|
+
aseiClearanceTicketNatureOfDemand: null;
|
|
13
|
+
aseiClearanceTicketLastName: string;
|
|
14
|
+
aseiClearanceTicketFirstName: string;
|
|
15
|
+
aseiClearanceTicketStatus: AseiTicketStatus;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AseiInstitution extends Little {
|
|
19
|
+
_right: Rights;
|
|
20
|
+
_user: Little;
|
|
21
|
+
aseiInstitutionValidator: Little[];
|
|
22
|
+
processContext: null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface AseiGroups {
|
|
26
|
+
dsi: number;
|
|
27
|
+
gestionnaireApplicatif: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AseiRights {
|
|
31
|
+
accessWriter: boolean;
|
|
32
|
+
accessApp: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface BaseAutocomplete {
|
|
2
|
+
value: string;
|
|
3
|
+
uri: string;
|
|
4
|
+
shortUri: string;
|
|
5
|
+
title: string;
|
|
6
|
+
name: string;
|
|
7
|
+
mainType: string;
|
|
8
|
+
type: string;
|
|
9
|
+
label: string;
|
|
10
|
+
cssClass: string;
|
|
11
|
+
cssColor: string;
|
|
12
|
+
class: string;
|
|
13
|
+
Pseudo: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type AudienceAutocomplete = BaseAutocomplete;
|
|
17
|
+
export type CommunityAutocomplete = BaseAutocomplete;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface CreateGroup {
|
|
2
|
+
title: string;
|
|
3
|
+
description: string;
|
|
4
|
+
privacy: string; // "1", "2" or "3"
|
|
5
|
+
idCategory?: string;
|
|
6
|
+
type: string;
|
|
7
|
+
uriCommunity?: string;
|
|
8
|
+
widgets: Array<string>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type GroupWidgets = Record<
|
|
12
|
+
string,
|
|
13
|
+
{
|
|
14
|
+
idWidget: string;
|
|
15
|
+
title: string;
|
|
16
|
+
url: string;
|
|
17
|
+
type: string;
|
|
18
|
+
icon: string;
|
|
19
|
+
description: string;
|
|
20
|
+
}
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
export interface Category {
|
|
24
|
+
id: string;
|
|
25
|
+
idorder: number;
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export interface SearchCategoryModel {
|
|
2
|
+
id: string;
|
|
3
|
+
mainType: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
title: string;
|
|
6
|
+
cssclass?: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
count?: number;
|
|
9
|
+
typesExcluded: string[];
|
|
10
|
+
facets: SearchFacetModel[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SearchFacetModel {
|
|
14
|
+
facetType: string;
|
|
15
|
+
facetOptions: any;
|
|
16
|
+
field: string;
|
|
17
|
+
title: string;
|
|
18
|
+
category?: SearchCategoryModel['id']; // If a facet is specific to a category
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SearchFacetValueModel {
|
|
22
|
+
count: number;
|
|
23
|
+
value: string;
|
|
24
|
+
title: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** *
|
|
28
|
+
* Used in search query to specify a filter
|
|
29
|
+
* field : name/id of the filter category (ie skills)
|
|
30
|
+
* value : id of the field (ie react)
|
|
31
|
+
* exclude : boolean to include or exclude the filter
|
|
32
|
+
*/
|
|
33
|
+
export interface SearchQueryFilterModel {
|
|
34
|
+
field: string;
|
|
35
|
+
value: string;
|
|
36
|
+
exclude: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Used in search query to specify a filter
|
|
41
|
+
* field : name/id of the field to sort
|
|
42
|
+
* order : desc' | 'asc'
|
|
43
|
+
*/
|
|
44
|
+
export interface SearchQuerySortModel {
|
|
45
|
+
field: string;
|
|
46
|
+
order: 'desc' | 'asc';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* facetLimit : max number of facets (default 25)
|
|
51
|
+
* skipEmptyFacets : remove empty facets (with 0 results)
|
|
52
|
+
*/
|
|
53
|
+
export interface SearchQueryOption {
|
|
54
|
+
facetLimit: number;
|
|
55
|
+
skipEmptyFacets: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface SearchConfig {
|
|
59
|
+
home: {
|
|
60
|
+
mode: 'result' | 'category';
|
|
61
|
+
facets: SearchFacetModel[];
|
|
62
|
+
};
|
|
63
|
+
categories: SearchCategoryModel[];
|
|
64
|
+
viewcard?: Record<string, { name: string; title: string }[]>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface SearchResultCatProps {
|
|
68
|
+
title: string;
|
|
69
|
+
id: string;
|
|
70
|
+
showAll?: boolean; // FIXME rename to indexed (back + front)
|
|
71
|
+
results: SearchResultProps[];
|
|
72
|
+
}
|
|
73
|
+
export interface SearchResultProps {
|
|
74
|
+
title: string;
|
|
75
|
+
picture: string;
|
|
76
|
+
uri: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface SearchQuery {
|
|
80
|
+
keywords?: string;
|
|
81
|
+
category?: string;
|
|
82
|
+
facetCategories?: boolean;
|
|
83
|
+
filters?: SearchQueryFilterModel[];
|
|
84
|
+
page?: number;
|
|
85
|
+
limit?: number;
|
|
86
|
+
sort?: SearchQuerySortModel;
|
|
87
|
+
options?: SearchQueryOption;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// FIXME improve this simple format (which can be an article, a user, a company...)
|
|
91
|
+
// In particular businessNetworkingBusinessLine, businessNetworkingCity, businessNetworkingRegion
|
|
92
|
+
export interface Result {
|
|
93
|
+
id: number;
|
|
94
|
+
type: string;
|
|
95
|
+
uri: string;
|
|
96
|
+
title: string;
|
|
97
|
+
mainType: string;
|
|
98
|
+
_url: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface SearchQueryResult {
|
|
102
|
+
results: Result[];
|
|
103
|
+
facets: SearchFacetModel[];
|
|
104
|
+
categories: SearchCategoryModel[];
|
|
105
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface Taxonomy {
|
|
2
|
+
id: number;
|
|
3
|
+
type: string;
|
|
4
|
+
title: string;
|
|
5
|
+
dateCreation: string;
|
|
6
|
+
mainTypes: never[];
|
|
7
|
+
types: null;
|
|
8
|
+
mandatory: null;
|
|
9
|
+
public: null;
|
|
10
|
+
wallFilter: null;
|
|
11
|
+
jamespot: string;
|
|
12
|
+
uri: string;
|
|
13
|
+
mainType: string;
|
|
14
|
+
_cssColor: string;
|
|
15
|
+
_cssClass: string;
|
|
16
|
+
_right: {
|
|
17
|
+
create: boolean;
|
|
18
|
+
read: boolean;
|
|
19
|
+
publish: boolean;
|
|
20
|
+
administrate: boolean;
|
|
21
|
+
update: boolean;
|
|
22
|
+
delete: boolean;
|
|
23
|
+
comment: boolean;
|
|
24
|
+
member: boolean;
|
|
25
|
+
};
|
|
26
|
+
_values: {
|
|
27
|
+
type: string;
|
|
28
|
+
title: string;
|
|
29
|
+
dateCreation: string;
|
|
30
|
+
mainTypes: null;
|
|
31
|
+
types: null;
|
|
32
|
+
mandatory: null;
|
|
33
|
+
public: null;
|
|
34
|
+
wallFilter: null;
|
|
35
|
+
jamespot: string;
|
|
36
|
+
};
|
|
37
|
+
_timezone: {
|
|
38
|
+
dateCreation: string;
|
|
39
|
+
};
|
|
40
|
+
_url: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface TaxonomyCreate {
|
|
44
|
+
type: 'taxonomyClose' | 'taxonomyOpen';
|
|
45
|
+
title: string;
|
|
46
|
+
concepts: Array<string>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export interface ApiWrapper<T, U = string[]> {
|
|
2
|
+
o: string;
|
|
3
|
+
f: string;
|
|
4
|
+
error: number;
|
|
5
|
+
messages: U;
|
|
6
|
+
errorMsg?: string;
|
|
7
|
+
result: T;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface PagingResults<T> {
|
|
11
|
+
cnt: number;
|
|
12
|
+
data: Array<T>;
|
|
13
|
+
facets: Array<{}>;
|
|
14
|
+
idQuery?: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
page: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ApiError<U = string> {
|
|
20
|
+
error: number;
|
|
21
|
+
messages: U[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface BaseMessage {
|
|
25
|
+
msg: string;
|
|
26
|
+
code: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type BaseMessages = BaseMessage[];
|
|
30
|
+
export type BaseMessagesOne = [BaseMessage];
|
|
31
|
+
|
|
32
|
+
export type Rights = {
|
|
33
|
+
create: boolean;
|
|
34
|
+
read: boolean;
|
|
35
|
+
publish: boolean;
|
|
36
|
+
administrate: boolean;
|
|
37
|
+
update: boolean;
|
|
38
|
+
delete: boolean;
|
|
39
|
+
comment: boolean;
|
|
40
|
+
member: boolean;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type Little = {
|
|
44
|
+
id: number;
|
|
45
|
+
type: string;
|
|
46
|
+
uri: string;
|
|
47
|
+
title: string;
|
|
48
|
+
_url: string;
|
|
49
|
+
dateCreation: string;
|
|
50
|
+
dateModified: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type Order = {
|
|
54
|
+
name: string;
|
|
55
|
+
sort: 'ASC' | 'DESC';
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type Orders = Array<Order>;
|
|
59
|
+
|
|
60
|
+
export type Filter = {
|
|
61
|
+
name: string;
|
|
62
|
+
value: string;
|
|
63
|
+
operator?: '<' | '>' | '<=' | '>=' | '!=' | '<>' | 'like' | 'between' | 'is' | 'is not' | 'in' | 'link' | 'match';
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type Filters = Array<Filter>;
|