@pristy/pristy-libvue 0.3.0 → 0.3.1

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.
@@ -0,0 +1,944 @@
1
+ import { AlfrescoApi as _e, ContentApi as ke, UploadApi as Ae, RenditionsApi as Se, NodesApi as Pe, SitesApi as Le, SearchApi as Oe, PeopleApi as Ve, FavoritesApi as je, TrashcanApi as Ce } from "@alfresco/js-api";
2
+ import { getCurrentInstance as de, inject as xe, markRaw as S, ref as fe, watch as De, reactive as Ie, effectScope as $e, isRef as I, isReactive as re, toRef as T, toRaw as Re, nextTick as ie, computed as me, onUnmounted as Fe, toRefs as ae } from "vue";
3
+ let M = null;
4
+ function E() {
5
+ return M || (M = new _e({
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 ke(E())), W;
14
+ }
15
+ let q = null;
16
+ function Ue() {
17
+ return q || (q = new Ae(E())), q;
18
+ }
19
+ let H = null;
20
+ function ce() {
21
+ return H || (H = new Se(E())), H;
22
+ }
23
+ let B = null;
24
+ function v() {
25
+ return B || (B = new Pe(E())), B;
26
+ }
27
+ let J = null;
28
+ function k() {
29
+ return J || (J = new Le(E())), J;
30
+ }
31
+ let G = null;
32
+ function Te() {
33
+ return G || (G = new Oe(E())), G;
34
+ }
35
+ let Y = null;
36
+ function K() {
37
+ return Y || (Y = new Ve(E())), Y;
38
+ }
39
+ let Q = null;
40
+ function Xe() {
41
+ return Q || (Q = new je(E())), Q;
42
+ }
43
+ let X = null;
44
+ function Ze() {
45
+ return X || (X = new Ce(E())), X;
46
+ }
47
+ class he {
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 Me(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 We() {
219
+ return new he();
220
+ }
221
+ class Ke {
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 Ue().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
+ We().uploadFileError(n);
238
+ }
239
+ );
240
+ }
241
+ createRendition(r, t) {
242
+ return ce().createRendition(r, {
243
+ id: t
244
+ });
245
+ }
246
+ createAllRendition(r) {
247
+ return ce().createRendition(r, [
248
+ {
249
+ id: "doclib"
250
+ },
251
+ {
252
+ id: "imgpreview"
253
+ }
254
+ ]);
255
+ }
256
+ }
257
+ function O() {
258
+ return new he();
259
+ }
260
+ class et {
261
+ getNode(r) {
262
+ const t = {
263
+ include: [
264
+ "isFavorite",
265
+ "properties",
266
+ "allowableOperations",
267
+ "permissions"
268
+ ]
269
+ };
270
+ return v().getNode(r, t).then((e) => e.entry);
271
+ }
272
+ createNode(r, t) {
273
+ return v().createNode(r, t).then(
274
+ (e) => e,
275
+ (e) => {
276
+ O().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 v().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 v().updateNode(r, t).then(
301
+ (e) => e,
302
+ function(e) {
303
+ O().updateNodeError(e);
304
+ }
305
+ );
306
+ }
307
+ deleteNode(r, t) {
308
+ const e = {};
309
+ return v().deleteNode(r, e).then(
310
+ (n) => n,
311
+ function(n) {
312
+ O().deleteNodeError(n, t);
313
+ }
314
+ );
315
+ }
316
+ getParents(r) {
317
+ const t = {
318
+ include: ["isFavorite", "properties"]
319
+ };
320
+ return v().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 v().listNodeChildren(r, t).then((e) => e.list.entries.map((o) => o.entry).find((o) => o.name === "documentLibrary"));
338
+ }
339
+ updateContentNode(r, t) {
340
+ return v().updateNodeContent(r, t).then(
341
+ (e) => e,
342
+ function(e) {
343
+ O().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 v().copyNode(r, n, o).then(
357
+ (a) => a,
358
+ function(a) {
359
+ O().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 v().moveNode(r, n, o).then(
373
+ (a) => a,
374
+ function(a) {
375
+ O().moveNodeError(a);
376
+ }
377
+ );
378
+ }
379
+ }
380
+ class tt {
381
+ getPublicLink() {
382
+ }
383
+ createPublicLink() {
384
+ }
385
+ }
386
+ class rt {
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 Te().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 v().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 K().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 ze = !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 Z(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 C;
583
+ const F = (s) => C = s, qe = 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 ge(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) && !re(e) ? s[t] = ge(n, e) : s[t] = e;
599
+ }
600
+ return s;
601
+ }
602
+ const be = () => {
603
+ };
604
+ function ue(s, r, t, e = be) {
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 && de() && Fe(n), n;
611
+ }
612
+ function V(s, ...r) {
613
+ s.slice().forEach((t) => {
614
+ t(...r);
615
+ });
616
+ }
617
+ function ee(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) && !re(e) ? s[t] = ee(n, e) : s[t] = e;
623
+ }
624
+ return s;
625
+ }
626
+ const He = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : Symbol();
627
+ function Be(s) {
628
+ return !P(s) || !s.hasOwnProperty(He);
629
+ }
630
+ const { assign: N } = Object;
631
+ function le(s) {
632
+ return !!(I(s) && s.effect);
633
+ }
634
+ function pe(s, r, t, e) {
635
+ const { state: n, actions: o, getters: a } = r, u = t.state.value[s];
636
+ let w;
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 ? ae(fe(n ? n() : {}).value) : ae(t.state.value[s]);
640
+ return N(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(me(() => {
641
+ F(t);
642
+ const _ = t._s.get(s);
643
+ return a[m].call(_, _);
644
+ })), d), {}));
645
+ }
646
+ return w = te(s, f, r, t, e, !0), w.$reset = function() {
647
+ const d = n ? n() : {};
648
+ this.$patch((m) => {
649
+ N(m, d);
650
+ });
651
+ }, w;
652
+ }
653
+ function te(s, r, t = {}, e, n, o) {
654
+ let a;
655
+ const u = N({ actions: {} }, t);
656
+ if (process.env.NODE_ENV !== "production" && !e._e.active)
657
+ throw new Error("Pinia destroyed");
658
+ const w = {
659
+ deep: !0
660
+ };
661
+ process.env.NODE_ENV !== "production" && !ze && (w.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 = fe({});
668
+ let se;
669
+ function ne(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
+ }) : (ee(e.state.value[s], l), i = {
676
+ type: D.patchObject,
677
+ payload: l,
678
+ storeId: s,
679
+ events: _
680
+ });
681
+ const p = se = Symbol();
682
+ ie().then(() => {
683
+ se === p && (f = !0);
684
+ }), g = !0, V(d, i, e.state.value[s]);
685
+ }
686
+ const Ee = 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
+ } : be;
689
+ function ye() {
690
+ a.stop(), d = [], m = [], e._s.delete(s);
691
+ }
692
+ function oe(l, i) {
693
+ return function() {
694
+ F(e);
695
+ const p = Array.from(arguments), h = [], y = [];
696
+ function Ne(b) {
697
+ h.push(b);
698
+ }
699
+ function we(b) {
700
+ y.push(b);
701
+ }
702
+ V(m, {
703
+ args: p,
704
+ name: l,
705
+ store: c,
706
+ after: Ne,
707
+ onError: we
708
+ });
709
+ let j;
710
+ try {
711
+ j = i.apply(this && this.$id === s ? this : c, p);
712
+ } catch (b) {
713
+ throw V(y, b), b;
714
+ }
715
+ return j instanceof Promise ? j.then((b) => (V(h, b), b)).catch((b) => (V(y, b), Promise.reject(b))) : (V(h, j), j);
716
+ };
717
+ }
718
+ const $ = /* @__PURE__ */ S({
719
+ actions: {},
720
+ getters: {},
721
+ state: [],
722
+ hotState: U
723
+ }), ve = {
724
+ _p: e,
725
+ $id: s,
726
+ $onAction: ue.bind(null, m),
727
+ $patch: ne,
728
+ $reset: Ee,
729
+ $subscribe(l, i = {}) {
730
+ const p = ue(d, l, i.detached, () => h()), h = a.run(() => De(() => e.state.value[s], (y) => {
731
+ (i.flush === "sync" ? g : f) && l({
732
+ storeId: s,
733
+ type: D.direct,
734
+ events: _
735
+ }, y);
736
+ }, N({}, w, i)));
737
+ return p;
738
+ },
739
+ $dispose: ye
740
+ }, c = Ie(N(
741
+ process.env.NODE_ENV !== "production" && x ? {
742
+ _customProperties: S(/* @__PURE__ */ new Set()),
743
+ _hmrPayload: $
744
+ } : {},
745
+ ve
746
+ ));
747
+ e._s.set(s, c);
748
+ const A = e._e.run(() => (a = $e(), a.run(() => r())));
749
+ for (const l in A) {
750
+ const i = A[l];
751
+ if (I(i) && !le(i) || re(i))
752
+ process.env.NODE_ENV !== "production" && n ? R(U.value, l, T(A, l)) : o || (L && Be(i) && (I(i) ? i.value = L[l] : ee(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 : oe(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" && le(i) && ($.getters[l] = o ? t.getters[l] : i, x && (A._getters || (A._getters = S([]))).push(l));
758
+ }
759
+ if (N(c, A), N(Re(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
+ ne((i) => {
765
+ N(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], y = c.$state[p];
773
+ typeof h == "object" && P(h) && P(y) ? ge(h, y) : i.$state[p] = y;
774
+ }
775
+ R(c, p, T(i.$state, p));
776
+ }), Object.keys(c.$state).forEach((p) => {
777
+ p in i.$state || Z(c, p);
778
+ }), f = !1, g = !1, e.state.value[s] = T(i._hmrPayload, "hotState"), g = !0, ie().then(() => {
779
+ f = !0;
780
+ });
781
+ for (const p in i._hmrPayload.actions) {
782
+ const h = i[p];
783
+ R(c, p, oe(p, h));
784
+ }
785
+ for (const p in i._hmrPayload.getters) {
786
+ const h = i._hmrPayload.getters[p], y = o ? me(() => (F(e), h.call(c, c))) : h;
787
+ R(c, p, y);
788
+ }
789
+ Object.keys(c._hmrPayload.getters).forEach((p) => {
790
+ p in i._hmrPayload.getters || Z(c, p);
791
+ }), Object.keys(c._hmrPayload.actions).forEach((p) => {
792
+ p in i._hmrPayload.actions || Z(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)), N(c, i);
816
+ } else
817
+ N(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 Je(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, w) {
832
+ const f = de();
833
+ if (u = (process.env.NODE_ENV === "test" && C && C._testing ? null : u) || f && xe(qe), u && F(u), process.env.NODE_ENV !== "production" && !C)
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 = C, u._s.has(e) || (o ? te(e, r, n, u) : pe(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" && w) {
841
+ const d = "__hot:" + e, m = o ? te(d, r, n, u, !0) : pe(d, N({}, n), u, !0);
842
+ w._hotUpdate(m), delete u.state.value[d], u._s.delete(d);
843
+ }
844
+ if (process.env.NODE_ENV !== "production" && x && f && f.proxy && !w) {
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 st = Je({
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(), K().getPerson("-me-").then((r) => (this.$patch({
878
+ person: r.entry,
879
+ apiAlfresco: s
880
+ }), !0)).catch((r) => Ge(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
+ Me(t);
891
+ });
892
+ },
893
+ apiLogin(s, r) {
894
+ return E().login(s, r).then(() => (this.$patch({
895
+ apiAlfresco: E()
896
+ }), K().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 Ge(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
+ export {
929
+ Ke as AlfrescoFileService,
930
+ et as AlfrescoNodeService,
931
+ tt as AlfrescoPermissionService,
932
+ he as ErrorService,
933
+ rt as WorkspaceService,
934
+ E as alfrescoApi,
935
+ Xe as favoritesApi,
936
+ v as nodesApi,
937
+ K as peopleApi,
938
+ ce as renditionsApi,
939
+ Te as searchApi,
940
+ k as sitesApi,
941
+ Ze as trashcanApi,
942
+ Ue as uploadApi,
943
+ st as useUserStore
944
+ };
@@ -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,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]}/*!
2
+ * pinia v2.0.17
3
+ * (c) 2022 Eduardo San Martin Morote
4
+ * @license MIT
5
+ */let j;const T=s=>j=s,ve=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();function O(s){return s&&typeof s=="object"&&Object.prototype.toString.call(s)==="[object Object]"&&typeof s.toJSON!="function"}var D;(function(s){s.direct="direct",s.patchObject="patch object",s.patchFunction="patch function"})(D||(D={}));const I=typeof window<"u";function ie(s,r){for(const t in r){const e=r[t];if(!(t in s))continue;const n=s[t];O(n)&&O(e)&&!u.isRef(e)&&!u.isReactive(e)?s[t]=ie(n,e):s[t]=e}return s}const ae=()=>{};function ce(s,r,t,e=ae){s.push(r);const n=()=>{const o=s.indexOf(r);o>-1&&(s.splice(o,1),e())};return!t&&u.getCurrentInstance()&&u.onUnmounted(n),n}function R(s,...r){s.slice().forEach(t=>{t(...r)})}function te(s,r){for(const t in r){if(!r.hasOwnProperty(t))continue;const e=r[t],n=s[t];O(n)&&O(e)&&s.hasOwnProperty(t)&&!u.isRef(e)&&!u.isReactive(e)?s[t]=te(n,e):s[t]=e}return s}const ke=process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();function Ae(s){return!O(s)||!s.hasOwnProperty(ke)}const{assign:k}=Object;function le(s){return!!(u.isRef(s)&&s.effect)}function ue(s,r,t,e){const{state:n,actions:o,getters:a}=r,l=t.state.value[s];let S;function h(){!l&&(process.env.NODE_ENV==="production"||!e)&&(t.state.value[s]=n?n():{});const w=process.env.NODE_ENV!=="production"&&e?u.toRefs(u.ref(n?n():{}).value):u.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]=u.markRaw(u.computed(()=>{T(t);const P=t._s.get(s);return a[b].call(P,P)})),m),{}))}return S=re(s,h,r,t,e,!0),S.$reset=function(){const m=n?n():{};this.$patch(b=>{k(b,m)})},S}function re(s,r,t={},e,n,o){let a;const l=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=u.markRaw([]),b=u.markRaw([]),P;const C=e.state.value[s];!o&&!C&&(process.env.NODE_ENV==="production"||!n)&&(e.state.value[s]={});const se=u.ref({});let pe;function de(p){let i;h=w=!1,process.env.NODE_ENV!=="production"&&(P=[]),typeof p=="function"?(p(e.state.value[s]),i={type:D.patchFunction,storeId:s,events:P}):(te(e.state.value[s],p),i={type:D.patchObject,payload:p,storeId:s,events:P});const d=pe=Symbol();u.nextTick().then(()=>{pe===d&&(h=!0)}),w=!0,R(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().`)}:ae;function Ve(){a.stop(),m=[],b=[],e._s.delete(s)}function fe(p,i){return function(){T(e);const d=Array.from(arguments),E=[],A=[];function Ce(_){E.push(_)}function je(_){A.push(_)}R(b,{args:d,name:p,store:c,after:Ce,onError:je});let $;try{$=i.apply(this&&this.$id===s?this:c,d)}catch(_){throw R(A,_),_}return $ instanceof Promise?$.then(_=>(R(E,_),_)).catch(_=>(R(A,_),Promise.reject(_))):(R(E,$),$)}}const x=u.markRaw({actions:{},getters:{},state:[],hotState:se}),Re={_p:e,$id:s,$onAction:ce.bind(null,b),$patch:de,$reset:Oe,$subscribe(p,i={}){const d=ce(m,p,i.detached,()=>E()),E=a.run(()=>u.watch(()=>e.state.value[s],A=>{(i.flush==="sync"?w:h)&&p({storeId:s,type:D.direct,events:P},A)},k({},S,i)));return d},$dispose:Ve},c=u.reactive(k(process.env.NODE_ENV!=="production"&&I?{_customProperties:u.markRaw(new Set),_hmrPayload:x}:{},Re));e._s.set(s,c);const L=e._e.run(()=>(a=u.effectScope(),a.run(()=>r())));for(const p in L){const i=L[p];if(u.isRef(i)&&!le(i)||u.isReactive(i))process.env.NODE_ENV!=="production"&&n?U(se.value,p,u.toRef(L,p)):o||(C&&Ae(i)&&(u.isRef(i)?i.value=C[p]:te(i,C[p])),e.state.value[s][p]=i),process.env.NODE_ENV!=="production"&&x.state.push(p);else if(typeof i=="function"){const d=process.env.NODE_ENV!=="production"&&n?i:fe(p,i);L[p]=d,process.env.NODE_ENV!=="production"&&(x.actions[p]=i),l.actions[p]=i}else process.env.NODE_ENV!=="production"&&le(i)&&(x.getters[p]=o?t.getters[p]:i,I&&(L._getters||(L._getters=u.markRaw([]))).push(p))}if(k(c,L),k(u.toRaw(c),L),Object.defineProperty(c,"$state",{get:()=>process.env.NODE_ENV!=="production"&&n?se.value:e.state.value[s],set:p=>{if(process.env.NODE_ENV!=="production"&&n)throw new Error("cannot set hotState");de(i=>{k(i,p)})}}),process.env.NODE_ENV!=="production"){c._hotUpdate=u.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"&&O(E)&&O(A)?ie(E,A):i.$state[d]=A}U(c,d,u.toRef(i.$state,d))}),Object.keys(c.$state).forEach(d=>{d in i.$state||ee(c,d)}),h=!1,w=!1,e.state.value[s]=u.toRef(i._hmrPayload,"hotState"),w=!0,u.nextTick().then(()=>{h=!0});for(const d in i._hmrPayload.actions){const E=i[d];U(c,d,fe(d,E))}for(const d in i._hmrPayload.getters){const E=i._hmrPayload.getters[d],A=o?u.computed(()=>(T(e),E.call(c,c))):E;U(c,d,A)}Object.keys(c._hmrPayload.getters).forEach(d=>{d in i._hmrPayload.getters||ee(c,d)}),Object.keys(c._hmrPayload.actions).forEach(d=>{d in i._hmrPayload.actions||ee(c,d)}),c._hmrPayload=i._hmrPayload,c._getters=i._getters,c._hotUpdating=!1});const p={writable:!0,configurable:!0,enumerable:!1};I&&["_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"&&I){const i=a.run(()=>p({store:c,app:e._a,pinia:e,options:l}));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:l})))}),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}".`),C&&o&&t.hydrate&&t.hydrate(c.$state,C),h=!0,w=!0,c}function Se(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(l,S){const h=u.getCurrentInstance();if(l=(process.env.NODE_ENV==="test"&&j&&j._testing?null:l)||h&&u.inject(ve),l&&T(l),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.`);l=j,l._s.has(e)||(o?re(e,r,n,l):ue(e,n,l),process.env.NODE_ENV!=="production"&&(a._pinia=l));const w=l._s.get(e);if(process.env.NODE_ENV!=="production"&&S){const m="__hot:"+e,b=o?re(m,r,n,l,!0):ue(m,k({},n),l,!0);S._hotUpdate(b),delete l.state.value[m],l._s.delete(m)}if(process.env.NODE_ENV!=="production"&&I&&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 Pe=Se({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=>{ge(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)}f.AlfrescoFileService=Ee,f.AlfrescoNodeService=ye,f.AlfrescoPermissionService=we,f.ErrorService=K,f.WorkspaceService=Ne,f.alfrescoApi=y,f.favoritesApi=me,f.nodesApi=N,f.peopleApi=F,f.renditionsApi=B,f.searchApi=oe,f.sitesApi=v,f.trashcanApi=he,f.uploadApi=ne,f.useUserStore=Pe,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristy/pristy-libvue",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Library for Pristy application",
5
5
  "homepage": "https://pristy.fr/en/",
6
6
  "author": "JECI SARL",