Skip to content

Commit 3023cfe

Browse files
committed
adjust object mapper naming
1 parent e889c72 commit 3023cfe

14 files changed

+24
-24
lines changed

src/Documents/Commands/FacetQueryCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class FacetQueryCommand extends QueryCommand {
4747

4848
const [results, includes, rest] = await Promise.all([resultsPromise, includesPromise, restPromise]);
4949
const rawResult = Object.assign({} as any, rest, { results, includes }) as QueryResult;
50-
const queryResult = conventions.entityObjectMapper.fromObjectLiteral<QueryResult>(rawResult, {
50+
const queryResult = conventions.objectMapper.fromObjectLiteral<QueryResult>(rawResult, {
5151
typeName: QueryResult.name,
5252
nestedTypes: {
5353
indexTimestamp: "date",

src/Documents/Commands/GetConflictsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class GetConflictsCommand extends RavenCommand<GetConflictsResult> {
3737
let body: string = null;
3838
await this._defaultPipeline(_ => body = _).process(bodyStream)
3939
.then(results => {
40-
this.result = this._conventions.entityObjectMapper.fromObjectLiteral(results, {
40+
this.result = this._conventions.objectMapper.fromObjectLiteral(results, {
4141
nestedTypes: {
4242
"results[].lastModified": "Date"
4343
}

src/Documents/Commands/QueryCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class QueryCommand extends RavenCommand<QueryResult> {
112112

113113
const [results, includes, rest] = await Promise.all([resultsPromise, includesPromise, restPromise]);
114114
const rawResult = Object.assign({} as any, rest, { results, includes }) as QueryResult;
115-
const queryResult = conventions.entityObjectMapper
115+
const queryResult = conventions.objectMapper
116116
.fromObjectLiteral<QueryResult>(rawResult, {
117117
typeName: QueryResult.name,
118118
nestedTypes: {

src/Documents/Conventions/DocumentConventions.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class DocumentConventions {
7070
private _localEntityFieldNameConvention: CasingConvention;
7171
private _remoteEntityFieldNameConvention: CasingConvention;
7272

73-
private _entityObjectMapper: TypesAwareObjectMapper;
73+
private _objectMapper: TypesAwareObjectMapper;
7474

7575
private _useCompression;
7676

@@ -110,20 +110,20 @@ export class DocumentConventions {
110110
this._maxHttpCacheSize = 128 * 1024 * 1024;
111111

112112
this._knownEntityTypes = new Map();
113-
this._entityObjectMapper = new TypesAwareObjectMapper({
113+
this._objectMapper = new TypesAwareObjectMapper({
114114
dateFormat: DateUtil.DEFAULT_DATE_FORMAT,
115115
documentConventions: this
116116
});
117117

118118
this._useCompression = null;
119119
}
120120

121-
public get entityObjectMapper(): TypesAwareObjectMapper {
122-
return this._entityObjectMapper;
121+
public get objectMapper(): TypesAwareObjectMapper {
122+
return this._objectMapper;
123123
}
124124

125-
public set entityObjectMapper(value: TypesAwareObjectMapper) {
126-
this._entityObjectMapper = value;
125+
public set objectMapper(value: TypesAwareObjectMapper) {
126+
this._objectMapper = value;
127127
}
128128

129129
public get readBalanceBehavior(): ReadBalanceBehavior {
@@ -156,7 +156,7 @@ export class DocumentConventions {
156156
public deserializeEntityFromJson(documentType: ObjectTypeDescriptor, document: object): object {
157157
try {
158158
const typeName = documentType ? documentType.name : null;
159-
return this.entityObjectMapper.fromObjectLiteral(document, { typeName });
159+
return this.objectMapper.fromObjectLiteral(document, { typeName });
160160
} catch (err) {
161161
throwError("RavenException", "Cannot deserialize entity", err);
162162
}

src/Documents/Operations/Indexes/IndexHasChangedOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class IndexHasChangedCommand extends RavenCommand<boolean> {
3636
public constructor(conventions: DocumentConventions, definition: IndexDefinition) {
3737
super();
3838

39-
this._definition = conventions.entityObjectMapper.toObjectLiteral(definition);
39+
this._definition = conventions.objectMapper.toObjectLiteral(definition);
4040
}
4141

4242
public get isReadRequest(): boolean {

src/Documents/Operations/Indexes/PutIndexesOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class PutIndexesCommand extends RavenCommand<PutIndexResult[]> {
5757
throwError("InvalidArgumentException", "Index name cannot be null.");
5858
}
5959

60-
result.push(this._conventions.entityObjectMapper.toObjectLiteral(next));
60+
result.push(this._conventions.objectMapper.toObjectLiteral(next));
6161

6262
return result;
6363
}, []);

src/Documents/Operations/Indexes/SetIndexesLockOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class SetIndexLockCommand extends RavenCommand<void> {
7373
}
7474

7575
this._responseType = "Empty";
76-
this._parameters = conventions.entityObjectMapper.toObjectLiteral(parameters);
76+
this._parameters = conventions.objectMapper.toObjectLiteral(parameters);
7777
}
7878

7979
public createRequest(node: ServerNode): HttpRequestParameters {

src/Documents/Operations/Indexes/SetIndexesPriorityOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class SetIndexPriorityCommand extends RavenCommand<void> {
6363
throwError("InvalidArgumentException", "Parameters cannot be null");
6464
}
6565

66-
this._parameters = conventions.entityObjectMapper.toObjectLiteral(parameters);
66+
this._parameters = conventions.objectMapper.toObjectLiteral(parameters);
6767
}
6868

6969
public createRequest(node: ServerNode): HttpRequestParameters {

src/Documents/Operations/PatchOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class PatchCommand extends RavenCommand<PatchResult> {
128128

129129
this._id = id;
130130
this._changeVector = changeVector;
131-
this._patch = conventions.entityObjectMapper.toObjectLiteral({ patch, patchIfMissing });
131+
this._patch = conventions.objectMapper.toObjectLiteral({ patch, patchIfMissing });
132132
this._skipPatchIfChangeVectorMismatch = skipPatchIfChangeVectorMismatch;
133133
this._returnDebugInformation = returnDebugInformation;
134134
this._test = test;

src/Documents/Operations/PatchRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class PatchRequest {
1515
return {
1616
Script: this.script,
1717
Values: Object.keys(this.values).reduce((result, next) => {
18-
const literal = conventions.entityObjectMapper.toObjectLiteral(this.values[next]);
18+
const literal = conventions.objectMapper.toObjectLiteral(this.values[next]);
1919
result[next] = conventions.transformObjectKeysToRemoteFieldNameConvention(literal);
2020
return result;
2121
}, {})

0 commit comments

Comments
 (0)