@pristy/pristy-libvue 2.16.4 → 2.17.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{ActivityHistory-xzPcANBj.js → ActivityHistory-BdWRS5sV.js} +2 -2
  2. package/dist/{ActivityHistory-xzPcANBj.js.map → ActivityHistory-BdWRS5sV.js.map} +1 -1
  3. package/dist/{BookmarksComponent-BqEC4Gga.js → BookmarksComponent-DemvcE10.js} +2 -2
  4. package/dist/{BookmarksComponent-BqEC4Gga.js.map → BookmarksComponent-DemvcE10.js.map} +1 -1
  5. package/dist/{ChartWrapper-DhucHEU4.js → ChartWrapper-BtwzmpkS.js} +2 -2
  6. package/dist/{ChartWrapper-DhucHEU4.js.map → ChartWrapper-BtwzmpkS.js.map} +1 -1
  7. package/dist/{DisplayFileInDashboardComponent-CSPAb_VI.js → DisplayFileInDashboardComponent-BHWDFOUi.js} +2 -2
  8. package/dist/{DisplayFileInDashboardComponent-CSPAb_VI.js.map → DisplayFileInDashboardComponent-BHWDFOUi.js.map} +1 -1
  9. package/dist/{ExternalApps-B7kTbQpU.js → ExternalApps-CAijJytf.js} +2 -2
  10. package/dist/{ExternalApps-B7kTbQpU.js.map → ExternalApps-CAijJytf.js.map} +1 -1
  11. package/dist/{FavoriteList--1f1GGAH.js → FavoriteList-CRzvTs8t.js} +2 -2
  12. package/dist/{FavoriteList--1f1GGAH.js.map → FavoriteList-CRzvTs8t.js.map} +1 -1
  13. package/dist/{MarkdownComponent-6zA1QrYC.js → MarkdownComponent-DOlPc8op.js} +2 -2
  14. package/dist/{MarkdownComponent-6zA1QrYC.js.map → MarkdownComponent-DOlPc8op.js.map} +1 -1
  15. package/dist/{SearchInput-DzExnLWr.js → SearchInput-BVvFmb7_.js} +2 -2
  16. package/dist/{SearchInput-DzExnLWr.js.map → SearchInput-BVvFmb7_.js.map} +1 -1
  17. package/dist/{UnknownBlockType-49mDl7CJ.js → UnknownBlockType-DwEstLka.js} +2 -2
  18. package/dist/{UnknownBlockType-49mDl7CJ.js.map → UnknownBlockType-DwEstLka.js.map} +1 -1
  19. package/dist/{index-BJIXYrMg.js → index-CnpqKWu6.js} +6653 -6316
  20. package/dist/index-CnpqKWu6.js.map +1 -0
  21. package/dist/pristy-libvue.css +1 -1
  22. package/dist/pristy-libvue.es.js +130 -129
  23. package/dist/pristy-libvue.umd.js +21 -21
  24. package/dist/pristy-libvue.umd.js.map +1 -1
  25. package/dist/src/components/auth/OidcCallback.vue.d.ts +4 -0
  26. package/dist/src/components/auth/OidcCallback.vue.d.ts.map +1 -0
  27. package/dist/src/components/layouts/AppLayout.vue.d.ts +3 -3
  28. package/dist/src/components/layouts/AppSidebar.vue.d.ts +3 -3
  29. package/dist/src/components/layouts/AppSubmenu.vue.d.ts +7 -3
  30. package/dist/src/components/layouts/AppSubmenu.vue.d.ts.map +1 -1
  31. package/dist/src/components/layouts/AppTopbar.vue.d.ts.map +1 -1
  32. package/dist/src/components/search/AdvancedSearchPanel.vue.d.ts +14 -10
  33. package/dist/src/components/search/AdvancedSearchPanel.vue.d.ts.map +1 -1
  34. package/dist/src/components/search/AdvancedViewPanel.vue.d.ts +14 -10
  35. package/dist/src/components/search/AdvancedViewPanel.vue.d.ts.map +1 -1
  36. package/dist/src/components/search/SaveViewPopup.vue.d.ts +7 -5
  37. package/dist/src/components/search/SaveViewPopup.vue.d.ts.map +1 -1
  38. package/dist/src/composables/useAuth.d.ts.map +1 -1
  39. package/dist/src/i18n/index.d.ts +10 -0
  40. package/dist/src/i18n/index.d.ts.map +1 -1
  41. package/dist/src/index.d.ts +1 -0
  42. package/dist/src/index.d.ts.map +1 -1
  43. package/dist/src/plugins/KeycloakPlugin.d.ts +1 -1
  44. package/dist/src/plugins/KeycloakPlugin.d.ts.map +1 -1
  45. package/dist/src/services/WorkflowService.d.ts +13 -11
  46. package/dist/src/services/WorkflowService.d.ts.map +1 -1
  47. package/dist/src/services/auth/KeycloakAuthProvider.d.ts +44 -0
  48. package/dist/src/services/auth/KeycloakAuthProvider.d.ts.map +1 -0
  49. package/dist/src/services/auth/OidcAuthProvider.d.ts +38 -0
  50. package/dist/src/services/auth/OidcAuthProvider.d.ts.map +1 -0
  51. package/dist/src/services/auth/__tests__/FakeAuthProvider.d.ts +32 -0
  52. package/dist/src/services/auth/__tests__/FakeAuthProvider.d.ts.map +1 -0
  53. package/dist/src/services/auth/authProvider.d.ts +57 -0
  54. package/dist/src/services/auth/authProvider.d.ts.map +1 -0
  55. package/dist/src/services/auth/buildOidcSettings.d.ts +29 -0
  56. package/dist/src/services/auth/buildOidcSettings.d.ts.map +1 -0
  57. package/dist/src/stores/config.d.ts +21 -0
  58. package/dist/src/stores/config.d.ts.map +1 -1
  59. package/dist/src/stores/user.d.ts +51 -24
  60. package/dist/src/stores/user.d.ts.map +1 -1
  61. package/package.json +20 -23
  62. package/dist/index-BJIXYrMg.js.map +0 -1
