Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export class AuthorizationResultBasedCreateMutator<
cascadingDeleteCause: null,
});

const temporaryEntityForPrivacyCheck = entityLoader.constructionUtils.constructEntity({
const temporaryEntityForPrivacyCheck = entityLoader.constructionUtils['constructEntity']({
[this.entityConfiguration.idField]: '00000000-0000-0000-0000-000000000000', // zero UUID
...this.fieldsForEntity,
} as unknown as TFields);
Expand Down Expand Up @@ -383,7 +383,7 @@ export class AuthorizationResultBasedCreateMutator<
entityLoader.invalidationUtils.invalidateFieldsForTransaction(queryContext, insertResult);

const unauthorizedEntityAfterInsert =
entityLoader.constructionUtils.constructEntity(insertResult);
entityLoader.constructionUtils['constructEntity'](insertResult);
const newEntity = await enforceAsyncResult(
entityLoader.loadByIDAsync(unauthorizedEntityAfterInsert.getID()),
);
Expand Down Expand Up @@ -543,7 +543,7 @@ export class AuthorizationResultBasedUpdateMutator<
cascadingDeleteCause: this.cascadingDeleteCause,
});

const entityAboutToBeUpdated = entityLoader.constructionUtils.constructEntity(
const entityAboutToBeUpdated = entityLoader.constructionUtils['constructEntity'](
this.fieldsForEntity,
);
const authorizeUpdateResult = await asyncResult(
Expand Down
2 changes: 1 addition & 1 deletion packages/entity/src/EntityConstructionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class EntityConstructionUtils<
*
* @param fieldsObject - fields object
*/
public constructEntity(fieldsObject: TFields): TEntity {
private constructEntity(fieldsObject: TFields): TEntity {
const idField = this.entityConfiguration.idField;
const id = nullthrows(fieldsObject[idField], 'must provide ID to create an entity');
const entitySelectedFields =
Expand Down
4 changes: 2 additions & 2 deletions packages/entity/src/__tests__/EntityMutator-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ describe(EntityMutatorFactory, () => {
keyof SimpleTestFields
>
>(EntityConstructionUtils);
when(entityConstructionUtilsMock.constructEntity(anything())).thenReturn(fakeEntity);
when(entityConstructionUtilsMock['constructEntity'](anything())).thenReturn(fakeEntity);
when(entityLoaderMock.constructionUtils).thenReturn(instance(entityConstructionUtilsMock));
const entityLoader = instance(entityLoaderMock);

Expand Down Expand Up @@ -1645,7 +1645,7 @@ describe(EntityMutatorFactory, () => {
keyof SimpleTestFields
>
>(EntityConstructionUtils);
when(entityConstructionUtilsMock.constructEntity(anything())).thenReturn(fakeEntity);
when(entityConstructionUtilsMock['constructEntity'](anything())).thenReturn(fakeEntity);
when(entityLoaderMock.constructionUtils).thenReturn(instance(entityConstructionUtilsMock));
const entityLoader = instance(entityLoaderMock);

Expand Down
2 changes: 1 addition & 1 deletion packages/entity/src/utils/EntityPrivacyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ async function canViewerDeleteInternalAsync<
return {
previousValue: entity,
syntheticallyUpdatedValue:
entityLoader.constructionUtils.constructEntity(syntheticFields),
entityLoader.constructionUtils['constructEntity'](syntheticFields),
};
},
);
Expand Down