@arsedizioni/ars-utils 21.2.123 → 21.2.125
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.
|
@@ -2233,9 +2233,6 @@ class ClipperService {
|
|
|
2233
2233
|
get teams() {
|
|
2234
2234
|
return this._teams;
|
|
2235
2235
|
}
|
|
2236
|
-
set teams(value) {
|
|
2237
|
-
this._teams = value;
|
|
2238
|
-
}
|
|
2239
2236
|
ngOnDestroy() {
|
|
2240
2237
|
if (this.broadcastServiceSubscription) {
|
|
2241
2238
|
this.broadcastServiceSubscription.unsubscribe();
|
|
@@ -2506,7 +2503,7 @@ class ClipperService {
|
|
|
2506
2503
|
* Update channel state
|
|
2507
2504
|
* @param value : the new dashboard result with updated channels and dashboard info
|
|
2508
2505
|
*/
|
|
2509
|
-
|
|
2506
|
+
setChannelsState(value) {
|
|
2510
2507
|
// Update channels
|
|
2511
2508
|
if (this._loginInfo) {
|
|
2512
2509
|
this._loginInfo.channels = value.channels ?? [];
|
|
@@ -3116,6 +3113,162 @@ class ClipperService {
|
|
|
3116
3113
|
downloadArchiveFile(id, otp) {
|
|
3117
3114
|
return this.httpClient.get(this._serviceUri + '/archive/files/download/?id=' + id + '&otp=' + (otp ?? ''), { responseType: 'blob' });
|
|
3118
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
|
+
queryContacts(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
|
+
}
|
|
3119
3272
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClipperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3120
3273
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: ClipperService, providedIn: 'root' }); }
|
|
3121
3274
|
}
|