@arsedizioni/ars-utils 19.1.50 → 19.1.52

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.
@@ -85,6 +85,9 @@ export declare const ClipperSectors: SectorInfo[];
85
85
  export declare const ClipperSectorTypes: NameValueItem<string>[];
86
86
  export declare const ClipperAuthors: SectorInfo[];
87
87
  export declare const ClipperSources: NameValueItem<string>[];
88
+ export declare class ClipperUpdateChannelsStateParams {
89
+ activeChannels: ClipperChannelSettings[];
90
+ }
88
91
  export interface ClipperChannelSettingsItem<T> {
89
92
  name: string;
90
93
  value: T;
@@ -149,8 +152,8 @@ export interface ClipperLoginResult extends LoginResult<ClipperUserInfo> {
149
152
  export interface ClipperLoginInfo {
150
153
  context: ClipperUserInfo;
151
154
  complianceContext?: any | null;
152
- userSettings?: ClipperChannelSettings[] | null;
153
- userCredentials?: string | null;
155
+ channels?: ClipperChannelSettings[] | null;
156
+ credentials?: string | null;
154
157
  OAUTH?: LoginOAuthType | null;
155
158
  }
156
159
  export declare class ClipperSearchParams {
@@ -530,6 +533,7 @@ export interface ClipperDashboardResult {
530
533
  expiredDeadlines?: number | null;
531
534
  expiringDeadlines?: number | null;
532
535
  documentUpdates?: number | null;
536
+ channels?: ClipperChannelSettings[] | null;
533
537
  }
534
538
  export declare class ClipperDashboard {
535
539
  items: import("@angular/core").WritableSignal<ClipperDashboardItem[]>;
@@ -3,7 +3,7 @@ import { ApiResult, Folder, FolderTree, NameValueItem } from '@arsedizioni/ars-u
3
3
  import { RecoverPasswordDialogData, RecoverPasswordDialogResult, ResetPasswordDialogResult } from '@arsedizioni/ars-utils/ui';
4
4
  import { LoginOAuthType } from '@arsedizioni/ars-utils/ui.oauth';
5
5
  import { Subscription } from 'rxjs';
6
- import { ClipperServiceFlags, ClipperDashboard, ClipperDashboardResult, ClipperDocumentInfo, ClipperDocumentStructure, ClipperDocumentUpdateStateParams, ClipperExportDocumentsParams, ClipperLoginInfo, ClipperLoginResult, ClipperModule, ClipperOTPInfo, ClipperSearchArsEventsParams, ClipperSearchArsEventsResult, ClipperReferencesSearchParams, ClipperSearchFacetsResult, ClipperSearchParams, ClipperSearchResult, ClipperSendDocumentsByEmailParams, ClipperTaxonomyParams, ClipperUserLink, ClipperUserSearch, ClipperTeamMemberInfo, ClipperTeamsSearchParams, ClipperTeamsSearchResult, ClipperTeamInfo, ClipperTeamMembersSearchResult, ClipperCalendarSearchParams, ClipperCalendarSearchResult, ClipperSearchCalendarSnapshotResult, ClipperCalendarCopyDeadlinesParams, ClipperDeadlineInfo, ClipperCalendarSaveDeadlineParams, ClipperArchiveFoldersSearchParams, ClipperArchiveFoldersSearchResult, ClipperArchiveFileInfo, ClipperArchiveFoldersImportParams, ClipperArchiveFilesSearchResult, ClipperArchiveFilesDeleteParams, ClipperArchiveFilesCopyParams, ClipperArchiveFilesSearchParams, ClipperModel, ClipperChannel, ClipperLastDaysResult } from '../definitions';
6
+ import { ClipperServiceFlags, ClipperDashboard, ClipperDashboardResult, ClipperDocumentInfo, ClipperDocumentStructure, ClipperDocumentUpdateStateParams, ClipperExportDocumentsParams, ClipperLoginInfo, ClipperLoginResult, ClipperModule, ClipperOTPInfo, ClipperSearchArsEventsParams, ClipperSearchArsEventsResult, ClipperReferencesSearchParams, ClipperSearchFacetsResult, ClipperSearchParams, ClipperSearchResult, ClipperSendDocumentsByEmailParams, ClipperTaxonomyParams, ClipperUserLink, ClipperUserSearch, ClipperTeamMemberInfo, ClipperTeamsSearchParams, ClipperTeamsSearchResult, ClipperTeamInfo, ClipperTeamMembersSearchResult, ClipperCalendarSearchParams, ClipperCalendarSearchResult, ClipperSearchCalendarSnapshotResult, ClipperCalendarCopyDeadlinesParams, ClipperDeadlineInfo, ClipperCalendarSaveDeadlineParams, ClipperArchiveFoldersSearchParams, ClipperArchiveFoldersSearchResult, ClipperArchiveFileInfo, ClipperArchiveFoldersImportParams, ClipperArchiveFilesSearchResult, ClipperArchiveFilesDeleteParams, ClipperArchiveFilesCopyParams, ClipperArchiveFilesSearchParams, ClipperModel, ClipperChannel, ClipperLastDaysResult, ClipperUpdateChannelsStateParams } from '../definitions';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class ClipperService implements OnDestroy {
9
9
  private httpClient;
@@ -119,7 +119,7 @@ export declare class ClipperService implements OnDestroy {
119
119
  /**
120
120
  * Initialize channels
121
121
  */
122
- private initializeChannels;
122
+ initializeChannels(): void;
123
123
  /**
124
124
  * Update channels
125
125
  * @param values : the new channel values
@@ -292,7 +292,7 @@ export declare class ClipperService implements OnDestroy {
292
292
  * Update channel state
293
293
  * @param id: the channel id (1, 2, 3, 4)
294
294
  */
295
- updateChannelState(id: number, enabled: boolean): import("rxjs").Observable<ApiResult<ClipperDashboardResult>>;
295
+ updateChannelsState(params: ClipperUpdateChannelsStateParams): import("rxjs").Observable<ApiResult<ClipperDashboardResult>>;
296
296
  /**
297
297
  * Get trial info
298
298
  */
@@ -1404,6 +1404,8 @@ const ClipperSources = [
1404
1404
  name: 'Fonti diverse',
1405
1405
  }
1406
1406
  ];
1407
+ class ClipperUpdateChannelsStateParams {
1408
+ }
1407
1409
  class ClipperChannelSettings {
1408
1410
  constructor() {
1409
1411
  this.isEnabled = false;
@@ -2385,11 +2387,11 @@ class ClipperService {
2385
2387
  this.setToken(r.value);
2386
2388
  const loginInfo = {
2387
2389
  context: r.value.context,
2388
- userSettings: r.value.settings,
2390
+ channels: r.value.settings,
2389
2391
  OAUTH: oauth
2390
2392
  };
2391
2393
  if (!oauth) {
2392
- loginInfo.userCredentials =
2394
+ loginInfo.credentials =
2393
2395
  SystemUtils.cipher(JSON.stringify({
2394
2396
  email: email,
2395
2397
  password: password,
@@ -2466,7 +2468,7 @@ class ClipperService {
2466
2468
  initializeChannels() {
2467
2469
  if (this.loggedIn()) {
2468
2470
  let channels = [];
2469
- this.loginInfo?.userSettings?.forEach(n => {
2471
+ this.loginInfo?.channels?.forEach(n => {
2470
2472
  if (n.isActive) {
2471
2473
  const channel = ClipperChannels.find(x => x.value === n.channelId);
2472
2474
  if (channel) {
@@ -2859,17 +2861,30 @@ class ClipperService {
2859
2861
  * @param params parameters
2860
2862
  */
2861
2863
  updateSettings(params) {
2862
- return this.httpClient.post(this._serviceUri + '/account/settings/update', params);
2864
+ return this.httpClient.post(this._serviceUri + '/account/settings/update', params).pipe(map(r => {
2865
+ if (r.success) {
2866
+ if (params.channels) {
2867
+ // Update channels
2868
+ this._loginInfo.channels = params.channels;
2869
+ this.initializeChannels();
2870
+ }
2871
+ }
2872
+ return r;
2873
+ }));
2863
2874
  }
2864
2875
  /**
2865
2876
  * Update channel state
2866
2877
  * @param id: the channel id (1, 2, 3, 4)
2867
2878
  */
2868
- updateChannelState(id, enabled) {
2869
- return this.httpClient.post(this._serviceUri + '/account/settings/channels/update', {
2870
- channelId: id,
2871
- isEnabled: enabled,
2872
- });
2879
+ updateChannelsState(params) {
2880
+ return this.httpClient.post(this._serviceUri + '/account/settings/channels/update', params).pipe(map(r => {
2881
+ if (r.success) {
2882
+ // Update channels
2883
+ this._loginInfo.channels = r.value.channels ?? [];
2884
+ this.initializeChannels();
2885
+ }
2886
+ return r;
2887
+ }));
2873
2888
  }
2874
2889
  /**
2875
2890
  * Get trial info
@@ -3157,10 +3172,10 @@ class ClipperService {
3157
3172
  downloadArchiveFile(id, otp = null) {
3158
3173
  return this.httpClient.get(this._serviceUri + '/archive/files/download/?id=' + id + '&otp=' + (otp ?? ''), { responseType: 'blob' });
3159
3174
  }
3160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClipperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3161
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClipperService, providedIn: 'root' }); }
3175
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ClipperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3176
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ClipperService, providedIn: 'root' }); }
3162
3177
  }
3163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClipperService, decorators: [{
3178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ClipperService, decorators: [{
3164
3179
  type: Injectable,
3165
3180
  args: [{
3166
3181
  providedIn: 'root',
@@ -3253,19 +3268,19 @@ class ClipperAuthInterceptor {
3253
3268
  }
3254
3269
  return request;
3255
3270
  }
3256
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClipperAuthInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3257
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClipperAuthInterceptor }); }
3271
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ClipperAuthInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3272
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ClipperAuthInterceptor }); }
3258
3273
  }
3259
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ClipperAuthInterceptor, decorators: [{
3274
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ClipperAuthInterceptor, decorators: [{
3260
3275
  type: Injectable
3261
3276
  }] });
3262
3277
 
3263
3278
  class ArsClipperCommonModule {
3264
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ArsClipperCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3265
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: ArsClipperCommonModule }); }
3266
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ArsClipperCommonModule }); }
3279
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ArsClipperCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3280
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.1", ngImport: i0, type: ArsClipperCommonModule }); }
3281
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ArsClipperCommonModule }); }
3267
3282
  }
3268
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: ArsClipperCommonModule, decorators: [{
3283
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.1", ngImport: i0, type: ArsClipperCommonModule, decorators: [{
3269
3284
  type: NgModule
3270
3285
  }] });
3271
3286
 
@@ -3277,5 +3292,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
3277
3292
  * Generated bundle index. Do not edit.
3278
3293
  */
3279
3294
 
3280
- export { ArsClipperCommonModule, ClipperArchiveCopyMode, ClipperArchiveFileStorageType, ClipperArchiveFileStorageTypes, ClipperArchiveFileType, ClipperArchiveFileTypes, ClipperArchiveFilesSearchParams, ClipperArchiveFoldersSearchParams, ClipperAuthInterceptor, ClipperAuthors, ClipperCalendarCopyMode, ClipperCalendarSearchParams, ClipperCalendarState, ClipperCalendarStates, ClipperChannel, ClipperChannelSettings, ClipperChannels, ClipperDashboard, ClipperDocumentChangeReasons, ClipperDocumentContainer, ClipperExportDocumentsFormat, ClipperFacet, ClipperMessages, ClipperModel, ClipperModels, ClipperModule, ClipperModuleGroup, ClipperModuleGroups, ClipperModules, ClipperQueryReferencesMode, ClipperRecurrenceType, ClipperRecurrenceTypes, ClipperRegions, ClipperSearchCalendarSnapshotResult, ClipperSearchFacetsSnapshot, ClipperSearchParams, ClipperSearchResult, ClipperSearchUtils, ClipperSectorTypes, ClipperSectors, ClipperSelectionMode, ClipperService, ClipperServiceFlags, ClipperSort, ClipperSources, ClipperTeamInfo, ClipperTeamMemberInfo, ClipperTeamProduct, ClipperTeamProductPermission, ClipperUtils };
3295
+ export { ArsClipperCommonModule, ClipperArchiveCopyMode, ClipperArchiveFileStorageType, ClipperArchiveFileStorageTypes, ClipperArchiveFileType, ClipperArchiveFileTypes, ClipperArchiveFilesSearchParams, ClipperArchiveFoldersSearchParams, ClipperAuthInterceptor, ClipperAuthors, ClipperCalendarCopyMode, ClipperCalendarSearchParams, ClipperCalendarState, ClipperCalendarStates, ClipperChannel, ClipperChannelSettings, ClipperChannels, ClipperDashboard, ClipperDocumentChangeReasons, ClipperDocumentContainer, ClipperExportDocumentsFormat, ClipperFacet, ClipperMessages, ClipperModel, ClipperModels, ClipperModule, ClipperModuleGroup, ClipperModuleGroups, ClipperModules, ClipperQueryReferencesMode, ClipperRecurrenceType, ClipperRecurrenceTypes, ClipperRegions, ClipperSearchCalendarSnapshotResult, ClipperSearchFacetsSnapshot, ClipperSearchParams, ClipperSearchResult, ClipperSearchUtils, ClipperSectorTypes, ClipperSectors, ClipperSelectionMode, ClipperService, ClipperServiceFlags, ClipperSort, ClipperSources, ClipperTeamInfo, ClipperTeamMemberInfo, ClipperTeamProduct, ClipperTeamProductPermission, ClipperUpdateChannelsStateParams, ClipperUtils };
3281
3296
  //# sourceMappingURL=arsedizioni-ars-utils-clipper.common.mjs.map