Compare commits

...

8 Commits

Author SHA1 Message Date
standardci
6a457281ea chore(release): publish new version
- @standardnotes/api-gateway@1.15.6
 - @standardnotes/auth-server@1.21.3
 - @standardnotes/domain-events-infra@1.7.36
 - @standardnotes/domain-events@2.55.1
 - @standardnotes/event-store@1.2.3
 - @standardnotes/files-server@1.5.39
 - @standardnotes/scheduler-server@1.10.16
 - @standardnotes/syncing-server@1.6.53
2022-09-01 10:11:46 +00:00
Karol Sójko
41c512798d fix(domain-events): add admin-panel as event source option 2022-09-01 12:10:00 +02:00
standardci
ffa0f51305 chore(release): publish new version
- @standardnotes/api-gateway@1.15.5
 - @standardnotes/auth-server@1.21.2
 - @standardnotes/domain-events-infra@1.7.35
 - @standardnotes/domain-events@2.55.0
 - @standardnotes/event-store@1.2.2
 - @standardnotes/files-server@1.5.38
 - @standardnotes/scheduler-server@1.10.15
 - @standardnotes/syncing-server@1.6.52
2022-09-01 09:02:44 +00:00
Karol Sójko
e0cec9e24a feat(domain-events): add subscription revert requested event 2022-09-01 11:00:45 +02:00
standardci
f6b359a772 chore(release): publish new version
- @standardnotes/scheduler-server@1.10.14
2022-08-30 12:53:27 +00:00
Karol Sójko
648eb89c7c fix(scheduler): linter issues 2022-08-30 14:51:54 +02:00
standardci
ba22e085b8 chore(release): publish new version
- @standardnotes/scheduler-server@1.10.13
2022-08-30 12:46:35 +00:00
Karol Sójko
35373db1d3 fix(scheduler): skip sending exit survery when a subscription is replaced 2022-08-30 14:44:54 +02:00
24 changed files with 122 additions and 12 deletions

5
.pnp.cjs generated
View File