@@ -3,7 +3,7 @@ import { StoreDefinition, PiniaCustomStateProperties } from 'pinia';
3
3
  * `useUserStore` is a Pinia store for managing user authentication, session, and related user data.
4
4
  *
5
5
  * The store includes state variables for managing user session details, actions for logging in and out,
6
- * validating sessions, and interacting with authentication systems like Keycloak and Alfresco,
6
+ * validating sessions, and interacting with the OIDC `AuthProvider` façade and Alfresco,
7
7
  * as well as getters for computed properties like `displayName`.
8
8
  *
9
9
  * State:
@@ -11,18 +11,19 @@ import { StoreDefinition, PiniaCustomStateProperties } from 'pinia';
11
11
  * - `isAdmin` {boolean} - Indicates whether the current user is an administrator.
12
12
  * - `isLoggedIn` {boolean} - Tracks whether the user is currently logged in.
13
13
  * - `person` {object|null} - Stores the person details of the logged-in user.
14
- * - `keycloak` {object|null} - Represents Keycloak authentication configuration.
15
14
  * - `homeFolder` {string|null} - Stores the user's home folder path.
16
15
  *
17
16
  * Getters:
18
17
  * - `displayName` {string} - Returns the display name of the logged-in user, or an empty string if no user is logged in.
19
18
  *
20
19
  * Actions:
