@pristy/pristy-libvue 0.3.1 → 0.3.3
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 +189 -163
- package/dist/pristy-libvue.umd.js +4 -4
- 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 |
|
package/dist/pristy-libvue.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AlfrescoApi as
|
|
2
|
-
import { getCurrentInstance as
|
|
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
3
|
let M = null;
|
|
4
4
|
function E() {
|
|
5
|
-
return M || (M = new
|
|
5
|
+
return M || (M = new Ae({
|
|
6
6
|
hostEcm: window.config.ALFRESCO_HOST,
|
|
7
7
|
authType: window.config.ALFRESCO_AUTH,
|
|
8
8
|
contextRoot: window.config.ALFRESCO_ROOT
|
|
@@ -10,41 +10,41 @@ function E() {
|
|
|
10
10
|
}
|
|
11
11
|
let W = null;
|
|
12
12
|
function z() {
|
|
13
|
-
return W || (W = new
|
|
13
|
+
return W || (W = new Se(E())), W;
|
|
14
14
|
}
|
|
15
15
|
let q = null;
|
|
16
|
-
function
|
|
17
|
-
return q || (q = new
|
|
16
|
+
function Me() {
|
|
17
|
+
return q || (q = new Pe(E())), q;
|
|
18
18
|
}
|
|
19
19
|
let H = null;
|
|
20
|
-
function
|
|
21
|
-
return H || (H = new
|
|
20
|
+
function ue() {
|
|
21
|
+
return H || (H = new Le(E())), H;
|
|
22
22
|
}
|
|
23
23
|
let B = null;
|
|
24
|
-
function
|
|
25
|
-
return B || (B = new
|
|
26
|
-
}
|
|
27
|
-
let J = null;
|
|
28
|
-
function k() {
|
|
29
|
-
return J || (J = new Le(E())), J;
|
|
24
|
+
function y() {
|
|
25
|
+
return B || (B = new Ve(E())), B;
|
|
30
26
|
}
|
|
31
27
|
let G = null;
|
|
32
|
-
function
|
|
28
|
+
function k() {
|
|
33
29
|
return G || (G = new Oe(E())), G;
|
|
34
30
|
}
|
|
31
|
+
let J = null;
|
|
32
|
+
function We() {
|
|
33
|
+
return J || (J = new Ce(E())), J;
|
|
34
|
+
}
|
|
35
35
|
let Y = null;
|
|
36
|
-
function
|
|
37
|
-
return Y || (Y = new
|
|
36
|
+
function ee() {
|
|
37
|
+
return Y || (Y = new je(E())), Y;
|
|
38
38
|
}
|
|
39
39
|
let Q = null;
|
|
40
|
-
function
|
|
41
|
-
return Q || (Q = new
|
|
40
|
+
function X() {
|
|
41
|
+
return Q || (Q = new xe(E())), Q;
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
function
|
|
45
|
-
return
|
|
43
|
+
let Z = null;
|
|
44
|
+
function Ke() {
|
|
45
|
+
return Z || (Z = new De(E())), Z;
|
|
46
46
|
}
|
|
47
|
-
class
|
|
47
|
+
class be {
|
|
48
48
|
uploadFileError(r, t) {
|
|
49
49
|
let e;
|
|
50
50
|
switch (r.status) {
|
|
@@ -201,7 +201,7 @@ class he {
|
|
|
201
201
|
throw new Error(t);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ze(s) {
|
|
205
205
|
let r, t = JSON.parse(s.message).error;
|
|
206
206
|
switch (t.statusCode) {
|
|
207
207
|
case 401:
|
|
@@ -215,10 +215,10 @@ function Me(s) {
|
|
|
215
215
|
}
|
|
216
216
|
throw new Error(r);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
219
|
-
return new
|
|
218
|
+
function qe() {
|
|
219
|
+
return new be();
|
|
220
220
|
}
|
|
221
|
-
class
|
|
221
|
+
class et {
|
|
222
222
|
getThumbnailUrl(r) {
|
|
223
223
|
return z().getDocumentThumbnailUrl(r);
|
|
224
224
|
}
|
|
@@ -229,22 +229,22 @@ class Ke {
|
|
|
229
229
|
return z().getContentUrl(r);
|
|
230
230
|
}
|
|
231
231
|
uploadFile(r, t, e) {
|
|
232
|
-
return
|
|
232
|
+
return Me().uploadFile(e, null, r, null, t).on("progress", (n) => {
|
|
233
233
|
console.log("Percent :" + n.percent);
|
|
234
234
|
}).then(
|
|
235
235
|
(n) => this.createAllRendition(n.entry.id).then(() => n).catch((o) => o),
|
|
236
236
|
(n) => {
|
|
237
|
-
|
|
237
|
+
qe().uploadFileError(n, e.name);
|
|
238
238
|
}
|
|
239
239
|
);
|
|
240
240
|
}
|
|
241
241
|
createRendition(r, t) {
|
|
242
|
-
return
|
|
242
|
+
return ue().createRendition(r, {
|
|
243
243
|
id: t
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
createAllRendition(r) {
|
|
247
|
-
return
|
|
247
|
+
return ue().createRendition(r, [
|
|
248
248
|
{
|
|
249
249
|
id: "doclib"
|
|
250
250
|
},
|
|
@@ -254,10 +254,10 @@ class Ke {
|
|
|
254
254
|
]);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
function
|
|
258
|
-
return new
|
|
257
|
+
function V() {
|
|
258
|
+
return new be();
|
|
259
259
|
}
|
|
260
|
-
class
|
|
260
|
+
class tt {
|
|
261
261
|
getNode(r) {
|
|
262
262
|
const t = {
|
|
263
263
|
include: [
|
|
@@ -267,13 +267,13 @@ class et {
|
|
|
267
267
|
"permissions"
|
|
268
268
|
]
|
|
269
269
|
};
|
|
270
|
-
return
|
|
270
|
+
return y().getNode(r, t).then((e) => e.entry);
|
|
271
271
|
}
|
|
272
272
|
createNode(r, t) {
|
|
273
|
-
return
|
|
273
|
+
return y().createNode(r, t).then(
|
|
274
274
|
(e) => e,
|
|
275
275
|
(e) => {
|
|
276
|
-
|
|
276
|
+
V().createNodeError(e);
|
|
277
277
|
}
|
|
278
278
|
);
|
|
279
279
|
}
|
|
@@ -286,7 +286,7 @@ class et {
|
|
|
286
286
|
"permissions"
|
|
287
287
|
]
|
|
288
288
|
};
|
|
289
|
-
return
|
|
289
|
+
return y().listNodeChildren(r, t).then((e) => {
|
|
290
290
|
let n = e.list.entries.map((a) => a.entry), o = n.filter(
|
|
291
291
|
(a) => a.name === "documentLibrary"
|
|
292
292
|
)[0];
|
|
@@ -297,19 +297,19 @@ class et {
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
updateNode(r, t) {
|
|
300
|
-
return
|
|
300
|
+
return y().updateNode(r, t).then(
|
|
301
301
|
(e) => e,
|
|
302
302
|
function(e) {
|
|
303
|
-
|
|
303
|
+
V().updateNodeError(e);
|
|
304
304
|
}
|
|
305
305
|
);
|
|
306
306
|
}
|
|
307
307
|
deleteNode(r, t) {
|
|
308
308
|
const e = {};
|
|
309
|
-
return
|
|
309
|
+
return y().deleteNode(r, e).then(
|
|
310
310
|
(n) => n,
|
|
311
311
|
function(n) {
|
|
312
|
-
|
|
312
|
+
V().deleteNodeError(n, t);
|
|
313
313
|
}
|
|
314
314
|
);
|
|
315
315
|
}
|
|
@@ -317,7 +317,7 @@ class et {
|
|
|
317
317
|
const t = {
|
|
318
318
|
include: ["isFavorite", "properties"]
|
|
319
319
|
};
|
|
320
|
-
return
|
|
320
|
+
return y().listParents(r, t).then((e) => {
|
|
321
321
|
let n = e.list.entries.map((a) => a.entry), o = n[0];
|
|
322
322
|
return o && o.name === "documentLibrary" ? this.getParents(o.id).then((a) => ({
|
|
323
323
|
documentLibrary: o,
|
|
@@ -334,13 +334,13 @@ class et {
|
|
|
334
334
|
"permissions"
|
|
335
335
|
]
|
|
336
336
|
};
|
|
337
|
-
return
|
|
337
|
+
return y().listNodeChildren(r, t).then((e) => e.list.entries.map((o) => o.entry).find((o) => o.name === "documentLibrary"));
|
|
338
338
|
}
|
|
339
339
|
updateContentNode(r, t) {
|
|
340
|
-
return
|
|
340
|
+
return y().updateNodeContent(r, t).then(
|
|
341
341
|
(e) => e,
|
|
342
342
|
function(e) {
|
|
343
|
-
|
|
343
|
+
V().updateContentNodeError(e);
|
|
344
344
|
}
|
|
345
345
|
);
|
|
346
346
|
}
|
|
@@ -353,10 +353,10 @@ class et {
|
|
|
353
353
|
}, o = {
|
|
354
354
|
include: ["path"]
|
|
355
355
|
};
|
|
356
|
-
return
|
|
356
|
+
return y().copyNode(r, n, o).then(
|
|
357
357
|
(a) => a,
|
|
358
358
|
function(a) {
|
|
359
|
-
|
|
359
|
+
V().copyNodeError(a);
|
|
360
360
|
}
|
|
361
361
|
);
|
|
362
362
|
}
|
|
@@ -369,21 +369,21 @@ class et {
|
|
|
369
369
|
}, o = {
|
|
370
370
|
include: ["path"]
|
|
371
371
|
};
|
|
372
|
-
return
|
|
372
|
+
return y().moveNode(r, n, o).then(
|
|
373
373
|
(a) => a,
|
|
374
374
|
function(a) {
|
|
375
|
-
|
|
375
|
+
V().moveNodeError(a);
|
|
376
376
|
}
|
|
377
377
|
);
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
|
-
class
|
|
380
|
+
class rt {
|
|
381
381
|
getPublicLink() {
|
|
382
382
|
}
|
|
383
383
|
createPublicLink() {
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
|
-
class
|
|
386
|
+
class st {
|
|
387
387
|
getWorkspaces() {
|
|
388
388
|
const r = {
|
|
389
389
|
skipCount: 0,
|
|
@@ -405,7 +405,7 @@ class rt {
|
|
|
405
405
|
},
|
|
406
406
|
localization: { locales: ["fr_FR"] }
|
|
407
407
|
};
|
|
408
|
-
return
|
|
408
|
+
return We().search(t).then((e) => e.list.entries.map((n) => {
|
|
409
409
|
let o = n.entry;
|
|
410
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
411
|
})).catch((e) => {
|
|
@@ -524,7 +524,7 @@ class rt {
|
|
|
524
524
|
"pm:typeEspace": t
|
|
525
525
|
}
|
|
526
526
|
};
|
|
527
|
-
return
|
|
527
|
+
return y().updateNode(r, e).then((n) => n).catch((n) => {
|
|
528
528
|
let o;
|
|
529
529
|
switch (n.status) {
|
|
530
530
|
case 404:
|
|
@@ -537,7 +537,7 @@ class rt {
|
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
539
|
async getAllUsers() {
|
|
540
|
-
return
|
|
540
|
+
return ee().listPeople().then((r) => r.list.entries.map((t) => {
|
|
541
541
|
let e = t.entry;
|
|
542
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
543
|
firstname: e.firstName,
|
|
@@ -563,11 +563,11 @@ class rt {
|
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
var
|
|
566
|
+
var He = !1;
|
|
567
567
|
function R(s, r, t) {
|
|
568
568
|
return Array.isArray(s) ? (s.length = Math.max(s.length, r), s.splice(r, 1, t), t) : (s[r] = t, t);
|
|
569
569
|
}
|
|
570
|
-
function
|
|
570
|
+
function K(s, r) {
|
|
571
571
|
if (Array.isArray(s)) {
|
|
572
572
|
s.splice(r, 1);
|
|
573
573
|
return;
|
|
@@ -579,8 +579,8 @@ function Z(s, r) {
|
|
|
579
579
|
* (c) 2022 Eduardo San Martin Morote
|
|
580
580
|
* @license MIT
|
|
581
581
|
*/
|
|
582
|
-
let
|
|
583
|
-
const F = (s) =>
|
|
582
|
+
let j;
|
|
583
|
+
const F = (s) => j = s, Be = process.env.NODE_ENV !== "production" ? Symbol("pinia") : Symbol();
|
|
584
584
|
function P(s) {
|
|
585
585
|
return s && typeof s == "object" && Object.prototype.toString.call(s) === "[object Object]" && typeof s.toJSON != "function";
|
|
586
586
|
}
|
|
@@ -589,130 +589,130 @@ var D;
|
|
|
589
589
|
s.direct = "direct", s.patchObject = "patch object", s.patchFunction = "patch function";
|
|
590
590
|
})(D || (D = {}));
|
|
591
591
|
const x = typeof window < "u";
|
|
592
|
-
function
|
|
592
|
+
function Ee(s, r) {
|
|
593
593
|
for (const t in r) {
|
|
594
594
|
const e = r[t];
|
|
595
595
|
if (!(t in s))
|
|
596
596
|
continue;
|
|
597
597
|
const n = s[t];
|
|
598
|
-
P(n) && P(e) && !I(e) && !
|
|
598
|
+
P(n) && P(e) && !I(e) && !se(e) ? s[t] = Ee(n, e) : s[t] = e;
|
|
599
599
|
}
|
|
600
600
|
return s;
|
|
601
601
|
}
|
|
602
|
-
const
|
|
602
|
+
const ve = () => {
|
|
603
603
|
};
|
|
604
|
-
function
|
|
604
|
+
function le(s, r, t, e = ve) {
|
|
605
605
|
s.push(r);
|
|
606
606
|
const n = () => {
|
|
607
607
|
const o = s.indexOf(r);
|
|
608
608
|
o > -1 && (s.splice(o, 1), e());
|
|
609
609
|
};
|
|
610
|
-
return !t &&
|
|
610
|
+
return !t && me() && Te(n), n;
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function O(s, ...r) {
|
|
613
613
|
s.slice().forEach((t) => {
|
|
614
614
|
t(...r);
|
|
615
615
|
});
|
|
616
616
|
}
|
|
617
|
-
function
|
|
617
|
+
function te(s, r) {
|
|
618
618
|
for (const t in r) {
|
|
619
619
|
if (!r.hasOwnProperty(t))
|
|
620
620
|
continue;
|
|
621
621
|
const e = r[t], n = s[t];
|
|
622
|
-
P(n) && P(e) && s.hasOwnProperty(t) && !I(e) && !
|
|
622
|
+
P(n) && P(e) && s.hasOwnProperty(t) && !I(e) && !se(e) ? s[t] = te(n, e) : s[t] = e;
|
|
623
623
|
}
|
|
624
624
|
return s;
|
|
625
625
|
}
|
|
626
|
-
const
|
|
627
|
-
function
|
|
628
|
-
return !P(s) || !s.hasOwnProperty(
|
|
626
|
+
const Ge = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : Symbol();
|
|
627
|
+
function Je(s) {
|
|
628
|
+
return !P(s) || !s.hasOwnProperty(Ge);
|
|
629
629
|
}
|
|
630
|
-
const { assign:
|
|
631
|
-
function
|
|
630
|
+
const { assign: w } = Object;
|
|
631
|
+
function pe(s) {
|
|
632
632
|
return !!(I(s) && s.effect);
|
|
633
633
|
}
|
|
634
|
-
function
|
|
634
|
+
function de(s, r, t, e) {
|
|
635
635
|
const { state: n, actions: o, getters: a } = r, u = t.state.value[s];
|
|
636
|
-
let
|
|
636
|
+
let N;
|
|
637
637
|
function f() {
|
|
638
638
|
!u && (process.env.NODE_ENV === "production" || !e) && (t.state.value[s] = n ? n() : {});
|
|
639
|
-
const g = process.env.NODE_ENV !== "production" && e ?
|
|
640
|
-
return
|
|
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
641
|
F(t);
|
|
642
642
|
const _ = t._s.get(s);
|
|
643
643
|
return a[m].call(_, _);
|
|
644
644
|
})), d), {}));
|
|
645
645
|
}
|
|
646
|
-
return
|
|
646
|
+
return N = re(s, f, r, t, e, !0), N.$reset = function() {
|
|
647
647
|
const d = n ? n() : {};
|
|
648
648
|
this.$patch((m) => {
|
|
649
|
-
|
|
649
|
+
w(m, d);
|
|
650
650
|
});
|
|
651
|
-
},
|
|
651
|
+
}, N;
|
|
652
652
|
}
|
|
653
|
-
function
|
|
653
|
+
function re(s, r, t = {}, e, n, o) {
|
|
654
654
|
let a;
|
|
655
|
-
const u =
|
|
655
|
+
const u = w({ actions: {} }, t);
|
|
656
656
|
if (process.env.NODE_ENV !== "production" && !e._e.active)
|
|
657
657
|
throw new Error("Pinia destroyed");
|
|
658
|
-
const
|
|
658
|
+
const N = {
|
|
659
659
|
deep: !0
|
|
660
660
|
};
|
|
661
|
-
process.env.NODE_ENV !== "production" && !
|
|
661
|
+
process.env.NODE_ENV !== "production" && !He && (N.onTrigger = (l) => {
|
|
662
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
663
|
});
|
|
664
664
|
let f, g, d = S([]), m = S([]), _;
|
|
665
665
|
const L = e.state.value[s];
|
|
666
666
|
!o && !L && (process.env.NODE_ENV === "production" || !n) && (e.state.value[s] = {});
|
|
667
|
-
const U =
|
|
668
|
-
let
|
|
669
|
-
function
|
|
667
|
+
const U = he({});
|
|
668
|
+
let ne;
|
|
669
|
+
function oe(l) {
|
|
670
670
|
let i;
|
|
671
671
|
f = g = !1, process.env.NODE_ENV !== "production" && (_ = []), typeof l == "function" ? (l(e.state.value[s]), i = {
|
|
672
672
|
type: D.patchFunction,
|
|
673
673
|
storeId: s,
|
|
674
674
|
events: _
|
|
675
|
-
}) : (
|
|
675
|
+
}) : (te(e.state.value[s], l), i = {
|
|
676
676
|
type: D.patchObject,
|
|
677
677
|
payload: l,
|
|
678
678
|
storeId: s,
|
|
679
679
|
events: _
|
|
680
680
|
});
|
|
681
|
-
const p =
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
}), g = !0,
|
|
681
|
+
const p = ne = Symbol();
|
|
682
|
+
ae().then(() => {
|
|
683
|
+
ne === p && (f = !0);
|
|
684
|
+
}), g = !0, O(d, i, e.state.value[s]);
|
|
685
685
|
}
|
|
686
|
-
const
|
|
686
|
+
const ye = process.env.NODE_ENV !== "production" ? () => {
|
|
687
687
|
throw new Error(`\u{1F34D}: Store "${s}" is built using the setup syntax and does not implement $reset().`);
|
|
688
|
-
} :
|
|
689
|
-
function
|
|
688
|
+
} : ve;
|
|
689
|
+
function we() {
|
|
690
690
|
a.stop(), d = [], m = [], e._s.delete(s);
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function ie(l, i) {
|
|
693
693
|
return function() {
|
|
694
694
|
F(e);
|
|
695
|
-
const p = Array.from(arguments), h = [],
|
|
696
|
-
function
|
|
695
|
+
const p = Array.from(arguments), h = [], v = [];
|
|
696
|
+
function _e(b) {
|
|
697
697
|
h.push(b);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
700
|
-
|
|
699
|
+
function ke(b) {
|
|
700
|
+
v.push(b);
|
|
701
701
|
}
|
|
702
|
-
|
|
702
|
+
O(m, {
|
|
703
703
|
args: p,
|
|
704
704
|
name: l,
|
|
705
705
|
store: c,
|
|
706
|
-
after:
|
|
707
|
-
onError:
|
|
706
|
+
after: _e,
|
|
707
|
+
onError: ke
|
|
708
708
|
});
|
|
709
|
-
let
|
|
709
|
+
let C;
|
|
710
710
|
try {
|
|
711
|
-
|
|
711
|
+
C = i.apply(this && this.$id === s ? this : c, p);
|
|
712
712
|
} catch (b) {
|
|
713
|
-
throw
|
|
713
|
+
throw O(v, b), b;
|
|
714
714
|
}
|
|
715
|
-
return
|
|
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
716
|
};
|
|
717
717
|
}
|
|
718
718
|
const $ = /* @__PURE__ */ S({
|
|
@@ -720,76 +720,76 @@ function te(s, r, t = {}, e, n, o) {
|
|
|
720
720
|
getters: {},
|
|
721
721
|
state: [],
|
|
722
722
|
hotState: U
|
|
723
|
-
}),
|
|
723
|
+
}), Ne = {
|
|
724
724
|
_p: e,
|
|
725
725
|
$id: s,
|
|
726
|
-
$onAction:
|
|
727
|
-
$patch:
|
|
728
|
-
$reset:
|
|
726
|
+
$onAction: le.bind(null, m),
|
|
727
|
+
$patch: oe,
|
|
728
|
+
$reset: ye,
|
|
729
729
|
$subscribe(l, i = {}) {
|
|
730
|
-
const p =
|
|
730
|
+
const p = le(d, l, i.detached, () => h()), h = a.run(() => $e(() => e.state.value[s], (v) => {
|
|
731
731
|
(i.flush === "sync" ? g : f) && l({
|
|
732
732
|
storeId: s,
|
|
733
733
|
type: D.direct,
|
|
734
734
|
events: _
|
|
735
|
-
},
|
|
736
|
-
},
|
|
735
|
+
}, v);
|
|
736
|
+
}, w({}, N, i)));
|
|
737
737
|
return p;
|
|
738
738
|
},
|
|
739
|
-
$dispose:
|
|
740
|
-
}, c =
|
|
739
|
+
$dispose: we
|
|
740
|
+
}, c = Re(w(
|
|
741
741
|
process.env.NODE_ENV !== "production" && x ? {
|
|
742
742
|
_customProperties: S(/* @__PURE__ */ new Set()),
|
|
743
743
|
_hmrPayload: $
|
|
744
744
|
} : {},
|
|
745
|
-
|
|
745
|
+
Ne
|
|
746
746
|
));
|
|
747
747
|
e._s.set(s, c);
|
|
748
|
-
const A = e._e.run(() => (a =
|
|
748
|
+
const A = e._e.run(() => (a = Fe(), a.run(() => r())));
|
|
749
749
|
for (const l in A) {
|
|
750
750
|
const i = A[l];
|
|
751
|
-
if (I(i) && !
|
|
752
|
-
process.env.NODE_ENV !== "production" && n ? R(U.value, l, T(A, l)) : o || (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
753
|
else if (typeof i == "function") {
|
|
754
|
-
const p = process.env.NODE_ENV !== "production" && n ? i :
|
|
754
|
+
const p = process.env.NODE_ENV !== "production" && n ? i : ie(l, i);
|
|
755
755
|
A[l] = p, process.env.NODE_ENV !== "production" && ($.actions[l] = i), u.actions[l] = i;
|
|
756
756
|
} else
|
|
757
|
-
process.env.NODE_ENV !== "production" &&
|
|
757
|
+
process.env.NODE_ENV !== "production" && pe(i) && ($.getters[l] = o ? t.getters[l] : i, x && (A._getters || (A._getters = S([]))).push(l));
|
|
758
758
|
}
|
|
759
|
-
if (
|
|
759
|
+
if (w(c, A), w(Ue(c), A), Object.defineProperty(c, "$state", {
|
|
760
760
|
get: () => process.env.NODE_ENV !== "production" && n ? U.value : e.state.value[s],
|
|
761
761
|
set: (l) => {
|
|
762
762
|
if (process.env.NODE_ENV !== "production" && n)
|
|
763
763
|
throw new Error("cannot set hotState");
|
|
764
|
-
|
|
765
|
-
|
|
764
|
+
oe((i) => {
|
|
765
|
+
w(i, l);
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
768
|
}), process.env.NODE_ENV !== "production") {
|
|
769
769
|
c._hotUpdate = S((i) => {
|
|
770
770
|
c._hotUpdating = !0, i._hmrPayload.state.forEach((p) => {
|
|
771
771
|
if (p in c.$state) {
|
|
772
|
-
const h = i.$state[p],
|
|
773
|
-
typeof h == "object" && P(h) && P(
|
|
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
774
|
}
|
|
775
775
|
R(c, p, T(i.$state, p));
|
|
776
776
|
}), Object.keys(c.$state).forEach((p) => {
|
|
777
|
-
p in i.$state ||
|
|
778
|
-
}), f = !1, g = !1, e.state.value[s] = T(i._hmrPayload, "hotState"), g = !0,
|
|
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
779
|
f = !0;
|
|
780
780
|
});
|
|
781
781
|
for (const p in i._hmrPayload.actions) {
|
|
782
782
|
const h = i[p];
|
|
783
|
-
R(c, p,
|
|
783
|
+
R(c, p, ie(p, h));
|
|
784
784
|
}
|
|
785
785
|
for (const p in i._hmrPayload.getters) {
|
|
786
|
-
const h = i._hmrPayload.getters[p],
|
|
787
|
-
R(c, p,
|
|
786
|
+
const h = i._hmrPayload.getters[p], v = o ? ge(() => (F(e), h.call(c, c))) : h;
|
|
787
|
+
R(c, p, v);
|
|
788
788
|
}
|
|
789
789
|
Object.keys(c._hmrPayload.getters).forEach((p) => {
|
|
790
|
-
p in i._hmrPayload.getters ||
|
|
790
|
+
p in i._hmrPayload.getters || K(c, p);
|
|
791
791
|
}), Object.keys(c._hmrPayload.actions).forEach((p) => {
|
|
792
|
-
p in i._hmrPayload.actions ||
|
|
792
|
+
p in i._hmrPayload.actions || K(c, p);
|
|
793
793
|
}), c._hmrPayload = i._hmrPayload, c._getters = i._getters, c._hotUpdating = !1;
|
|
794
794
|
});
|
|
795
795
|
const l = {
|
|
@@ -812,9 +812,9 @@ function te(s, r, t = {}, e, n, o) {
|
|
|
812
812
|
pinia: e,
|
|
813
813
|
options: u
|
|
814
814
|
}));
|
|
815
|
-
Object.keys(i || {}).forEach((p) => c._customProperties.add(p)),
|
|
815
|
+
Object.keys(i || {}).forEach((p) => c._customProperties.add(p)), w(c, i);
|
|
816
816
|
} else
|
|
817
|
-
|
|
817
|
+
w(c, a.run(() => l({
|
|
818
818
|
store: c,
|
|
819
819
|
app: e._a,
|
|
820
820
|
pinia: e,
|
|
@@ -824,24 +824,24 @@ function te(s, r, t = {}, e, n, o) {
|
|
|
824
824
|
state: () => new MyClass()
|
|
825
825
|
Found in store "${c.$id}".`), L && o && t.hydrate && t.hydrate(c.$state, L), f = !0, g = !0, c;
|
|
826
826
|
}
|
|
827
|
-
function
|
|
827
|
+
function Ye(s, r, t) {
|
|
828
828
|
let e, n;
|
|
829
829
|
const o = typeof r == "function";
|
|
830
830
|
typeof s == "string" ? (e = s, n = o ? t : r) : (n = s, e = s.id);
|
|
831
|
-
function a(u,
|
|
832
|
-
const f =
|
|
833
|
-
if (u = (process.env.NODE_ENV === "test" &&
|
|
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
834
|
throw new Error(`[\u{1F34D}]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
|
|
835
835
|
const pinia = createPinia()
|
|
836
836
|
app.use(pinia)
|
|
837
837
|
This will fail in production.`);
|
|
838
|
-
u =
|
|
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
839
|
const g = u._s.get(e);
|
|
840
|
-
if (process.env.NODE_ENV !== "production" &&
|
|
841
|
-
const d = "__hot:" + e, m = o ?
|
|
842
|
-
|
|
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
843
|
}
|
|
844
|
-
if (process.env.NODE_ENV !== "production" && x && f && f.proxy && !
|
|
844
|
+
if (process.env.NODE_ENV !== "production" && x && f && f.proxy && !N) {
|
|
845
845
|
const d = f.proxy, m = "_pStores" in d ? d._pStores : d._pStores = {};
|
|
846
846
|
m[e] = g;
|
|
847
847
|
}
|
|
@@ -849,7 +849,7 @@ This will fail in production.`);
|
|
|
849
849
|
}
|
|
850
850
|
return a.$id = e, a;
|
|
851
851
|
}
|
|
852
|
-
const
|
|
852
|
+
const fe = Ye({
|
|
853
853
|
id: "user",
|
|
854
854
|
state: () => ({
|
|
855
855
|
displayName: "",
|
|
@@ -874,10 +874,10 @@ const st = Je({
|
|
|
874
874
|
},
|
|
875
875
|
isLoggedIn() {
|
|
876
876
|
let s;
|
|
877
|
-
return this.apiAlfresco ? s = this.apiAlfresco : s = E(),
|
|
877
|
+
return this.apiAlfresco ? s = this.apiAlfresco : s = E(), ee().getPerson("-me-").then((r) => (this.$patch({
|
|
878
878
|
person: r.entry,
|
|
879
879
|
apiAlfresco: s
|
|
880
|
-
}), !0)).catch((r) =>
|
|
880
|
+
}), !0)).catch((r) => Qe(r));
|
|
881
881
|
},
|
|
882
882
|
async login(s, r) {
|
|
883
883
|
if (!s || !r)
|
|
@@ -887,13 +887,13 @@ const st = Je({
|
|
|
887
887
|
person: t.entry
|
|
888
888
|
});
|
|
889
889
|
}).catch((t) => {
|
|
890
|
-
|
|
890
|
+
ze(t);
|
|
891
891
|
});
|
|
892
892
|
},
|
|
893
893
|
apiLogin(s, r) {
|
|
894
894
|
return E().login(s, r).then(() => (this.$patch({
|
|
895
895
|
apiAlfresco: E()
|
|
896
|
-
}),
|
|
896
|
+
}), ee().getPerson("-me-"))).catch((t) => Promise.reject(t));
|
|
897
897
|
},
|
|
898
898
|
async publiclogoff() {
|
|
899
899
|
const s = localStorage.getItem("ACS_USERNAME");
|
|
@@ -919,26 +919,52 @@ const st = Je({
|
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
921
|
});
|
|
922
|
-
function
|
|
922
|
+
function Qe(s) {
|
|
923
923
|
let r = JSON.parse(s.message).error;
|
|
924
924
|
if (r.statusCode === 401 || r.statusCode === 403)
|
|
925
925
|
return !1;
|
|
926
926
|
throw new Error(s);
|
|
927
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: n } : e.target = { file: 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
|
+
}
|
|
928
953
|
export {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
954
|
+
et as AlfrescoFileService,
|
|
955
|
+
tt as AlfrescoNodeService,
|
|
956
|
+
rt as AlfrescoPermissionService,
|
|
957
|
+
be as ErrorService,
|
|
958
|
+
nt as FavoriteService,
|
|
959
|
+
st as WorkspaceService,
|
|
934
960
|
E as alfrescoApi,
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
961
|
+
X as favoritesApi,
|
|
962
|
+
y as nodesApi,
|
|
963
|
+
ee as peopleApi,
|
|
964
|
+
ue as renditionsApi,
|
|
965
|
+
We as searchApi,
|
|
940
966
|
k as sitesApi,
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
967
|
+
Ke as trashcanApi,
|
|
968
|
+
Me as uploadApi,
|
|
969
|
+
fe as useUserStore
|
|
944
970
|
};
|
|
@@ -1,10 +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,u){"use strict";let M=null;function y(){return M||(M=new g.AlfrescoApi({hostEcm:window.config.ALFRESCO_HOST,authType:window.config.ALFRESCO_AUTH,contextRoot:window.config.ALFRESCO_ROOT})),M}let W=null;function z(){return W||(W=new g.ContentApi(y())),W}let q=null;function ne(){return q||(q=new g.UploadApi(y())),q}let H=null;function B(){return H||(H=new g.RenditionsApi(y())),H}let J=null;function N(){return J||(J=new g.NodesApi(y())),J}let G=null;function v(){return G||(G=new g.SitesApi(y())),G}let Y=null;function oe(){return Y||(Y=new g.SearchApi(y())),Y}let Q=null;function F(){return Q||(Q=new g.PeopleApi(y())),Q}let X=null;function me(){return X||(X=new g.FavoritesApi(y())),X}let Z=null;function he(){return Z||(Z=new g.TrashcanApi(y())),Z}class K{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 ge(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 be(){return new K}class Ee{getThumbnailUrl(r){return z().getDocumentThumbnailUrl(r)}getPreviewUrl(r){return z().getDocumentPreviewUrl(r)}getContentUrl(r){return z().getContentUrl(r)}uploadFile(r,t,e){return ne().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=>{be().uploadFileError(n)})}createRendition(r,t){return B().createRendition(r,{id:t})}createAllRendition(r){return B().createRendition(r,[{id:"doclib"},{id:"imgpreview"}])}}function V(){return new K}class ye{getNode(r){const t={include:["isFavorite","properties","allowableOperations","permissions"]};return N().getNode(r,t).then(e=>e.entry)}createNode(r,t){return N().createNode(r,t).then(e=>e,e=>{V().createNodeError(e)})}getChildren(r){const t={include:["isFavorite","properties","allowableOperations","permissions"]};return N().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 N().updateNode(r,t).then(e=>e,function(e){V().updateNodeError(e)})}deleteNode(r,t){const e={};return N().deleteNode(r,e).then(n=>n,function(n){V().deleteNodeError(n,t)})}getParents(r){const t={include:["isFavorite","properties"]};return N().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 N().listNodeChildren(r,t).then(e=>e.list.entries.map(o=>o.entry).find(o=>o.name==="documentLibrary"))}updateContentNode(r,t){return N().updateNodeContent(r,t).then(e=>e,function(e){V().updateContentNodeError(e)})}copyNode(r,t,e){const n=e!==null?{targetParentId:t,name:e}:{targetParentId:t},o={include:["path"]};return N().copyNode(r,n,o).then(a=>a,function(a){V().copyNodeError(a)})}moveNode(r,t,e){const n=e!==null?{targetParentId:t,name:e}:{targetParentId:t},o={include:["path"]};return N().moveNode(r,n,o).then(a=>a,function(a){V().moveNodeError(a)})}}class we{getPublicLink(){}createPublicLink(){}}class Ne{getWorkspaces(){const r={skipCount:0,maxItems:100};return v().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 oe().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 v().getSite(r,t).then(e=>e.entry).catch(e=>{throw new Error(e.message)})}getWorkspaceMemberships(r){const t={};return v().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 v().createSite(o).then(a=>a).catch(a=>{let l;switch(a.status){case 400:l="L'identifiant choisi ne respecte pas le format requis.";break;case 409:l="L'identifiant choisi est d\xE9j\xE0 existant.";break;default:l=a.message}throw new Error(l)})}async getWorskpaceUuid(r){const t={skipCount:0,maxItems:100};let e=null;const n=(await v.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 v().updateSiteMembership(r,t,n,o).then(a=>a).catch(a=>{let l;switch(a.status){case 404:l="L'identifiant entr\xE9 ne correspond \xE0 aucun utilisateur.";break;case 422:l="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:l=a.message}throw new Error(l)})}deleteWorkspaceMember(r,t){return v().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 v().createSiteMembership(r,n,o).then(a=>a).catch(a=>{let l;switch(a.status){case 403:l="Vous ne pouvez pas inviter sur ce site.";break;case 404:l="Vous ne pouvez pas ajouter un utilisateur inexistant.";break;case 409:l="L'utilisateur a d\xE9j\xE0 acc\xE8s \xE0 cet espace.";break;default:l=a.message}throw new Error(l)})}updateWorkspaceType(r,t){const e={properties:{"pm:typeEspace":t}};return N().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 v().deleteSite(r,t).then(()=>{console.log("Site deletion successful.")}).catch(e=>{throw new Error(e.message)})}updateWorkspace(r,t){return v().updateSite(r,t).then(e=>e).catch(e=>{throw new Error(e.message)})}}var _e=!1;function U(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 ee(s,r){if(Array.isArray(s)){s.splice(r,1);return}delete s[r]}/*!
|
|
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,e.name)})}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
2
|
* pinia v2.0.17
|
|
3
3
|
* (c) 2022 Eduardo San Martin Morote
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/let j;const
|
|
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
6
|
state: () => new MyClass()
|
|
7
|
-
Found in store "${c.$id}".`),
|
|
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
8
|
const pinia = createPinia()
|
|
9
9
|
app.use(pinia)
|
|
10
|
-
This will fail in production.`);
|
|
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:n}:e.target={file: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"}})});
|