@arsedizioni/ars-utils 21.2.122 → 21.2.124

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.
@@ -2499,6 +2499,36 @@ class ClipperService {
2499
2499
  // Reset login
2500
2500
  this.reset();
2501
2501
  }
2502
+ /**
2503
+ * Update channel state
2504
+ * @param value : the new dashboard result with updated channels and dashboard info
2505
+ */
2506
+ setChannelsState(value) {
2507
+ // Update channels
2508
+ if (this._loginInfo) {
2509
+ this._loginInfo.channels = value.channels ?? [];
2510
+ }
2511
+ // Update dashboard
2512
+ this.dashboard.documentUpdates = value.documentUpdates;
2513
+ this.dashboard.expiredDeadlines = value.expiredDeadlines;
2514
+ this.dashboard.expiringDeadlines = value.expiringDeadlines;
2515
+ this.dashboard.isTrial = value.isTrial;
2516
+ this.dashboard.items.set(value.items ?? []);
2517
+ this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
2518
+ this.storeContext();
2519
+ this.initializeChannels();
2520
+ }
2521
+ /**
2522
+ * Update channels
2523
+ * @param channels: the new channels settings
2524
+ */
2525
+ setChannels(channels) {
2526
+ if (this._loginInfo) {
2527
+ this._loginInfo.channels = channels;
2528
+ this.storeContext();
2529
+ this.initializeChannels();
2530
+ }
2531
+ }
2502
2532
  /**
2503
2533
  * Initialize channels
2504
2534
  */
@@ -2731,23 +2761,6 @@ class ClipperService {
2731
2761
  this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
2732
2762
  }
2733
2763
  ///
2734
- // LINKS
2735
- ///
2736
- /**
2737
- * Save a user link
2738
- * @param item: the user link
2739
- */
2740
- saveLink(item) {
2741
- return this.httpClient.post(this._serviceUri + '/account/links/save', item);
2742
- }
2743
- /**
2744
- * Delete a user link
2745
- * @param item: the user link
2746
- */
2747
- deleteLink(item) {
2748
- return this.httpClient.post(this._serviceUri + '/account/links/delete', item);
2749
- }
2750
- ///
2751
2764
  // BAG - WORKING DOCUMENTS
2752
2765
  ///
