mirror of
https://github.com/standardnotes/server
synced 2026-07-09 11:01:54 -04:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f064176f2 | |||
| c7b0c7dfa8 | |||
| df20dd46db | |||
| 6dfd09989e | |||
| fc821709e2 | |||
| e986abaab5 | |||
| a006fb3119 | |||
| 2af812eaf1 | |||
| d13c975f94 |
@@ -24,7 +24,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v2
|
uses: aws-actions/configure-aws-credentials@v3
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Configure AWS credentials
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v2
|
uses: aws-actions/configure-aws-credentials@v3
|
||||||
with:
|
with:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@master
|
uses: docker/setup-buildx-action@master
|
||||||
|
|
||||||
- name: Publish Docker image
|
- name: Publish Docker image
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: ${{ steps.bundle-dir.outputs.temp_dir }}
|
context: ${{ steps.bundle-dir.outputs.temp_dir }}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@master
|
uses: docker/setup-buildx-action@master
|
||||||
|
|
||||||
- name: Publish Docker image
|
- name: Publish Docker image
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
builder: ${{ steps.buildx.outputs.name }}
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
context: .
|
context: .
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.26.3](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.26.2...@standardnotes/analytics@2.26.3) (2023-09-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/analytics
|
||||||
|
|
||||||
|
## [2.26.2](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.26.1...@standardnotes/analytics@2.26.2) (2023-09-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/analytics
|
||||||
|
|
||||||
## [2.26.1](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.26.0...@standardnotes/analytics@2.26.1) (2023-09-01)
|
## [2.26.1](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.26.0...@standardnotes/analytics@2.26.1) (2023-09-01)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/analytics",
|
"name": "@standardnotes/analytics",
|
||||||
"version": "2.26.1",
|
"version": "2.26.3",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <21.0.0"
|
"node": ">=18.0.0 <21.0.0"
|
||||||
},
|
},
|
||||||
@@ -29,12 +29,12 @@
|
|||||||
"@types/jest": "^29.5.1",
|
"@types/jest": "^29.5.1",
|
||||||
"@types/mixpanel": "^2.14.4",
|
"@types/mixpanel": "^2.14.4",
|
||||||
"@types/node": "^20.5.7",
|
"@types/node": "^20.5.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
"@typescript-eslint/parser": "^6.5.0",
|
||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ import { AnalyticsActivity } from '../../Domain/Analytics/AnalyticsActivity'
|
|||||||
import { AnalyticsStoreInterface } from '../../Domain/Analytics/AnalyticsStoreInterface'
|
import { AnalyticsStoreInterface } from '../../Domain/Analytics/AnalyticsStoreInterface'
|
||||||
|
|
||||||
export class RedisAnalyticsStore implements AnalyticsStoreInterface {
|
export class RedisAnalyticsStore implements AnalyticsStoreInterface {
|
||||||
constructor(private periodKeyGenerator: PeriodKeyGeneratorInterface, private redisClient: IORedis.Redis) {}
|
constructor(
|
||||||
|
private periodKeyGenerator: PeriodKeyGeneratorInterface,
|
||||||
|
private redisClient: IORedis.Redis,
|
||||||
|
) {}
|
||||||
|
|
||||||
async calculateActivityTotalCountOverTime(activity: AnalyticsActivity, period: Period): Promise<number> {
|
async calculateActivityTotalCountOverTime(activity: AnalyticsActivity, period: Period): Promise<number> {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import { Period } from '../../Domain/Time/Period'
|
|||||||
import { PeriodKeyGeneratorInterface } from '../../Domain/Time/PeriodKeyGeneratorInterface'
|
import { PeriodKeyGeneratorInterface } from '../../Domain/Time/PeriodKeyGeneratorInterface'
|
||||||
|
|
||||||
export class RedisStatisticsStore implements StatisticsStoreInterface, StatisticMeasureRepositoryInterface {
|
export class RedisStatisticsStore implements StatisticsStoreInterface, StatisticMeasureRepositoryInterface {
|
||||||
constructor(private periodKeyGenerator: PeriodKeyGeneratorInterface, private redisClient: IORedis.Redis) {}
|
constructor(
|
||||||
|
private periodKeyGenerator: PeriodKeyGeneratorInterface,
|
||||||
|
private redisClient: IORedis.Redis,
|
||||||
|
) {}
|
||||||
|
|
||||||
async save(statisticMeasure: StatisticMeasure): Promise<void> {
|
async save(statisticMeasure: StatisticMeasure): Promise<void> {
|
||||||
const periodKey = this.periodKeyGenerator.getDailyKey(statisticMeasure.props.date)
|
const periodKey = this.periodKeyGenerator.getDailyKey(statisticMeasure.props.date)
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.73.7](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.73.6...@standardnotes/api-gateway@1.73.7) (2023-09-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||||
|
|
||||||
|
## [1.73.6](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.73.5...@standardnotes/api-gateway@1.73.6) (2023-09-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||||
|
|
||||||
## [1.73.5](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.73.4...@standardnotes/api-gateway@1.73.5) (2023-09-01)
|
## [1.73.5](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.73.4...@standardnotes/api-gateway@1.73.5) (2023-09-01)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/api-gateway
|
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/api-gateway",
|
"name": "@standardnotes/api-gateway",
|
||||||
"version": "1.73.5",
|
"version": "1.73.7",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <21.0.0"
|
"node": ">=18.0.0 <21.0.0"
|
||||||
},
|
},
|
||||||
@@ -54,14 +54,13 @@
|
|||||||
"@types/jsonwebtoken": "^9.0.1",
|
"@types/jsonwebtoken": "^9.0.1",
|
||||||
"@types/node": "^20.5.7",
|
"@types/node": "^20.5.7",
|
||||||
"@types/prettyjson": "^0.0.30",
|
"@types/prettyjson": "^0.0.30",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
"@typescript-eslint/parser": "^6.5.0",
|
||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"nodemon": "^2.0.19",
|
|
||||||
"npm-check-updates": "^16.13.2",
|
"npm-check-updates": "^16.13.2",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { ServiceContainerInterface, ServiceIdentifier } from '@standardnotes/dom
|
|||||||
import { ServiceProxyInterface } from '../Http/ServiceProxyInterface'
|
import { ServiceProxyInterface } from '../Http/ServiceProxyInterface'
|
||||||
|
|
||||||
export class DirectCallServiceProxy implements ServiceProxyInterface {
|
export class DirectCallServiceProxy implements ServiceProxyInterface {
|
||||||
constructor(private serviceContainer: ServiceContainerInterface, private filesServerUrl: string) {}
|
constructor(
|
||||||
|
private serviceContainer: ServiceContainerInterface,
|
||||||
|
private filesServerUrl: string,
|
||||||
|
) {}
|
||||||
|
|
||||||
async validateSession(headers: {
|
async validateSession(headers: {
|
||||||
authorization: string
|
authorization: string
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.137.6](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.137.5...@standardnotes/auth-server@1.137.6) (2023-09-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/auth-server
|
||||||
|
|
||||||
|
## [1.137.5](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.137.4...@standardnotes/auth-server@1.137.5) (2023-09-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/auth-server
|
||||||
|
|
||||||
## [1.137.4](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.137.3...@standardnotes/auth-server@1.137.4) (2023-09-01)
|
## [1.137.4](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.137.3...@standardnotes/auth-server@1.137.4) (2023-09-01)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/auth-server",
|
"name": "@standardnotes/auth-server",
|
||||||
"version": "1.137.4",
|
"version": "1.137.6",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <21.0.0"
|
"node": ">=18.0.0 <21.0.0"
|
||||||
},
|
},
|
||||||
@@ -84,15 +84,14 @@
|
|||||||
"@types/otplib": "^10.0.0",
|
"@types/otplib": "^10.0.0",
|
||||||
"@types/prettyjson": "^0.0.30",
|
"@types/prettyjson": "^0.0.30",
|
||||||
"@types/ua-parser-js": "^0.7.36",
|
"@types/ua-parser-js": "^0.7.36",
|
||||||
"@types/uuid": "^9.0.2",
|
"@types/uuid": "^9.0.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
"@typescript-eslint/parser": "^6.5.0",
|
||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"nodemon": "^2.0.19",
|
|
||||||
"npm-check-updates": "^16.13.2",
|
"npm-check-updates": "^16.13.2",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
export class MFAValidationError extends Error {
|
export class MFAValidationError extends Error {
|
||||||
constructor(message: string, public tag: string, public payload?: Record<string, unknown>) {
|
constructor(
|
||||||
|
message: string,
|
||||||
|
public tag: string,
|
||||||
|
public payload?: Record<string, unknown>,
|
||||||
|
) {
|
||||||
super(message)
|
super(message)
|
||||||
Object.setPrototypeOf(this, MFAValidationError.prototype)
|
Object.setPrototypeOf(this, MFAValidationError.prototype)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ import { SettingServiceInterface } from '../Setting/SettingServiceInterface'
|
|||||||
import { UserRepositoryInterface } from '../User/UserRepositoryInterface'
|
import { UserRepositoryInterface } from '../User/UserRepositoryInterface'
|
||||||
|
|
||||||
export class EmailSubscriptionUnsubscribedEventHandler implements DomainEventHandlerInterface {
|
export class EmailSubscriptionUnsubscribedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private userRepository: UserRepositoryInterface, private settingsService: SettingServiceInterface) {}
|
constructor(
|
||||||
|
private userRepository: UserRepositoryInterface,
|
||||||
|
private settingsService: SettingServiceInterface,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: EmailSubscriptionUnsubscribedEvent): Promise<void> {
|
async handle(event: EmailSubscriptionUnsubscribedEvent): Promise<void> {
|
||||||
const usernameOrError = Username.create(event.payload.userEmail)
|
const usernameOrError = Username.create(event.payload.userEmail)
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { Logger } from 'winston'
|
|||||||
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
||||||
|
|
||||||
export class FileRemovedEventHandler implements DomainEventHandlerInterface {
|
export class FileRemovedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser, private logger: Logger) {}
|
constructor(
|
||||||
|
private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: FileRemovedEvent): Promise<void> {
|
async handle(event: FileRemovedEvent): Promise<void> {
|
||||||
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { Logger } from 'winston'
|
|||||||
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
||||||
|
|
||||||
export class FileUploadedEventHandler implements DomainEventHandlerInterface {
|
export class FileUploadedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser, private logger: Logger) {}
|
constructor(
|
||||||
|
private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: FileUploadedEvent): Promise<void> {
|
async handle(event: FileUploadedEvent): Promise<void> {
|
||||||
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { Logger } from 'winston'
|
|||||||
import { DeleteAccount } from '../UseCase/DeleteAccount/DeleteAccount'
|
import { DeleteAccount } from '../UseCase/DeleteAccount/DeleteAccount'
|
||||||
|
|
||||||
export class PaymentsAccountDeletedEventHandler implements DomainEventHandlerInterface {
|
export class PaymentsAccountDeletedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private deleteAccountUseCase: DeleteAccount, private logger: Logger) {}
|
constructor(
|
||||||
|
private deleteAccountUseCase: DeleteAccount,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: PaymentsAccountDeletedEvent): Promise<void> {
|
async handle(event: PaymentsAccountDeletedEvent): Promise<void> {
|
||||||
const result = await this.deleteAccountUseCase.execute({
|
const result = await this.deleteAccountUseCase.execute({
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { Logger } from 'winston'
|
|||||||
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
||||||
|
|
||||||
export class SharedVaultFileMovedEventHandler implements DomainEventHandlerInterface {
|
export class SharedVaultFileMovedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser, private logger: Logger) {}
|
constructor(
|
||||||
|
private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: SharedVaultFileMovedEvent): Promise<void> {
|
async handle(event: SharedVaultFileMovedEvent): Promise<void> {
|
||||||
const subtractResult = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
const subtractResult = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { Logger } from 'winston'
|
|||||||
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
||||||
|
|
||||||
export class SharedVaultFileRemovedEventHandler implements DomainEventHandlerInterface {
|
export class SharedVaultFileRemovedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser, private logger: Logger) {}
|
constructor(
|
||||||
|
private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: SharedVaultFileRemovedEvent): Promise<void> {
|
async handle(event: SharedVaultFileRemovedEvent): Promise<void> {
|
||||||
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { Logger } from 'winston'
|
|||||||
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
import { UpdateStorageQuotaUsedForUser } from '../UseCase/UpdateStorageQuotaUsedForUser/UpdateStorageQuotaUsedForUser'
|
||||||
|
|
||||||
export class SharedVaultFileUploadedEventHandler implements DomainEventHandlerInterface {
|
export class SharedVaultFileUploadedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser, private logger: Logger) {}
|
constructor(
|
||||||
|
private updateStorageQuotaUsedForUserUseCase: UpdateStorageQuotaUsedForUser,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: SharedVaultFileUploadedEvent): Promise<void> {
|
async handle(event: SharedVaultFileUploadedEvent): Promise<void> {
|
||||||
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
const result = await this.updateStorageQuotaUsedForUserUseCase.execute({
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ import { UpdateTransitionStatus } from '../UseCase/UpdateTransitionStatus/Update
|
|||||||
import { Logger } from 'winston'
|
import { Logger } from 'winston'
|
||||||
|
|
||||||
export class TransitionStatusUpdatedEventHandler implements DomainEventHandlerInterface {
|
export class TransitionStatusUpdatedEventHandler implements DomainEventHandlerInterface {
|
||||||
constructor(private updateTransitionStatusUseCase: UpdateTransitionStatus, private logger: Logger) {}
|
constructor(
|
||||||
|
private updateTransitionStatusUseCase: UpdateTransitionStatus,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handle(event: TransitionStatusUpdatedEvent): Promise<void> {
|
async handle(event: TransitionStatusUpdatedEvent): Promise<void> {
|
||||||
const result = await this.updateTransitionStatusUseCase.execute({
|
const result = await this.updateTransitionStatusUseCase.execute({
|
||||||
|
|||||||
+4
-1
@@ -5,7 +5,10 @@ import { Request, Response } from 'express'
|
|||||||
import { GetSetting } from '../../../Domain/UseCase/GetSetting/GetSetting'
|
import { GetSetting } from '../../../Domain/UseCase/GetSetting/GetSetting'
|
||||||
|
|
||||||
export class BaseSubscriptionSettingsController extends BaseHttpController {
|
export class BaseSubscriptionSettingsController extends BaseHttpController {
|
||||||
constructor(protected doGetSetting: GetSetting, private controllerContainer?: ControllerContainerInterface) {
|
constructor(
|
||||||
|
protected doGetSetting: GetSetting,
|
||||||
|
private controllerContainer?: ControllerContainerInterface,
|
||||||
|
) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
if (this.controllerContainer !== undefined) {
|
if (this.controllerContainer !== undefined) {
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import { CreateValetToken } from '../../../Domain/UseCase/CreateValetToken/Creat
|
|||||||
import { CreateValetTokenPayload } from '../../../Domain/ValetToken/CreateValetTokenPayload'
|
import { CreateValetTokenPayload } from '../../../Domain/ValetToken/CreateValetTokenPayload'
|
||||||
|
|
||||||
export class BaseValetTokenController extends BaseHttpController {
|
export class BaseValetTokenController extends BaseHttpController {
|
||||||
constructor(protected createValetKey: CreateValetToken, private controllerContainer?: ControllerContainerInterface) {
|
constructor(
|
||||||
|
protected createValetKey: CreateValetToken,
|
||||||
|
private controllerContainer?: ControllerContainerInterface,
|
||||||
|
) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
if (this.controllerContainer !== undefined) {
|
if (this.controllerContainer !== undefined) {
|
||||||
|
|||||||
+4
-1
@@ -4,7 +4,10 @@ import { BaseMiddleware } from 'inversify-express-utils'
|
|||||||
import { Logger } from 'winston'
|
import { Logger } from 'winston'
|
||||||
|
|
||||||
export abstract class ApiGatewayAuthMiddleware extends BaseMiddleware {
|
export abstract class ApiGatewayAuthMiddleware extends BaseMiddleware {
|
||||||
constructor(private tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>, private logger: Logger) {
|
constructor(
|
||||||
|
private tokenDecoder: TokenDecoderInterface<CrossServiceTokenData>,
|
||||||
|
private logger: Logger,
|
||||||
|
) {
|
||||||
super()
|
super()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ import { OfflineSubscriptionTokenRepositoryInterface } from '../../Domain/Auth/O
|
|||||||
export class TypeORMOfflineSubscriptionTokenRepository implements OfflineSubscriptionTokenRepositoryInterface {
|
export class TypeORMOfflineSubscriptionTokenRepository implements OfflineSubscriptionTokenRepositoryInterface {
|
||||||
private readonly PREFIX = 'offline-subscription-token'
|
private readonly PREFIX = 'offline-subscription-token'
|
||||||
|
|
||||||
constructor(private cacheEntryRepository: CacheEntryRepositoryInterface, private timer: TimerInterface) {}
|
constructor(
|
||||||
|
private cacheEntryRepository: CacheEntryRepositoryInterface,
|
||||||
|
private timer: TimerInterface,
|
||||||
|
) {}
|
||||||
|
|
||||||
async getUserEmailByToken(token: string): Promise<string | undefined> {
|
async getUserEmailByToken(token: string): Promise<string | undefined> {
|
||||||
const userUuid = await this.cacheEntryRepository.findUnexpiredOneByKey(`${this.PREFIX}:${token}`)
|
const userUuid = await this.cacheEntryRepository.findUnexpiredOneByKey(`${this.PREFIX}:${token}`)
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ import { SubscriptionTokenRepositoryInterface } from '../../Domain/Subscription/
|
|||||||
export class TypeORMSubscriptionTokenRepository implements SubscriptionTokenRepositoryInterface {
|
export class TypeORMSubscriptionTokenRepository implements SubscriptionTokenRepositoryInterface {
|
||||||
private readonly PREFIX = 'subscription-token'
|
private readonly PREFIX = 'subscription-token'
|
||||||
|
|
||||||
constructor(private cacheEntryRepository: CacheEntryRepositoryInterface, private timer: TimerInterface) {}
|
constructor(
|
||||||
|
private cacheEntryRepository: CacheEntryRepositoryInterface,
|
||||||
|
private timer: TimerInterface,
|
||||||
|
) {}
|
||||||
|
|
||||||
async getUserUuidByToken(token: string): Promise<string | undefined> {
|
async getUserUuidByToken(token: string): Promise<string | undefined> {
|
||||||
const userUuid = await this.cacheEntryRepository.findUnexpiredOneByKey(`${this.PREFIX}:${token}`)
|
const userUuid = await this.cacheEntryRepository.findUnexpiredOneByKey(`${this.PREFIX}:${token}`)
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.50.4](https://github.com/standardnotes/server/compare/@standardnotes/common@1.50.3...@standardnotes/common@1.50.4) (2023-09-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/common
|
||||||
|
|
||||||
|
## [1.50.3](https://github.com/standardnotes/server/compare/@standardnotes/common@1.50.2...@standardnotes/common@1.50.3) (2023-09-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/common
|
||||||
|
|
||||||
## [1.50.2](https://github.com/standardnotes/server/compare/@standardnotes/common@1.50.1...@standardnotes/common@1.50.2) (2023-08-30)
|
## [1.50.2](https://github.com/standardnotes/server/compare/@standardnotes/common@1.50.1...@standardnotes/common@1.50.2) (2023-08-30)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/common
|
**Note:** Version bump only for package @standardnotes/common
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/common",
|
"name": "@standardnotes/common",
|
||||||
"version": "1.50.2",
|
"version": "1.50.4",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <21.0.0"
|
"node": ">=18.0.0 <21.0.0"
|
||||||
},
|
},
|
||||||
@@ -25,12 +25,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.1",
|
"@types/jest": "^29.5.1",
|
||||||
"@types/node": "^20.5.7",
|
"@types/node": "^20.5.7",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
"@typescript-eslint/parser": "^6.5.0",
|
||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.26.3](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.26.2...@standardnotes/domain-core@1.26.3) (2023-09-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/domain-core
|
||||||
|
|
||||||
|
## [1.26.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.26.1...@standardnotes/domain-core@1.26.2) (2023-09-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/domain-core
|
||||||
|
|
||||||
## [1.26.1](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.26.0...@standardnotes/domain-core@1.26.1) (2023-08-30)
|
## [1.26.1](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.26.0...@standardnotes/domain-core@1.26.1) (2023-08-30)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/domain-core
|
**Note:** Version bump only for package @standardnotes/domain-core
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/domain-core",
|
"name": "@standardnotes/domain-core",
|
||||||
"version": "1.26.1",
|
"version": "1.26.3",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <21.0.0"
|
"node": ">=18.0.0 <21.0.0"
|
||||||
},
|
},
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
"clean": "rm -fr dist",
|
"clean": "rm -fr dist",
|
||||||
"build": "tsc --build",
|
"build": "tsc --build",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
|
"lint:fix": "eslint . --ext .ts --fix",
|
||||||
"test": "jest spec --coverage --passWithNoTests"
|
"test": "jest spec --coverage --passWithNoTests"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -28,13 +29,13 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.1",
|
"@types/jest": "^29.5.1",
|
||||||
"@types/node": "^20.5.7",
|
"@types/node": "^20.5.7",
|
||||||
"@types/uuid": "^9.0.2",
|
"@types/uuid": "^9.0.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
"@typescript-eslint/parser": "^6.5.0",
|
||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import { UniqueEntityId } from './UniqueEntityId'
|
|||||||
export abstract class Entity<T> {
|
export abstract class Entity<T> {
|
||||||
protected readonly _id: UniqueEntityId
|
protected readonly _id: UniqueEntityId
|
||||||
|
|
||||||
constructor(public readonly props: T, id?: UniqueEntityId) {
|
constructor(
|
||||||
|
public readonly props: T,
|
||||||
|
id?: UniqueEntityId,
|
||||||
|
) {
|
||||||
this._id = id ? id : new UniqueEntityId()
|
this._id = id ? id : new UniqueEntityId()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
/* istanbul ignore file */
|
/* istanbul ignore file */
|
||||||
|
|
||||||
export class Result<T> {
|
export class Result<T> {
|
||||||
constructor(private isSuccess: boolean, private error?: string, private value?: T) {
|
constructor(
|
||||||
|
private isSuccess: boolean,
|
||||||
|
private error?: string,
|
||||||
|
private value?: T,
|
||||||
|
) {
|
||||||
Object.freeze(this)
|
Object.freeze(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.12.21](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.12.20...@standardnotes/domain-events-infra@1.12.21) (2023-09-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
||||||
|
|
||||||
|
## [1.12.20](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.12.19...@standardnotes/domain-events-infra@1.12.20) (2023-09-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
||||||
|
|
||||||
## [1.12.19](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.12.18...@standardnotes/domain-events-infra@1.12.19) (2023-09-01)
|
## [1.12.19](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.12.18...@standardnotes/domain-events-infra@1.12.19) (2023-09-01)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/domain-events-infra",
|
"name": "@standardnotes/domain-events-infra",
|
||||||
"version": "1.12.19",
|
"version": "1.12.21",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <21.0.0"
|
"node": ">=18.0.0 <21.0.0"
|
||||||
},
|
},
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
"clean": "rm -fr dist",
|
"clean": "rm -fr dist",
|
||||||
"build": "tsc --build",
|
"build": "tsc --build",
|
||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
|
"lint:fix": "eslint . --ext .ts --fix",
|
||||||
"test": "jest spec --coverage"
|
"test": "jest spec --coverage"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -34,12 +35,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/ioredis": "^5.0.0",
|
"@types/ioredis": "^5.0.0",
|
||||||
"@types/jest": "^29.5.1",
|
"@types/jest": "^29.5.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
||||||
"@typescript-eslint/parser": "^5.59.2",
|
"@typescript-eslint/parser": "^6.5.0",
|
||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^29.1.0",
|
"ts-jest": "^29.1.0",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ import {
|
|||||||
} from '@standardnotes/domain-events'
|
} from '@standardnotes/domain-events'
|
||||||
|
|
||||||
export class DirectCallEventMessageHandler implements DomainEventMessageHandlerInterface {
|
export class DirectCallEventMessageHandler implements DomainEventMessageHandlerInterface {
|
||||||
constructor(private handlers: Map<string, DomainEventHandlerInterface>, private logger: Logger) {}
|
constructor(
|
||||||
|
private handlers: Map<string, DomainEventHandlerInterface>,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handleMessage(messageOrEvent: string | DomainEventInterface): Promise<void> {
|
async handleMessage(messageOrEvent: string | DomainEventInterface): Promise<void> {
|
||||||
if (typeof messageOrEvent === 'string') {
|
if (typeof messageOrEvent === 'string') {
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import * as zlib from 'zlib'
|
|||||||
import { DomainEventPublisherInterface, DomainEventInterface } from '@standardnotes/domain-events'
|
import { DomainEventPublisherInterface, DomainEventInterface } from '@standardnotes/domain-events'
|
||||||
|
|
||||||
export class RedisDomainEventPublisher implements DomainEventPublisherInterface {
|
export class RedisDomainEventPublisher implements DomainEventPublisherInterface {
|
||||||
constructor(private redisClient: IORedis.Redis, private eventChannel: string) {}
|
constructor(
|
||||||
|
private redisClient: IORedis.Redis,
|
||||||
|
private eventChannel: string,
|
||||||
|
) {}
|
||||||
|
|
||||||
async publish(event: DomainEventInterface): Promise<void> {
|
async publish(event: DomainEventInterface): Promise<void> {
|
||||||
const message = zlib.deflateSync(JSON.stringify(event)).toString('base64')
|
const message = zlib.deflateSync(JSON.stringify(event)).toString('base64')
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ import * as IORedis from 'ioredis'
|
|||||||
import { DomainEventSubscriberInterface } from '@standardnotes/domain-events'
|
import { DomainEventSubscriberInterface } from '@standardnotes/domain-events'
|
||||||
|
|
||||||
export class RedisDomainEventSubscriber implements DomainEventSubscriberInterface {
|
export class RedisDomainEventSubscriber implements DomainEventSubscriberInterface {
|
||||||
constructor(private redisClient: IORedis.Redis, private eventChannel: string) {}
|
constructor(
|
||||||
|
private redisClient: IORedis.Redis,
|
||||||
|
private eventChannel: string,
|
||||||
|
) {}
|
||||||
|
|
||||||
start(): void {
|
start(): void {
|
||||||
void this.redisClient.subscribe(this.eventChannel)
|
void this.redisClient.subscribe(this.eventChannel)
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import {
|
|||||||
} from '@standardnotes/domain-events'
|
} from '@standardnotes/domain-events'
|
||||||
|
|
||||||
export class RedisEventMessageHandler implements DomainEventMessageHandlerInterface {
|
export class RedisEventMessageHandler implements DomainEventMessageHandlerInterface {
|
||||||
constructor(private handlers: Map<string, DomainEventHandlerInterface>, private logger: Logger) {}
|
constructor(
|
||||||
|
private handlers: Map<string, DomainEventHandlerInterface>,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handleMessage(message: string): Promise<void> {
|
async handleMessage(message: string): Promise<void> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { MessageAttributeValue, PublishCommand, PublishCommandInput, SNSClient }
|
|||||||
import { DomainEventInterface, DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
import { DomainEventInterface, DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
||||||
|
|
||||||
export class SNSDomainEventPublisher implements DomainEventPublisherInterface {
|
export class SNSDomainEventPublisher implements DomainEventPublisherInterface {
|
||||||
constructor(private snsClient: SNSClient, private topicArn: string) {}
|
constructor(
|
||||||
|
private snsClient: SNSClient,
|
||||||
|
private topicArn: string,
|
||||||
|
) {}
|
||||||
|
|
||||||
async publish(event: DomainEventInterface): Promise<void> {
|
async publish(event: DomainEventInterface): Promise<void> {
|
||||||
const message: PublishCommandInput = {
|
const message: PublishCommandInput = {
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import {
|
|||||||
} from '@standardnotes/domain-events'
|
} from '@standardnotes/domain-events'
|
||||||
|
|
||||||
export class SQSEventMessageHandler implements DomainEventMessageHandlerInterface {
|
export class SQSEventMessageHandler implements DomainEventMessageHandlerInterface {
|
||||||
constructor(private handlers: Map<string, DomainEventHandlerInterface>, private logger: Logger) {}
|
constructor(
|
||||||
|
private handlers: Map<string, DomainEventHandlerInterface>,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handleMessage(message: string): Promise<void> {
|
async handleMessage(message: string): Promise<void> {
|
||||||
const messageParsed = JSON.parse(message)
|
const messageParsed = JSON.parse(message)
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ import {
|
|||||||
export class SQSNewRelicBounceNotificiationHandler implements DomainEventMessageHandlerInterface {
|
export class SQSNewRelicBounceNotificiationHandler implements DomainEventMessageHandlerInterface {
|
||||||
private readonly ALLOWED_NOTIFICATION_TYPES = ['Bounce']
|
private readonly ALLOWED_NOTIFICATION_TYPES = ['Bounce']
|
||||||
|
|
||||||
constructor(private handlers: Map<string, DomainEventHandlerInterface>, private logger: Logger) {}
|
constructor(
|
||||||
|
private handlers: Map<string, DomainEventHandlerInterface>,
|
||||||
|
private logger: Logger,
|
||||||
|
) {}
|
||||||
|
|
||||||
async handleMessage(message: string): Promise<void> {
|
async handleMessage(message: string): Promise<void> {
|
||||||
const messageParsed = JSON.parse(JSON.parse(message).Message)
|
const messageParsed = JSON.parse(JSON.parse(message).Message)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user