mirror of
https://github.com/standardnotes/server
synced 2026-05-12 06:57:20 -04:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cdad3143c9 | |||
| 00fe32136e | |||
| 52f56eeb68 | |||
| b595264e31 | |||
| bf04262170 | |||
| fd589922bb | |||
| fb7029f5c1 | |||
| cc4b4f9bf8 |
@@ -3,6 +3,18 @@
|
|||||||
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.12.15](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.12.14...@standardnotes/analytics@2.12.15) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/analytics
|
||||||
|
|
||||||
|
## [2.12.14](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.12.13...@standardnotes/analytics@2.12.14) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/analytics
|
||||||
|
|
||||||
|
## [2.12.13](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.12.12...@standardnotes/analytics@2.12.13) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/analytics
|
||||||
|
|
||||||
## [2.12.12](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.12.11...@standardnotes/analytics@2.12.12) (2022-12-08)
|
## [2.12.12](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.12.11...@standardnotes/analytics@2.12.12) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/analytics
|
**Note:** Version bump only for package @standardnotes/analytics
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/analytics",
|
"name": "@standardnotes/analytics",
|
||||||
"version": "2.12.12",
|
"version": "2.12.15",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.39.19](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.39.18...@standardnotes/api-gateway@1.39.19) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||||
|
|
||||||
|
## [1.39.18](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.39.17...@standardnotes/api-gateway@1.39.18) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||||
|
|
||||||
|
## [1.39.17](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.39.16...@standardnotes/api-gateway@1.39.17) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||||
|
|
||||||
## [1.39.16](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.39.15...@standardnotes/api-gateway@1.39.16) (2022-12-08)
|
## [1.39.16](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.39.15...@standardnotes/api-gateway@1.39.16) (2022-12-08)
|
||||||
|
|
||||||
**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.39.16",
|
"version": "1.39.19",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,26 @@
|
|||||||
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.66.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.66.0...@standardnotes/auth-server@1.66.1) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/auth-server
|
||||||
|
|
||||||
|
# [1.66.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.65.0...@standardnotes/auth-server@1.66.0) (2022-12-09)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **email:** replace offline subscription token created event in favour of email requested ([b595264](https://github.com/standardnotes/server/commit/b595264e313ac5ae5404f6a4a05b90b8c11f7f02))
|
||||||
|
|
||||||
|
# [1.65.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.64.7...@standardnotes/auth-server@1.65.0) (2022-12-09)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **auth:** remove offline subscription token created event in favour of email requested ([fd58992](https://github.com/standardnotes/server/commit/fd589922bba29595a0dfd154a42fe158024fad28))
|
||||||
|
|
||||||
|
## [1.64.7](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.64.6...@standardnotes/auth-server@1.64.7) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/auth-server
|
||||||
|
|
||||||
## [1.64.6](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.64.5...@standardnotes/auth-server@1.64.6) (2022-12-08)
|
## [1.64.6](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.64.5...@standardnotes/auth-server@1.64.6) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/auth-server
|
**Note:** Version bump only for package @standardnotes/auth-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/auth-server",
|
"name": "@standardnotes/auth-server",
|
||||||
"version": "1.64.6",
|
"version": "1.66.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { html } from './offline-subscription-token-created.html'
|
||||||
|
|
||||||
|
export function getSubject(): string {
|
||||||
|
return 'Access to your Standard Notes Subscription Dashboard'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getBody(email: string, offlineSubscriptionDashboardUrl: string): string {
|
||||||
|
return html(email, offlineSubscriptionDashboardUrl)
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { html } from './shared-subscription-invitation-created.html'
|
||||||
|
|
||||||
|
export function getSubject(): string {
|
||||||
|
return 'You have been invited to a Standard Notes subscription'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getBody(inviterIdentifier: string, inviteUuid: string): string {
|
||||||
|
return html(inviterIdentifier, inviteUuid)
|
||||||
|
}
|
||||||
@@ -5,11 +5,5 @@ export function getSubject(email: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getBody(email: string, device: string, browser: string, date: Date): string {
|
export function getBody(email: string, device: string, browser: string, date: Date): string {
|
||||||
const body = html
|
return html(email, device, browser, date.toLocaleString())
|
||||||
|
|
||||||
return body
|
|
||||||
.replace('%%EMAIL%%', email)
|
|
||||||
.replace('%%DEVICE%%', device)
|
|
||||||
.replace('%%BROWSER%%', browser)
|
|
||||||
.replace('%%TIME_AND_DATE%%', date.toLocaleString())
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
export const html = (userEmail: string, offlineSubscriptionDashboardUrl: string) => `<div class="sn-component">
|
||||||
|
<div class="sk-panel static">
|
||||||
|
<div class="sk-panel-content">
|
||||||
|
<div class="sk-panel-section">
|
||||||
|
<h1 class="h1 title sk-panel-row">
|
||||||
|
<div class="sk-panel-column">
|
||||||
|
Access your Standard Notes Subscription Dashboard,
|
||||||
|
</div>
|
||||||
|
</h1>
|
||||||
|
<div class="faded sk-panel-row small">Registered as ${userEmail}</div>
|
||||||
|
</div>
|
||||||
|
<div class="sk-panel-section">
|
||||||
|
<div class="title">Link to your subscription dashboard: <a
|
||||||
|
href="${offlineSubscriptionDashboardUrl}">${offlineSubscriptionDashboardUrl}</a></div>
|
||||||
|
</div>
|
||||||
|
<div class="sk-panel-section">
|
||||||
|
<p>
|
||||||
|
Get help any time by visiting our <a href="https://standardnotes.com/help">Help page</a>
|
||||||
|
or by replying directly to this email.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export const html = (inviterIdentifier: string, inviteUuid: string) => `<p>Hello,</p>
|
||||||
|
<p>You've been invited to join a Standard Notes premium subscription at no cost. ${inviterIdentifier} has invited you to share the benefits of their subscription plan.</p>
|
||||||
|
<p>
|
||||||
|
<a href='https://app.standardnotes.com/?accept-subscription-invite=${inviteUuid}'>Accept Invite</a>
|
||||||
|
</p>`
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
export const html = `
|
export const html = (email: string, device: string, browser: string, timeAndDate: string) => `
|
||||||
<div>
|
<div>
|
||||||
<p>Hello,</p>
|
<p>Hello,</p>
|
||||||
<p>We've detected a new sign-in to your account %%EMAIL%%.</p>
|
<p>We've detected a new sign-in to your account ${email}</p>
|
||||||
<p>
|
<p>
|
||||||
<b>Device type</b>: %%DEVICE%%
|
<b>Device type</b>: ${device}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>Browser type</b>: %%BROWSER%%
|
<b>Browser type</b>: ${browser}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>Time and date</strong>: <span>%%TIME_AND_DATE%%</span>
|
<strong>Time and date</strong>: <span>${timeAndDate}</span>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If this was you, please disregard this email. If it wasn't you, we recommend signing into your account and
|
If this was you, please disregard this email. If it wasn't you, we recommend signing into your account and
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {
|
|||||||
UserEmailChangedEvent,
|
UserEmailChangedEvent,
|
||||||
UserRegisteredEvent,
|
UserRegisteredEvent,
|
||||||
UserRolesChangedEvent,
|
UserRolesChangedEvent,
|
||||||
OfflineSubscriptionTokenCreatedEvent,
|
|
||||||
EmailBackupRequestedEvent,
|
EmailBackupRequestedEvent,
|
||||||
CloudBackupRequestedEvent,
|
CloudBackupRequestedEvent,
|
||||||
ListedAccountRequestedEvent,
|
ListedAccountRequestedEvent,
|
||||||
@@ -290,24 +289,6 @@ export class DomainEventFactory implements DomainEventFactoryInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createOfflineSubscriptionTokenCreatedEvent(token: string, email: string): OfflineSubscriptionTokenCreatedEvent {
|
|
||||||
return {
|
|
||||||
type: 'OFFLINE_SUBSCRIPTION_TOKEN_CREATED',
|
|
||||||
createdAt: this.timer.getUTCDate(),
|
|
||||||
meta: {
|
|
||||||
correlation: {
|
|
||||||
userIdentifier: email,
|
|
||||||
userIdentifierType: 'email',
|
|
||||||
},
|
|
||||||
origin: DomainEventService.Auth,
|
|
||||||
},
|
|
||||||
payload: {
|
|
||||||
token,
|
|
||||||
email,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
createUserRegisteredEvent(dto: {
|
createUserRegisteredEvent(dto: {
|
||||||
userUuid: string
|
userUuid: string
|
||||||
email: string
|
email: string
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import {
|
|||||||
UserRegisteredEvent,
|
UserRegisteredEvent,
|
||||||
UserRolesChangedEvent,
|
UserRolesChangedEvent,
|
||||||
UserEmailChangedEvent,
|
UserEmailChangedEvent,
|
||||||
OfflineSubscriptionTokenCreatedEvent,
|
|
||||||
EmailBackupRequestedEvent,
|
EmailBackupRequestedEvent,
|
||||||
ListedAccountRequestedEvent,
|
ListedAccountRequestedEvent,
|
||||||
UserDisabledSessionUserAgentLoggingEvent,
|
UserDisabledSessionUserAgentLoggingEvent,
|
||||||
@@ -56,7 +55,6 @@ export interface DomainEventFactoryInterface {
|
|||||||
}): AccountDeletionRequestedEvent
|
}): AccountDeletionRequestedEvent
|
||||||
createUserRolesChangedEvent(userUuid: string, email: string, currentRoles: RoleName[]): UserRolesChangedEvent
|
createUserRolesChangedEvent(userUuid: string, email: string, currentRoles: RoleName[]): UserRolesChangedEvent
|
||||||
createUserEmailChangedEvent(userUuid: string, fromEmail: string, toEmail: string): UserEmailChangedEvent
|
createUserEmailChangedEvent(userUuid: string, fromEmail: string, toEmail: string): UserEmailChangedEvent
|
||||||
createOfflineSubscriptionTokenCreatedEvent(token: string, email: string): OfflineSubscriptionTokenCreatedEvent
|
|
||||||
createUserDisabledSessionUserAgentLoggingEvent(dto: {
|
createUserDisabledSessionUserAgentLoggingEvent(dto: {
|
||||||
userUuid: Uuid
|
userUuid: Uuid
|
||||||
email: string
|
email: string
|
||||||
|
|||||||
+7
-10
@@ -5,7 +5,7 @@ import { TimerInterface } from '@standardnotes/time'
|
|||||||
import { OfflineSubscriptionTokenRepositoryInterface } from '../../Auth/OfflineSubscriptionTokenRepositoryInterface'
|
import { OfflineSubscriptionTokenRepositoryInterface } from '../../Auth/OfflineSubscriptionTokenRepositoryInterface'
|
||||||
|
|
||||||
import { CreateOfflineSubscriptionToken } from './CreateOfflineSubscriptionToken'
|
import { CreateOfflineSubscriptionToken } from './CreateOfflineSubscriptionToken'
|
||||||
import { DomainEventPublisherInterface, OfflineSubscriptionTokenCreatedEvent } from '@standardnotes/domain-events'
|
import { DomainEventPublisherInterface, EmailRequestedEvent } from '@standardnotes/domain-events'
|
||||||
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
||||||
import { OfflineUserSubscriptionRepositoryInterface } from '../../Subscription/OfflineUserSubscriptionRepositoryInterface'
|
import { OfflineUserSubscriptionRepositoryInterface } from '../../Subscription/OfflineUserSubscriptionRepositoryInterface'
|
||||||
import { OfflineUserSubscription } from '../../Subscription/OfflineUserSubscription'
|
import { OfflineUserSubscription } from '../../Subscription/OfflineUserSubscription'
|
||||||
@@ -47,9 +47,9 @@ describe('CreateOfflineSubscriptionToken', () => {
|
|||||||
domainEventPublisher.publish = jest.fn()
|
domainEventPublisher.publish = jest.fn()
|
||||||
|
|
||||||
domainEventFactory = {} as jest.Mocked<DomainEventFactoryInterface>
|
domainEventFactory = {} as jest.Mocked<DomainEventFactoryInterface>
|
||||||
domainEventFactory.createOfflineSubscriptionTokenCreatedEvent = jest
|
domainEventFactory.createEmailRequestedEvent = jest
|
||||||
.fn()
|
.fn()
|
||||||
.mockReturnValue({} as jest.Mocked<OfflineSubscriptionTokenCreatedEvent>)
|
.mockReturnValue({} as jest.Mocked<EmailRequestedEvent>)
|
||||||
|
|
||||||
timer = {} as jest.Mocked<TimerInterface>
|
timer = {} as jest.Mocked<TimerInterface>
|
||||||
timer.convertStringDateToMicroseconds = jest.fn().mockReturnValue(1)
|
timer.convertStringDateToMicroseconds = jest.fn().mockReturnValue(1)
|
||||||
@@ -71,10 +71,7 @@ describe('CreateOfflineSubscriptionToken', () => {
|
|||||||
expiresAt: 1,
|
expiresAt: 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(domainEventFactory.createOfflineSubscriptionTokenCreatedEvent).toHaveBeenCalledWith(
|
expect(domainEventFactory.createEmailRequestedEvent).toHaveBeenCalled()
|
||||||
'random-string',
|
|
||||||
'test@test.com',
|
|
||||||
)
|
|
||||||
expect(domainEventPublisher.publish).toHaveBeenCalled()
|
expect(domainEventPublisher.publish).toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -91,7 +88,7 @@ describe('CreateOfflineSubscriptionToken', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
|
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
|
||||||
expect(domainEventFactory.createOfflineSubscriptionTokenCreatedEvent).not.toHaveBeenCalled()
|
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
|
||||||
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
|
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -110,7 +107,7 @@ describe('CreateOfflineSubscriptionToken', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
|
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
|
||||||
expect(domainEventFactory.createOfflineSubscriptionTokenCreatedEvent).not.toHaveBeenCalled()
|
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
|
||||||
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
|
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -129,7 +126,7 @@ describe('CreateOfflineSubscriptionToken', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
|
expect(offlineSubscriptionTokenRepository.save).not.toHaveBeenCalled()
|
||||||
expect(domainEventFactory.createOfflineSubscriptionTokenCreatedEvent).not.toHaveBeenCalled()
|
expect(domainEventFactory.createEmailRequestedEvent).not.toHaveBeenCalled()
|
||||||
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
|
expect(domainEventPublisher.publish).not.toHaveBeenCalled()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
+9
-1
@@ -1,4 +1,5 @@
|
|||||||
import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
||||||
|
import { EmailLevel } from '@standardnotes/domain-core'
|
||||||
import { CryptoNode } from '@standardnotes/sncrypto-node'
|
import { CryptoNode } from '@standardnotes/sncrypto-node'
|
||||||
import { TimerInterface } from '@standardnotes/time'
|
import { TimerInterface } from '@standardnotes/time'
|
||||||
import { inject, injectable } from 'inversify'
|
import { inject, injectable } from 'inversify'
|
||||||
@@ -6,6 +7,7 @@ import { Logger } from 'winston'
|
|||||||
|
|
||||||
import TYPES from '../../../Bootstrap/Types'
|
import TYPES from '../../../Bootstrap/Types'
|
||||||
import { OfflineSubscriptionTokenRepositoryInterface } from '../../Auth/OfflineSubscriptionTokenRepositoryInterface'
|
import { OfflineSubscriptionTokenRepositoryInterface } from '../../Auth/OfflineSubscriptionTokenRepositoryInterface'
|
||||||
|
import { getBody, getSubject } from '../../Email/OfflineSubscriptionTokenCreated'
|
||||||
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
||||||
import { OfflineUserSubscriptionRepositoryInterface } from '../../Subscription/OfflineUserSubscriptionRepositoryInterface'
|
import { OfflineUserSubscriptionRepositoryInterface } from '../../Subscription/OfflineUserSubscriptionRepositoryInterface'
|
||||||
import { UseCaseInterface } from '../UseCaseInterface'
|
import { UseCaseInterface } from '../UseCaseInterface'
|
||||||
@@ -62,7 +64,13 @@ export class CreateOfflineSubscriptionToken implements UseCaseInterface {
|
|||||||
await this.offlineSubscriptionTokenRepository.save(offlineSubscriptionToken)
|
await this.offlineSubscriptionTokenRepository.save(offlineSubscriptionToken)
|
||||||
|
|
||||||
await this.domainEventPublisher.publish(
|
await this.domainEventPublisher.publish(
|
||||||
this.domainEventFactory.createOfflineSubscriptionTokenCreatedEvent(token, dto.userEmail),
|
this.domainEventFactory.createEmailRequestedEvent({
|
||||||
|
body: getBody(dto.userEmail, `https://standardnotes.com/dashboard/offline?subscription_token=${token}`),
|
||||||
|
level: EmailLevel.LEVELS.System,
|
||||||
|
subject: getSubject(),
|
||||||
|
messageIdentifier: 'OFFLINE_SUBSCRIPTION_ACCESS',
|
||||||
|
userEmail: dto.userEmail,
|
||||||
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
+6
-1
@@ -1,6 +1,10 @@
|
|||||||
import 'reflect-metadata'
|
import 'reflect-metadata'
|
||||||
|
|
||||||
import { DomainEventPublisherInterface, SharedSubscriptionInvitationCreatedEvent } from '@standardnotes/domain-events'
|
import {
|
||||||
|
DomainEventPublisherInterface,
|
||||||
|
SharedSubscriptionInvitationCreatedEvent,
|
||||||
|
EmailRequestedEvent,
|
||||||
|
} from '@standardnotes/domain-events'
|
||||||
import { TimerInterface } from '@standardnotes/time'
|
import { TimerInterface } from '@standardnotes/time'
|
||||||
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
||||||
import { SharedSubscriptionInvitationRepositoryInterface } from '../../SharedSubscription/SharedSubscriptionInvitationRepositoryInterface'
|
import { SharedSubscriptionInvitationRepositoryInterface } from '../../SharedSubscription/SharedSubscriptionInvitationRepositoryInterface'
|
||||||
@@ -51,6 +55,7 @@ describe('InviteToSharedSubscription', () => {
|
|||||||
domainEventFactory.createSharedSubscriptionInvitationCreatedEvent = jest
|
domainEventFactory.createSharedSubscriptionInvitationCreatedEvent = jest
|
||||||
.fn()
|
.fn()
|
||||||
.mockReturnValue({} as jest.Mocked<SharedSubscriptionInvitationCreatedEvent>)
|
.mockReturnValue({} as jest.Mocked<SharedSubscriptionInvitationCreatedEvent>)
|
||||||
|
domainEventFactory.createEmailRequestedEvent = jest.fn().mockReturnValue({} as jest.Mocked<EmailRequestedEvent>)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should not create an inivitation for sharing the subscription if inviter has no subscription', async () => {
|
it('should not create an inivitation for sharing the subscription if inviter has no subscription', async () => {
|
||||||
|
|||||||
+12
@@ -1,9 +1,11 @@
|
|||||||
import { RoleName } from '@standardnotes/common'
|
import { RoleName } from '@standardnotes/common'
|
||||||
import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
||||||
|
import { EmailLevel } from '@standardnotes/domain-core'
|
||||||
import { TimerInterface } from '@standardnotes/time'
|
import { TimerInterface } from '@standardnotes/time'
|
||||||
import { inject, injectable } from 'inversify'
|
import { inject, injectable } from 'inversify'
|
||||||
|
|
||||||
import TYPES from '../../../Bootstrap/Types'
|
import TYPES from '../../../Bootstrap/Types'
|
||||||
|
import { getBody, getSubject } from '../../Email/SharedSubscriptionInvitationCreated'
|
||||||
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
import { DomainEventFactoryInterface } from '../../Event/DomainEventFactoryInterface'
|
||||||
import { InvitationStatus } from '../../SharedSubscription/InvitationStatus'
|
import { InvitationStatus } from '../../SharedSubscription/InvitationStatus'
|
||||||
import { InviteeIdentifierType } from '../../SharedSubscription/InviteeIdentifierType'
|
import { InviteeIdentifierType } from '../../SharedSubscription/InviteeIdentifierType'
|
||||||
@@ -89,6 +91,16 @@ export class InviteToSharedSubscription implements UseCaseInterface {
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
await this.domainEventPublisher.publish(
|
||||||
|
this.domainEventFactory.createEmailRequestedEvent({
|
||||||
|
userEmail: dto.inviteeIdentifier,
|
||||||
|
level: EmailLevel.LEVELS.System,
|
||||||
|
body: getBody(dto.inviterEmail, savedInvitation.uuid),
|
||||||
|
messageIdentifier: 'SHARED_SUBSCRIPTION_INVITATION',
|
||||||
|
subject: getSubject(),
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
sharedSubscriptionInvitationUuid: savedInvitation.uuid,
|
sharedSubscriptionInvitationUuid: savedInvitation.uuid,
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.9.49](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.48...@standardnotes/domain-events-infra@1.9.49) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
||||||
|
|
||||||
|
## [1.9.48](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.47...@standardnotes/domain-events-infra@1.9.48) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
||||||
|
|
||||||
|
## [1.9.47](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.46...@standardnotes/domain-events-infra@1.9.47) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
||||||
|
|
||||||
## [1.9.46](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.45...@standardnotes/domain-events-infra@1.9.46) (2022-12-08)
|
## [1.9.46](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.45...@standardnotes/domain-events-infra@1.9.46) (2022-12-08)
|
||||||
|
|
||||||
**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.9.46",
|
"version": "1.9.49",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
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.100.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.99.0...@standardnotes/domain-events@2.100.0) (2022-12-09)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **syncing-server:** remove google drive backup failed event in favour of email requested ([00fe321](https://github.com/standardnotes/server/commit/00fe32136e7add627e58e8ea223f7f484f1d3718))
|
||||||
|
|
||||||
|
# [2.99.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.98.4...@standardnotes/domain-events@2.99.0) (2022-12-09)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **auth:** remove offline subscription token created event in favour of email requested ([fd58992](https://github.com/standardnotes/server/commit/fd589922bba29595a0dfd154a42fe158024fad28))
|
||||||
|
|
||||||
|
## [2.98.4](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.98.3...@standardnotes/domain-events@2.98.4) (2022-12-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **domain-events:** remove unused event ([cc4b4f9](https://github.com/standardnotes/server/commit/cc4b4f9bf831b9aabec7d506d977ee1df50d5222))
|
||||||
|
|
||||||
## [2.98.3](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.98.2...@standardnotes/domain-events@2.98.3) (2022-12-08)
|
## [2.98.3](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.98.2...@standardnotes/domain-events@2.98.3) (2022-12-08)
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/domain-events",
|
"name": "@standardnotes/domain-events",
|
||||||
"version": "2.98.3",
|
"version": "2.100.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
import { DomainEventInterface } from './DomainEventInterface'
|
|
||||||
|
|
||||||
import { GoogleDriveBackupFailedEventPayload } from './GoogleDriveBackupFailedEventPayload'
|
|
||||||
|
|
||||||
export interface GoogleDriveBackupFailedEvent extends DomainEventInterface {
|
|
||||||
type: 'GOOGLE_DRIVE_BACKUP_FAILED'
|
|
||||||
payload: GoogleDriveBackupFailedEventPayload
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export interface GoogleDriveBackupFailedEventPayload {
|
|
||||||
muteCloudEmailsSettingUuid: string
|
|
||||||
extensionSettingUuid?: string
|
|
||||||
email: string
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import { DomainEventInterface } from './DomainEventInterface'
|
|
||||||
|
|
||||||
import { OfflineSubscriptionTokenCreatedEventPayload } from './OfflineSubscriptionTokenCreatedEventPayload'
|
|
||||||
|
|
||||||
export interface OfflineSubscriptionTokenCreatedEvent extends DomainEventInterface {
|
|
||||||
type: 'OFFLINE_SUBSCRIPTION_TOKEN_CREATED'
|
|
||||||
payload: OfflineSubscriptionTokenCreatedEventPayload
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export interface OfflineSubscriptionTokenCreatedEventPayload {
|
|
||||||
token: string
|
|
||||||
email: string
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import { DomainEventInterface } from './DomainEventInterface'
|
|
||||||
|
|
||||||
import { SubscriptionRateAdjustedEventPayload } from './SubscriptionRateAdjustedEventPayload'
|
|
||||||
|
|
||||||
export interface SubscriptionRateAdjustedEvent extends DomainEventInterface {
|
|
||||||
type: 'SUBSCRIPTION_RATE_ADJUSTED'
|
|
||||||
payload: SubscriptionRateAdjustedEventPayload
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export interface SubscriptionRateAdjustedEventPayload {
|
|
||||||
userEmail: string
|
|
||||||
newRateFormatted: string
|
|
||||||
refundAmountInDollarsFormatted: string
|
|
||||||
}
|
|
||||||
@@ -34,8 +34,6 @@ export * from './Event/FileRemovedEvent'
|
|||||||
export * from './Event/FileRemovedEventPayload'
|
export * from './Event/FileRemovedEventPayload'
|
||||||
export * from './Event/FileUploadedEvent'
|
export * from './Event/FileUploadedEvent'
|
||||||
export * from './Event/FileUploadedEventPayload'
|
export * from './Event/FileUploadedEventPayload'
|
||||||
export * from './Event/GoogleDriveBackupFailedEvent'
|
|
||||||
export * from './Event/GoogleDriveBackupFailedEventPayload'
|
|
||||||
export * from './Event/ItemDumpedEvent'
|
export * from './Event/ItemDumpedEvent'
|
||||||
export * from './Event/ItemDumpedEventPayload'
|
export * from './Event/ItemDumpedEventPayload'
|
||||||
export * from './Event/ItemRevisionCreationRequestedEvent'
|
export * from './Event/ItemRevisionCreationRequestedEvent'
|
||||||
@@ -50,8 +48,6 @@ export * from './Event/ListedAccountRequestedEvent'
|
|||||||
export * from './Event/ListedAccountRequestedEventPayload'
|
export * from './Event/ListedAccountRequestedEventPayload'
|
||||||
export * from './Event/MuteEmailsSettingChangedEvent'
|
export * from './Event/MuteEmailsSettingChangedEvent'
|
||||||
export * from './Event/MuteEmailsSettingChangedEventPayload'
|
export * from './Event/MuteEmailsSettingChangedEventPayload'
|
||||||
export * from './Event/OfflineSubscriptionTokenCreatedEvent'
|
|
||||||
export * from './Event/OfflineSubscriptionTokenCreatedEventPayload'
|
|
||||||
export * from './Event/OneDriveBackupFailedEvent'
|
export * from './Event/OneDriveBackupFailedEvent'
|
||||||
export * from './Event/OneDriveBackupFailedEventPayload'
|
export * from './Event/OneDriveBackupFailedEventPayload'
|
||||||
export * from './Event/PaymentFailedEvent'
|
export * from './Event/PaymentFailedEvent'
|
||||||
@@ -76,8 +72,6 @@ export * from './Event/SubscriptionCancelledEvent'
|
|||||||
export * from './Event/SubscriptionCancelledEventPayload'
|
export * from './Event/SubscriptionCancelledEventPayload'
|
||||||
export * from './Event/SubscriptionPurchasedEvent'
|
export * from './Event/SubscriptionPurchasedEvent'
|
||||||
export * from './Event/SubscriptionPurchasedEventPayload'
|
export * from './Event/SubscriptionPurchasedEventPayload'
|
||||||
export * from './Event/SubscriptionRateAdjustedEvent'
|
|
||||||
export * from './Event/SubscriptionRateAdjustedEventPayload'
|
|
||||||
export * from './Event/SubscriptionReactivatedEvent'
|
export * from './Event/SubscriptionReactivatedEvent'
|
||||||
export * from './Event/SubscriptionReactivatedEventPayload'
|
export * from './Event/SubscriptionReactivatedEventPayload'
|
||||||
export * from './Event/SubscriptionReassignedEvent'
|
export * from './Event/SubscriptionReassignedEvent'
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.6.46](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.6.45...@standardnotes/event-store@1.6.46) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/event-store
|
||||||
|
|
||||||
|
## [1.6.45](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.6.44...@standardnotes/event-store@1.6.45) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/event-store
|
||||||
|
|
||||||
|
## [1.6.44](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.6.43...@standardnotes/event-store@1.6.44) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/event-store
|
||||||
|
|
||||||
## [1.6.43](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.6.42...@standardnotes/event-store@1.6.43) (2022-12-08)
|
## [1.6.43](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.6.42...@standardnotes/event-store@1.6.43) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/event-store
|
**Note:** Version bump only for package @standardnotes/event-store
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/event-store",
|
"name": "@standardnotes/event-store",
|
||||||
"version": "1.6.43",
|
"version": "1.6.46",
|
||||||
"description": "Event Store Service",
|
"description": "Event Store Service",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "dist/src/index.js",
|
"main": "dist/src/index.js",
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.8.45](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.8.44...@standardnotes/files-server@1.8.45) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/files-server
|
||||||
|
|
||||||
|
## [1.8.44](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.8.43...@standardnotes/files-server@1.8.44) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/files-server
|
||||||
|
|
||||||
|
## [1.8.43](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.8.42...@standardnotes/files-server@1.8.43) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/files-server
|
||||||
|
|
||||||
## [1.8.42](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.8.41...@standardnotes/files-server@1.8.42) (2022-12-08)
|
## [1.8.42](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.8.41...@standardnotes/files-server@1.8.42) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/files-server
|
**Note:** Version bump only for package @standardnotes/files-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/files-server",
|
"name": "@standardnotes/files-server",
|
||||||
"version": "1.8.42",
|
"version": "1.8.45",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.9.18](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.9.17...@standardnotes/revisions-server@1.9.18) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/revisions-server
|
||||||
|
|
||||||
|
## [1.9.17](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.9.16...@standardnotes/revisions-server@1.9.17) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/revisions-server
|
||||||
|
|
||||||
|
## [1.9.16](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.9.15...@standardnotes/revisions-server@1.9.16) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/revisions-server
|
||||||
|
|
||||||
## [1.9.15](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.9.14...@standardnotes/revisions-server@1.9.15) (2022-12-08)
|
## [1.9.15](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.9.14...@standardnotes/revisions-server@1.9.15) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/revisions-server
|
**Note:** Version bump only for package @standardnotes/revisions-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/revisions-server",
|
"name": "@standardnotes/revisions-server",
|
||||||
"version": "1.9.15",
|
"version": "1.9.18",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.14.10](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.14.9...@standardnotes/scheduler-server@1.14.10) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||||
|
|
||||||
|
## [1.14.9](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.14.8...@standardnotes/scheduler-server@1.14.9) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||||
|
|
||||||
|
## [1.14.8](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.14.7...@standardnotes/scheduler-server@1.14.8) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||||
|
|
||||||
## [1.14.7](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.14.6...@standardnotes/scheduler-server@1.14.7) (2022-12-08)
|
## [1.14.7](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.14.6...@standardnotes/scheduler-server@1.14.7) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/scheduler-server
|
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/scheduler-server",
|
"name": "@standardnotes/scheduler-server",
|
||||||
"version": "1.14.7",
|
"version": "1.14.10",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,20 @@
|
|||||||
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.21.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.20.17...@standardnotes/syncing-server@1.21.0) (2022-12-09)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **syncing-server:** remove google drive backup failed event in favour of email requested ([00fe321](https://github.com/standardnotes/syncing-server-js/commit/00fe32136e7add627e58e8ea223f7f484f1d3718))
|
||||||
|
|
||||||
|
## [1.20.17](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.20.16...@standardnotes/syncing-server@1.20.17) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||||
|
|
||||||
|
## [1.20.16](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.20.15...@standardnotes/syncing-server@1.20.16) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||||
|
|
||||||
## [1.20.15](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.20.14...@standardnotes/syncing-server@1.20.15) (2022-12-08)
|
## [1.20.15](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.20.14...@standardnotes/syncing-server@1.20.15) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/syncing-server
|
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/syncing-server",
|
"name": "@standardnotes/syncing-server",
|
||||||
"version": "1.20.15",
|
"version": "1.21.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { html } from './google-drive-backup-failed.html'
|
||||||
|
|
||||||
|
export function getSubject(): string {
|
||||||
|
return 'Failed Daily Backup to Google Drive Sync'
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getBody(): string {
|
||||||
|
return html
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
export const html = `<p>Hello,</p>
|
||||||
|
<p>We recently tried backing up your data to <strong>Google Drive Sync</strong>, but an issue prevented us from
|
||||||
|
doing
|
||||||
|
so.</p>
|
||||||
|
<p>
|
||||||
|
The usual cause is an expired or revoked token from your sync provider. Please follow
|
||||||
|
<a href='https://standardnotes.com/help/27/how-do-i-enable-dropbox-google-drive-or-onedrive-backups'>these
|
||||||
|
instructions</a>
|
||||||
|
to use CloudLink on the web or desktop Standard Notes application to uninstall then reinstall this sync provider.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
We apologize for any inconvenience this may cause.
|
||||||
|
If you have any questions, please feel free to reply directly to this email.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Thanks,
|
||||||
|
<br>SN</br>
|
||||||
|
</p>
|
||||||
|
<a href='https://app.standardnotes.com/?settings=backups'>Mute these emails</a>`
|
||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
DuplicateItemSyncedEvent,
|
DuplicateItemSyncedEvent,
|
||||||
EmailArchiveExtensionSyncedEvent,
|
EmailArchiveExtensionSyncedEvent,
|
||||||
EmailBackupAttachmentCreatedEvent,
|
EmailBackupAttachmentCreatedEvent,
|
||||||
GoogleDriveBackupFailedEvent,
|
EmailRequestedEvent,
|
||||||
ItemDumpedEvent,
|
ItemDumpedEvent,
|
||||||
ItemRevisionCreationRequestedEvent,
|
ItemRevisionCreationRequestedEvent,
|
||||||
ItemsSyncedEvent,
|
ItemsSyncedEvent,
|
||||||
@@ -149,21 +149,24 @@ export class DomainEventFactory implements DomainEventFactoryInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createGoogleDriveBackupFailedEvent(muteCloudEmailsSettingUuid: string, email: string): GoogleDriveBackupFailedEvent {
|
createEmailRequestedEvent(dto: {
|
||||||
|
userEmail: string
|
||||||
|
messageIdentifier: string
|
||||||
|
level: string
|
||||||
|
body: string
|
||||||
|
subject: string
|
||||||
|
}): EmailRequestedEvent {
|
||||||
return {
|
return {
|
||||||
type: 'GOOGLE_DRIVE_BACKUP_FAILED',
|
type: 'EMAIL_REQUESTED',
|
||||||
createdAt: this.timer.getUTCDate(),
|
createdAt: this.timer.getUTCDate(),
|
||||||
meta: {
|
meta: {
|
||||||
correlation: {
|
correlation: {
|
||||||
userIdentifier: email,
|
userIdentifier: dto.userEmail,
|
||||||
userIdentifierType: 'email',
|
userIdentifierType: 'email',
|
||||||
},
|
},
|
||||||
origin: DomainEventService.SyncingServer,
|
origin: DomainEventService.SyncingServer,
|
||||||
},
|
},
|
||||||
payload: {
|
payload: dto,
|
||||||
muteCloudEmailsSettingUuid,
|
|
||||||
email,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
DuplicateItemSyncedEvent,
|
DuplicateItemSyncedEvent,
|
||||||
EmailArchiveExtensionSyncedEvent,
|
EmailArchiveExtensionSyncedEvent,
|
||||||
EmailBackupAttachmentCreatedEvent,
|
EmailBackupAttachmentCreatedEvent,
|
||||||
GoogleDriveBackupFailedEvent,
|
EmailRequestedEvent,
|
||||||
ItemDumpedEvent,
|
ItemDumpedEvent,
|
||||||
ItemRevisionCreationRequestedEvent,
|
ItemRevisionCreationRequestedEvent,
|
||||||
ItemsSyncedEvent,
|
ItemsSyncedEvent,
|
||||||
@@ -16,7 +16,13 @@ import {
|
|||||||
export interface DomainEventFactoryInterface {
|
export interface DomainEventFactoryInterface {
|
||||||
createUserContentSizeRecalculationRequestedEvent(userUuid: string): UserContentSizeRecalculationRequestedEvent
|
createUserContentSizeRecalculationRequestedEvent(userUuid: string): UserContentSizeRecalculationRequestedEvent
|
||||||
createDropboxBackupFailedEvent(muteCloudEmailsSettingUuid: string, email: string): DropboxBackupFailedEvent
|
createDropboxBackupFailedEvent(muteCloudEmailsSettingUuid: string, email: string): DropboxBackupFailedEvent
|
||||||
createGoogleDriveBackupFailedEvent(muteCloudEmailsSettingUuid: string, email: string): GoogleDriveBackupFailedEvent
|
createEmailRequestedEvent(dto: {
|
||||||
|
userEmail: string
|
||||||
|
messageIdentifier: string
|
||||||
|
level: string
|
||||||
|
body: string
|
||||||
|
subject: string
|
||||||
|
}): EmailRequestedEvent
|
||||||
createOneDriveBackupFailedEvent(muteCloudEmailsSettingUuid: string, email: string): OneDriveBackupFailedEvent
|
createOneDriveBackupFailedEvent(muteCloudEmailsSettingUuid: string, email: string): OneDriveBackupFailedEvent
|
||||||
createItemsSyncedEvent(dto: {
|
createItemsSyncedEvent(dto: {
|
||||||
userUuid: string
|
userUuid: string
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { KeyParamsData } from '@standardnotes/responses'
|
import { KeyParamsData } from '@standardnotes/responses'
|
||||||
import { DomainEventInterface, DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
import { DomainEventInterface, DomainEventPublisherInterface } from '@standardnotes/domain-events'
|
||||||
|
import { EmailLevel } from '@standardnotes/domain-core'
|
||||||
import { AxiosInstance } from 'axios'
|
import { AxiosInstance } from 'axios'
|
||||||
import { inject, injectable } from 'inversify'
|
import { inject, injectable } from 'inversify'
|
||||||
import { Logger } from 'winston'
|
import { Logger } from 'winston'
|
||||||
@@ -10,6 +11,7 @@ import { ItemRepositoryInterface } from '../Item/ItemRepositoryInterface'
|
|||||||
import { ExtensionName } from './ExtensionName'
|
import { ExtensionName } from './ExtensionName'
|
||||||
import { ExtensionsHttpServiceInterface } from './ExtensionsHttpServiceInterface'
|
import { ExtensionsHttpServiceInterface } from './ExtensionsHttpServiceInterface'
|
||||||
import { SendItemsToExtensionsServerDTO } from './SendItemsToExtensionsServerDTO'
|
import { SendItemsToExtensionsServerDTO } from './SendItemsToExtensionsServerDTO'
|
||||||
|
import { getBody, getSubject } from '../Email/GoogleDriveBackupFailed'
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class ExtensionsHttpService implements ExtensionsHttpServiceInterface {
|
export class ExtensionsHttpService implements ExtensionsHttpServiceInterface {
|
||||||
@@ -121,7 +123,13 @@ export class ExtensionsHttpService implements ExtensionsHttpServiceInterface {
|
|||||||
case 'DROPBOX':
|
case 'DROPBOX':
|
||||||
return this.domainEventFactory.createDropboxBackupFailedEvent(muteCloudEmailsSettingUuid, email)
|
return this.domainEventFactory.createDropboxBackupFailedEvent(muteCloudEmailsSettingUuid, email)
|
||||||
case 'GOOGLE_DRIVE':
|
case 'GOOGLE_DRIVE':
|
||||||
return this.domainEventFactory.createGoogleDriveBackupFailedEvent(muteCloudEmailsSettingUuid, email)
|
return this.domainEventFactory.createEmailRequestedEvent({
|
||||||
|
userEmail: email,
|
||||||
|
level: EmailLevel.LEVELS.FailedCloudBackup,
|
||||||
|
body: getBody(),
|
||||||
|
messageIdentifier: 'FAILED_GOOGLE_DRIVE_BACKUP',
|
||||||
|
subject: getSubject(),
|
||||||
|
})
|
||||||
case 'ONE_DRIVE':
|
case 'ONE_DRIVE':
|
||||||
return this.domainEventFactory.createOneDriveBackupFailedEvent(muteCloudEmailsSettingUuid, email)
|
return this.domainEventFactory.createOneDriveBackupFailedEvent(muteCloudEmailsSettingUuid, email)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.4.46](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.4.45...@standardnotes/websockets-server@1.4.46) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/websockets-server
|
||||||
|
|
||||||
|
## [1.4.45](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.4.44...@standardnotes/websockets-server@1.4.45) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/websockets-server
|
||||||
|
|
||||||
|
## [1.4.44](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.4.43...@standardnotes/websockets-server@1.4.44) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/websockets-server
|
||||||
|
|
||||||
## [1.4.43](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.4.42...@standardnotes/websockets-server@1.4.43) (2022-12-08)
|
## [1.4.43](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.4.42...@standardnotes/websockets-server@1.4.43) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/websockets-server
|
**Note:** Version bump only for package @standardnotes/websockets-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/websockets-server",
|
"name": "@standardnotes/websockets-server",
|
||||||
"version": "1.4.43",
|
"version": "1.4.46",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,18 @@
|
|||||||
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.17.45](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.17.44...@standardnotes/workspace-server@1.17.45) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/workspace-server
|
||||||
|
|
||||||
|
## [1.17.44](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.17.43...@standardnotes/workspace-server@1.17.44) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/workspace-server
|
||||||
|
|
||||||
|
## [1.17.43](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.17.42...@standardnotes/workspace-server@1.17.43) (2022-12-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/workspace-server
|
||||||
|
|
||||||
## [1.17.42](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.17.41...@standardnotes/workspace-server@1.17.42) (2022-12-08)
|
## [1.17.42](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.17.41...@standardnotes/workspace-server@1.17.42) (2022-12-08)
|
||||||
|
|
||||||
**Note:** Version bump only for package @standardnotes/workspace-server
|
**Note:** Version bump only for package @standardnotes/workspace-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/workspace-server",
|
"name": "@standardnotes/workspace-server",
|
||||||
"version": "1.17.42",
|
"version": "1.17.45",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0.0 <19.0.0"
|
"node": ">=18.0.0 <19.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user