21
- * - `logout` - Logs out the current user and stops the auto-renew for the OIDC connection.
22
- * - `validateSession` - Checks if the client is logged in and retrieves the Alfresco ticket using the Keycloak Bearer Token.
23
- * - `connectKeycloak` - Handles the redirection and connection to Keycloak for unauthenticated users.
24
- * - `keycloakReady` - Stores the Keycloak object and retrieves the Alfresco ticket using the Keycloak Bearer Token.
25
- * - `getAlfTicket` - Logs into Alfresco with the Bearer token and retrieves the Alfresco ticket.
20
+ * - `logout` - Logs out the current user, clearing the local session and delegating to the auth provider.
21
+ * - `validateSession` - Checks if the client is logged in and retrieves the Alfresco ticket using the provider's Bearer token.
22
+ * - `connectKeycloak` - Redirects to the IdP via the auth provider for unauthenticated users, otherwise loads the current Person.
23
+ * - `completeLogin` - Consumes the IdP redirect via the auth provider and opens the Alfresco session.
24
+ * - `keycloakReady` - Subscribes to the auth provider's token-renewal and session-lost events, then retrieves the Alfresco ticket.
25
+ * - `getAlfTicket` - Logs into Alfresco with the Bearer token supplied by the auth provider and retrieves the Alfresco ticket.
26
+ * - `accountConsoleUrl` - Returns the IdP account console URL for a given section, via the auth provider.
26
27
  * - `getPerson` - Retrieves the person details for the currently authenticated user.
27
28
  * - `login` - Attempts to log in a user with a username and password.
28
29
  * - `apiLogin` - Handles Basic Authentication with Alfresco.
