Compare commits

...

4 Commits

Author SHA1 Message Date
standardci
6ffce30a36 chore(release): publish new version
- @standardnotes/api-gateway@1.68.0
 - @standardnotes/home-server@1.13.15
 - @standardnotes/syncing-server@1.72.0
2023-07-27 06:28:46 +00:00
Karol Sójko
f5a57d886c fix: show logs on failing suite 2023-07-27 08:13:49 +02:00
Karol Sójko
e8ba49ecca feat(syncing-server): add deleting outbound messages
Co-authored-by: Mo <mo@standardnotes.com>
2023-07-27 08:06:56 +02:00
Karol Sójko
c79a5dc94b fix: add e2e yarn command for convenience 2023-07-26 15:23:08 +02:00
17 changed files with 98 additions and 14 deletions

View File

@@ -128,3 +128,9 @@ jobs:
- name: Run E2E Test Suite
run: yarn dlx mocha-headless-chrome --timeout 1200000 -f http://localhost:9001/mocha/test.html
- name: Show logs on failure
if: ${{ failure()}}
run: |
tail -n 100 logs/*.err
tail -n 100 logs/*.log

View File

@@ -17,7 +17,8 @@
"release": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish new version\"",
"publish": "lerna publish from-git --yes --no-verify-access --loglevel verbose",
"postversion": "./scripts/push-tags-one-by-one.sh",
"upgrade:snjs": "yarn workspaces foreach --verbose run upgrade:snjs"
"upgrade:snjs": "yarn workspaces foreach --verbose run upgrade:snjs",
"e2e": "yarn build packages/home-server && PORT=3123 yarn workspace @standardnotes/home-server start"
},
"devDependencies": {
"@commitlint/cli": "^17.0.2",

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.68.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.67.4...@standardnotes/api-gateway@1.68.0) (2023-07-27)
### Features
* **syncing-server:** add deleting outbound messages ([e8ba49e](https://github.com/standardnotes/api-gateway/commit/e8ba49ecca38ab10c0ea0e1f4cf4db9fb17366db))
## [1.67.4](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.67.3...@standardnotes/api-gateway@1.67.4) (2023-07-26)
**Note:** Version bump only for package @standardnotes/api-gateway

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api-gateway",
"version": "1.67.4",
"version": "1.68.0",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -83,6 +83,16 @@ export class SharedVaultInvitesController extends BaseHttpController {
)
}
@httpDelete('/invites/outbound')
async deleteOutboundUserInvites(request: Request, response: Response): Promise<void> {
await this.httpService.callSyncingServer(
request,
response,
this.endpointResolver.resolveEndpointOrMethodIdentifier('DELETE', 'shared-vaults/invites/outbound'),
request.body,
)
}
@httpGet('/invites/outbound')
async getOutboundUserInvites(request: Request, response: Response): Promise<void> {
await this.httpService.callSyncingServer(

View File

@@ -79,6 +79,7 @@ export class EndpointResolver implements EndpointResolverInterface {
['[POST]:shared-vaults/:sharedVaultUuid/invites/:inviteUuid/accept', 'sync.shared-vault-invites.accept'],
['[POST]:shared-vaults/:sharedVaultUuid/invites/:inviteUuid/decline', 'sync.shared-vault-invites.decline'],
['[DELETE]:shared-vaults/invites/inbound', 'sync.shared-vault-invites.delete-inbound'],
['[DELETE]:shared-vaults/invites/outbound', 'sync.shared-vault-invites.delete-outbound'],
['[GET]:shared-vaults/invites/outbound', 'sync.shared-vault-invites.get-outbound'],
['[GET]:shared-vaults/invites', 'sync.shared-vault-invites.get-user-invites'],
['[GET]:shared-vaults/:sharedVaultUuid/invites', 'sync.shared-vault-invites.get-vault-invites'],

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.13.15](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.13.14...@standardnotes/home-server@1.13.15) (2023-07-27)
**Note:** Version bump only for package @standardnotes/home-server
## [1.13.14](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.13.13...@standardnotes/home-server@1.13.14) (2023-07-26)
**Note:** Version bump only for package @standardnotes/home-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.13.14",
"version": "1.13.15",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.72.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.71.0...@standardnotes/syncing-server@1.72.0) (2023-07-27)
### Features
* **syncing-server:** add deleting outbound messages ([e8ba49e](https://github.com/standardnotes/syncing-server-js/commit/e8ba49ecca38ab10c0ea0e1f4cf4db9fb17366db))
# [1.71.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.70.5...@standardnotes/syncing-server@1.71.0) (2023-07-26)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.71.0",
"version": "1.72.0",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -24,6 +24,7 @@ describe('DeleteSharedVaultInvitesSentByUser', () => {
sharedVaultInviteRepository = {} as jest.Mocked<SharedVaultInviteRepositoryInterface>
sharedVaultInviteRepository.findBySenderUuidAndSharedVaultUuid = jest.fn().mockReturnValue([sharedVaultInvite])
sharedVaultInviteRepository.findBySenderUuid = jest.fn().mockReturnValue([sharedVaultInvite])
declineInviteToSharedVault = {} as jest.Mocked<DeclineInviteToSharedVault>
declineInviteToSharedVault.execute = jest.fn().mockReturnValue(Result.ok())
@@ -75,4 +76,15 @@ describe('DeleteSharedVaultInvitesSentByUser', () => {
expect(result.isFailed()).toBeTruthy()
})
it('should decline all invites by user to all shared vaults', async () => {
const useCase = createUseCase()
const result = await useCase.execute({
userUuid: '00000000-0000-0000-0000-000000000000',
})
expect(result.isFailed()).toBeFalsy()
expect(declineInviteToSharedVault.execute).toHaveBeenCalled()
})
})

View File

@@ -16,16 +16,22 @@ export class DeleteSharedVaultInvitesSentByUser implements UseCaseInterface<void
}
const userUuid = userUuidOrError.getValue()
const sharedVaultUuidOrError = Uuid.create(dto.sharedVaultUuid)
if (sharedVaultUuidOrError.isFailed()) {
return Result.fail(sharedVaultUuidOrError.getError())
}
const sharedVaultUuid = sharedVaultUuidOrError.getValue()
let inboundInvites = []
if (dto.sharedVaultUuid !== undefined) {
const sharedVaultUuidOrError = Uuid.create(dto.sharedVaultUuid)
if (sharedVaultUuidOrError.isFailed()) {
return Result.fail(sharedVaultUuidOrError.getError())
}
const sharedVaultUuid = sharedVaultUuidOrError.getValue()
inboundInvites = await this.sharedVaultInviteRepository.findBySenderUuidAndSharedVaultUuid({
senderUuid: userUuid,
sharedVaultUuid,
})
} else {
inboundInvites = await this.sharedVaultInviteRepository.findBySenderUuid(userUuid)
}
const inboundInvites = await this.sharedVaultInviteRepository.findBySenderUuidAndSharedVaultUuid({
senderUuid: userUuid,
sharedVaultUuid,
})
for (const invite of inboundInvites) {
const result = await this.declineInviteToSharedVault.execute({
inviteUuid: invite.id.toString(),

View File

@@ -1,4 +1,4 @@
export interface DeleteSharedVaultInvitesSentByUserDTO {
userUuid: string
sharedVaultUuid: string
sharedVaultUuid?: string
}

View File

@@ -38,6 +38,10 @@ export class HomeServerSharedVaultInvitesController extends BaseHttpController {
'sync.shared-vault-invites.delete-inbound',
this.deleteInboundUserInvites.bind(this),
)
this.controllerContainer.register(
'sync.shared-vault-invites.delete-outbound',
this.deleteOutboundUserInvites.bind(this),
)
this.controllerContainer.register(
'sync.shared-vault-invites.get-outbound',
this.getOutboundUserInvites.bind(this),
@@ -172,6 +176,27 @@ export class HomeServerSharedVaultInvitesController extends BaseHttpController {
})
}
async deleteOutboundUserInvites(_request: Request, response: Response): Promise<results.JsonResult> {
const result = await this.deleteSharedVaultInvitesSentByUserUseCase.execute({
userUuid: response.locals.user.uuid,
})
if (result.isFailed()) {
return this.json(
{
error: {
message: result.getError(),
},
},
HttpStatusCode.BadRequest,
)
}
return this.json({
success: true,
})
}
async getOutboundUserInvites(_request: Request, response: Response): Promise<results.JsonResult> {
const result = await this.getSharedVaultInvitesSentByUserUseCase.execute({
senderUuid: response.locals.user.uuid,

View File

@@ -72,6 +72,11 @@ export class InversifyExpressSharedVaultInvitesController extends HomeServerShar
return super.deleteInboundUserInvites(request, response)
}
@httpDelete('/invites/outbound')
override async deleteOutboundUserInvites(request: Request, response: Response): Promise<results.JsonResult> {
return super.deleteOutboundUserInvites(request, response)
}
@httpGet('/invites/outbound')
override async getOutboundUserInvites(request: Request, response: Response): Promise<results.JsonResult> {
return super.getOutboundUserInvites(request, response)

View File

@@ -14,6 +14,7 @@ export class MessageHttpMapper implements MapperInterface<Message, MessageHttpRe
recipient_uuid: domain.props.recipientUuid.value,
sender_uuid: domain.props.senderUuid.value,
encrypted_message: domain.props.encryptedMessage,
replaceability_identifier: domain.props.replaceabilityIdentifier,
created_at_timestamp: domain.props.timestamps.createdAt,
updated_at_timestamp: domain.props.timestamps.updatedAt,
}

View File

@@ -3,6 +3,7 @@ export interface MessageHttpRepresentation {
recipient_uuid: string
sender_uuid: string
encrypted_message: string
replaceability_identifier: string | null
created_at_timestamp: number
updated_at_timestamp: number
}