@@ -2866,11 +2866,12 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@types/jest", "npm:28.1.4"],\
["@types/newrelic", "npm:7.0.3"],\
["@types/node", "npm:18.0.3"],\
["@typescript-eslint/eslint-plugin", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:5.30.5"],\
["@typescript-eslint/eslint-plugin", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:5.30.5"],\
["aws-sdk", "npm:2.1168.0"],\
["dayjs", "npm:1.11.3"],\
["dotenv", "npm:16.0.1"],\
["eslint-plugin-prettier", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.2.1"],\
["eslint", "npm:8.19.0"],\
["eslint-plugin-prettier", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:4.2.1"],\
["inversify", "npm:6.0.1"],\
["ioredis", "npm:5.2.0"],\
["jest", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:28.1.2"],\

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.15.6](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.15.5...@standardnotes/api-gateway@1.15.6) (2022-09-01)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.15.5](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.15.4...@standardnotes/api-gateway@1.15.5) (2022-09-01)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.15.4](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.15.3...@standardnotes/api-gateway@1.15.4) (2022-08-30)
**Note:** Version bump only for package @standardnotes/api-gateway

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api-gateway",
"version": "1.15.4",
"version": "1.15.6",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.21.3](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.21.2...@standardnotes/auth-server@1.21.3) (2022-09-01)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.21.2](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.21.1...@standardnotes/auth-server@1.21.2) (2022-09-01)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.21.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.21.0...@standardnotes/auth-server@1.21.1) (2022-08-30)
**Note:** Version bump only for package @standardnotes/auth-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.21.1",
"version": "1.21.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.7.36](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.7.35...@standardnotes/domain-events-infra@1.7.36) (2022-09-01)
**Note:** Version bump only for package @standardnotes/domain-events-infra
## [1.7.35](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.7.34...@standardnotes/domain-events-infra@1.7.35) (2022-09-01)
**Note:** Version bump only for package @standardnotes/domain-events-infra
## [1.7.34](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.7.33...@standardnotes/domain-events-infra@1.7.34) (2022-08-30)
**Note:** Version bump only for package @standardnotes/domain-events-infra

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events-infra",
"version": "1.7.34",
"version": "1.7.36",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.55.1](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.55.0...@standardnotes/domain-events@2.55.1) (2022-09-01)
### Bug Fixes
* **domain-events:** add admin-panel as event source option ([41c5127](https://github.com/standardnotes/server/commit/41c512798d932859b5d46c6e62fccb89fa288891))
# [2.55.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.54.2...@standardnotes/domain-events@2.55.0) (2022-09-01)
### Features
* **domain-events:** add subscription revert requested event ([e0cec9e](https://github.com/standardnotes/server/commit/e0cec9e24ab9954868fb428062c9a82d0f0f85d5))
## [2.54.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.54.1...@standardnotes/domain-events@2.54.2) (2022-08-30)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events",
"version": "2.54.2",
"version": "2.55.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -1,4 +1,5 @@
export enum DomainEventService {
AdminPanel = 'admin-panel',
Auth = 'auth',
SyncingServer = 'syncing-server',
Payments = 'payments',

View File

@@ -0,0 +1,8 @@
import { DomainEventInterface } from './DomainEventInterface'
import { SubscriptionRevertRequestedEventPayload } from './SubscriptionRevertRequestedEventPayload'
export interface SubscriptionRevertRequestedEvent extends DomainEventInterface {
type: 'SUBSCRIPTION_REVERT_REQUESTED'
payload: SubscriptionRevertRequestedEventPayload
}

View File

@@ -0,0 +1,3 @@
export interface SubscriptionRevertRequestedEventPayload {
userEmail: string
}

View File

@@ -86,6 +86,8 @@ export * from './Event/SubscriptionRenewedEvent'
export * from './Event/SubscriptionRenewedEventPayload'
export * from './Event/SubscriptionExpiredEvent'
export * from './Event/SubscriptionExpiredEventPayload'
export * from './Event/SubscriptionRevertRequestedEvent'
export * from './Event/SubscriptionRevertRequestedEventPayload'
export * from './Event/SubscriptionSyncRequestedEvent'
export * from './Event/SubscriptionSyncRequestedEventPayload'
export * from './Event/UserDisabledSessionUserAgentLoggingEvent'

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.2.3](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.2.2...@standardnotes/event-store@1.2.3) (2022-09-01)
**Note:** Version bump only for package @standardnotes/event-store
## [1.2.2](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.2.1...@standardnotes/event-store@1.2.2) (2022-09-01)
**Note:** Version bump only for package @standardnotes/event-store
## [1.2.1](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.2.0...@standardnotes/event-store@1.2.1) (2022-08-30)
**Note:** Version bump only for package @standardnotes/event-store

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/event-store",
"version": "1.2.1",
"version": "1.2.3",
"description": "Event Store Service",
"private": true,
"main": "dist/src/index.js",

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.5.39](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.5.38...@standardnotes/files-server@1.5.39) (2022-09-01)
**Note:** Version bump only for package @standardnotes/files-server
## [1.5.38](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.5.37...@standardnotes/files-server@1.5.38) (2022-09-01)
**Note:** Version bump only for package @standardnotes/files-server
## [1.5.37](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.5.36...@standardnotes/files-server@1.5.37) (2022-08-30)
**Note:** Version bump only for package @standardnotes/files-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files-server",
"version": "1.5.37",
"version": "1.5.39",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.10.16](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.10.15...@standardnotes/scheduler-server@1.10.16) (2022-09-01)
**Note:** Version bump only for package @standardnotes/scheduler-server
## [1.10.15](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.10.14...@standardnotes/scheduler-server@1.10.15) (2022-09-01)
**Note:** Version bump only for package @standardnotes/scheduler-server
## [1.10.14](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.10.13...@standardnotes/scheduler-server@1.10.14) (2022-08-30)
### Bug Fixes
* **scheduler:** linter issues ([648eb89](https://github.com/standardnotes/server/commit/648eb89c7c7b95cfb6235e38180958c3d332825d))
## [1.10.13](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.10.12...@standardnotes/scheduler-server@1.10.13) (2022-08-30)
### Bug Fixes
* **scheduler:** skip sending exit survery when a subscription is replaced ([35373db](https://github.com/standardnotes/server/commit/35373db1d3d25ae5878ef7f7cfc8594a6623da8a))
## [1.10.12](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.10.11...@standardnotes/scheduler-server@1.10.12) (2022-08-30)
**Note:** Version bump only for package @standardnotes/scheduler-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/scheduler-server",
"version": "1.10.12",
"version": "1.10.16",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -15,6 +15,7 @@
"prebuild": "yarn clean",
"build": "tsc --rootDir ./",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"pretest": "yarn lint && yarn build",
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
"worker": "yarn node dist/bin/worker.js",
@@ -48,6 +49,7 @@
"@types/newrelic": "^7.0.3",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"eslint": "^8.14.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.2",
"npm-check-updates": "^16.0.1",

View File

@@ -24,7 +24,9 @@ describe('SubscriptionCancelledEventHandler', () => {
})
it('should schedule a job to do an exit interview', async () => {
await createHandler().handle({ payload: { userEmail: 'test@test.te' } } as jest.Mocked<SubscriptionCancelledEvent>)
await createHandler().handle({
payload: { userEmail: 'test@test.te', replaced: false },
} as jest.Mocked<SubscriptionCancelledEvent>)
expect(jobRepository.save).toHaveBeenNthCalledWith(1, {
createdAt: 1,
@@ -35,4 +37,12 @@ describe('SubscriptionCancelledEventHandler', () => {
userIdentifierType: 'email',
})
})
it('should not schedule a job to do an exit interview if the subscription is replaced', async () => {
await createHandler().handle({
payload: { userEmail: 'test@test.te', replaced: true },
} as jest.Mocked<SubscriptionCancelledEvent>)
expect(jobRepository.save).not.toHaveBeenCalled()
})
})

View File

@@ -16,7 +16,9 @@ export class SubscriptionCancelledEventHandler implements DomainEventHandlerInte
) {}
async handle(event: SubscriptionCancelledEvent): Promise<void> {
await this.scheduleExitInterview(event)
if (!event.payload.replaced) {
await this.scheduleExitInterview(event)
}
}
private async scheduleExitInterview(event: SubscriptionCancelledEvent): Promise<void> {

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.6.53](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.6.52...@standardnotes/syncing-server@1.6.53) (2022-09-01)
**Note:** Version bump only for package @standardnotes/syncing-server
## [1.6.52](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.6.51...@standardnotes/syncing-server@1.6.52) (2022-09-01)
**Note:** Version bump only for package @standardnotes/syncing-server
## [1.6.51](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.6.50...@standardnotes/syncing-server@1.6.51) (2022-08-30)
**Note:** Version bump only for package @standardnotes/syncing-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.6.51",
"version": "1.6.53",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -2122,6 +2122,7 @@ __metadata:
aws-sdk: ^2.1158.0
dayjs: ^1.11.3
dotenv: ^16.0.1
eslint: ^8.14.0
eslint-plugin-prettier: ^4.0.0
inversify: ^6.0.1
ioredis: ^5.2.0