@solidpepper/solidpepper-service 1.1.1 → 1.1.3

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.
@@ -1665,6 +1665,12 @@ class ExchangesConfigurationsService {
1665
1665
  overwrite: overwrite,
1666
1666
  }, options);
1667
1667
  }
1668
+ DeleteExchangeConfiguration(exchangeConfigurationGuid) {
1669
+ let headers = this._settings.getHeaders();
1670
+ return this.http.delete(this._settings.getSettings('apiUrl') +
1671
+ 'exchangesconfigurations/' +
1672
+ exchangeConfigurationGuid, { headers });
1673
+ }
1668
1674
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ExchangesConfigurationsService, deps: [{ token: i1.HttpClient }, { token: SettingsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1669
1675
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: ExchangesConfigurationsService, providedIn: 'root' }); }
1670
1676
  }
@@ -2274,6 +2280,12 @@ class MenuService {
2274
2280
  link: '/media/assets-selections',
2275
2281
  icon: 'fas fa-file-zipper',
2276
2282
  };
2283
+ const AssetsConversions = {
2284
+ rights: this.rightsAccesModule['rights']?.['Products']?.['Products']?.['MassUpdate']?.['functionIsActive'] ?? false,
2285
+ text: this.assetsConversionsLabel,
2286
+ link: '/media/conversions',
2287
+ icon: 'fas fa-wand-magic-sparkles',
2288
+ };
2277
2289
  // const WorkFlows = {
2278
2290
  // rights: this.rightsAccesModule['rights']['Workflows']['Workflows']['subModuleIsActive'],
2279
2291
  // text: this.workFlowsLabel,
@@ -2299,6 +2311,7 @@ class MenuService {
2299
2311
  RecentlyDeleted,
2300
2312
  AssetsProfiles,
2301
2313
  AssetsSelections,
2314
+ AssetsConversions,
2302
2315
  // WorkFlows,
2303
2316
  //AssetsOnHold,
2304
2317
  //AssetsFavorites,
@@ -2794,6 +2807,9 @@ class MenuService {
2794
2807
  tr.get('menu.media.ASSETSSELECTION').subscribe((res) => {
2795
2808
  this.assetsSelectionsLabel = res;
2796
2809
  });
2810
+ tr.get('menu.media.CONVERSIONS').subscribe((res) => {
2811
+ this.assetsConversionsLabel = res;
2812
+ });
2797
2813
  tr.get('menu.workflows.WORKFLOWS').subscribe((res) => {
2798
2814
  this.workFlowsLabel = res;
2799
2815
  });
@@ -4748,6 +4764,7 @@ class ExportsService {
4748
4764
  channelGuid: exchangeObject.channelGuid,
4749
4765
  exchangeOrder: exchangeObject.exchangeOrder,
4750
4766
  exportColumns: exchangeObject.exportColumns,
4767
+ attributesWithCode: exchangeObject.attributesWithCode
4751
4768
  }, options);
4752
4769
  }
4753
4770
  exportDownloadCate(exchangeObject) {
@@ -6281,67 +6298,41 @@ class SkusDeclinaisonsService {
6281
6298
  getHasDeclinaisons(skuGuid, archive = false) {
6282
6299
  let headers = this._settingsService.getHeaders();
6283
6300
  if (!archive) {
6284
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6285
- 'skus/' +
6286
- skuGuid +
6287
- '/hasskumodelisvariant', { headers });
6301
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skus/' + skuGuid + '/hasskumodelisvariant', { headers });
6288
6302
  }
6289
6303
  else {
6290
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6291
- 'skusArchive/' +
6292
- skuGuid +
6293
- '/hasskumodelisvariant', { headers });
6304
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skusArchive/' + skuGuid + '/hasskumodelisvariant', { headers });
6294
6305
  }
6295
6306
  }
