@sitecore/sc-contenthub-webclient-sdk 1.2.4 → 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.
- package/dist/mappers/entity-mapper.js +4 -0
- package/dist/mappers/related-path-mapper.d.ts +3 -0
- package/dist/mappers/related-path-mapper.js +10 -0
- package/dist/models/entity-path.d.ts +2 -0
- package/dist/models/entity-path.js +8 -0
- package/dist/models/search/field-filter-request-resource.d.ts +1 -0
- package/dist/models/search/field-filter-request-resource.js +4 -0
- package/package.json +1 -1
|
@@ -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
|
|
@@ -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);
|
|
@@ -3,6 +3,7 @@ import { FilterOperator } from "./filter-operator";
|
|
|
3
3
|
import { RequestedFilterType } from "./requested-filter-type";
|
|
4
4
|
export declare class FieldFilterRequestResource {
|
|
5
5
|
fieldName: string;
|
|
6
|
+
definitionName?: string;
|
|
6
7
|
groupIdentifier?: string;
|
|
7
8
|
operator: FilterOperator;
|
|
8
9
|
values: Array<unknown>;
|
|
@@ -30,6 +30,10 @@ __decorate([
|
|
|
30
30
|
(0, ta_json_1.JsonProperty)("name"),
|
|
31
31
|
__metadata("design:type", String)
|
|
32
32
|
], FieldFilterRequestResource.prototype, "fieldName", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, ta_json_1.JsonProperty)("definition"),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], FieldFilterRequestResource.prototype, "definitionName", void 0);
|
|
33
37
|
__decorate([
|
|
34
38
|
(0, ta_json_1.JsonProperty)("group_identifier"),
|
|
35
39
|
__metadata("design:type", String)
|