Compare commits

...

2 Commits

13 changed files with 21 additions and 3 deletions

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.15.32](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.15.31...@standardnotes/home-server@1.15.32) (2023-09-11)
**Note:** Version bump only for package @standardnotes/home-server
## [1.15.31](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.15.30...@standardnotes/home-server@1.15.31) (2023-09-08)
**Note:** Version bump only for package @standardnotes/home-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.15.31",
"version": "1.15.32",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.33.4](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.33.3...@standardnotes/revisions-server@1.33.4) (2023-09-11)
### Bug Fixes
* **revisions:** add shared vault uuid to revision metadata http representation ([156fa7a](https://github.com/standardnotes/server/commit/156fa7a618b9f33a839580019d0398c1b838697d))
## [1.33.3](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.33.2...@standardnotes/revisions-server@1.33.3) (2023-09-08)
**Note:** Version bump only for package @standardnotes/revisions-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/revisions-server",
"version": "1.33.3",
"version": "1.33.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -2,5 +2,6 @@ import { ContentType, Dates } from '@standardnotes/domain-core'
export interface RevisionMetadataProps {
contentType: ContentType
sharedVaultUuid: string | null
dates: Dates
}

View File

@@ -126,7 +126,7 @@ export class MongoDBRevisionRepository implements RevisionRepositoryInterface {
let persistence = []
if (sharedVaultUuids.length > 0) {
persistence = await this.mongoRepository.find({
select: ['_id', 'contentType', 'createdAt', 'updatedAt'],
select: ['_id', 'contentType', 'createdAt', 'updatedAt', 'sharedVaultUuid'],
where: {
$and: [
{ itemUuid: { $eq: itemUuid.value } },

View File

@@ -129,6 +129,7 @@ export class SQLLegacyRevisionRepository implements RevisionRepositoryInterface
.addSelect('content_type', 'contentType')
.addSelect('created_at', 'createdAt')
.addSelect('updated_at', 'updatedAt')
.addSelect('shared_vault_uuid', 'sharedVaultUuid')
.where('item_uuid = :itemUuid', { itemUuid: itemUuid.value })
.andWhere('user_uuid = :userUuid', { userUuid: userUuid.value })
.orderBy('created_at', 'DESC')

View File

@@ -71,6 +71,7 @@ export class SQLRevisionRepository extends SQLLegacyRevisionRepository {
.addSelect('content_type', 'contentType')
.addSelect('created_at', 'createdAt')
.addSelect('updated_at', 'updatedAt')
.addSelect('shared_vault_uuid', 'sharedVaultUuid')
.orderBy('created_at', 'DESC')
if (sharedVaultUuids.length > 0) {

View File

@@ -19,6 +19,7 @@ export class RevisionMetadataHttpMapper
created_at: domain.props.dates.createdAt.toISOString(),
updated_at: domain.props.dates.updatedAt.toISOString(),
required_role: this.getRequiredRoleToViewRevision.execute({ createdAt: domain.props.dates.createdAt }).getValue(),
shared_vault_uuid: domain.props.sharedVaultUuid,
}
}
}

View File

@@ -4,4 +4,5 @@ export interface RevisionMetadataHttpRepresentation {
created_at: string
updated_at: string
required_role: string
shared_vault_uuid: string | null
}

View File

@@ -24,6 +24,7 @@ export class MongoDBRevisionMetadataPersistenceMapper implements MapperInterface
{
contentType,
dates,
sharedVaultUuid: projection.sharedVaultUuid,
},
new UniqueEntityId(projection._id.toHexString()),
)

View File

@@ -26,6 +26,7 @@ export class SQLLegacyRevisionMetadataPersistenceMapper
{
contentType,
dates,
sharedVaultUuid: null,
},
new UniqueEntityId(projection.uuid),
)

View File

@@ -24,6 +24,7 @@ export class SQLRevisionMetadataPersistenceMapper implements MapperInterface<Rev
{
contentType,
dates,
sharedVaultUuid: projection.sharedVaultUuid,
},
new UniqueEntityId(projection.uuid),
)