Compare commits

..

17 Commits

Author SHA1 Message Date
standardci
4ef97ee058 chore(release): publish new version
- @standardnotes/workspace-server@1.14.5
2022-10-17 08:36:07 +00:00
Karol Sójko
6af8ff700e fix(workspaces): allow type of workspace to come from parameters 2022-10-17 10:34:20 +02:00
standardci
7c323a915c chore(release): publish new version
- @standardnotes/workspace-server@1.14.4
2022-10-17 08:04:42 +00:00
Karol Sójko
365d316878 fix(workspaces): listing workspace uuids 2022-10-17 10:02:46 +02:00
Karol Sójko
c40f1312ca fix(syncing-server): github workflow 2022-10-17 09:43:58 +02:00
Karol Sójko
528cd829fd fix(websockets): github workflow 2022-10-17 09:39:53 +02:00
Karol Sójko
fd170f3bad fix(workspaces): cache key 2022-10-17 09:20:43 +02:00
standardci
17388d252b chore(release): publish new version
- @standardnotes/workspace-server@1.14.3
2022-10-17 07:14:13 +00:00
Karol Sójko
d232e71683 fix(workspaces): add debug logs for listing workspaces 2022-10-17 09:12:17 +02:00
standardci
d11928dee7 chore(release): publish new version
- @standardnotes/workspace-server@1.14.2
2022-10-14 12:35:24 +00:00
Karol Sójko
0cacc8efa0 fix(workspace): fetching users workspaces list 2022-10-14 14:33:09 +02:00
Karol Sójko
63b2436d81 chore: fix caching paths 2022-10-14 12:18:47 +02:00
Karol Sójko
faacf92ba3 chore: improve deploy workflow for workspaces 2022-10-14 12:11:43 +02:00
standardci
f0f3dad082 chore(release): publish new version
- @standardnotes/workspace-server@1.14.1
2022-10-14 09:46:43 +00:00
Karol Sójko
d2fcc761ad fix(workspaces): reading response locals when listing workspaces 2022-10-14 11:44:25 +02:00
standardci
79c00b0e7a chore(release): publish new version
- @standardnotes/api-gateway@1.31.2
2022-10-13 11:11:09 +00:00
Karol Sójko
219b1baa41 fix(api-gateway): make web sockets url optional 2022-10-13 13:09:18 +02:00
14 changed files with 418 additions and 46 deletions

View File

