@sitecore/sc-contenthub-webclient-sdk 1.2.5 → 1.2.6

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.
@@ -111,10 +111,12 @@ class EntityMapper {
111
111
  const modifiedBy = entity.modifiedBy
112
112
  ? yield this._client.linkHelper.entityToLinkAsync(entity.modifiedBy)
113
113
  : undefined;
114
+ const relatedPaths = this._relatedPathMapper.mapToResource(entity);
114
115
  const resource = new entity_resource_1.EntityResource({
115
116
  entityDefinition: definitionLink,
116
117
  id: entity.id || 0,
117
118
  identifier: entity.identifier,
119
+ cultures: entity.cultures.map(x => x),
118
120
  isRootTaxonomyItem: entity.isRootTaxonomyItem,
119
121
  isPathRoot: entity.isPathRoot,
120
122
  inheritsSecurity: entity.inheritsSecurity,
@@ -133,6 +135,8 @@ class EntityMapper {
133
135
  modules: entity.modules,
134
136
  roles: entity.roles,
135
137
  permissions: entity.permissions,
138
+ path: entity.path,
139
+ relatedPaths: relatedPaths,
136
140
  lockedOn: entity.lockedOn,
137
141
  lockedBy: lockedBy,
138
142
  createdOn: entity.createdOn,
@@ -1,5 +1,8 @@
1
+ import { MapStringTo } from "../base-types";
2
+ import { IEntity } from "../contracts/base/entity";
1
3
  import { IRelatedPath } from "../contracts/base/related-path";
2
4
  import { EntityResource } from "../models/entity-resource";
3
5
  export declare class RelatedPathMapper {
4
6
  mapRelatedPaths(resource: EntityResource): Array<IRelatedPath>;
7
+ mapToResource(entity: IEntity): MapStringTo<unknown> | undefined;
5
8
  }
@@ -26,6 +26,16 @@ class RelatedPathMapper {
26
26
  }
27
27
  return list;
28
28
  }
29
+ mapToResource(entity) {
30
+ if (entity == null || entity.relatedPaths == null || Object.keys(entity.relatedPaths).length === 0) {
31
+ return undefined;
32
+ }
33
+ const list = {};
34
+ for (const relatedPath of entity.relatedPaths) {
35
+ list[relatedPath.name] = relatedPath.items;
36
+ }
37
+ return list;
38
+ }
29
39
  }
30
40
  exports.RelatedPathMapper = RelatedPathMapper;
31
41
  //# sourceMappingURL=related-path-mapper.js.map
@@ -1,4 +1,6 @@
1
1
  import { MapCultureTo } from "base-types";
2
2
  export declare class EntityPath {
3
3
  values: MapCultureTo<string>;
4
+ entity: string;
5
+ definition: string;
4
6
  }
@@ -17,6 +17,14 @@ __decorate([
17
17
  (0, ta_json_1.JsonProperty)("values"),
18
18
  __metadata("design:type", Object)
19
19
  ], EntityPath.prototype, "values", void 0);
20
+ __decorate([
21
+ (0, ta_json_1.JsonProperty)("entity"),
22
+ __metadata("design:type", String)
23
+ ], EntityPath.prototype, "entity", void 0);
24
+ __decorate([
25
+ (0, ta_json_1.JsonProperty)("definition"),
26
+ __metadata("design:type", String)
27
+ ], EntityPath.prototype, "definition", void 0);
20
28
  EntityPath = __decorate([
21
29
  (0, ta_json_1.JsonObject)()
22
30
  ], EntityPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore/sc-contenthub-webclient-sdk",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Sitecore Content Hub WebClient SDK.",
5
5
  "scripts": {
6
6
  "build": "npm run clean && npm run test && tsc && npm run lint",