@@ -34,7 +35,6 @@ export const useUserStore: StoreDefinition<"UserStore", {
34
35
  isAdmin: boolean;
35
36
  isLoggedIn: boolean;
36
37
  person: any;
37
- keycloak: any;
38
38
  homeFolder: any;
39
39
  isPristyAdmin: any;
40
40
  }, {
@@ -43,7 +43,6 @@ export const useUserStore: StoreDefinition<"UserStore", {
43
43
  isAdmin: boolean;
44
44
  isLoggedIn: boolean;
45
45
  person: any;
46
- keycloak: any;
47
46
  homeFolder: any;
48
47
  isPristyAdmin: any;
49
48
  } & PiniaCustomStateProperties<{
@@ -51,7 +50,6 @@ export const useUserStore: StoreDefinition<"UserStore", {
51
50
  isAdmin: boolean;
52
51
  isLoggedIn: boolean;
53
52
  person: any;
54
- keycloak: any;
55
53
  homeFolder: any;
56
54
  isPristyAdmin: any;
57
55
  }>): any;
@@ -62,32 +60,61 @@ export const useUserStore: StoreDefinition<"UserStore", {
62
60
  */
63
61
  logout(): Promise<axios.AxiosResponse<any>>;
64
62
  /**
65
- * Check if the client is logged and get alf_ticket using Keycloak Bearer Token
66
- * @return {Promise<{id:string}>} Current alf_token
63
+ * Check whether the client is logged in and, when authentication is
64
+ * delegated to an OIDC provider via the AuthProvider façade, refresh the
65
+ * Alfresco ticket using its Bearer token.
66
+ * @return {Promise<{id:string}|undefined>} Current alf_token, or
67
+ * undefined when the session cannot be validated
67
68
  */
68
69
  validateSession(): Promise<{
69
70
  id: string;
70
- }>;
71
+ } | undefined>;
71
72
  /**
72
- * Redirect to Keycloak if unauthent, else retrieve current Person
73
- * form Alfresco.
73
+ * Ensure the user is authenticated. Redirects to the IdP when they are not,
74
+ * otherwise loads their Person from Alfresco.
75
+ * @param {string} [returnTo] in-app path to return to after login
74
76
  * @return {Promise<void>}
75
77
  */
76
- connectKeycloak: () => Promise<void>;
78
+ connectKeycloak: (returnTo?: string) => Promise<void>;
79
+ /**
80
+ * Consume the IdP redirect and open the Alfresco session.
81
+ * @return {Promise<string>} the in-app path to navigate to
82
+ */
83
+ completeLogin: () => Promise<string>;
77
84
  /**
78
- * Store Keycloak object and get alf_ticket using Keycloak Bearer Token.
79
- * We will ask alf_ticket every ALF_TOKEN_TTL_MS (60s)
80
- * @param {any} _keycloak Keycloak object yet authenticate
81
- * @return {Promise<{id: string}>}
85
+ * @param {string} section "profile" or "password"
86
+ * @return {string|null} the IdP account console URL, when one is available
82
87
  */
83
- keycloakReady(_keycloak: any): Promise<{
88
+ accountConsoleUrl(section: string): string | null;
89
+ /**
90
+ * Subscribe to the provider and open the Alfresco session. The Alfresco
91
+ * ticket is refreshed when the OIDC token is renewed, replacing the former
92
+ * unconditional 60 s poll.
93
+ *
94
+ * Does nothing beyond registering the two subscriptions when the provider
95
+ * has no session yet: `OidcAuthProvider.init()` resolves happily for an
96
+ * anonymous browser (unlike keycloak-js's `onLoad: "login-required"`), so
97
+ * requesting a ticket here would send `Authorization: Bearer null` and
98
+ * surface a misleading initialization error. A later login still
99
+ * refreshes the ticket via the `onTokenRenewed` subscription.
100
+ * @param {Object} provider the auth provider, already initialised
101
+ * @return {Promise<{id: string}|undefined>}
102
+ */
103
+ keycloakReady(provider: any): Promise<{
84
104
  id: string;
85
- }>;
105
+ } | undefined>;
86
106
  /**
87
- * Log to Alfresco with Bearer token and set alf_token
107
+ * Log to Alfresco with Bearer token and set alf_token.
108
+ *
109
+ * Retries exactly once on an HTTP 401, per the design spec ("single retry
110
+ * on 401 on `/tickets/-me-`"): this replaces the 60 s poller the migration
111
+ * deleted, since under an OIDC IdP (e.g. Entra) the token and the
112
+ * Alfresco ticket can have comparable lifetimes, so an idle tab may lose
113
+ * its ticket with nothing else scheduled to refresh it.
114
+ * @param {boolean} [isRetry] internal guard, never pass this explicitly
88
115
  * @return {Promise<{id:string} | undefined>} Current alf_token or undefined if not using OIDC
89
116
  */
90
- getAlfTicket(): Promise<{
117
+ getAlfTicket(isRetry?: boolean): Promise<{
91
118
  id: string;
92
119
  } | undefined>;
93
120
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/stores/user.js"],"names":[],"mappings":";AAsCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBI;;;OAGG;cADS,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAqC7C;;;OAGG;uBADS,OAAO,CAAC;QAAC,EAAE,EAAC,MAAM,CAAA;KAAC,CAAC;IA0BhC;;;;OAIG;2BADS,OAAO,CAAC,IAAI,CAAC;IA0BzB;;;;;OAKG;6BAFQ,GAAG,GACF,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,CAAC;IASjC;;;OAGG;oBADS,OAAO,CAAC;QAAC,E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;;;;OAKG;gBAHQ,MAAM,KACN,MAAM,GACL,OAAO,CAAC,GAAG,CAAC;IAcxB;;;OAGG;oBADS,OAAO,CAAC,IAAI,CAAC;IAUzB;;;;OAIG;2BAFQ,MAAM,GACL,OAAO,CAAC,MAAM,CAAC;GAwB5B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pristy/pristy-libvue",
3
- "version": "2.16.4",
3
+ "version": "2.17.2",
4
4
  "description": "Core library used by all Pristy applications",
5
5
  "homepage": "https://pristy.fr/en/",
6
6
  "author": "JECI SARL",
@@ -41,10 +41,10 @@
41
41
  "peerDependencies": {
42
42
  "@codemirror/autocomplete": "^6.20.3",
43
43
  "@codemirror/collab": "^6.1.1",
44
- "@codemirror/commands": "^6.10.4",
45
- "@codemirror/lang-html": "^6.4.11",
44
+ "@codemirror/commands": "^6.11.0",
45
+ "@codemirror/lang-html": "^6.4.12",
46
46
  "@codemirror/lang-json": "^6.0.2",
47
- "@codemirror/lang-markdown": "^6.5.0",
47
+ "@codemirror/lang-markdown": "^6.5.2",
48
48
  "@codemirror/lang-xml": "^6.1.0",
49
49
  "@codemirror/lang-yaml": "^6.1.3",
50
50
  "@codemirror/language": "^6.12.4",
@@ -54,15 +54,12 @@
54
54
  "@codemirror/search": "^6.7.1",
55
55
  "@codemirror/state": "^6.7.1",
56
56
  "@codemirror/theme-one-dark": "^6.1.3",
57
- "@codemirror/view": "^6.43.6",
57
+ "@codemirror/view": "^6.43.9",
58
58
  "codemirror": "6.0.2",
59
- "vue": "^3.5.22",
60
- "vue-i18n": "^11.4.6",
59
+ "vue": "^3.5.41",
60
+ "vue-i18n": "^11.4.8",
61
61
  "vue-router": "^4.6.4"
62
62
  },
63
- "resolutions": {
64
- "@codemirror/state": "6.5.2"
65
- },
66
63
  "overrides": {
67
64
  "minimatch": "^10.2.6"
68
65
  },
@@ -74,20 +71,21 @@
74
71
  "@tato30/vue-pdf": "^1.11.5",
75
72
  "@vueuse/core": "^12.8.2",
76
73
  "async-retry": "^1.3.3",
77
- "axios": "^1.18.1",
78
- "dompurify": "^3.4.11",
74
+ "axios": "^1.19.0",
75
+ "dompurify": "^3.4.14",
79
76
  "email-validator": "^2.0.4",
80
- "highlight.js": "^11.11.1",
77
+ "highlight.js": "^11.12.0",
81
78
  "jszip": "^3.10.1",
82
79
  "keycloak-js": "^26.2.4",
83
80
  "marked": "^16.4.2",
84
81
  "marked-highlight": "^2.2.4",
82
+ "oidc-client-ts": "^3.5.0",
85
83
  "p-limit": "^6.2.0",
86
84
  "pdf-lib": "^1.17.1",
87
85
  "pinia": "^2.3.1",
88
86
  "primevue": "^4.5.5",
89
87
  "quick-lru": "^7.3.0",
90
- "sanitize-html": "^2.17.5",
88
+ "sanitize-html": "^2.17.7",
91
89
  "type-check": "^0.4.0",
92
90
  "vue-draggable-next": "^2.3.0"
93
91
  },
@@ -95,20 +93,19 @@
95
93
  "@codemirror/collab": "^6.1.1",
96
94
  "@eslint/js": "^10.0.1",
97
95
  "@vitejs/plugin-legacy": "^7.2.1",
98
- "@vitejs/plugin-vue": "^6.0.7",
96
+ "@vitejs/plugin-vue": "^6.0.8",
99
97
  "@vitest/coverage-v8": "^3.2.7",
100
- "eslint": "^10.8.0",
101
- "eslint-config-prettier": "^10.1.8",
102
- "eslint-plugin-n": "^17.24.0",
98
+ "@vue/test-utils": "^2.4.11",
99
+ "eslint": "^10.8.1",
103
100
  "eslint-plugin-prettier": "^5.5.6",
104
- "eslint-plugin-promise": "^7.3.0",
105
101
  "eslint-plugin-vue": "^10.10.0",
106
- "globals": "^17.8.0",
102
+ "globals": "^17.11.0",
107
103
  "jsdom": "^27.4.0",
108
- "prettier": "^3.9.4",
104
+ "prettier": "^3.9.6",
109
105
  "rollup-plugin-visualizer": "^6.0.11",
110
- "sass": "^1.101.0",
111
- "svgo": "^4.0.1",
106
+ "sass": "^1.102.0",
107
+ "svgo": "^4.0.2",
108
+ "typescript": "^6.0.3",
112
109
  "vite": "^7.3.6",
113
110
  "vite-plugin-dts": "^4.5.4",
114
111
  "vitest": "^3.2.4"