@@ -11,12 +11,19 @@ on:
workflow_dispatch:
jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-syncing-server-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
@@ -24,14 +31,89 @@ jobs:
node-version-file: '.nvmrc'
- name: Build
run: yarn build
run: yarn build:syncing-server
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-syncing-server-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:syncing-server
- name: Lint
run: yarn lint:syncing-server
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-syncing-server-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:syncing-server
- name: Test
run: yarn test:syncing-server
e2e:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-syncing-server-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:syncing-server
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
@@ -57,28 +139,41 @@ jobs:
wait_workflow: true
publish-aws-ecr:
needs: test
needs: [ test, lint, e2e ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-syncing-server-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build locally
run: yarn build
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:syncing-server
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
@@ -92,25 +187,37 @@ jobs:
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
publish-docker-hub:
needs: test
needs: [ test, lint, e2e ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-syncing-server-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build locally
run: yarn build
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:syncing-server
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build, tag, and push image to Docker Hub
- name: Publish Docker image as stable
run: |
yarn docker build @standardnotes/syncing-server -t standardnotes/syncing-server-js:latest
docker push standardnotes/syncing-server-js:latest

View File

@@ -11,12 +11,19 @@ on:
workflow_dispatch:
jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-websockets-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
@@ -24,37 +31,100 @@ jobs:
node-version-file: '.nvmrc'
- name: Build
run: yarn build
- name: Lint
run: yarn lint:websockets
- name: Test
run: yarn test:websockets
publish-aws-ecr:
needs: test
run: yarn build:websockets
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-websockets-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build locally
run: yarn build
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:websockets
- name: Lint
run: yarn lint:websockets
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-websockets-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:websockets
- name: Test
run: yarn test:websockets
publish-aws-ecr:
needs: [ test, lint ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-websockets-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:websockets
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
@@ -68,24 +138,36 @@ jobs:
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
publish-docker-hub:
needs: test
needs: [ test, lint ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-websockets-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build locally
run: yarn build
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:websockets
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish Docker image as stable
run: |
yarn docker build @standardnotes/websockets-server -t standardnotes/websockets:latest

View File

@@ -11,12 +11,19 @@ on:
workflow_dispatch:
jobs:
test:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-workspace-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
@@ -24,14 +31,89 @@ jobs:
node-version-file: '.nvmrc'
- name: Build
run: yarn build
run: yarn build:workspace
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-workspace-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:workspace
- name: Lint
run: yarn lint:workspace
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-workspace-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:workspace
- name: Test
run: yarn test:workspace
e2e:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-workspace-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:workspace
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
@@ -57,28 +139,41 @@ jobs:
wait_workflow: true
publish-aws-ecr:
needs: test
needs: [ test, lint, e2e ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-workspace-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build locally
run: yarn build
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:workspace
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
id: build-image
env:
@@ -92,24 +187,36 @@ jobs:
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
publish-docker-hub:
needs: test
needs: [ test, lint, e2e ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: packages/**/dist
key: ${{ runner.os }}-workspace-build-${{ github.sha }}
- name: Set up Node
uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Build locally
run: yarn build
- name: Build
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn build:workspace
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish Docker image as stable
run: |
yarn docker build @standardnotes/workspace-server -t standardnotes/workspace:latest

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.31.2](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.31.1...@standardnotes/api-gateway@1.31.2) (2022-10-13)
### Bug Fixes
* **api-gateway:** make web sockets url optional ([219b1ba](https://github.com/standardnotes/api-gateway/commit/219b1baa41f24ba140f24f48bf9c9d7e01288ed5))
## [1.31.1](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.31.0...@standardnotes/api-gateway@1.31.1) (2022-10-13)
**Note:** Version bump only for package @standardnotes/api-gateway

View File

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

View File

@@ -76,7 +76,7 @@ export class ContainerConfigLoader {
container.bind(TYPES.FILES_SERVER_URL).toConstantValue(env.get('FILES_SERVER_URL', true))
container.bind(TYPES.AUTH_JWT_SECRET).toConstantValue(env.get('AUTH_JWT_SECRET'))
container.bind(TYPES.WORKSPACE_SERVER_URL).toConstantValue(env.get('WORKSPACE_SERVER_URL'))
container.bind(TYPES.WEB_SOCKET_SERVER_URL).toConstantValue(env.get('WEB_SOCKET_SERVER_URL'))
container.bind(TYPES.WEB_SOCKET_SERVER_URL).toConstantValue(env.get('WEB_SOCKET_SERVER_URL', true))
container
.bind(TYPES.HTTP_CALL_TIMEOUT)
.toConstantValue(env.get('HTTP_CALL_TIMEOUT', true) ? +env.get('HTTP_CALL_TIMEOUT', true) : 60_000)

View File

@@ -65,6 +65,12 @@ export class HttpService implements HttpServiceInterface {
endpoint: string,
payload?: Record<string, unknown> | string,
): Promise<void> {
if (!this.webSocketServerUrl) {
this.logger.debug('Websockets Server URL not defined. Skipped request to WebSockets API.')
return
}
await this.callServer(this.webSocketServerUrl, request, response, endpoint, payload)
}

View File

@@ -3,6 +3,36 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.14.5](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.14.4...@standardnotes/workspace-server@1.14.5) (2022-10-17)
### Bug Fixes
* **workspaces:** allow type of workspace to come from parameters ([6af8ff7](https://github.com/standardnotes/server/commit/6af8ff700ea795252d5f8d3a955f27eef9240ae2))
## [1.14.4](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.14.3...@standardnotes/workspace-server@1.14.4) (2022-10-17)
### Bug Fixes
* **workspaces:** listing workspace uuids ([365d316](https://github.com/standardnotes/server/commit/365d316878d8d76256efc102e53ff9868789cbc8))
## [1.14.3](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.14.2...@standardnotes/workspace-server@1.14.3) (2022-10-17)
### Bug Fixes
* **workspaces:** add debug logs for listing workspaces ([d232e71](https://github.com/standardnotes/server/commit/d232e71683d553ddaa41dd2f75716cdf8e62a19f))
## [1.14.2](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.14.1...@standardnotes/workspace-server@1.14.2) (2022-10-14)
### Bug Fixes
* **workspace:** fetching users workspaces list ([0cacc8e](https://github.com/standardnotes/server/commit/0cacc8efa06d6dde0e8cc4486c303082a5ee4211))
## [1.14.1](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.14.0...@standardnotes/workspace-server@1.14.1) (2022-10-14)
### Bug Fixes
* **workspaces:** reading response locals when listing workspaces ([d2fcc76](https://github.com/standardnotes/server/commit/d2fcc761ad30786c7245f379ded996da383c5cfe))
# [1.14.0](https://github.com/standardnotes/server/compare/@standardnotes/workspace-server@1.13.2...@standardnotes/workspace-server@1.14.0) (2022-10-13)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/workspace-server",
"version": "1.14.0",
"version": "1.14.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},

View File

@@ -1,5 +1,6 @@
import { WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import 'reflect-metadata'
import { WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import { ProjectorInterface } from '../Domain/Projection/ProjectorInterface'
import { WorkspaceProjection } from '../Domain/Projection/WorkspaceProjection'
import { WorkspaceUserProjection } from '../Domain/Projection/WorkspaceUserProjection'

View File

@@ -14,7 +14,7 @@ import {
WorkspaceKeyshareInitiatingRequestParams,
WorkspaceKeyshareInitiatingResponse,
} from '@standardnotes/api'
import { Uuid, WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import { Uuid, WorkspaceAccessLevel } from '@standardnotes/common'
import TYPES from '../Bootstrap/Types'
import { CreateWorkspace } from '../Domain/UseCase/CreateWorkspace/CreateWorkspace'
@@ -93,7 +93,7 @@ export class WorkspacesController implements WorkspaceServerInterface {
encryptedWorkspaceKey: params.encryptedWorkspaceKey,
publicKey: params.publicKey,
name: params.workspaceName,
type: WorkspaceType.Root,
type: params.workspaceType,
ownerUuid: params.ownerUuid as string,
})

View File

@@ -1,5 +1,7 @@
import { WorkspaceAccessLevel } from '@standardnotes/common'
import 'reflect-metadata'
import { WorkspaceAccessLevel } from '@standardnotes/common'
import { Logger } from 'winston'
import { Workspace } from '../../Workspace/Workspace'
import { WorkspaceRepositoryInterface } from '../../Workspace/WorkspaceRepositoryInterface'
import { WorkspaceUser } from '../../Workspace/WorkspaceUser'
@@ -14,10 +16,14 @@ describe('ListWorkspaces', () => {
let joinedWorkspace: Workspace
let workspaceUser1: WorkspaceUser
let workspaceUser2: WorkspaceUser
let logger: Logger
const createUseCase = () => new ListWorkspaces(workspaceRepository, workspaceUserRepository)
const createUseCase = () => new ListWorkspaces(workspaceRepository, workspaceUserRepository, logger)
beforeEach(() => {
logger = {} as jest.Mocked<Logger>
logger.debug = jest.fn()
ownedWorkspace = { uuid: 'o-1-2-3' } as jest.Mocked<Workspace>
joinedWorkspace = { uuid: 'j-1-2-3' } as jest.Mocked<Workspace>
@@ -44,4 +50,17 @@ describe('ListWorkspaces', () => {
joinedWorkspaces: [joinedWorkspace],
})
})
it('should list empty owned and joined workspaces for a user that does not have any', async () => {
workspaceUserRepository.findByUserUuid = jest.fn().mockReturnValue([])
const result = await createUseCase().execute({
userUuid: 'u-1-2-3',
})
expect(result).toEqual({
ownedWorkspaces: [],
joinedWorkspaces: [],
})
})
})

View File

@@ -1,7 +1,9 @@
import { WorkspaceAccessLevel } from '@standardnotes/common'
import { inject, injectable } from 'inversify'
import { Logger } from 'winston'
import TYPES from '../../../Bootstrap/Types'
import { Workspace } from '../../Workspace/Workspace'
import { WorkspaceRepositoryInterface } from '../../Workspace/WorkspaceRepositoryInterface'
import { WorkspaceUserRepositoryInterface } from '../../Workspace/WorkspaceUserRepositoryInterface'
import { UseCaseInterface } from '../UseCaseInterface'
@@ -14,23 +16,35 @@ export class ListWorkspaces implements UseCaseInterface {
constructor(
@inject(TYPES.WorkspaceRepository) private workspaceRepository: WorkspaceRepositoryInterface,
@inject(TYPES.WorkspaceUserRepository) private workspaceUserRepository: WorkspaceUserRepositoryInterface,
@inject(TYPES.Logger) private logger: Logger,
) {}
async execute(dto: ListWorkspacesDTO): Promise<ListWorkspacesResponse> {
this.logger.debug(`Listing workspaces for user ${dto.userUuid}`)
const workspaceAssociations = await this.workspaceUserRepository.findByUserUuid(dto.userUuid)
const ownedWorkspacesUuids = []
const joinedWorkspacesUuids = []
for (const workspaceAssociation of workspaceAssociations) {
if ([WorkspaceAccessLevel.Admin, WorkspaceAccessLevel.Owner].includes(workspaceAssociation.accessLevel)) {
ownedWorkspacesUuids.push(workspaceAssociation.uuid)
ownedWorkspacesUuids.push(workspaceAssociation.workspaceUuid)
} else {
joinedWorkspacesUuids.push(workspaceAssociation.uuid)
joinedWorkspacesUuids.push(workspaceAssociation.workspaceUuid)
}
}
const ownedWorkspaces = await this.workspaceRepository.findByUuids(ownedWorkspacesUuids)
const joinedWorkspaces = await this.workspaceRepository.findByUuids(joinedWorkspacesUuids)
this.logger.debug(`Owned workspaces uuids: ${JSON.stringify(ownedWorkspacesUuids)}`)
this.logger.debug(`Joined workspaces uuids: ${JSON.stringify(joinedWorkspacesUuids)}`)
let ownedWorkspaces: Array<Workspace> = []
if (ownedWorkspacesUuids.length > 0) {
ownedWorkspaces = await this.workspaceRepository.findByUuids(ownedWorkspacesUuids)
}
let joinedWorkspaces: Array<Workspace> = []
if (joinedWorkspacesUuids.length > 0) {
joinedWorkspaces = await this.workspaceRepository.findByUuids(joinedWorkspacesUuids)
}
return {
ownedWorkspaces,

View File

@@ -21,7 +21,7 @@ export class InversifyExpressWorkspacesController extends BaseHttpController {
}
@httpGet('/')
async listWorkspaces(response: Response): Promise<results.JsonResult> {
async listWorkspaces(_request: Request, response: Response): Promise<results.JsonResult> {
const result = await this.workspacesController.listWorkspaces({
userUuid: response.locals.user.uuid,
})