Compare commits

..

6 Commits

Author SHA1 Message Date
standardci f1b6f48926 chore(release): publish new version
- @standardnotes/revisions-server@1.3.0
2022-11-22 09:21:44 +00:00
Karol Sójko 14ab1cae69 feat(revisions): add filesystem dump repository 2022-11-22 10:19:46 +01:00
standardci 5f9cf90b16 chore(release): publish new version
- @standardnotes/syncing-server@1.17.0
2022-11-22 09:13:25 +00:00
Karol Sójko 97b367d4ee feat(syncing-server): add dumping backup items to filesystem 2022-11-22 10:11:09 +01:00
standardci 47119fb346 chore(release): publish new version
- @standardnotes/analytics@2.11.6
 - @standardnotes/api-gateway@1.38.9
 - @standardnotes/auth-server@1.60.4
 - @standardnotes/common@1.46.0
 - @standardnotes/domain-core@1.2.2
 - @standardnotes/domain-events-infra@1.9.31
 - @standardnotes/domain-events@2.90.1
 - @standardnotes/event-store@1.6.26
 - @standardnotes/files-server@1.8.26
 - @standardnotes/predicates@1.6.1
 - @standardnotes/revisions-server@1.2.2
 - @standardnotes/scheduler-server@1.13.27
 - @standardnotes/security@1.7.1
 - @standardnotes/syncing-server@1.16.1
 - @standardnotes/websockets-server@1.4.28
 - @standardnotes/workspace-server@1.17.26
