@arsedizioni/ars-utils 18.2.332 → 18.2.333

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.
@@ -1,5 +1,5 @@
1
1
  import { SendToDialogResult } from '@arsedizioni/ars-utils/ui.application';
2
- import { LoginResult, NameValueItem } from '@arsedizioni/ars-utils/core';
2
+ import { LoginResult, LoginResult2, NameValueItem } from '@arsedizioni/ars-utils/core';
3
3
  import { LoginOAuthType } from '@arsedizioni/ars-utils/ui.oauth';
4
4
  import { Signal } from '@angular/core';
5
5
  export declare enum ClipperSelectionMode {
@@ -125,6 +125,9 @@ export interface ClipperUserInfo {
125
125
  export interface ClipperLoginResult extends LoginResult<ClipperUserInfo> {
126
126
  settings?: ClipperChannelSettings[] | null;
127
127
  }
128
+ export interface ClipperLoginResult2 extends LoginResult2<ClipperUserInfo> {
129
+ settings?: ClipperChannelSettings[] | null;
130
+ }
128
131
  export interface ClipperLoginInfo {
129
132
  context: ClipperUserInfo;
130
133
  complianceContext?: any | null;
@@ -2,7 +2,7 @@ import { OnDestroy, Signal } from '@angular/core';
2
2
  import { ApiResult, FolderTree, NameValueItem } from '@arsedizioni/ars-utils/core';
3
3
  import { LoginOAuthType } from '@arsedizioni/ars-utils/ui.oauth';
4
4
  import { Observable, Subscription } from 'rxjs';
5
- import { ClipperDashboard, ClipperDocumentInfo, ClipperDocumentStructure, ClipperDocumentUpdateStateParams, ClipperExportDocumentsParams, ClipperLoginInfo, ClipperLoginResult, ClipperModule, ClipperOTPInfo, ClipperQueryArsEventsParams, ClipperQueryArsEventsResult, ClipperReferencesSearchParams, ClipperSearchFacetsResult, ClipperSearchParams, ClipperSearchResult, ClipperSendDocumentsByEmailParams, ClipperTaxonomyParams, ClipperUserLink, ClipperUserSearch } from '../definitions';
5
+ import { ClipperDashboard, ClipperDocumentInfo, ClipperDocumentStructure, ClipperDocumentUpdateStateParams, ClipperExportDocumentsParams, ClipperLoginInfo, ClipperLoginResult, ClipperLoginResult2, ClipperModule, ClipperOTPInfo, ClipperQueryArsEventsParams, ClipperQueryArsEventsResult, ClipperReferencesSearchParams, ClipperSearchFacetsResult, ClipperSearchParams, ClipperSearchResult, ClipperSendDocumentsByEmailParams, ClipperTaxonomyParams, ClipperUserLink, ClipperUserSearch } from '../definitions';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class ClipperService implements OnDestroy {
8
8
  private readonly REFRESH_INTERVAL;
@@ -41,13 +41,19 @@ export declare class ClipperService implements OnDestroy {
41
41
  */
42
42
  private setToken;
43
43
  /**
44
+ * Set JWT tokens
45
+ * @param valur : token
46
+ */
47
+ private setToken2;
48
+ /**
44
49
  * Enable JWT token auto refresh
45
50
  */
46
51
  private enableTokenRefresh;
47
52
  /**
48
53
  * Return current JWT token
54
+ * @param refresh: true to get the refresh token. Default is false.
49
55
  */
50
- getToken(): string;
56
+ getToken(refresh?: boolean): string;
51
57
  /**
52
58
  * Perform login
53
59
  * @param email: the optioanl email if using OAuth2
@@ -58,6 +64,16 @@ export declare class ClipperService implements OnDestroy {
58
64
  * @returns: the login result
59
65
  */
60
66
  login(email?: string | null | undefined, password?: string | null | undefined, remember?: boolean | null | undefined, oauth?: LoginOAuthType | null | undefined, oauthAccessToken?: string | null | undefined): Observable<ApiResult<ClipperLoginResult>>;
67
+ /**
68
+ * Perform login
69
+ * @param email: the optioanl email if using OAuth2
70
+ * @parma password: the optional password if using OAuth2
71
+ * @param remember: remember credentials
72
+ * @param oauth: the optional open authentication supported
73
+ * @param oauthAccessToken: the optional OAuth2 access token
74
+ * @returns: the login result
75
+ */
76
+ login2(email?: string | null | undefined, password?: string | null | undefined, remember?: boolean | null | undefined, oauth?: LoginOAuthType | null | undefined, oauthAccessToken?: string | null | undefined): Observable<ApiResult<ClipperLoginResult2>>;
61
77
  /**
62
78
  * Perform logout
63
79
  */
@@ -75,6 +91,10 @@ export declare class ClipperService implements OnDestroy {
75
91
  */
76
92
  private refresh;
77
93
  /**
94
+ * Perform token refresh
95
+ */
96
+ refresh2(): Observable<void>;
97
+ /**
78
98
  * Get a new one time password
79
99
  * @param id: the optional repository id
80
100
  */
@@ -149,3 +149,8 @@ export interface LoginResult<T> extends ApiResult<boolean> {
149
149
  context: T;
150
150
  token: string;
151
151
  }
152
+ export interface LoginResult2<T> extends ApiResult<boolean> {
153
+ context: T;
154
+ tokenInfo: [token: string, expires: Date];
155
+ refreshTokenInfo: [token: string, expires: Date];
156
+ }