2753
2766
  /**
@@ -2883,136 +2896,6 @@ class ClipperService {
2883
2896
  .post(this.serviceUri + '/documents/searches/delete', { id: id });
2884
2897
  }
2885
2898
  ///
2886
- // USER SETTINGS AND TRIAL
2887
- ///
2888
- /**
2889
- * Reset a user password
2890
- * @param params parameters
2891
- */
2892
- resetPassword(params) {
2893
- return this.httpClient.post(this._serviceUri + '/account/password/reset', params);
2894
- }
2895
- /**
2896
- * Recover password
2897
- * @param params parameters
2898
- */
2899
- recoverPassword(params) {
2900
- return this.httpClient.post(this._serviceUri + '/account/password/recover', params);
2901
- }
2902
- /**
2903
- * Update settings
2904
- * @param params parameters
2905
- */
2906
- updateSettings(params) {
2907
- return this.httpClient.post(this._serviceUri + '/account/settings/update', params).pipe(map(r => {
2908
- if (r.success) {
2909
- if (params.channels) {
2910
- // Update channels
2911
- if (this._loginInfo) {
2912
- this._loginInfo.channels = params.channels;
2913
- this.storeContext();
2914
- this.initializeChannels();
2915
- }
2916
- }
2917
- }
2918
- return r;
2919
- }));
2920
- }
2921
- /**
2922
- * Update channel state
2923
- * @param id: the channel id (1, 2, 3, 4)
2924
- */
2925
- updateChannelsState(params) {
2926
- return this.httpClient.post(this._serviceUri + '/account/settings/channels/update', params).pipe(map(r => {
2927
- if (r.success) {
2928
- // Update channels
2929
- if (this._loginInfo) {
2930
- this._loginInfo.channels = r.value.channels ?? [];
2931
- }
2932
- // Update dashboard
2933
- this.dashboard.documentUpdates = r.value.documentUpdates;
2934
- this.dashboard.expiredDeadlines = r.value.expiredDeadlines;
2935
- this.dashboard.expiringDeadlines = r.value.expiringDeadlines;
2936
- this.dashboard.isTrial = r.value.isTrial;
2937
- this.dashboard.items.set(r.value.items ?? []);
2938
- this.broadcastService.sendMessage(ClipperMessages.COMMAND_DASHBOARD_UPDATED);
2939
- this.storeContext();
2940
- this.initializeChannels();
2941
- }
2942
- return r;
2943
- }));
2944
- }
2945
- /**
2946
- * Get trial info
2947
- */
2948
- getTrialInfo() {
2949
- return this.httpClient.get(this._serviceUri + '/account/trial');
2950
- }
2951
- /**
2952
- * Update trial info
2953
- */
2954
- updateTrialInfo() {
2955
- if (!this._loginInfo || this._loginInfo?.context?.hasTrial === false)
2956
- return; // Not supported
2957
- this.getTrialInfo().subscribe((r) => {
2958
- if (r.success) {
2959
- if (this._loginInfo?.context) {
2960
- if (r.value) {
2961
- this._loginInfo.context.hasTrial = true;
2962
- this._loginInfo.context.trialInfo = r.value;
2963
- }
2964
- else {
2965
- this._loginInfo.context.hasTrial = false;
2966
- this._loginInfo.context.trialInfo = undefined;
2967
- }
2968
- }
2969
- }
2970
- });
2971
- }
2972
- ///
2973
- // TEAMS
2974
- ///
2975
- /**
2976
- * Rename a team
2977
- * @param newName : the new name
2978
- */
2979
- renameTeam(newName) {
2980
- return this.httpClient.post(this._serviceUri + '/account/teams/update', { title: newName });
2981
- }
2982
- /**
2983
- * Retrieve teams
2984
- */
2985
- getTeams(params) {
2986
- return this.httpClient.post(this._serviceUri + '/account/teams', params)
2987
- .pipe(map((r) => {
2988
- // Store teams
2989
- if (!params.adminsOnly) {
2990
- this._teams = r.value.items;
2991
- }
2992
- return r;
2993
- }));
2994
- }
2995
- /**
2996
- * Retrieve team members
2997
- */
2998
- getTeamMembers(params) {
2999
- return this.httpClient.post(this._serviceUri + '/account/teams/members', params);
3000
- }
3001
- /**
3002
- * Delete members
3003
- * @param ids: the id list to delete
3004
- */
3005
- deleteTeamMembers(ids) {
3006
- return this.httpClient.post(this._serviceUri + '/account/teams/members/delete', { ids: ids });
3007
- }
3008
- /**
3009
- * Save member
3010
- * @param item: the item to save
3011
- */
3012
- saveTeamMember(item) {
3013
- return this.httpClient.post(this._serviceUri + '/account/teams/members/save', item);
3014
- }
3015
- ///
3016
2899
  // CALENDAR
3017
2900
  ///