2022-11-22 07:25:59 +00:00
Karol Sójko d77eb7f5f1 feat(common): add marketing campaign for black friday 2022 email message identifier 2022-11-22 08:23:32 +01:00
39 changed files with 182 additions and 26 deletions
+4
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.
## [2.11.6](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.11.5...@standardnotes/analytics@2.11.6) (2022-11-22)
**Note:** Version bump only for package @standardnotes/analytics
## [2.11.5](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.11.4...@standardnotes/analytics@2.11.5) (2022-11-21)
**Note:** Version bump only for package @standardnotes/analytics
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/analytics",
"version": "2.11.5",
"version": "2.11.6",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+4
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.38.9](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.38.8...@standardnotes/api-gateway@1.38.9) (2022-11-22)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.38.8](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.38.7...@standardnotes/api-gateway@1.38.8) (2022-11-21)
**Note:** Version bump only for package @standardnotes/api-gateway
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api-gateway",
"version": "1.38.8",
"version": "1.38.9",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+4
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.60.4](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.60.3...@standardnotes/auth-server@1.60.4) (2022-11-22)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.60.3](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.60.2...@standardnotes/auth-server@1.60.3) (2022-11-21)
**Note:** Version bump only for package @standardnotes/auth-server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.60.3",
"version": "1.60.4",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+6
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.46.0](https://github.com/standardnotes/server/compare/@standardnotes/common@1.45.0...@standardnotes/common@1.46.0) (2022-11-22)
### Features
* **common:** add marketing campaign for black friday 2022 email message identifier ([d77eb7f](https://github.com/standardnotes/server/commit/d77eb7f5f11bcc7cd5c6fa6d20e891b466af7b45))
# [1.45.0](https://github.com/standardnotes/server/compare/@standardnotes/common@1.44.4...@standardnotes/common@1.45.0) (2022-11-14)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/common",
"version": "1.45.0",
"version": "1.46.0",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
@@ -18,6 +18,7 @@ export enum EmailMessageIdentifier {
STUDENT_DISCOUNT_REQUESTED = 'STUDENT_DISCOUNT_REQUESTED',
STUDENT_DISCOUNT_APPROVED = 'STUDENT_DISCOUNT_APPROVED',
MARKETING_CAMPAIGN_FILES = 'MARKETING_CAMPAIGN_FILES',
MARKETING_BLACK_FRIDAY_2022 = 'MARKETING_BLACK_FRIDAY_2022',
PAYMENT_FAILED = 'PAYMENT_FAILED',
SEND_INVOICE = 'SEND_INVOICE',
DISCOUNT_NOTICE = 'DISCOUNT_NOTICE',
+4
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.2.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.2.1...@standardnotes/domain-core@1.2.2) (2022-11-22)
**Note:** Version bump only for package @standardnotes/domain-core
## [1.2.1](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.2.0...@standardnotes/domain-core@1.2.1) (2022-11-21)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-core",
"version": "1.2.1",
"version": "1.2.2",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
@@ -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.9.31](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.30...@standardnotes/domain-events-infra@1.9.31) (2022-11-22)
**Note:** Version bump only for package @standardnotes/domain-events-infra
## [1.9.30](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.29...@standardnotes/domain-events-infra@1.9.30) (2022-11-21)
**Note:** Version bump only for package @standardnotes/domain-events-infra
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events-infra",
"version": "1.9.30",
"version": "1.9.31",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+4
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.
## [2.90.1](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.90.0...@standardnotes/domain-events@2.90.1) (2022-11-22)
**Note:** Version bump only for package @standardnotes/domain-events
# [2.90.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.89.0...@standardnotes/domain-events@2.90.0) (2022-11-21)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events",
"version": "2.90.0",
"version": "2.90.1",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+4
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.6.26](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.6.25...@standardnotes/event-store@1.6.26) (2022-11-22)
**Note:** Version bump only for package @standardnotes/event-store
## [1.6.25](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.6.24...@standardnotes/event-store@1.6.25) (2022-11-21)
**Note:** Version bump only for package @standardnotes/event-store
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/event-store",
"version": "1.6.25",
"version": "1.6.26",
"description": "Event Store Service",
"private": true,
"main": "dist/src/index.js",
+4
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.8.26](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.8.25...@standardnotes/files-server@1.8.26) (2022-11-22)
**Note:** Version bump only for package @standardnotes/files-server
## [1.8.25](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.8.24...@standardnotes/files-server@1.8.25) (2022-11-21)
**Note:** Version bump only for package @standardnotes/files-server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files-server",
"version": "1.8.25",
"version": "1.8.26",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+4
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.6.1](https://github.com/standardnotes/server/compare/@standardnotes/predicates@1.6.0...@standardnotes/predicates@1.6.1) (2022-11-22)
**Note:** Version bump only for package @standardnotes/predicates
# [1.6.0](https://github.com/standardnotes/server/compare/@standardnotes/predicates@1.5.7...@standardnotes/predicates@1.6.0) (2022-11-14)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/predicates",
"version": "1.6.0",
"version": "1.6.1",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.3.0](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.2.2...@standardnotes/revisions-server@1.3.0) (2022-11-22)
### Features
* **revisions:** add filesystem dump repository ([14ab1ca](https://github.com/standardnotes/server/commit/14ab1cae6981b7c12e797dd316da1b3bdb37c75f))
## [1.2.2](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.2.1...@standardnotes/revisions-server@1.2.2) (2022-11-22)
**Note:** Version bump only for package @standardnotes/revisions-server
## [1.2.1](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.2.0...@standardnotes/revisions-server@1.2.1) (2022-11-21)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/revisions-server",
"version": "1.2.1",
"version": "1.3.0",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+16 -9
View File
@@ -35,6 +35,7 @@ import { RevisionPersistenceMapper } from '../Mapping/RevisionPersistenceMapper'
import { ItemDumpedEventHandler } from '../Domain/Handler/ItemDumpedEventHandler'
import { DumpRepositoryInterface } from '../Domain/Dump/DumpRepositoryInterface'
import { S3DumpRepository } from '../Infra/S3/S3ItemDumpRepository'
import { FSDumpRepository } from '../Infra/FS/FSDumpRepository'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const newrelicFormatter = require('@newrelic/winston-enricher')
@@ -126,15 +127,21 @@ export class ContainerConfigLoader {
container.get(TYPES.RevisionPersistenceMapper),
),
)
container
.bind<DumpRepositoryInterface>(TYPES.DumpRepository)
.toConstantValue(
new S3DumpRepository(
container.get(TYPES.S3_BACKUP_BUCKET_NAME),
container.get(TYPES.S3),
container.get(TYPES.RevisionItemStringMapper),
),
)
if (env.get('S3_AWS_REGION', true)) {
container
.bind<DumpRepositoryInterface>(TYPES.DumpRepository)
.toConstantValue(
new S3DumpRepository(
container.get(TYPES.S3_BACKUP_BUCKET_NAME),
container.get(TYPES.S3),
container.get(TYPES.RevisionItemStringMapper),
),
)
} else {
container
.bind<DumpRepositoryInterface>(TYPES.DumpRepository)
.toConstantValue(new FSDumpRepository(container.get(TYPES.RevisionItemStringMapper)))
}
// use cases
container
@@ -0,0 +1,21 @@
import { MapperInterface } from '@standardnotes/domain-core'
import { promises } from 'fs'
import { DumpRepositoryInterface } from '../../Domain/Dump/DumpRepositoryInterface'
import { Revision } from '../../Domain/Revision/Revision'
export class FSDumpRepository implements DumpRepositoryInterface {
constructor(private revisionStringItemMapper: MapperInterface<Revision, string>) {}
async getRevisionFromDumpPath(path: string): Promise<Revision | null> {
const contents = (await promises.readFile(path)).toString()
const revision = this.revisionStringItemMapper.toDomain(contents)
return revision
}
async removeDump(path: string): Promise<void> {
await promises.rm(path)
}
}
+4
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.13.27](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.13.26...@standardnotes/scheduler-server@1.13.27) (2022-11-22)
**Note:** Version bump only for package @standardnotes/scheduler-server
## [1.13.26](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.13.25...@standardnotes/scheduler-server@1.13.26) (2022-11-21)
**Note:** Version bump only for package @standardnotes/scheduler-server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/scheduler-server",
"version": "1.13.26",
"version": "1.13.27",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+4
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.7.1](https://github.com/standardnotes/server/compare/@standardnotes/security@1.7.0...@standardnotes/security@1.7.1) (2022-11-22)
**Note:** Version bump only for package @standardnotes/security
# [1.7.0](https://github.com/standardnotes/server/compare/@standardnotes/security@1.6.4...@standardnotes/security@1.7.0) (2022-11-14)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/security",
"version": "1.7.0",
"version": "1.7.1",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+3
View File
@@ -42,3 +42,6 @@ NEW_RELIC_NO_CONFIG_FILE=true
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=false
NEW_RELIC_LOG_ENABLED=false
NEW_RELIC_LOG_LEVEL=info
# (Optional) Revision Dumps
FILE_UPLOAD_PATH=
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.17.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.16.1...@standardnotes/syncing-server@1.17.0) (2022-11-22)
### Features
* **syncing-server:** add dumping backup items to filesystem ([97b367d](https://github.com/standardnotes/syncing-server-js/commit/97b367d4eee1e8bc2fcfd4a477e6fb1d19507c14))
## [1.16.1](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.16.0...@standardnotes/syncing-server@1.16.1) (2022-11-22)
**Note:** Version bump only for package @standardnotes/syncing-server
# [1.16.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.15.0...@standardnotes/syncing-server@1.16.0) (2022-11-21)
### Features
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.16.0",
"version": "1.17.0",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
@@ -85,6 +85,7 @@ import { MapperInterface } from '@standardnotes/domain-core'
import { RevisionMetadata } from '../Domain/Revision/RevisionMetadata'
import { SimpleRevisionProjection } from '../Projection/SimpleRevisionProjection'
import { ItemRevisionCreationRequestedEventHandler } from '../Domain/Handler/ItemRevisionCreationRequestedEventHandler'
import { FSItemBackupService } from '../Infra/FS/FSItemBackupService'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const newrelicFormatter = require('@newrelic/winston-enricher')
@@ -92,6 +93,7 @@ const newrelicFormatter = require('@newrelic/winston-enricher')
export class ContainerConfigLoader {
private readonly DEFAULT_CONTENT_SIZE_TRANSFER_LIMIT = 10_000_000
private readonly DEFAULT_MAX_ITEMS_LIMIT = 300
private readonly DEFAULT_FILE_UPLOAD_PATH = `${__dirname}/../../uploads`
async load(): Promise<Container> {
const env: Env = new Env()
@@ -203,6 +205,11 @@ export class ContainerConfigLoader {
.toConstantValue(
env.get('MAX_ITEMS_LIMIT', true) ? +env.get('MAX_ITEMS_LIMIT', true) : this.DEFAULT_MAX_ITEMS_LIMIT,
)
container
.bind(TYPES.FILE_UPLOAD_PATH)
.toConstantValue(
env.get('FILE_UPLOAD_PATH', true) ? env.get('FILE_UPLOAD_PATH', true) : this.DEFAULT_FILE_UPLOAD_PATH,
)
// use cases
container.bind<SyncItems>(TYPES.SyncItems).to(SyncItems)
@@ -252,7 +259,11 @@ export class ContainerConfigLoader {
.to(SyncResponseFactoryResolver)
container.bind<AuthHttpServiceInterface>(TYPES.AuthHttpService).to(AuthHttpService)
container.bind<ExtensionsHttpServiceInterface>(TYPES.ExtensionsHttpService).to(ExtensionsHttpService)
container.bind<ItemBackupServiceInterface>(TYPES.ItemBackupService).to(S3ItemBackupService)
if (env.get('S3_AWS_REGION', true)) {
container.bind<ItemBackupServiceInterface>(TYPES.ItemBackupService).to(S3ItemBackupService)
} else {
container.bind<ItemBackupServiceInterface>(TYPES.ItemBackupService).to(FSItemBackupService)
}
container.bind<RevisionServiceInterface>(TYPES.RevisionService).to(RevisionService)
if (env.get('SNS_TOPIC_ARN', true)) {
@@ -37,6 +37,7 @@ const TYPES = {
VERSION: Symbol.for('VERSION'),
CONTENT_SIZE_TRANSFER_LIMIT: Symbol.for('CONTENT_SIZE_TRANSFER_LIMIT'),
MAX_ITEMS_LIMIT: Symbol.for('MAX_ITEMS_LIMIT'),
FILE_UPLOAD_PATH: Symbol.for('FILE_UPLOAD_PATH'),
// use cases
SyncItems: Symbol.for('SyncItems'),
CheckIntegrity: Symbol.for('CheckIntegrity'),
@@ -0,0 +1,34 @@
import { KeyParamsData } from '@standardnotes/responses'
import { promises } from 'fs'
import * as uuid from 'uuid'
import { inject, injectable } from 'inversify'
import TYPES from '../../Bootstrap/Types'
import { Item } from '../../Domain/Item/Item'
import { ItemBackupServiceInterface } from '../../Domain/Item/ItemBackupServiceInterface'
import { ItemProjection } from '../../Projection/ItemProjection'
import { ProjectorInterface } from '../../Projection/ProjectorInterface'
@injectable()
export class FSItemBackupService implements ItemBackupServiceInterface {
constructor(
@inject(TYPES.FILE_UPLOAD_PATH) private fileUploadPath: string,
@inject(TYPES.ItemProjector) private itemProjector: ProjectorInterface<Item, ItemProjection>,
) {}
async backup(_items: Item[], _authParams: KeyParamsData): Promise<string> {
throw new Error('Method not implemented.')
}
async dump(item: Item): Promise<string> {
const contents = JSON.stringify({
item: await this.itemProjector.projectFull(item),
})
const path = `${this.fileUploadPath}/dumps/${uuid.v4()}`
await promises.writeFile(path, contents)
return path
}
}
+4
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.4.28](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.4.27...@standardnotes/websockets-server@1.4.28) (2022-11-22)
**Note:** Version bump only for package @standardnotes/websockets-server
## [1.4.27](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.4.26...@standardnotes/websockets-server@1.4.27) (2022-11-21)
**Note:** Version bump only for package @standardnotes/websockets-server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/websockets-server",
"version": "1.4.27",
"version": "1.4.28",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
+4
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.17.26](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.17.25...@standardnotes/workspace-server@1.17.26) (2022-11-22)
**Note:** Version bump only for package @standardnotes/workspace-server
## [1.17.25](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.17.24...@standardnotes/workspace-server@1.17.25) (2022-11-21)
**Note:** Version bump only for package @standardnotes/workspace-server
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/workspace-server",
"version": "1.17.25",
"version": "1.17.26",
"engines": {
"node": ">=18.0.0 <19.0.0"
},