@pristy/pristy-libvue 0.3.0 → 0.3.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/README.md +14 -9
- package/dist/pristy-libvue.mjs +970 -0
- package/dist/pristy-libvue.umd.js +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,17 +27,22 @@ npm link
|
|
|
27
27
|
```
|
|
28
28
|
npm link <local directory off pristy-libvue>
|
|
29
29
|
```
|
|
30
|
+
The library needs to be built by vite to be usable locally.
|
|
31
|
+
```
|
|
32
|
+
npm run build:library
|
|
33
|
+
```
|
|
30
34
|
|
|
31
35
|
The pristy-libvue package of the package.json will be overloaded by the local library.
|
|
32
36
|
|
|
33
37
|
## Versions
|
|
34
38
|
|
|
35
|
-
| Version | Commits
|
|
36
|
-
|
|
37
|
-
| 0.1.4 | First stable release
|
|
38
|
-
| 0.2.0 | Add copy and move nodes functions, Error management corrections
|
|
39
|
-
| 0.2.3 | Add workspaceService
|
|
40
|
-
| 0.2.4 | Adding the publication of an act
|
|
41
|
-
| 0.2.5 | Update Readme and licence in package.json
|
|
42
|
-
| 0.2.6 | Update wording
|
|
43
|
-
|
|
39
|
+
| Version | Commits |
|
|
40
|
+
|---------|:----------------------------------------------------------------|
|
|
41
|
+
| 0.1.4 | First stable release |
|
|
42
|
+
| 0.2.0 | Add copy and move nodes functions, Error management corrections |
|
|
43
|
+
| 0.2.3 | Add workspaceService |
|
|
44
|
+
| 0.2.4 | Adding the publication of an act |
|
|
45
|
+
| 0.2.5 | Update Readme and licence in package.json |
|
|
46
|
+
| 0.2.6 | Update wording |
|
|
47
|
+
| 0.2.7 | Fix import of TrashCanApi |
|
|
48
|
+
| 0.3.0 | Build with vite and linter and alfresco js-api version 5.0.0 |
|
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
import { AlfrescoApi as Ae, ContentApi as Se, UploadApi as Pe, RenditionsApi as Le, NodesApi as Ve, SitesApi as Oe, SearchApi as Ce, PeopleApi as je, FavoritesApi as xe, TrashcanApi as De } from "@alfresco/js-api";
|
|
2
|
+
import { getCurrentInstance as me, inject as Ie, markRaw as S, ref as he, watch as $e, reactive as Re, effectScope as Fe, isRef as I, isReactive as se, toRef as T, toRaw as Ue, nextTick as ae, computed as ge, onUnmounted as Te, toRefs as ce } from "vue";
|
|
3
|
+
let M = null;
|
|
4
|
+
function E() {
|
|
5
|
+
return M || (M = new Ae({
|
|
6
|
+
hostEcm: window.config.ALFRESCO_HOST,
|
|
7
|
+
authType: window.config.ALFRESCO_AUTH,
|
|
8
|
+
contextRoot: window.config.ALFRESCO_ROOT
|
|
9
|
+
})), M;
|
|
10
|
+
}
|
|
11
|
+
let W = null;
|
|
12
|
+
function z() {
|
|
13
|
+
return W || (W = new Se(E())), W;
|
|
14
|
+
}
|
|
15
|
+
let q = null;
|
|
16
|
+
function Me() {
|
|
17
|
+
return q || (q = new Pe(E())), q;
|
|
18
|
+
}
|
|
19
|
+
let H = null;
|
|
20
|
+
function ue() {
|
|
21
|
+
return H || (H = new Le(E())), H;
|
|
22
|
+
}
|
|
23
|
+
let B = null;
|
|
24
|
+
function y() {
|
|
25
|
+
return B || (B = new Ve(E())), B;
|
|
26
|
+
}
|
|
27
|
+
let G = null;
|
|
28
|
+
function k() {
|
|
29
|
+
return G || (G = new Oe(E())), G;
|
|
30
|
+
}
|
|
31
|
+
let J = null;
|
|
32
|
+
function We() {
|
|
33
|
+
return J || (J = new Ce(E())), J;
|
|
34
|
+
}
|
|
35
|
+
let Y = null;
|
|
36
|
+
function ee() {
|
|
37
|
+
return Y || (Y = new je(E())), Y;
|
|
38
|
+
}
|
|
39
|
+
let Q = null;
|
|
40
|
+
function X() {
|
|
41
|
+
return Q || (Q = new xe(E())), Q;
|
|
42
|
+
}
|
|
43
|
+
let Z = null;
|
|
44
|
+
function Ke() {
|
|
45
|
+
return Z || (Z = new De(E())), Z;
|
|
46
|
+
}
|
|
47
|
+
class be {
|
|
48
|
+
uploadFileError(r, t) {
|
|
49
|
+
let e;
|
|
50
|
+
switch (r.status) {
|
|
51
|
+
case 400:
|
|
52
|
+
e = "Les param\xE8tres de la requ\xEAte sont invalides.";
|
|
53
|
+
break;
|
|
54
|
+
case 403:
|
|
55
|
+
e = "Vous n'avez pas les droits pour cr\xE9er un fichier.";
|
|
56
|
+
break;
|
|
57
|
+
case 404:
|
|
58
|
+
e = "Impossible de trouver le dossier parent.";
|
|
59
|
+
break;
|
|
60
|
+
case 409:
|
|
61
|
+
e = "Le fichier " + t + " existe d\xE9j\xE0.";
|
|
62
|
+
break;
|
|
63
|
+
case 413:
|
|
64
|
+
e = "Le contenu d\xE9passe la limite de taille de fichier individuelle configur\xE9e pour le r\xE9seau ou le syst\xE8me";
|
|
65
|
+
break;
|
|
66
|
+
case 415:
|
|
67
|
+
e = "Le type du contenu du noeud n'est pas support\xE9.";
|
|
68
|
+
break;
|
|
69
|
+
case 422:
|
|
70
|
+
e = "Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom de fichier contenant des caract\xE8res non valides.";
|
|
71
|
+
break;
|
|
72
|
+
case 507:
|
|
73
|
+
e = "Le contenu d\xE9passe la limite de quota de stockage globale configur\xE9e pour le r\xE9seau ou le syst\xE8me.";
|
|
74
|
+
break;
|
|
75
|
+
default:
|
|
76
|
+
e = r.message;
|
|
77
|
+
}
|
|
78
|
+
throw new Error(e);
|
|
79
|
+
}
|
|
80
|
+
createNodeError(r) {
|
|
81
|
+
let t;
|
|
82
|
+
switch (r.status) {
|
|
83
|
+
case 400:
|
|
84
|
+
t = "Le nom choisi est invalide.";
|
|
85
|
+
break;
|
|
86
|
+
case 409:
|
|
87
|
+
t = "Le nom choisi est d\xE9j\xE0 existant.";
|
|
88
|
+
break;
|
|
89
|
+
case 422:
|
|
90
|
+
t = "Le nom choisi ne respecte pas le format requis.";
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
t = r.message;
|
|
94
|
+
}
|
|
95
|
+
throw new Error(t);
|
|
96
|
+
}
|
|
97
|
+
updateNodeError(r) {
|
|
98
|
+
let t;
|
|
99
|
+
switch (r.status) {
|
|
100
|
+
case 400:
|
|
101
|
+
t = "Le nom choisi est invalide.";
|
|
102
|
+
break;
|
|
103
|
+
case 409:
|
|
104
|
+
t = "Le nom choisi est d\xE9j\xE0 existant.";
|
|
105
|
+
break;
|
|
106
|
+
case 422:
|
|
107
|
+
t = "Le nom choisi ne respecte pas le format requis.";
|
|
108
|
+
break;
|
|
109
|
+
default:
|
|
110
|
+
t = r.message;
|
|
111
|
+
}
|
|
112
|
+
throw new Error(t);
|
|
113
|
+
}
|
|
114
|
+
deleteNodeError(r, t) {
|
|
115
|
+
let e;
|
|
116
|
+
switch (r.status) {
|
|
117
|
+
case 403:
|
|
118
|
+
e = `Vous n'avez pas la permission de supprimer ce ${t}.`;
|
|
119
|
+
break;
|
|
120
|
+
case 404:
|
|
121
|
+
e = `Le ${t} \xE0 supprimer n'existe pas.`;
|
|
122
|
+
break;
|
|
123
|
+
case 409:
|
|
124
|
+
e = `Vous ne pouvez pas supprimer ce ${t}, ce dernier est verrouill\xE9.`;
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
e = r.message;
|
|
128
|
+
}
|
|
129
|
+
throw new Error(e);
|
|
130
|
+
}
|
|
131
|
+
updateContentNodeError(r) {
|
|
132
|
+
let t;
|
|
133
|
+
switch (r.status) {
|
|
134
|
+
case 400:
|
|
135
|
+
t = "Le type du contenu du noeud n'est pas support\xE9.";
|
|
136
|
+
break;
|
|
137
|
+
case 403:
|
|
138
|
+
t = "Vous n'avez pas la permission pour mettre \xE0 jour.";
|
|
139
|
+
break;
|
|
140
|
+
case 404:
|
|
141
|
+
t = "Impossible de mettre \xE0 jour un fichier inexistant.";
|
|
142
|
+
break;
|
|
143
|
+
case 409:
|
|
144
|
+
t = "Le nom du fichier est d\xE9j\xE0 existant.";
|
|
145
|
+
break;
|
|
146
|
+
case 413:
|
|
147
|
+
t = "Le contenu d\xE9passe la taille limite individuelle de fichier configur\xE9e pour le r\xE9seau ou le syst\xE8me.";
|
|
148
|
+
break;
|
|
149
|
+
case 422:
|
|
150
|
+
t = "Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom de fichier contenant des caract\xE8res non valides.";
|
|
151
|
+
break;
|
|
152
|
+
case 507:
|
|
153
|
+
t = "Le contenu d\xE9passe la limite de quota de stockage globale configur\xE9e pour le r\xE9seau ou le syst\xE8me.";
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
t = r.message;
|
|
157
|
+
}
|
|
158
|
+
throw new Error(t);
|
|
159
|
+
}
|
|
160
|
+
copyNodeError(r) {
|
|
161
|
+
let t;
|
|
162
|
+
switch (r.status) {
|
|
163
|
+
case 403:
|
|
164
|
+
t = "Vous n'avez pas la permission pour copier cet \xE9l\xE9ment";
|
|
165
|
+
break;
|
|
166
|
+
case 404:
|
|
167
|
+
t = "Impossible de copier un \xE9l\xE9ment inexistant.";
|
|
168
|
+
break;
|
|
169
|
+
case 409:
|
|
170
|
+
t = "Le nom de l'\xE9l\xE9ment entre en conflit avec un \xE9l\xE9ment existant au m\xEAme endroit.";
|
|
171
|
+
break;
|
|
172
|
+
case 422:
|
|
173
|
+
t = "Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom d'\xE9l\xE9ment contenant des caract\xE8res non valides.";
|
|
174
|
+
break;
|
|
175
|
+
default:
|
|
176
|
+
t = r.message;
|
|
177
|
+
}
|
|
178
|
+
throw new Error(t);
|
|
179
|
+
}
|
|
180
|
+
moveNodeError(r) {
|
|
181
|
+
let t;
|
|
182
|
+
switch (r.status) {
|
|
183
|
+
case 400:
|
|
184
|
+
t = "Vous ne pouvez pas d\xE9placer l'\xE9l\xE9ment \xE0 l'endroit ou il se trouve.";
|
|
185
|
+
break;
|
|
186
|
+
case 403:
|
|
187
|
+
t = "Vous n'avez pas la permission pour d\xE9placer cet \xE9l\xE9ment";
|
|
188
|
+
break;
|
|
189
|
+
case 404:
|
|
190
|
+
t = "Impossible de d\xE9placer un \xE9l\xE9ment inexistant.";
|
|
191
|
+
break;
|
|
192
|
+
case 409:
|
|
193
|
+
t = "Le nom de l'\xE9l\xE9ment entre en conflit avec un \xE9l\xE9ment existant au m\xEAme endroit.";
|
|
194
|
+
break;
|
|
195
|
+
case 422:
|
|
196
|
+
t = "Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom d'\xE9l\xE9ment contenant des caract\xE8res non valides.";
|
|
197
|
+
break;
|
|
198
|
+
default:
|
|
199
|
+
t = r.message;
|
|
200
|
+
}
|
|
201
|
+
throw new Error(t);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
function ze(s) {
|
|
205
|
+
let r, t = JSON.parse(s.message).error;
|
|
206
|
+
switch (t.statusCode) {
|
|
207
|
+
case 401:
|
|
208
|
+
r = "L'authentification a \xE9chou\xE9";
|
|
209
|
+
break;
|
|
210
|
+
case 403:
|
|
211
|
+
r = "Nom d'utilisateur ou mot de passe incorrect.";
|
|
212
|
+
break;
|
|
213
|
+
default:
|
|
214
|
+
r = t.message;
|
|
215
|
+
}
|
|
216
|
+
throw new Error(r);
|
|
217
|
+
}
|
|
218
|
+
function qe() {
|
|
219
|
+
return new be();
|
|
220
|
+
}
|
|
221
|
+
class et {
|
|
222
|
+
getThumbnailUrl(r) {
|
|
223
|
+
return z().getDocumentThumbnailUrl(r);
|
|
224
|
+
}
|
|
225
|
+
getPreviewUrl(r) {
|
|
226
|
+
return z().getDocumentPreviewUrl(r);
|
|
227
|
+
}
|
|
228
|
+
getContentUrl(r) {
|
|
229
|
+
return z().getContentUrl(r);
|
|
230
|
+
}
|
|
231
|
+
uploadFile(r, t, e) {
|
|
232
|
+
return Me().uploadFile(e, null, r, null, t).on("progress", (n) => {
|
|
233
|
+
console.log("Percent :" + n.percent);
|
|
234
|
+
}).then(
|
|
235
|
+
(n) => this.createAllRendition(n.entry.id).then(() => n).catch((o) => o),
|
|
236
|
+
(n) => {
|
|
237
|
+
qe().uploadFileError(n);
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
createRendition(r, t) {
|
|
242
|
+
return ue().createRendition(r, {
|
|
243
|
+
id: t
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
createAllRendition(r) {
|
|
247
|
+
return ue().createRendition(r, [
|
|
248
|
+
{
|
|
249
|
+
id: "doclib"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
id: "imgpreview"
|
|
253
|
+
}
|
|
254
|
+
]);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function V() {
|
|
258
|
+
return new be();
|
|
259
|
+
}
|
|
260
|
+
class tt {
|
|
261
|
+
getNode(r) {
|
|
262
|
+
const t = {
|
|
263
|
+
include: [
|
|
264
|
+
"isFavorite",
|
|
265
|
+
"properties",
|
|
266
|
+
"allowableOperations",
|
|
267
|
+
"permissions"
|
|
268
|
+
]
|
|
269
|
+
};
|
|
270
|
+
return y().getNode(r, t).then((e) => e.entry);
|
|
271
|
+
}
|
|
272
|
+
createNode(r, t) {
|
|
273
|
+
return y().createNode(r, t).then(
|
|
274
|
+
(e) => e,
|
|
275
|
+
(e) => {
|
|
276
|
+
V().createNodeError(e);
|
|
277
|
+
}
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
getChildren(r) {
|
|
281
|
+
const t = {
|
|
282
|
+
include: [
|
|
283
|
+
"isFavorite",
|
|
284
|
+
"properties",
|
|
285
|
+
"allowableOperations",
|
|
286
|
+
"permissions"
|
|
287
|
+
]
|
|
288
|
+
};
|
|
289
|
+
return y().listNodeChildren(r, t).then((e) => {
|
|
290
|
+
let n = e.list.entries.map((a) => a.entry), o = n.filter(
|
|
291
|
+
(a) => a.name === "documentLibrary"
|
|
292
|
+
)[0];
|
|
293
|
+
return o ? this.getChildren(o.id).then((a) => ({
|
|
294
|
+
documentLibrary: o,
|
|
295
|
+
subChildren: a
|
|
296
|
+
})) : n;
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
updateNode(r, t) {
|
|
300
|
+
return y().updateNode(r, t).then(
|
|
301
|
+
(e) => e,
|
|
302
|
+
function(e) {
|
|
303
|
+
V().updateNodeError(e);
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
deleteNode(r, t) {
|
|
308
|
+
const e = {};
|
|
309
|
+
return y().deleteNode(r, e).then(
|
|
310
|
+
(n) => n,
|
|
311
|
+
function(n) {
|
|
312
|
+
V().deleteNodeError(n, t);
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
getParents(r) {
|
|
317
|
+
const t = {
|
|
318
|
+
include: ["isFavorite", "properties"]
|
|
319
|
+
};
|
|
320
|
+
return y().listParents(r, t).then((e) => {
|
|
321
|
+
let n = e.list.entries.map((a) => a.entry), o = n[0];
|
|
322
|
+
return o && o.name === "documentLibrary" ? this.getParents(o.id).then((a) => ({
|
|
323
|
+
documentLibrary: o,
|
|
324
|
+
supParent: a
|
|
325
|
+
})) : n[0];
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
getDocumentLibrary(r) {
|
|
329
|
+
const t = {
|
|
330
|
+
include: [
|
|
331
|
+
"isFavorite",
|
|
332
|
+
"properties",
|
|
333
|
+
"allowableOperations",
|
|
334
|
+
"permissions"
|
|
335
|
+
]
|
|
336
|
+
};
|
|
337
|
+
return y().listNodeChildren(r, t).then((e) => e.list.entries.map((o) => o.entry).find((o) => o.name === "documentLibrary"));
|
|
338
|
+
}
|
|
339
|
+
updateContentNode(r, t) {
|
|
340
|
+
return y().updateNodeContent(r, t).then(
|
|
341
|
+
(e) => e,
|
|
342
|
+
function(e) {
|
|
343
|
+
V().updateContentNodeError(e);
|
|
344
|
+
}
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
copyNode(r, t, e) {
|
|
348
|
+
const n = e !== null ? {
|
|
349
|
+
targetParentId: t,
|
|
350
|
+
name: e
|
|
351
|
+
} : {
|
|
352
|
+
targetParentId: t
|
|
353
|
+
}, o = {
|
|
354
|
+
include: ["path"]
|
|
355
|
+
};
|
|
356
|
+
return y().copyNode(r, n, o).then(
|
|
357
|
+
(a) => a,
|
|
358
|
+
function(a) {
|
|
359
|
+
V().copyNodeError(a);
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
moveNode(r, t, e) {
|
|
364
|
+
const n = e !== null ? {
|
|
365
|
+
targetParentId: t,
|
|
366
|
+
name: e
|
|
367
|
+
} : {
|
|
368
|
+
targetParentId: t
|
|
369
|
+
}, o = {
|
|
370
|
+
include: ["path"]
|
|
371
|
+
};
|
|
372
|
+
return y().moveNode(r, n, o).then(
|
|
373
|
+
(a) => a,
|
|
374
|
+
function(a) {
|
|
375
|
+
V().moveNodeError(a);
|
|
376
|
+
}
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
class rt {
|
|
381
|
+
getPublicLink() {
|
|
382
|
+
}
|
|
383
|
+
createPublicLink() {
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
class st {
|
|
387
|
+
getWorkspaces() {
|
|
388
|
+
const r = {
|
|
389
|
+
skipCount: 0,
|
|
390
|
+
maxItems: 100
|
|
391
|
+
};
|
|
392
|
+
return k().listSites(r).then((t) => t.list.entries.map((e) => e.entry)).catch((t) => {
|
|
393
|
+
throw new Error(t.message);
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
searchAllWorkspaces(r = "") {
|
|
397
|
+
const t = {
|
|
398
|
+
query: {
|
|
399
|
+
query: "TYPE: 'st:site' " + r
|
|
400
|
+
},
|
|
401
|
+
include: ["properties"],
|
|
402
|
+
paging: {
|
|
403
|
+
maxItems: 100,
|
|
404
|
+
skipCount: 0
|
|
405
|
+
},
|
|
406
|
+
localization: { locales: ["fr_FR"] }
|
|
407
|
+
};
|
|
408
|
+
return We().search(t).then((e) => e.list.entries.map((n) => {
|
|
409
|
+
let o = n.entry;
|
|
410
|
+
return o.title = n.entry.properties["cm:title"], o.visibility = n.entry.properties["st:siteVisibility"], o.typeEspace = n.entry.properties["pm:typeEspace"], o;
|
|
411
|
+
})).catch((e) => {
|
|
412
|
+
throw new Error(e.message);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
getWorkspace(r) {
|
|
416
|
+
const t = {};
|
|
417
|
+
return k().getSite(r, t).then((e) => e.entry).catch((e) => {
|
|
418
|
+
throw new Error(e.message);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
getWorkspaceMemberships(r) {
|
|
422
|
+
const t = {};
|
|
423
|
+
return k().listSiteMemberships(r, t).then((e) => e.list.entries.map((n) => n.entry)).catch((e) => {
|
|
424
|
+
throw new Error(e.message);
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
createWorkspace(r, t, e, n) {
|
|
428
|
+
const o = {
|
|
429
|
+
id: r,
|
|
430
|
+
title: t,
|
|
431
|
+
description: e,
|
|
432
|
+
visibility: n
|
|
433
|
+
};
|
|
434
|
+
return k().createSite(o).then((a) => a).catch((a) => {
|
|
435
|
+
let u;
|
|
436
|
+
switch (a.status) {
|
|
437
|
+
case 400:
|
|
438
|
+
u = "L'identifiant choisi ne respecte pas le format requis.";
|
|
439
|
+
break;
|
|
440
|
+
case 409:
|
|
441
|
+
u = "L'identifiant choisi est d\xE9j\xE0 existant.";
|
|
442
|
+
break;
|
|
443
|
+
default:
|
|
444
|
+
u = a.message;
|
|
445
|
+
}
|
|
446
|
+
throw new Error(u);
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
async getWorskpaceUuid(r) {
|
|
450
|
+
const t = {
|
|
451
|
+
skipCount: 0,
|
|
452
|
+
maxItems: 100
|
|
453
|
+
};
|
|
454
|
+
let e = null;
|
|
455
|
+
const n = (await k.listSiteContainers(r, t)).list.entries;
|
|
456
|
+
for (let o in n)
|
|
457
|
+
n[o].entry.folderId === "documentLibrary" && (e = n[o].entry.id);
|
|
458
|
+
return e;
|
|
459
|
+
}
|
|
460
|
+
updateWorkspaceMemberRole(r, t, e) {
|
|
461
|
+
const n = {
|
|
462
|
+
role: e
|
|
463
|
+
}, o = {};
|
|
464
|
+
return k().updateSiteMembership(r, t, n, o).then((a) => a).catch((a) => {
|
|
465
|
+
let u;
|
|
466
|
+
switch (a.status) {
|
|
467
|
+
case 404:
|
|
468
|
+
u = "L'identifiant entr\xE9 ne correspond \xE0 aucun utilisateur.";
|
|
469
|
+
break;
|
|
470
|
+
case 422:
|
|
471
|
+
u = "Au moins un utilisateur doit \xEAtre Gestionnaire. Si ce n'est pas le cas, vous n'avez pas la permission de modifier le r\xF4le de cet utilisateur.";
|
|
472
|
+
break;
|
|
473
|
+
default:
|
|
474
|
+
u = a.message;
|
|
475
|
+
}
|
|
476
|
+
throw new Error(u);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
deleteWorkspaceMember(r, t) {
|
|
480
|
+
return k().deleteSiteMembership(r, t).then(() => t).catch((e) => {
|
|
481
|
+
let n;
|
|
482
|
+
switch (e.status) {
|
|
483
|
+
case 400:
|
|
484
|
+
n = "Impossible de supprimer le seul Gestionnaire de l'espace.";
|
|
485
|
+
break;
|
|
486
|
+
case 404:
|
|
487
|
+
n = "Vous ne pouvez pas supprimer un utilisateur inexistant.";
|
|
488
|
+
break;
|
|
489
|
+
case 422:
|
|
490
|
+
n = "Vous n'avez pas la permission de supprimer l'acc\xE8s \xE0 cet utilisateur.";
|
|
491
|
+
break;
|
|
492
|
+
default:
|
|
493
|
+
n = e.message;
|
|
494
|
+
}
|
|
495
|
+
throw new Error(n);
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
addWorkspaceMember(r, t, e) {
|
|
499
|
+
const n = {
|
|
500
|
+
role: e,
|
|
501
|
+
id: t
|
|
502
|
+
}, o = {};
|
|
503
|
+
return k().createSiteMembership(r, n, o).then((a) => a).catch((a) => {
|
|
504
|
+
let u;
|
|
505
|
+
switch (a.status) {
|
|
506
|
+
case 403:
|
|
507
|
+
u = "Vous ne pouvez pas inviter sur ce site.";
|
|
508
|
+
break;
|
|
509
|
+
case 404:
|
|
510
|
+
u = "Vous ne pouvez pas ajouter un utilisateur inexistant.";
|
|
511
|
+
break;
|
|
512
|
+
case 409:
|
|
513
|
+
u = "L'utilisateur a d\xE9j\xE0 acc\xE8s \xE0 cet espace.";
|
|
514
|
+
break;
|
|
515
|
+
default:
|
|
516
|
+
u = a.message;
|
|
517
|
+
}
|
|
518
|
+
throw new Error(u);
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
updateWorkspaceType(r, t) {
|
|
522
|
+
const e = {
|
|
523
|
+
properties: {
|
|
524
|
+
"pm:typeEspace": t
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
return y().updateNode(r, e).then((n) => n).catch((n) => {
|
|
528
|
+
let o;
|
|
529
|
+
switch (n.status) {
|
|
530
|
+
case 404:
|
|
531
|
+
o = "Vous ne pouvez pas mettre \xE0 jour un espace inexistant.";
|
|
532
|
+
break;
|
|
533
|
+
default:
|
|
534
|
+
o = n.message;
|
|
535
|
+
}
|
|
536
|
+
throw new Error(o);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
async getAllUsers() {
|
|
540
|
+
return ee().listPeople().then((r) => r.list.entries.map((t) => {
|
|
541
|
+
let e = t.entry;
|
|
542
|
+
return e.email = (e == null ? void 0 : e.email) || "", e.firstName = (e == null ? void 0 : e.firstName) || e.email, e.lastName = (e == null ? void 0 : e.lastName) || e.email, {
|
|
543
|
+
firstname: e.firstName,
|
|
544
|
+
lastname: e.lastName,
|
|
545
|
+
email: e.email,
|
|
546
|
+
id: e.id,
|
|
547
|
+
label: `${e.firstName} ${e.lastName}`,
|
|
548
|
+
label2: `${e.lastName} ${e.firstName}`
|
|
549
|
+
};
|
|
550
|
+
}));
|
|
551
|
+
}
|
|
552
|
+
deleteWorkspace(r) {
|
|
553
|
+
const t = {};
|
|
554
|
+
return k().deleteSite(r, t).then(() => {
|
|
555
|
+
console.log("Site deletion successful.");
|
|
556
|
+
}).catch((e) => {
|
|
557
|
+
throw new Error(e.message);
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
updateWorkspace(r, t) {
|
|
561
|
+
return k().updateSite(r, t).then((e) => e).catch((e) => {
|
|
562
|
+
throw new Error(e.message);
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
var He = !1;
|
|
567
|
+
function R(s, r, t) {
|
|
568
|
+
return Array.isArray(s) ? (s.length = Math.max(s.length, r), s.splice(r, 1, t), t) : (s[r] = t, t);
|
|
569
|
+
}
|
|
570
|
+
function K(s, r) {
|
|
571
|
+
if (Array.isArray(s)) {
|
|
572
|
+
s.splice(r, 1);
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
delete s[r];
|
|
576
|
+
}
|
|
577
|
+
/*!
|
|
578
|
+
* pinia v2.0.17
|
|
579
|
+
* (c) 2022 Eduardo San Martin Morote
|
|
580
|
+
* @license MIT
|
|
581
|
+
*/
|
|
582
|
+
let j;
|
|
583
|
+
const F = (s) => j = s, Be = process.env.NODE_ENV !== "production" ? Symbol("pinia") : Symbol();
|
|
584
|
+
function P(s) {
|
|
585
|
+
return s && typeof s == "object" && Object.prototype.toString.call(s) === "[object Object]" && typeof s.toJSON != "function";
|
|
586
|
+
}
|
|
587
|
+
var D;
|
|
588
|
+
(function(s) {
|
|
589
|
+
s.direct = "direct", s.patchObject = "patch object", s.patchFunction = "patch function";
|
|
590
|
+
})(D || (D = {}));
|
|
591
|
+
const x = typeof window < "u";
|
|
592
|
+
function Ee(s, r) {
|
|
593
|
+
for (const t in r) {
|
|
594
|
+
const e = r[t];
|
|
595
|
+
if (!(t in s))
|
|
596
|
+
continue;
|
|
597
|
+
const n = s[t];
|
|
598
|
+
P(n) && P(e) && !I(e) && !se(e) ? s[t] = Ee(n, e) : s[t] = e;
|
|
599
|
+
}
|
|
600
|
+
return s;
|
|
601
|
+
}
|
|
602
|
+
const ve = () => {
|
|
603
|
+
};
|
|
604
|
+
function le(s, r, t, e = ve) {
|
|
605
|
+
s.push(r);
|
|
606
|
+
const n = () => {
|
|
607
|
+
const o = s.indexOf(r);
|
|
608
|
+
o > -1 && (s.splice(o, 1), e());
|
|
609
|
+
};
|
|
610
|
+
return !t && me() && Te(n), n;
|
|
611
|
+
}
|
|
612
|
+
function O(s, ...r) {
|
|
613
|
+
s.slice().forEach((t) => {
|
|
614
|
+
t(...r);
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
function te(s, r) {
|
|
618
|
+
for (const t in r) {
|
|
619
|
+
if (!r.hasOwnProperty(t))
|
|
620
|
+
continue;
|
|
621
|
+
const e = r[t], n = s[t];
|
|
622
|
+
P(n) && P(e) && s.hasOwnProperty(t) && !I(e) && !se(e) ? s[t] = te(n, e) : s[t] = e;
|
|
623
|
+
}
|
|
624
|
+
return s;
|
|
625
|
+
}
|
|
626
|
+
const Ge = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : Symbol();
|
|
627
|
+
function Je(s) {
|
|
628
|
+
return !P(s) || !s.hasOwnProperty(Ge);
|
|
629
|
+
}
|
|
630
|
+
const { assign: w } = Object;
|
|
631
|
+
function pe(s) {
|
|
632
|
+
return !!(I(s) && s.effect);
|
|
633
|
+
}
|
|
634
|
+
function de(s, r, t, e) {
|
|
635
|
+
const { state: n, actions: o, getters: a } = r, u = t.state.value[s];
|
|
636
|
+
let N;
|
|
637
|
+
function f() {
|
|
638
|
+
!u && (process.env.NODE_ENV === "production" || !e) && (t.state.value[s] = n ? n() : {});
|
|
639
|
+
const g = process.env.NODE_ENV !== "production" && e ? ce(he(n ? n() : {}).value) : ce(t.state.value[s]);
|
|
640
|
+
return w(g, o, Object.keys(a || {}).reduce((d, m) => (process.env.NODE_ENV !== "production" && m in g && console.warn(`[\u{1F34D}]: A getter cannot have the same name as another state property. Rename one of them. Found with "${m}" in store "${s}".`), d[m] = S(ge(() => {
|
|
641
|
+
F(t);
|
|
642
|
+
const _ = t._s.get(s);
|
|
643
|
+
return a[m].call(_, _);
|
|
644
|
+
})), d), {}));
|
|
645
|
+
}
|
|
646
|
+
return N = re(s, f, r, t, e, !0), N.$reset = function() {
|
|
647
|
+
const d = n ? n() : {};
|
|
648
|
+
this.$patch((m) => {
|
|
649
|
+
w(m, d);
|
|
650
|
+
});
|
|
651
|
+
}, N;
|
|
652
|
+
}
|
|
653
|
+
function re(s, r, t = {}, e, n, o) {
|
|
654
|
+
let a;
|
|
655
|
+
const u = w({ actions: {} }, t);
|
|
656
|
+
if (process.env.NODE_ENV !== "production" && !e._e.active)
|
|
657
|
+
throw new Error("Pinia destroyed");
|
|
658
|
+
const N = {
|
|
659
|
+
deep: !0
|
|
660
|
+
};
|
|
661
|
+
process.env.NODE_ENV !== "production" && !He && (N.onTrigger = (l) => {
|
|
662
|
+
f ? _ = l : f == !1 && !c._hotUpdating && (Array.isArray(_) ? _.push(l) : console.error("\u{1F34D} debuggerEvents should be an array. This is most likely an internal Pinia bug."));
|
|
663
|
+
});
|
|
664
|
+
let f, g, d = S([]), m = S([]), _;
|
|
665
|
+
const L = e.state.value[s];
|
|
666
|
+
!o && !L && (process.env.NODE_ENV === "production" || !n) && (e.state.value[s] = {});
|
|
667
|
+
const U = he({});
|
|
668
|
+
let ne;
|
|
669
|
+
function oe(l) {
|
|
670
|
+
let i;
|
|
671
|
+
f = g = !1, process.env.NODE_ENV !== "production" && (_ = []), typeof l == "function" ? (l(e.state.value[s]), i = {
|
|
672
|
+
type: D.patchFunction,
|
|
673
|
+
storeId: s,
|
|
674
|
+
events: _
|
|
675
|
+
}) : (te(e.state.value[s], l), i = {
|
|
676
|
+
type: D.patchObject,
|
|
677
|
+
payload: l,
|
|
678
|
+
storeId: s,
|
|
679
|
+
events: _
|
|
680
|
+
});
|
|
681
|
+
const p = ne = Symbol();
|
|
682
|
+
ae().then(() => {
|
|
683
|
+
ne === p && (f = !0);
|
|
684
|
+
}), g = !0, O(d, i, e.state.value[s]);
|
|
685
|
+
}
|
|
686
|
+
const ye = process.env.NODE_ENV !== "production" ? () => {
|
|
687
|
+
throw new Error(`\u{1F34D}: Store "${s}" is built using the setup syntax and does not implement $reset().`);
|
|
688
|
+
} : ve;
|
|
689
|
+
function we() {
|
|
690
|
+
a.stop(), d = [], m = [], e._s.delete(s);
|
|
691
|
+
}
|
|
692
|
+
function ie(l, i) {
|
|
693
|
+
return function() {
|
|
694
|
+
F(e);
|
|
695
|
+
const p = Array.from(arguments), h = [], v = [];
|
|
696
|
+
function _e(b) {
|
|
697
|
+
h.push(b);
|
|
698
|
+
}
|
|
699
|
+
function ke(b) {
|
|
700
|
+
v.push(b);
|
|
701
|
+
}
|
|
702
|
+
O(m, {
|
|
703
|
+
args: p,
|
|
704
|
+
name: l,
|
|
705
|
+
store: c,
|
|
706
|
+
after: _e,
|
|
707
|
+
onError: ke
|
|
708
|
+
});
|
|
709
|
+
let C;
|
|
710
|
+
try {
|
|
711
|
+
C = i.apply(this && this.$id === s ? this : c, p);
|
|
712
|
+
} catch (b) {
|
|
713
|
+
throw O(v, b), b;
|
|
714
|
+
}
|
|
715
|
+
return C instanceof Promise ? C.then((b) => (O(h, b), b)).catch((b) => (O(v, b), Promise.reject(b))) : (O(h, C), C);
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
const $ = /* @__PURE__ */ S({
|
|
719
|
+
actions: {},
|
|
720
|
+
getters: {},
|
|
721
|
+
state: [],
|
|
722
|
+
hotState: U
|
|
723
|
+
}), Ne = {
|
|
724
|
+
_p: e,
|
|
725
|
+
$id: s,
|
|
726
|
+
$onAction: le.bind(null, m),
|
|
727
|
+
$patch: oe,
|
|
728
|
+
$reset: ye,
|
|
729
|
+
$subscribe(l, i = {}) {
|
|
730
|
+
const p = le(d, l, i.detached, () => h()), h = a.run(() => $e(() => e.state.value[s], (v) => {
|
|
731
|
+
(i.flush === "sync" ? g : f) && l({
|
|
732
|
+
storeId: s,
|
|
733
|
+
type: D.direct,
|
|
734
|
+
events: _
|
|
735
|
+
}, v);
|
|
736
|
+
}, w({}, N, i)));
|
|
737
|
+
return p;
|
|
738
|
+
},
|
|
739
|
+
$dispose: we
|
|
740
|
+
}, c = Re(w(
|
|
741
|
+
process.env.NODE_ENV !== "production" && x ? {
|
|
742
|
+
_customProperties: S(/* @__PURE__ */ new Set()),
|
|
743
|
+
_hmrPayload: $
|
|
744
|
+
} : {},
|
|
745
|
+
Ne
|
|
746
|
+
));
|
|
747
|
+
e._s.set(s, c);
|
|
748
|
+
const A = e._e.run(() => (a = Fe(), a.run(() => r())));
|
|
749
|
+
for (const l in A) {
|
|
750
|
+
const i = A[l];
|
|
751
|
+
if (I(i) && !pe(i) || se(i))
|
|
752
|
+
process.env.NODE_ENV !== "production" && n ? R(U.value, l, T(A, l)) : o || (L && Je(i) && (I(i) ? i.value = L[l] : te(i, L[l])), e.state.value[s][l] = i), process.env.NODE_ENV !== "production" && $.state.push(l);
|
|
753
|
+
else if (typeof i == "function") {
|
|
754
|
+
const p = process.env.NODE_ENV !== "production" && n ? i : ie(l, i);
|
|
755
|
+
A[l] = p, process.env.NODE_ENV !== "production" && ($.actions[l] = i), u.actions[l] = i;
|
|
756
|
+
} else
|
|
757
|
+
process.env.NODE_ENV !== "production" && pe(i) && ($.getters[l] = o ? t.getters[l] : i, x && (A._getters || (A._getters = S([]))).push(l));
|
|
758
|
+
}
|
|
759
|
+
if (w(c, A), w(Ue(c), A), Object.defineProperty(c, "$state", {
|
|
760
|
+
get: () => process.env.NODE_ENV !== "production" && n ? U.value : e.state.value[s],
|
|
761
|
+
set: (l) => {
|
|
762
|
+
if (process.env.NODE_ENV !== "production" && n)
|
|
763
|
+
throw new Error("cannot set hotState");
|
|
764
|
+
oe((i) => {
|
|
765
|
+
w(i, l);
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
}), process.env.NODE_ENV !== "production") {
|
|
769
|
+
c._hotUpdate = S((i) => {
|
|
770
|
+
c._hotUpdating = !0, i._hmrPayload.state.forEach((p) => {
|
|
771
|
+
if (p in c.$state) {
|
|
772
|
+
const h = i.$state[p], v = c.$state[p];
|
|
773
|
+
typeof h == "object" && P(h) && P(v) ? Ee(h, v) : i.$state[p] = v;
|
|
774
|
+
}
|
|
775
|
+
R(c, p, T(i.$state, p));
|
|
776
|
+
}), Object.keys(c.$state).forEach((p) => {
|
|
777
|
+
p in i.$state || K(c, p);
|
|
778
|
+
}), f = !1, g = !1, e.state.value[s] = T(i._hmrPayload, "hotState"), g = !0, ae().then(() => {
|
|
779
|
+
f = !0;
|
|
780
|
+
});
|
|
781
|
+
for (const p in i._hmrPayload.actions) {
|
|
782
|
+
const h = i[p];
|
|
783
|
+
R(c, p, ie(p, h));
|
|
784
|
+
}
|
|
785
|
+
for (const p in i._hmrPayload.getters) {
|
|
786
|
+
const h = i._hmrPayload.getters[p], v = o ? ge(() => (F(e), h.call(c, c))) : h;
|
|
787
|
+
R(c, p, v);
|
|
788
|
+
}
|
|
789
|
+
Object.keys(c._hmrPayload.getters).forEach((p) => {
|
|
790
|
+
p in i._hmrPayload.getters || K(c, p);
|
|
791
|
+
}), Object.keys(c._hmrPayload.actions).forEach((p) => {
|
|
792
|
+
p in i._hmrPayload.actions || K(c, p);
|
|
793
|
+
}), c._hmrPayload = i._hmrPayload, c._getters = i._getters, c._hotUpdating = !1;
|
|
794
|
+
});
|
|
795
|
+
const l = {
|
|
796
|
+
writable: !0,
|
|
797
|
+
configurable: !0,
|
|
798
|
+
enumerable: !1
|
|
799
|
+
};
|
|
800
|
+
x && ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((i) => {
|
|
801
|
+
Object.defineProperty(c, i, {
|
|
802
|
+
value: c[i],
|
|
803
|
+
...l
|
|
804
|
+
});
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
return e._p.forEach((l) => {
|
|
808
|
+
if (process.env.NODE_ENV !== "production" && x) {
|
|
809
|
+
const i = a.run(() => l({
|
|
810
|
+
store: c,
|
|
811
|
+
app: e._a,
|
|
812
|
+
pinia: e,
|
|
813
|
+
options: u
|
|
814
|
+
}));
|
|
815
|
+
Object.keys(i || {}).forEach((p) => c._customProperties.add(p)), w(c, i);
|
|
816
|
+
} else
|
|
817
|
+
w(c, a.run(() => l({
|
|
818
|
+
store: c,
|
|
819
|
+
app: e._a,
|
|
820
|
+
pinia: e,
|
|
821
|
+
options: u
|
|
822
|
+
})));
|
|
823
|
+
}), process.env.NODE_ENV !== "production" && c.$state && typeof c.$state == "object" && typeof c.$state.constructor == "function" && !c.$state.constructor.toString().includes("[native code]") && console.warn(`[\u{1F34D}]: The "state" must be a plain object. It cannot be
|
|
824
|
+
state: () => new MyClass()
|
|
825
|
+
Found in store "${c.$id}".`), L && o && t.hydrate && t.hydrate(c.$state, L), f = !0, g = !0, c;
|
|
826
|
+
}
|
|
827
|
+
function Ye(s, r, t) {
|
|
828
|
+
let e, n;
|
|
829
|
+
const o = typeof r == "function";
|
|
830
|
+
typeof s == "string" ? (e = s, n = o ? t : r) : (n = s, e = s.id);
|
|
831
|
+
function a(u, N) {
|
|
832
|
+
const f = me();
|
|
833
|
+
if (u = (process.env.NODE_ENV === "test" && j && j._testing ? null : u) || f && Ie(Be), u && F(u), process.env.NODE_ENV !== "production" && !j)
|
|
834
|
+
throw new Error(`[\u{1F34D}]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
|
|
835
|
+
const pinia = createPinia()
|
|
836
|
+
app.use(pinia)
|
|
837
|
+
This will fail in production.`);
|
|
838
|
+
u = j, u._s.has(e) || (o ? re(e, r, n, u) : de(e, n, u), process.env.NODE_ENV !== "production" && (a._pinia = u));
|
|
839
|
+
const g = u._s.get(e);
|
|
840
|
+
if (process.env.NODE_ENV !== "production" && N) {
|
|
841
|
+
const d = "__hot:" + e, m = o ? re(d, r, n, u, !0) : de(d, w({}, n), u, !0);
|
|
842
|
+
N._hotUpdate(m), delete u.state.value[d], u._s.delete(d);
|
|
843
|
+
}
|
|
844
|
+
if (process.env.NODE_ENV !== "production" && x && f && f.proxy && !N) {
|
|
845
|
+
const d = f.proxy, m = "_pStores" in d ? d._pStores : d._pStores = {};
|
|
846
|
+
m[e] = g;
|
|
847
|
+
}
|
|
848
|
+
return g;
|
|
849
|
+
}
|
|
850
|
+
return a.$id = e, a;
|
|
851
|
+
}
|
|
852
|
+
const fe = Ye({
|
|
853
|
+
id: "user",
|
|
854
|
+
state: () => ({
|
|
855
|
+
displayName: "",
|
|
856
|
+
token: "",
|
|
857
|
+
isAdmin: !1,
|
|
858
|
+
person: null,
|
|
859
|
+
apiAlfresco: null
|
|
860
|
+
}),
|
|
861
|
+
getters: {
|
|
862
|
+
displayName(s) {
|
|
863
|
+
return s.person == null ? "" : s.person.displayName;
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
actions: {
|
|
867
|
+
logout() {
|
|
868
|
+
console.log("logout with " + this.email), this.apiAlfresco && this.apiAlfresco.logout(), this.$patch({
|
|
869
|
+
token: "",
|
|
870
|
+
isAdmin: !1,
|
|
871
|
+
person: null,
|
|
872
|
+
apiAlfresco: null
|
|
873
|
+
});
|
|
874
|
+
},
|
|
875
|
+
isLoggedIn() {
|
|
876
|
+
let s;
|
|
877
|
+
return this.apiAlfresco ? s = this.apiAlfresco : s = E(), ee().getPerson("-me-").then((r) => (this.$patch({
|
|
878
|
+
person: r.entry,
|
|
879
|
+
apiAlfresco: s
|
|
880
|
+
}), !0)).catch((r) => Qe(r));
|
|
881
|
+
},
|
|
882
|
+
async login(s, r) {
|
|
883
|
+
if (!s || !r)
|
|
884
|
+
return !1;
|
|
885
|
+
await this.apiLogin(s, r).then((t) => {
|
|
886
|
+
this.$patch({
|
|
887
|
+
person: t.entry
|
|
888
|
+
});
|
|
889
|
+
}).catch((t) => {
|
|
890
|
+
ze(t);
|
|
891
|
+
});
|
|
892
|
+
},
|
|
893
|
+
apiLogin(s, r) {
|
|
894
|
+
return E().login(s, r).then(() => (this.$patch({
|
|
895
|
+
apiAlfresco: E()
|
|
896
|
+
}), ee().getPerson("-me-"))).catch((t) => Promise.reject(t));
|
|
897
|
+
},
|
|
898
|
+
async publiclogoff() {
|
|
899
|
+
const s = localStorage.getItem("ACS_USERNAME");
|
|
900
|
+
s && s.startsWith("user_publication_") && (localStorage.removeItem("ticket-ECM"), localStorage.removeItem("ACS_USERNAME"));
|
|
901
|
+
},
|
|
902
|
+
async publiclogin(s) {
|
|
903
|
+
let r = window.localStorage.getItem("ticket-ECM");
|
|
904
|
+
typeof r < "u" && r != null || await fetch(
|
|
905
|
+
window.config.ALFRESCO_HOST + "/alfresco/s/fr/jeci/pristy/authentication/ticket/publication/site/" + s,
|
|
906
|
+
{
|
|
907
|
+
method: "GET",
|
|
908
|
+
headers: {
|
|
909
|
+
"Content-Type": "application/json",
|
|
910
|
+
Accept: "application/json"
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
).then((t) => t.json()).then((t) => {
|
|
914
|
+
window.localStorage.setItem("ticket-ECM", t.ticket), window.localStorage.setItem("ACS_USERNAME", t.login);
|
|
915
|
+
});
|
|
916
|
+
},
|
|
917
|
+
alfrescoApi() {
|
|
918
|
+
return this.apiAlfresco;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
function Qe(s) {
|
|
923
|
+
let r = JSON.parse(s.message).error;
|
|
924
|
+
if (r.statusCode === 401 || r.statusCode === 403)
|
|
925
|
+
return !1;
|
|
926
|
+
throw new Error(s);
|
|
927
|
+
}
|
|
928
|
+
class nt {
|
|
929
|
+
getFavorites() {
|
|
930
|
+
const r = fe(), t = {
|
|
931
|
+
skipCount: 0,
|
|
932
|
+
maxItems: 100,
|
|
933
|
+
include: ["properties", "path"]
|
|
934
|
+
};
|
|
935
|
+
return X().listFavorites(r.person.id, t).then((e) => e.list.entries.map((n) => n.entry)).catch((e) => {
|
|
936
|
+
throw new Error(e.message);
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
changeSingleFavorite(r) {
|
|
940
|
+
const t = fe();
|
|
941
|
+
if (r.isFavorite)
|
|
942
|
+
return X().deleteFavorite(t.person.id, r.id).then(() => (r.isFavorite = !1, r)).catch((e) => {
|
|
943
|
+
throw new Error(e.message);
|
|
944
|
+
});
|
|
945
|
+
{
|
|
946
|
+
let e = { target: {} }, n = { guid: r.id };
|
|
947
|
+
return r.isFolder ? e.target.folder.push(n) : e.target.file.push(n), X().createFavorite(t.person.id, e).then((o) => (o.entry.targetGuid === r.id && (r.isFavorite = !0), r)).catch((o) => {
|
|
948
|
+
throw new Error(o.message);
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
export {
|
|
954
|
+
et as AlfrescoFileService,
|
|
955
|
+
tt as AlfrescoNodeService,
|
|
956
|
+
rt as AlfrescoPermissionService,
|
|
957
|
+
be as ErrorService,
|
|
958
|
+
nt as FavoriteService,
|
|
959
|
+
st as WorkspaceService,
|
|
960
|
+
E as alfrescoApi,
|
|
961
|
+
X as favoritesApi,
|
|
962
|
+
y as nodesApi,
|
|
963
|
+
ee as peopleApi,
|
|
964
|
+
ue as renditionsApi,
|
|
965
|
+
We as searchApi,
|
|
966
|
+
k as sitesApi,
|
|
967
|
+
Ke as trashcanApi,
|
|
968
|
+
Me as uploadApi,
|
|
969
|
+
fe as useUserStore
|
|
970
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
(function(f,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("@alfresco/js-api"),require("vue")):typeof define=="function"&&define.amd?define(["exports","@alfresco/js-api","vue"],g):(f=typeof globalThis<"u"?globalThis:f||self,g(f["pristy-libvue"]={},f.AlfrescoJsApi,f.Vue))})(this,function(f,g,l){"use strict";let W=null;function y(){return W||(W=new g.AlfrescoApi({hostEcm:window.config.ALFRESCO_HOST,authType:window.config.ALFRESCO_AUTH,contextRoot:window.config.ALFRESCO_ROOT})),W}let z=null;function q(){return z||(z=new g.ContentApi(y())),z}let H=null;function ie(){return H||(H=new g.UploadApi(y())),H}let B=null;function J(){return B||(B=new g.RenditionsApi(y())),B}let G=null;function v(){return G||(G=new g.NodesApi(y())),G}let Y=null;function _(){return Y||(Y=new g.SitesApi(y())),Y}let Q=null;function ae(){return Q||(Q=new g.SearchApi(y())),Q}let X=null;function F(){return X||(X=new g.PeopleApi(y())),X}let Z=null;function U(){return Z||(Z=new g.FavoritesApi(y())),Z}let K=null;function ge(){return K||(K=new g.TrashcanApi(y())),K}class ee{uploadFileError(r,t){let e;switch(r.status){case 400:e="Les param\xE8tres de la requ\xEAte sont invalides.";break;case 403:e="Vous n'avez pas les droits pour cr\xE9er un fichier.";break;case 404:e="Impossible de trouver le dossier parent.";break;case 409:e="Le fichier "+t+" existe d\xE9j\xE0.";break;case 413:e="Le contenu d\xE9passe la limite de taille de fichier individuelle configur\xE9e pour le r\xE9seau ou le syst\xE8me";break;case 415:e="Le type du contenu du noeud n'est pas support\xE9.";break;case 422:e="Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom de fichier contenant des caract\xE8res non valides.";break;case 507:e="Le contenu d\xE9passe la limite de quota de stockage globale configur\xE9e pour le r\xE9seau ou le syst\xE8me.";break;default:e=r.message}throw new Error(e)}createNodeError(r){let t;switch(r.status){case 400:t="Le nom choisi est invalide.";break;case 409:t="Le nom choisi est d\xE9j\xE0 existant.";break;case 422:t="Le nom choisi ne respecte pas le format requis.";break;default:t=r.message}throw new Error(t)}updateNodeError(r){let t;switch(r.status){case 400:t="Le nom choisi est invalide.";break;case 409:t="Le nom choisi est d\xE9j\xE0 existant.";break;case 422:t="Le nom choisi ne respecte pas le format requis.";break;default:t=r.message}throw new Error(t)}deleteNodeError(r,t){let e;switch(r.status){case 403:e=`Vous n'avez pas la permission de supprimer ce ${t}.`;break;case 404:e=`Le ${t} \xE0 supprimer n'existe pas.`;break;case 409:e=`Vous ne pouvez pas supprimer ce ${t}, ce dernier est verrouill\xE9.`;break;default:e=r.message}throw new Error(e)}updateContentNodeError(r){let t;switch(r.status){case 400:t="Le type du contenu du noeud n'est pas support\xE9.";break;case 403:t="Vous n'avez pas la permission pour mettre \xE0 jour.";break;case 404:t="Impossible de mettre \xE0 jour un fichier inexistant.";break;case 409:t="Le nom du fichier est d\xE9j\xE0 existant.";break;case 413:t="Le contenu d\xE9passe la taille limite individuelle de fichier configur\xE9e pour le r\xE9seau ou le syst\xE8me.";break;case 422:t="Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom de fichier contenant des caract\xE8res non valides.";break;case 507:t="Le contenu d\xE9passe la limite de quota de stockage globale configur\xE9e pour le r\xE9seau ou le syst\xE8me.";break;default:t=r.message}throw new Error(t)}copyNodeError(r){let t;switch(r.status){case 403:t="Vous n'avez pas la permission pour copier cet \xE9l\xE9ment";break;case 404:t="Impossible de copier un \xE9l\xE9ment inexistant.";break;case 409:t="Le nom de l'\xE9l\xE9ment entre en conflit avec un \xE9l\xE9ment existant au m\xEAme endroit.";break;case 422:t="Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom d'\xE9l\xE9ment contenant des caract\xE8res non valides.";break;default:t=r.message}throw new Error(t)}moveNodeError(r){let t;switch(r.status){case 400:t="Vous ne pouvez pas d\xE9placer l'\xE9l\xE9ment \xE0 l'endroit ou il se trouve.";break;case 403:t="Vous n'avez pas la permission pour d\xE9placer cet \xE9l\xE9ment";break;case 404:t="Impossible de d\xE9placer un \xE9l\xE9ment inexistant.";break;case 409:t="Le nom de l'\xE9l\xE9ment entre en conflit avec un \xE9l\xE9ment existant au m\xEAme endroit.";break;case 422:t="Exception d'int\xE9grit\xE9 du mod\xE8le incluant un nom d'\xE9l\xE9ment contenant des caract\xE8res non valides.";break;default:t=r.message}throw new Error(t)}}function be(s){let r,t=JSON.parse(s.message).error;switch(t.statusCode){case 401:r="L'authentification a \xE9chou\xE9";break;case 403:r="Nom d'utilisateur ou mot de passe incorrect.";break;default:r=t.message}throw new Error(r)}function Ee(){return new ee}class ye{getThumbnailUrl(r){return q().getDocumentThumbnailUrl(r)}getPreviewUrl(r){return q().getDocumentPreviewUrl(r)}getContentUrl(r){return q().getContentUrl(r)}uploadFile(r,t,e){return ie().uploadFile(e,null,r,null,t).on("progress",n=>{console.log("Percent :"+n.percent)}).then(n=>this.createAllRendition(n.entry.id).then(()=>n).catch(o=>o),n=>{Ee().uploadFileError(n)})}createRendition(r,t){return J().createRendition(r,{id:t})}createAllRendition(r){return J().createRendition(r,[{id:"doclib"},{id:"imgpreview"}])}}function O(){return new ee}class we{getNode(r){const t={include:["isFavorite","properties","allowableOperations","permissions"]};return v().getNode(r,t).then(e=>e.entry)}createNode(r,t){return v().createNode(r,t).then(e=>e,e=>{O().createNodeError(e)})}getChildren(r){const t={include:["isFavorite","properties","allowableOperations","permissions"]};return v().listNodeChildren(r,t).then(e=>{let n=e.list.entries.map(a=>a.entry),o=n.filter(a=>a.name==="documentLibrary")[0];return o?this.getChildren(o.id).then(a=>({documentLibrary:o,subChildren:a})):n})}updateNode(r,t){return v().updateNode(r,t).then(e=>e,function(e){O().updateNodeError(e)})}deleteNode(r,t){const e={};return v().deleteNode(r,e).then(n=>n,function(n){O().deleteNodeError(n,t)})}getParents(r){const t={include:["isFavorite","properties"]};return v().listParents(r,t).then(e=>{let n=e.list.entries.map(a=>a.entry),o=n[0];return o&&o.name==="documentLibrary"?this.getParents(o.id).then(a=>({documentLibrary:o,supParent:a})):n[0]})}getDocumentLibrary(r){const t={include:["isFavorite","properties","allowableOperations","permissions"]};return v().listNodeChildren(r,t).then(e=>e.list.entries.map(o=>o.entry).find(o=>o.name==="documentLibrary"))}updateContentNode(r,t){return v().updateNodeContent(r,t).then(e=>e,function(e){O().updateContentNodeError(e)})}copyNode(r,t,e){const n=e!==null?{targetParentId:t,name:e}:{targetParentId:t},o={include:["path"]};return v().copyNode(r,n,o).then(a=>a,function(a){O().copyNodeError(a)})}moveNode(r,t,e){const n=e!==null?{targetParentId:t,name:e}:{targetParentId:t},o={include:["path"]};return v().moveNode(r,n,o).then(a=>a,function(a){O().moveNodeError(a)})}}class ve{getPublicLink(){}createPublicLink(){}}class Ne{getWorkspaces(){const r={skipCount:0,maxItems:100};return _().listSites(r).then(t=>t.list.entries.map(e=>e.entry)).catch(t=>{throw new Error(t.message)})}searchAllWorkspaces(r=""){const t={query:{query:"TYPE: 'st:site' "+r},include:["properties"],paging:{maxItems:100,skipCount:0},localization:{locales:["fr_FR"]}};return ae().search(t).then(e=>e.list.entries.map(n=>{let o=n.entry;return o.title=n.entry.properties["cm:title"],o.visibility=n.entry.properties["st:siteVisibility"],o.typeEspace=n.entry.properties["pm:typeEspace"],o})).catch(e=>{throw new Error(e.message)})}getWorkspace(r){const t={};return _().getSite(r,t).then(e=>e.entry).catch(e=>{throw new Error(e.message)})}getWorkspaceMemberships(r){const t={};return _().listSiteMemberships(r,t).then(e=>e.list.entries.map(n=>n.entry)).catch(e=>{throw new Error(e.message)})}createWorkspace(r,t,e,n){const o={id:r,title:t,description:e,visibility:n};return _().createSite(o).then(a=>a).catch(a=>{let u;switch(a.status){case 400:u="L'identifiant choisi ne respecte pas le format requis.";break;case 409:u="L'identifiant choisi est d\xE9j\xE0 existant.";break;default:u=a.message}throw new Error(u)})}async getWorskpaceUuid(r){const t={skipCount:0,maxItems:100};let e=null;const n=(await _.listSiteContainers(r,t)).list.entries;for(let o in n)n[o].entry.folderId==="documentLibrary"&&(e=n[o].entry.id);return e}updateWorkspaceMemberRole(r,t,e){const n={role:e},o={};return _().updateSiteMembership(r,t,n,o).then(a=>a).catch(a=>{let u;switch(a.status){case 404:u="L'identifiant entr\xE9 ne correspond \xE0 aucun utilisateur.";break;case 422:u="Au moins un utilisateur doit \xEAtre Gestionnaire. Si ce n'est pas le cas, vous n'avez pas la permission de modifier le r\xF4le de cet utilisateur.";break;default:u=a.message}throw new Error(u)})}deleteWorkspaceMember(r,t){return _().deleteSiteMembership(r,t).then(()=>t).catch(e=>{let n;switch(e.status){case 400:n="Impossible de supprimer le seul Gestionnaire de l'espace.";break;case 404:n="Vous ne pouvez pas supprimer un utilisateur inexistant.";break;case 422:n="Vous n'avez pas la permission de supprimer l'acc\xE8s \xE0 cet utilisateur.";break;default:n=e.message}throw new Error(n)})}addWorkspaceMember(r,t,e){const n={role:e,id:t},o={};return _().createSiteMembership(r,n,o).then(a=>a).catch(a=>{let u;switch(a.status){case 403:u="Vous ne pouvez pas inviter sur ce site.";break;case 404:u="Vous ne pouvez pas ajouter un utilisateur inexistant.";break;case 409:u="L'utilisateur a d\xE9j\xE0 acc\xE8s \xE0 cet espace.";break;default:u=a.message}throw new Error(u)})}updateWorkspaceType(r,t){const e={properties:{"pm:typeEspace":t}};return v().updateNode(r,e).then(n=>n).catch(n=>{let o;switch(n.status){case 404:o="Vous ne pouvez pas mettre \xE0 jour un espace inexistant.";break;default:o=n.message}throw new Error(o)})}async getAllUsers(){return F().listPeople().then(r=>r.list.entries.map(t=>{let e=t.entry;return e.email=(e==null?void 0:e.email)||"",e.firstName=(e==null?void 0:e.firstName)||e.email,e.lastName=(e==null?void 0:e.lastName)||e.email,{firstname:e.firstName,lastname:e.lastName,email:e.email,id:e.id,label:`${e.firstName} ${e.lastName}`,label2:`${e.lastName} ${e.firstName}`}}))}deleteWorkspace(r){const t={};return _().deleteSite(r,t).then(()=>{console.log("Site deletion successful.")}).catch(e=>{throw new Error(e.message)})}updateWorkspace(r,t){return _().updateSite(r,t).then(e=>e).catch(e=>{throw new Error(e.message)})}}var _e=!1;function T(s,r,t){return Array.isArray(s)?(s.length=Math.max(s.length,r),s.splice(r,1,t),t):(s[r]=t,t)}function te(s,r){if(Array.isArray(s)){s.splice(r,1);return}delete s[r]}/*!
|
|
2
|
+
* pinia v2.0.17
|
|
3
|
+
* (c) 2022 Eduardo San Martin Morote
|
|
4
|
+
* @license MIT
|
|
5
|
+
*/let j;const x=s=>j=s,ke=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function V(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}var I;(function(s){s.direct="direct",s.patchObject="patch object",s.patchFunction="patch function"})(I||(I={}));const D=typeof window<"u";function ce(s,r){for(const t in r){const e=r[t];if(!(t in s))continue;const n=s[t];V(n)&&V(e)&&!l.isRef(e)&&!l.isReactive(e)?s[t]=ce(n,e):s[t]=e}return s}const ue=()=>{};function le(s,r,t,e=ue){s.push(r);const n=()=>{const o=s.indexOf(r);o>-1&&(s.splice(o,1),e())};return!t&&l.getCurrentInstance()&&l.onUnmounted(n),n}function C(s,...r){s.slice().forEach(t=>{t(...r)})}function re(s,r){for(const t in r){if(!r.hasOwnProperty(t))continue;const e=r[t],n=s[t];V(n)&&V(e)&&s.hasOwnProperty(t)&&!l.isRef(e)&&!l.isReactive(e)?s[t]=re(n,e):s[t]=e}return s}const Ae=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Se(s){return!V(s)||!s.hasOwnProperty(Ae)}const{assign:k}=Object;function pe(s){return!!(l.isRef(s)&&s.effect)}function de(s,r,t,e){const{state:n,actions:o,getters:a}=r,u=t.state.value[s];let S;function h(){!u&&(process.env.NODE_ENV==="production"||!e)&&(t.state.value[s]=n?n():{});const w=process.env.NODE_ENV!=="production"&&e?l.toRefs(l.ref(n?n():{}).value):l.toRefs(t.state.value[s]);return k(w,o,Object.keys(a||{}).reduce((m,b)=>(process.env.NODE_ENV!=="production"&&b in w&&console.warn(`[\u{1F34D}]: A getter cannot have the same name as another state property. Rename one of them. Found with "${b}" in store "${s}".`),m[b]=l.markRaw(l.computed(()=>{x(t);const P=t._s.get(s);return a[b].call(P,P)})),m),{}))}return S=se(s,h,r,t,e,!0),S.$reset=function(){const m=n?n():{};this.$patch(b=>{k(b,m)})},S}function se(s,r,t={},e,n,o){let a;const u=k({actions:{}},t);if(process.env.NODE_ENV!=="production"&&!e._e.active)throw new Error("Pinia destroyed");const S={deep:!0};process.env.NODE_ENV!=="production"&&!_e&&(S.onTrigger=p=>{h?P=p:h==!1&&!c._hotUpdating&&(Array.isArray(P)?P.push(p):console.error("\u{1F34D} debuggerEvents should be an array. This is most likely an internal Pinia bug."))});let h,w,m=l.markRaw([]),b=l.markRaw([]),P;const R=e.state.value[s];!o&&!R&&(process.env.NODE_ENV==="production"||!n)&&(e.state.value[s]={});const oe=l.ref({});let fe;function me(p){let i;h=w=!1,process.env.NODE_ENV!=="production"&&(P=[]),typeof p=="function"?(p(e.state.value[s]),i={type:I.patchFunction,storeId:s,events:P}):(re(e.state.value[s],p),i={type:I.patchObject,payload:p,storeId:s,events:P});const d=fe=Symbol();l.nextTick().then(()=>{fe===d&&(h=!0)}),w=!0,C(m,i,e.state.value[s])}const Oe=process.env.NODE_ENV!=="production"?()=>{throw new Error(`\u{1F34D}: Store "${s}" is built using the setup syntax and does not implement $reset().`)}:ue;function Ce(){a.stop(),m=[],b=[],e._s.delete(s)}function he(p,i){return function(){x(e);const d=Array.from(arguments),E=[],A=[];function je(N){E.push(N)}function Ie(N){A.push(N)}C(b,{args:d,name:p,store:c,after:je,onError:Ie});let $;try{$=i.apply(this&&this.$id===s?this:c,d)}catch(N){throw C(A,N),N}return $ instanceof Promise?$.then(N=>(C(E,N),N)).catch(N=>(C(A,N),Promise.reject(N))):(C(E,$),$)}}const M=l.markRaw({actions:{},getters:{},state:[],hotState:oe}),Re={_p:e,$id:s,$onAction:le.bind(null,b),$patch:me,$reset:Oe,$subscribe(p,i={}){const d=le(m,p,i.detached,()=>E()),E=a.run(()=>l.watch(()=>e.state.value[s],A=>{(i.flush==="sync"?w:h)&&p({storeId:s,type:I.direct,events:P},A)},k({},S,i)));return d},$dispose:Ce},c=l.reactive(k(process.env.NODE_ENV!=="production"&&D?{_customProperties:l.markRaw(new Set),_hmrPayload:M}:{},Re));e._s.set(s,c);const L=e._e.run(()=>(a=l.effectScope(),a.run(()=>r())));for(const p in L){const i=L[p];if(l.isRef(i)&&!pe(i)||l.isReactive(i))process.env.NODE_ENV!=="production"&&n?T(oe.value,p,l.toRef(L,p)):o||(R&&Se(i)&&(l.isRef(i)?i.value=R[p]:re(i,R[p])),e.state.value[s][p]=i),process.env.NODE_ENV!=="production"&&M.state.push(p);else if(typeof i=="function"){const d=process.env.NODE_ENV!=="production"&&n?i:he(p,i);L[p]=d,process.env.NODE_ENV!=="production"&&(M.actions[p]=i),u.actions[p]=i}else process.env.NODE_ENV!=="production"&&pe(i)&&(M.getters[p]=o?t.getters[p]:i,D&&(L._getters||(L._getters=l.markRaw([]))).push(p))}if(k(c,L),k(l.toRaw(c),L),Object.defineProperty(c,"$state",{get:()=>process.env.NODE_ENV!=="production"&&n?oe.value:e.state.value[s],set:p=>{if(process.env.NODE_ENV!=="production"&&n)throw new Error("cannot set hotState");me(i=>{k(i,p)})}}),process.env.NODE_ENV!=="production"){c._hotUpdate=l.markRaw(i=>{c._hotUpdating=!0,i._hmrPayload.state.forEach(d=>{if(d in c.$state){const E=i.$state[d],A=c.$state[d];typeof E=="object"&&V(E)&&V(A)?ce(E,A):i.$state[d]=A}T(c,d,l.toRef(i.$state,d))}),Object.keys(c.$state).forEach(d=>{d in i.$state||te(c,d)}),h=!1,w=!1,e.state.value[s]=l.toRef(i._hmrPayload,"hotState"),w=!0,l.nextTick().then(()=>{h=!0});for(const d in i._hmrPayload.actions){const E=i[d];T(c,d,he(d,E))}for(const d in i._hmrPayload.getters){const E=i._hmrPayload.getters[d],A=o?l.computed(()=>(x(e),E.call(c,c))):E;T(c,d,A)}Object.keys(c._hmrPayload.getters).forEach(d=>{d in i._hmrPayload.getters||te(c,d)}),Object.keys(c._hmrPayload.actions).forEach(d=>{d in i._hmrPayload.actions||te(c,d)}),c._hmrPayload=i._hmrPayload,c._getters=i._getters,c._hotUpdating=!1});const p={writable:!0,configurable:!0,enumerable:!1};D&&["_p","_hmrPayload","_getters","_customProperties"].forEach(i=>{Object.defineProperty(c,i,{value:c[i],...p})})}return e._p.forEach(p=>{if(process.env.NODE_ENV!=="production"&&D){const i=a.run(()=>p({store:c,app:e._a,pinia:e,options:u}));Object.keys(i||{}).forEach(d=>c._customProperties.add(d)),k(c,i)}else k(c,a.run(()=>p({store:c,app:e._a,pinia:e,options:u})))}),process.env.NODE_ENV!=="production"&&c.$state&&typeof c.$state=="object"&&typeof c.$state.constructor=="function"&&!c.$state.constructor.toString().includes("[native code]")&&console.warn(`[\u{1F34D}]: The "state" must be a plain object. It cannot be
|
|
6
|
+
state: () => new MyClass()
|
|
7
|
+
Found in store "${c.$id}".`),R&&o&&t.hydrate&&t.hydrate(c.$state,R),h=!0,w=!0,c}function Pe(s,r,t){let e,n;const o=typeof r=="function";typeof s=="string"?(e=s,n=o?t:r):(n=s,e=s.id);function a(u,S){const h=l.getCurrentInstance();if(u=(process.env.NODE_ENV==="test"&&j&&j._testing?null:u)||h&&l.inject(ke),u&&x(u),process.env.NODE_ENV!=="production"&&!j)throw new Error(`[\u{1F34D}]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
|
|
8
|
+
const pinia = createPinia()
|
|
9
|
+
app.use(pinia)
|
|
10
|
+
This will fail in production.`);u=j,u._s.has(e)||(o?se(e,r,n,u):de(e,n,u),process.env.NODE_ENV!=="production"&&(a._pinia=u));const w=u._s.get(e);if(process.env.NODE_ENV!=="production"&&S){const m="__hot:"+e,b=o?se(m,r,n,u,!0):de(m,k({},n),u,!0);S._hotUpdate(b),delete u.state.value[m],u._s.delete(m)}if(process.env.NODE_ENV!=="production"&&D&&h&&h.proxy&&!S){const m=h.proxy,b="_pStores"in m?m._pStores:m._pStores={};b[e]=w}return w}return a.$id=e,a}const ne=Pe({id:"user",state:()=>({displayName:"",token:"",isAdmin:!1,person:null,apiAlfresco:null}),getters:{displayName(s){return s.person==null?"":s.person.displayName}},actions:{logout(){console.log("logout with "+this.email),this.apiAlfresco&&this.apiAlfresco.logout(),this.$patch({token:"",isAdmin:!1,person:null,apiAlfresco:null})},isLoggedIn(){let s;return this.apiAlfresco?s=this.apiAlfresco:s=y(),F().getPerson("-me-").then(r=>(this.$patch({person:r.entry,apiAlfresco:s}),!0)).catch(r=>Le(r))},async login(s,r){if(!s||!r)return!1;await this.apiLogin(s,r).then(t=>{this.$patch({person:t.entry})}).catch(t=>{be(t)})},apiLogin(s,r){return y().login(s,r).then(()=>(this.$patch({apiAlfresco:y()}),F().getPerson("-me-"))).catch(t=>Promise.reject(t))},async publiclogoff(){const s=localStorage.getItem("ACS_USERNAME");s&&s.startsWith("user_publication_")&&(localStorage.removeItem("ticket-ECM"),localStorage.removeItem("ACS_USERNAME"))},async publiclogin(s){let r=window.localStorage.getItem("ticket-ECM");typeof r<"u"&&r!=null||await fetch(window.config.ALFRESCO_HOST+"/alfresco/s/fr/jeci/pristy/authentication/ticket/publication/site/"+s,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(t=>t.json()).then(t=>{window.localStorage.setItem("ticket-ECM",t.ticket),window.localStorage.setItem("ACS_USERNAME",t.login)})},alfrescoApi(){return this.apiAlfresco}}});function Le(s){let r=JSON.parse(s.message).error;if(r.statusCode===401||r.statusCode===403)return!1;throw new Error(s)}class Ve{getFavorites(){const r=ne(),t={skipCount:0,maxItems:100,include:["properties","path"]};return U().listFavorites(r.person.id,t).then(e=>e.list.entries.map(n=>n.entry)).catch(e=>{throw new Error(e.message)})}changeSingleFavorite(r){const t=ne();if(r.isFavorite)return U().deleteFavorite(t.person.id,r.id).then(()=>(r.isFavorite=!1,r)).catch(e=>{throw new Error(e.message)});{let e={target:{}},n={guid:r.id};return r.isFolder?e.target.folder.push(n):e.target.file.push(n),U().createFavorite(t.person.id,e).then(o=>(o.entry.targetGuid===r.id&&(r.isFavorite=!0),r)).catch(o=>{throw new Error(o.message)})}}}f.AlfrescoFileService=ye,f.AlfrescoNodeService=we,f.AlfrescoPermissionService=ve,f.ErrorService=ee,f.FavoriteService=Ve,f.WorkspaceService=Ne,f.alfrescoApi=y,f.favoritesApi=U,f.nodesApi=v,f.peopleApi=F,f.renditionsApi=J,f.searchApi=ae,f.sitesApi=_,f.trashcanApi=ge,f.uploadApi=ie,f.useUserStore=ne,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|