3018
2901
  /**
@@ -3230,6 +3113,162 @@ class ClipperService {
3230
3113
  downloadArchiveFile(id, otp) {
3231
3114
  return this.httpClient.get(this._serviceUri + '/archive/files/download/?id=' + id + '&otp=' + (otp ?? ''), { responseType: 'blob' });
3232
3115
  }
3116
+ ///
3117
+ // ACCOUNT AND SETTINGS
3118
+ ///
3119
+ /**
3120
+ * Reset a user password
3121
+ * @param params parameters
3122
+ */
3123
+ resetPassword(params) {
3124
+ return this.httpClient.post(this._serviceUri + '/account/password/reset', params);
3125
+ }
3126
+ /**
3127
+ * Recover password
3128
+ * @param params parameters
3129
+ */
3130
+ recoverPassword(params) {
3131
+ return this.httpClient.post(this._serviceUri + '/account/password/recover', params);
3132
+ }
3133
+ /**
3134
+ * Update settings
3135
+ * @param params parameters
3136
+ */
3137
+ updateSettings(params) {
3138
+ return this.httpClient.post(this._serviceUri + '/account/settings/update', params).pipe(map(r => {
3139
+ if (r.success) {
3140
+ if (params.channels) {
3141
+ this.setChannels(params.channels);
3142
+ }
3143
+ }
3144
+ return r;
3145
+ }));
3146
+ }
3147
+ /**
3148
+ * Update channel state
3149
+ * @param id: the channel id (1, 2, 3, 4)
3150
+ */
3151
+ updateChannelsState(params) {
3152
+ return this.httpClient.post(this._serviceUri + '/account/settings/channels/update', params).pipe(map(r => {
3153
+ if (r.success) {
3154
+ this.setChannelsState(r.value);
3155
+ }
3156
+ return r;
3157
+ }));
3158
+ }
3159
+ ///
3160
+ // TRIAL
3161
+ ///
3162
+ /**
3163
+ * Get trial info
3164
+ */
3165
+ getTrialInfo() {
3166
+ return this.httpClient.get(this._serviceUri + '/account/trial');
3167
+ }
3168
+ /**
3169
+ * Update trial info
3170
+ */
3171
+ updateTrialInfo() {
3172
+ if (!this._loginInfo || this._loginInfo?.context?.hasTrial === false)
3173
+ return; // Not supported
3174
+ this.getTrialInfo().subscribe((r) => {
3175
+ if (r.success) {
3176
+ if (this._loginInfo?.context) {
3177
+ if (r.value) {
3178
+ this._loginInfo.context.hasTrial = true;
3179
+ this._loginInfo.context.trialInfo = r.value;
3180
+ }
3181
+ else {
3182
+ this._loginInfo.context.hasTrial = false;
3183
+ this._loginInfo.context.trialInfo = undefined;
3184
+ }
3185
+ }
3186
+ }
3187
+ });
3188
+ }
3189
+ ///
3190
+ // LINKS
3191
+ ///
3192
+ /**
3193
+ * Save a user link
3194
+ * @param item: the user link
3195
+ */
3196
+ saveLink(item) {
3197
+ return this.httpClient.post(this._serviceUri + '/account/links/save', item);
3198
+ }
3199
+ /**
3200
+ * Delete a user link
3201
+ * @param item: the user link
3202
+ */
3203
+ deleteLink(item) {
3204
+ return this.httpClient.post(this._serviceUri + '/account/links/delete', item);
3205
+ }
3206
+ ///
3207
+ // TEAMS
3208
+ ///
3209
+ /**
3210
+ * Rename a team
3211
+ * @param newName : the new name
3212
+ */
3213
+ renameTeam(newName) {
3214
+ return this.httpClient.post(this._serviceUri + '/account/teams/update', { title: newName });
3215
+ }
3216
+ /**
3217
+ * Retrieve teams
3218
+ */
3219
+ getTeams(params) {
3220
+ return this.httpClient.post(this._serviceUri + '/account/teams', params)
3221
+ .pipe(map((r) => {
3222
+ // Store teams
3223
+ if (!params.adminsOnly) {
3224
+ this._teams = r.value.items;
3225
+ }
3226
+ return r;
3227
+ }));
3228
+ }
3229
+ /**
3230
+ * Retrieve team members
3231
+ */
3232
+ getTeamMembers(params) {
3233
+ return this.httpClient.post(this._serviceUri + '/account/teams/members', params);
3234
+ }
3235
+ /**
3236
+ * Delete members
3237
+ * @param ids: the id list to delete
3238
+ */
3239
+ deleteTeamMembers(ids) {
3240
+ return this.httpClient.post(this._serviceUri + '/account/teams/members/delete', { ids: ids });
3241
+ }
3242
+ /**
3243
+ * Save member
3244
+ * @param item: the item to save
3245
+ */
3246
+ saveTeamMember(item) {
3247
+ return this.httpClient.post(this._serviceUri + '/account/teams/members/save', item);
3248
+ }
3249
+ ///
3250
+ // CONTACTS
3251
+ ///
3252
+ /**
3253
+ * Retrieve contacts
3254
+ */
3255
+ getContacts(params) {
3256
+ return this.httpClient.post(this._serviceUri + '/account/contacts', params);
3257
+ }
3258
+ /**
3259
+ * Delete contacts
3260
+ * @param ids: the id list to delete
3261
+ */
3262
+ deleteContacts(ids) {
3263
+ return this.httpClient.post(this._serviceUri + '/account/contacts/delete', { ids: ids });
3264
+ }
3265
+ /**
3266
+ * Save member
3267
+ * @param item: the item to save
3268
+ */
3269
+ saveContact(item) {
3270
+ return this.httpClient.post(this._serviceUri + '/account/contacts/save', item);
3271
+ }
3233
3272
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClipperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3234
3273
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClipperService, providedIn: 'root' }); }
3235
3274
  }