Compare commits

...

2 Commits

Author SHA1 Message Date
standardci
421b5c5487 chore(release): publish new version
- @standardnotes/home-server@1.16.37
 - @standardnotes/revisions-server@1.40.4
2023-10-09 08:35:11 +00:00
Karol Sójko
465530841f fix(revisions): creation date formatting 2023-10-09 10:15:20 +02:00
7 changed files with 28 additions and 8 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.16.37](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.36...@standardnotes/home-server@1.16.37) (2023-10-09)
**Note:** Version bump only for package @standardnotes/home-server
## [1.16.36](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.16.35...@standardnotes/home-server@1.16.36) (2023-10-09)
**Note:** Version bump only for package @standardnotes/home-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.16.36",
"version": "1.16.37",
"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.40.4](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.40.3...@standardnotes/revisions-server@1.40.4) (2023-10-09)
### Bug Fixes
* **revisions:** creation date formatting ([4655308](https://github.com/standardnotes/server/commit/465530841f49df1bda44d9a9552306279575f57b))
## [1.40.3](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.40.2...@standardnotes/revisions-server@1.40.3) (2023-10-09)
### Bug Fixes

View File

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

View File

@@ -237,10 +237,10 @@ export class ContainerConfigLoader {
.toConstantValue(new SQLRevisionMetadataPersistenceMapper())
container
.bind<MapperInterface<Revision, SQLLegacyRevision>>(TYPES.Revisions_SQLLegacyRevisionPersistenceMapper)
.toConstantValue(new SQLLegacyRevisionPersistenceMapper())
.toConstantValue(new SQLLegacyRevisionPersistenceMapper(container.get<TimerInterface>(TYPES.Revisions_Timer)))
container
.bind<MapperInterface<Revision, SQLRevision>>(TYPES.Revisions_SQLRevisionPersistenceMapper)
.toConstantValue(new SQLRevisionPersistenceMapper())
.toConstantValue(new SQLRevisionPersistenceMapper(container.get<TimerInterface>(TYPES.Revisions_Timer)))
container
.bind<MapperInterface<RevisionMetadata, MongoDBRevision>>(
TYPES.Revisions_MongoDBRevisionMetadataPersistenceMapper,

View File

@@ -1,9 +1,12 @@
import { MapperInterface, Dates, UniqueEntityId, Uuid, ContentType } from '@standardnotes/domain-core'
import { TimerInterface } from '@standardnotes/time'
import { Revision } from '../../../Domain/Revision/Revision'
import { SQLLegacyRevision } from '../../../Infra/TypeORM/SQL/SQLLegacyRevision'
export class SQLLegacyRevisionPersistenceMapper implements MapperInterface<Revision, SQLLegacyRevision> {
constructor(private timer: TimerInterface) {}
toDomain(projection: SQLLegacyRevision): Revision {
const contentTypeOrError = ContentType.create(projection.contentType)
if (contentTypeOrError.isFailed()) {
@@ -37,7 +40,7 @@ export class SQLLegacyRevisionPersistenceMapper implements MapperInterface<Revis
authHash: projection.authHash,
content: projection.content,
contentType,
creationDate: projection.creationDate,
creationDate: new Date(this.timer.convertDateToFormattedString(projection.creationDate, 'YYYY-MM-DD')),
encItemKey: projection.encItemKey,
itemsKeyId: projection.itemsKeyId,
itemUuid,
@@ -61,7 +64,9 @@ export class SQLLegacyRevisionPersistenceMapper implements MapperInterface<Revis
sqlRevision.contentType = domain.props.contentType.value
sqlRevision.createdAt = domain.props.dates.createdAt
sqlRevision.updatedAt = domain.props.dates.updatedAt
sqlRevision.creationDate = domain.props.creationDate
sqlRevision.creationDate = new Date(
this.timer.convertDateToFormattedString(domain.props.creationDate, 'YYYY-MM-DD'),
)
sqlRevision.encItemKey = domain.props.encItemKey
sqlRevision.itemUuid = domain.props.itemUuid.value
sqlRevision.itemsKeyId = domain.props.itemsKeyId

View File

@@ -1,4 +1,5 @@
import { MapperInterface, Dates, UniqueEntityId, Uuid, ContentType } from '@standardnotes/domain-core'
import { TimerInterface } from '@standardnotes/time'
import { Revision } from '../../../Domain/Revision/Revision'
import { SQLRevision } from '../../../Infra/TypeORM/SQL/SQLRevision'
@@ -6,6 +7,8 @@ import { SharedVaultAssociation } from '../../../Domain/SharedVault/SharedVaultA
import { KeySystemAssociation } from '../../../Domain/KeySystem/KeySystemAssociation'
export class SQLRevisionPersistenceMapper implements MapperInterface<Revision, SQLRevision> {
constructor(private timer: TimerInterface) {}
toDomain(projection: SQLRevision): Revision {
const contentTypeOrError = ContentType.create(projection.contentType)
if (contentTypeOrError.isFailed()) {
@@ -72,7 +75,7 @@ export class SQLRevisionPersistenceMapper implements MapperInterface<Revision, S
authHash: projection.authHash,
content: projection.content,
contentType,
creationDate: projection.creationDate,
creationDate: new Date(this.timer.convertDateToFormattedString(projection.creationDate, 'YYYY-MM-DD')),
encItemKey: projection.encItemKey,
itemsKeyId: projection.itemsKeyId,
itemUuid,
@@ -98,7 +101,9 @@ export class SQLRevisionPersistenceMapper implements MapperInterface<Revision, S
sqlRevision.contentType = domain.props.contentType.value
sqlRevision.createdAt = domain.props.dates.createdAt
sqlRevision.updatedAt = domain.props.dates.updatedAt
sqlRevision.creationDate = domain.props.creationDate
sqlRevision.creationDate = new Date(
this.timer.convertDateToFormattedString(domain.props.creationDate, 'YYYY-MM-DD'),
)
sqlRevision.encItemKey = domain.props.encItemKey
sqlRevision.itemUuid = domain.props.itemUuid.value
sqlRevision.itemsKeyId = domain.props.itemsKeyId