6296
- getDeclinaiseons(skuGuid, archive = false, start = 0, limit = 15) {
6297
- let headers = this._settingsService.getHeaders();
6298
- if (!archive) {
6299
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6300
- 'skus/' +
6301
- skuGuid +
6302
- '/skumodelvariants?start=' +
6303
- start +
6304
- '&limit=' +
6305
- limit, { headers });
6306
- }
6307
- else {
6308
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6309
- 'skusArchive/' +
6310
- skuGuid +
6311
- '/skumodelvariants?start=' +
6312
- start +
6313
- '&limit=' +
6314
- limit, { headers });
6307
+ getDeclinaiseons(skuGuid, archive = false, start = 0, limit = 15, solidpepperFilters = null) {
6308
+ const headers = this._settingsService.getHeaders();
6309
+ const apiUrl = this._settingsService.getSettings('apiUrl');
6310
+ const endpoint = archive ? 'skusArchive/' : 'skus/';
6311
+ const params = {
6312
+ start: start.toString(),
6313
+ limit: limit.toString()
6314
+ };
6315
+ if (solidpepperFilters?.items?.length) {
6316
+ params.solidpepperFilters = JSON.stringify(solidpepperFilters);
6315
6317
  }
6318
+ return this.http.get(apiUrl + endpoint + skuGuid + '/skumodelvariants', { headers, params });
6316
6319
  }
6317
6320
  getDeclinaiseonsBySku(sku, archive = false) {
6318
6321
  let headers = this._settingsService.getHeaders();
6319
6322
  if (!archive) {
6320
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6321
- 'skus/' +
6322
- sku +
6323
- '/skumodelvariants?isSku=true', { headers });
6323
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skus/' + sku + '/skumodelvariants?isSku=true', { headers });
6324
6324
  }
6325
6325
  else {
6326
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6327
- 'skusArchive/' +
6328
- sku +
6329
- '/skumodelvariants?isSku=true', { headers });
6326
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skusArchive/' + sku + '/skumodelvariants?isSku=true', { headers });
6330
6327
  }
6331
6328
  }
6332
6329
  getAttribDec(skuGuid, archive = false) {
6333
6330
  let headers = this._settingsService.getHeaders();
6334
6331
  if (!archive) {
6335
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6336
- 'skus/' +
6337
- skuGuid +
6338
- '/attributesmodelvariant', { headers });
6332
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skus/' + skuGuid + '/attributesmodelvariant', { headers });
6339
6333
  }
6340
6334
  else {
6341
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6342
- 'skusArchive/' +
6343
- skuGuid +
6344
- '/attributesmodelvariant', { headers });
6335
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skusArchive/' + skuGuid + '/attributesmodelvariant', { headers });
6345
6336
  }
6346
6337
  }
6347
6338
  addDeclinaison(guid, skuName, obj, archive = false) {
@@ -6349,10 +6340,7 @@ class SkusDeclinaisonsService {
6349
6340
  let options = { headers: headers };
6350
6341
  if (!archive) {
6351
6342
  return this.http
6352
- .post(this._settingsService.getSettings('apiUrl') +
6353
- 'skus/' +
6354
- guid +
6355
- '/skumodelvariants', {
6343
+ .post(this._settingsService.getSettings('apiUrl') + 'skus/' + guid + '/skumodelvariants', {
6356
6344
  sku: skuName,
6357
6345
  skuAttributes: obj,
6358
6346
  }, options)
@@ -6363,10 +6351,7 @@ class SkusDeclinaisonsService {
6363
6351
  }
6364
6352
  else {
6365
6353
  return this.http
6366
- .post(this._settingsService.getSettings('apiUrl') +
6367
- 'skusArchive/' +
6368
- guid +
6369
- '/skumodelvariants', {
6354
+ .post(this._settingsService.getSettings('apiUrl') + 'skusArchive/' + guid + '/skumodelvariants', {
6370
6355
  sku: skuName,
6371
6356
  skuAttributes: obj,
6372
6357
  }, options)
@@ -6379,18 +6364,10 @@ class SkusDeclinaisonsService {
6379
6364
  getConfig(skuGuid, maskAttributeIsVariant = '', archive = false) {
6380
6365
  let headers = this._settingsService.getHeaders();
6381
6366
  if (!archive) {
6382
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6383
- 'skus/' +
6384
- skuGuid +
6385
- '/attributesmodelvariant?maskGuid=' +
6386
- maskAttributeIsVariant, { headers });
6367
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skus/' + skuGuid + '/attributesmodelvariant?maskGuid=' + maskAttributeIsVariant, { headers });
6387
6368
  }
6388
6369
  else {
6389
- return this.http.get(this._settingsService.getSettings('apiUrl') +
6390
- 'skusArchive/' +
6391
- skuGuid +
6392
- '/attributesmodelvariant?maskGuid=' +
6393
- maskAttributeIsVariant, { headers });
6370
+ return this.http.get(this._settingsService.getSettings('apiUrl') + 'skusArchive/' + skuGuid + '/attributesmodelvariant?maskGuid=' + maskAttributeIsVariant, { headers });
6394
6371
  }
6395
6372
  }
6396
6373
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SkusDeclinaisonsService, deps: [{ token: i1.HttpClient }, { token: SettingsService }, { token: websocketService }], target: i0.ɵɵFactoryTarget.Injectable }); }
@@ -12825,7 +12802,10 @@ class GenerationService {
12825
12802
  // CHUNKS
12826
12803
  const CHUNK_SIZE = 5 * 1024 * 1024;
12827
12804
  const totalChunks = Math.ceil(zipBlob.size / CHUNK_SIZE);
12828
- const uploadId = `${objectGeneratePDF.sourceGuid}_${Date.now()}`;
12805
+ const cleanSourceGuid = (objectGeneratePDF.sourceGuid || '')
12806
+ .toString()
12807
+ .replace(/[^a-zA-Z0-9_-]/g, '_');
12808
+ const uploadId = `${cleanSourceGuid}_${Date.now()}`;
12829
12809
  // CHUNKS LOOP
12830
12810
  for (let chunkIndex = 0; chunkIndex < totalChunks; chunkIndex++) {
12831
12811
  const start = chunkIndex * CHUNK_SIZE;
@@ -12936,6 +12916,13 @@ class ProductSheetsService {
12936
12916
  'Dam/product-sheets/asset/' +
12937
12917
  assetGuid, { headers });
12938
12918
  }
12919
+ exportProductSheetAsset(assetGuid) {
12920
+ let headers = this._settingsService.getHeaders();
12921
+ return this.http.get(this._settingsService.getSettings('apiUrl') +
12922
+ 'Dam/product-sheets/asset/' +
12923
+ assetGuid +
12924
+ '/export', { headers, responseType: 'blob' });
12925
+ }
12939
12926
  getProductSheetLines(productSheetGuid, start = 0, limit = 10000, summary = false) {
12940
12927
  let headers = this._settingsService.getHeaders();
12941
12928
  return this.http.get(this._settingsService.getSettings('apiUrl') +
@@ -15888,13 +15875,13 @@ class DocumentsService {
15888
15875
  '/' +
15889
15876
  version, { headers });
15890
15877
  }
15891
- createDocument(assetName, folderGuid) {
15878
+ createDocument(assetName, folderGuid, documentType = 'document') {
15892
15879
  let headers = this._settingsService.getHeaders();
15893
15880
  let options = { headers: headers };
15894
15881
  return this.http.post(this._settingsService.getSettings('apiUrl') + 'Dam/documents', {
15895
15882
  documentName: assetName,
15896
15883
  folderGuid: folderGuid,
15897
- documentType: 'document',
15884
+ documentType: documentType,
15898
15885
  }, options);
15899
15886
  }
15900
15887
  duplicateDocument(assetGuid, documentName, publicationGuid, folderGuid) {
@@ -16096,46 +16083,59 @@ class SearchDamAssetsService {
16096
16083
  this.headers = this._settingsService.getHeaders();
16097
16084
  this.queryUrl = '?search=';
16098
16085
  this.trashbinFilter = 'none';
16086
+ this.solidpepperFilters = null;
16087
+ }
16088
+ setSolidpepperFilters(filters) {
16089
+ this.solidpepperFilters = filters;
16099
16090
  }
16100
16091
  search(terms, stats, folderType = 'DAM', sort = null) {
16101
16092
  return combineLatest([terms, stats]).pipe(debounceTime(400), distinctUntilChanged(([t1, s1], [t2, s2]) => t1 === t2 && s1 === s2), switchMap((term) => this.searchEntries(term, folderType, sort)));
16102
16093
  }
16103
16094
  searchEntries(term, folderType, sortDirection) {
16104
- let headers = this._settingsService.getHeaders();
16095
+ const headers = this._settingsService.getHeaders();
16096
+ const filterQuery = this.getSolidpepperFiltersQuery();
16105
16097
  if (sortDirection) {
16106
- let sort = sortDirection.split('_')[0];
16107
- let direction = sortDirection.split('_')[1];
16098
+ const sort = sortDirection.split('_')[0];
16099
+ const direction = sortDirection.split('_')[1];
16108
16100
  return this.http
16109
16101
  .get(this._settingsService.getSettings('apiUrl') +
16110
16102
  'Dam/assets' +
16111
16103
  this.queryUrl +
16112
16104
  encodeURIComponent(term[0]) +
16113
16105
  '&status=' +
16114
- term[1] +
16106
+ encodeURIComponent(term[1] ?? '') +
16115
16107
  '&folderType=' +
16116
- folderType +
16108
+ encodeURIComponent(folderType) +
16117
16109
  '&sort=' +
16118
- sort +
16110
+ encodeURIComponent(sort) +
16119
16111
  '&direction=' +
16120
- direction +
16112
+ encodeURIComponent(direction) +
16121
16113
  '&trashbinMode=' +
16122
- this.trashbinFilter, { headers })
16114
+ encodeURIComponent(this.trashbinFilter) +
16115
+ filterQuery, { headers })
16123
16116
  .pipe(map$1((res) => res));
16124
16117
  }
16125
- else {
16126
- return this.http
16127
- .get(this._settingsService.getSettings('apiUrl') +
16128
- 'Dam/assets' +
16129
- this.queryUrl +
16130
- encodeURIComponent(term[0]) +
16131
- '&status=' +
16132
- term[1] +
16133
- '&folderType=' +
16134
- folderType +
16135
- '&trashbinMode=' +
16136
- this.trashbinFilter, { headers })
16137
- .pipe(map$1((res) => res));
16118
+ return this.http
16119
+ .get(this._settingsService.getSettings('apiUrl') +
16120
+ 'Dam/assets' +
16121
+ this.queryUrl +
16122
+ encodeURIComponent(term[0]) +
16123
+ '&status=' +
16124
+ encodeURIComponent(term[1] ?? '') +
16125
+ '&folderType=' +
16126
+ encodeURIComponent(folderType) +
16127
+ '&trashbinMode=' +
16128
+ encodeURIComponent(this.trashbinFilter) +
16129
+ filterQuery, { headers })
16130
+ .pipe(map$1((res) => res));
16131
+ }
16132
+ getSolidpepperFiltersQuery() {
16133
+ const hasRules = this.solidpepperFilters?.items?.some((item) => item.type === 'rule');
16134
+ if (!hasRules) {
16135
+ return '';
16138
16136
  }
16137
+ return ('&solidpepperFilters=' +
16138
+ encodeURIComponent(JSON.stringify(this.solidpepperFilters)));
16139
16139
  }
16140
16140
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SearchDamAssetsService, deps: [{ token: i1.HttpClient }, { token: SettingsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
16141
16141
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SearchDamAssetsService, providedIn: 'root' }); }
@@ -16263,6 +16263,7 @@ var AssetType;
16263
16263
  AssetType["FILE"] = "file";
16264
16264
  AssetType["PRODUCTSHEET"] = "productSheet";
16265
16265
  AssetType["DATASHEETFILE"] = "datasheetfile";
16266
+ AssetType["YOUBOOKY"] = "youbooky";
16266
16267
  AssetType["DOCUMENT"] = "document";
16267
16268
  AssetType["PUBLICATION"] = "publication";
16268
16269
  AssetType["TEMPLATE"] = "template";