Compare commits

..

9 Commits

Author SHA1 Message Date
standardci
ac5fc7d28a chore(release): publish new version
- @standardnotes/revisions-server@1.11.3
2023-02-13 08:18:04 +00:00
Karol Sójko
73f3fad13d Revert "fix(revisions): remove inversify.js in favour of simple di container implementation (#442)"
This reverts commit 89ee103303.
2023-02-13 09:02:37 +01:00
standardci
85e0e2165f chore(release): publish new version
- @standardnotes/revisions-server@1.11.2
2023-02-10 14:44:29 +00:00
Karol Sójko
89ee103303 fix(revisions): remove inversify.js in favour of simple di container implementation (#442) 2023-02-10 15:28:03 +01:00
standardci
6b313947c3 chore(release): publish new version
- @standardnotes/revisions-server@1.11.1
2023-02-10 12:20:38 +00:00
Karol Sójko
fba8e6ce35 chore: rearrange workflow deps 2023-02-10 13:05:48 +01:00
Karol Sójko
622c024547 fix(revisions): remove missing middleware binding 2023-02-10 13:00:18 +01:00
Karol Sójko
2c51d92bab chore: reduce Docker image size 2023-02-10 12:58:20 +01:00
Karol Sójko
11ef2ef708 chore: fix publishing flow 2023-02-10 12:57:38 +01:00
10 changed files with 45 additions and 28 deletions

View File

@@ -13,16 +13,9 @@ on:
required: true
jobs:
e2e:
name: E2E
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
secrets: inherit
publish:
runs-on: ubuntu-latest
needs: e2e
steps:
- uses: actions/checkout@v3

View File

@@ -88,15 +88,23 @@ jobs:
- name: Test
run: yarn test
e2e:
needs: build
name: E2E
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
secrets: inherit
publish-self-hosting:
needs: [ test, lint ]
needs: [ test, lint, e2e ]
name: Publish Self Hosting Docker Image
uses: standardnotes/server/.github/workflows/common-self-hosting.yml@main
secrets: inherit
publish-services:
needs: [ test, lint, e2e ]
runs-on: ubuntu-latest
needs: publish-self-hosting
steps:
- name: Checkout code
uses: actions/checkout@v3

View File

@@ -39,4 +39,8 @@ RUN yarn workspace @standardnotes/files-server bundle --no-compress --output-dir
RUN yarn workspace @standardnotes/revisions-server bundle --no-compress --output-directory /opt/bundled/revisions
RUN yarn workspace @standardnotes/api-gateway bundle --no-compress --output-directory /opt/bundled/api-gateway
WORKDIR /opt/bundled
RUN rm -rf /opt/server
ENTRYPOINT ["docker-entrypoint.sh"]

View File

@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.11.3](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.11.2...@standardnotes/revisions-server@1.11.3) (2023-02-13)
### Reverts
* Revert "fix(revisions): remove inversify.js in favour of simple di container implementation (#442)" ([73f3fad](https://github.com/standardnotes/server/commit/73f3fad13da57619f008ed486c1d4114f3bad3b6)), closes [#442](https://github.com/standardnotes/server/issues/442)
## [1.11.2](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.11.1...@standardnotes/revisions-server@1.11.2) (2023-02-10)
### Bug Fixes
* **revisions:** remove inversify.js in favour of simple di container implementation ([#442](https://github.com/standardnotes/server/issues/442)) ([89ee103](https://github.com/standardnotes/server/commit/89ee103303651b2b181c3b79b7a500358165dcf2))
## [1.11.1](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.11.0...@standardnotes/revisions-server@1.11.1) (2023-02-10)
### Bug Fixes
* **revisions:** remove missing middleware binding ([622c024](https://github.com/standardnotes/server/commit/622c024547126a7580274d7e368f3787b809f7bc))
# [1.11.0](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.10.30...@standardnotes/revisions-server@1.11.0) (2023-02-10)
### Bug Fixes

View File

@@ -13,6 +13,9 @@ import TYPES from '../src/Bootstrap/Types'
import { Env } from '../src/Bootstrap/Env'
import { ServerContainerConfigLoader } from '../src/Bootstrap/ServerContainerConfigLoader'
import '../src/Infra/InversifyExpress/InversifyExpressRevisionsController'
import '../src/Infra/InversifyExpress/InversifyExpressHealthCheckController'
const container = new ServerContainerConfigLoader()
void container.load().then((container) => {
const env: Env = container.get(TYPES.Env)

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/revisions-server",
"version": "1.11.0",
"version": "1.11.3",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -13,9 +13,6 @@ import { RevisionHttpMapper } from '../Mapping/RevisionHttpMapper'
import { RevisionMetadataHttpMapper } from '../Mapping/RevisionMetadataHttpMapper'
import { GetRequiredRoleToViewRevision } from '../Domain/UseCase/GetRequiredRoleToViewRevision/GetRequiredRoleToViewRevision'
import { CommonContainerConfigLoader } from './CommonContainerConfigLoader'
import { TYPE } from 'inversify-express-utils'
import { InversifyExpressRevisionsController } from '../Infra/InversifyExpress/InversifyExpressRevisionsController'
import { InversifyExpressHealthCheckController } from '../Infra/InversifyExpress/InversifyExpressHealthCheckController'
export class ServerContainerConfigLoader extends CommonContainerConfigLoader {
override async load(): Promise<Container> {
@@ -87,12 +84,6 @@ export class ServerContainerConfigLoader extends CommonContainerConfigLoader {
)
})
container.bind(TYPE.Controller).toDynamicValue((context: interfaces.Context) => {
return new InversifyExpressRevisionsController(context.container.get(TYPES.RevisionsController))
})
container.bind(TYPE.Controller).toDynamicValue(() => new InversifyExpressHealthCheckController())
return container
}
}

View File

@@ -40,8 +40,6 @@ const TYPES = {
DomainEventSubscriberFactory: Symbol.for('DomainEventSubscriberFactory'),
DomainEventMessageHandler: Symbol.for('DomainEventMessageHandler'),
Timer: Symbol.for('Timer'),
// Middleware
ApiGatewayAuthMiddleware: Symbol.for('ApiGatewayAuthMiddleware'),
}
export default TYPES

View File

@@ -1,7 +1,8 @@
import { httpGet } from 'inversify-express-utils'
import { BaseHttpController, controller, httpGet } from 'inversify-express-utils'
export class InversifyExpressHealthCheckController {
@httpGet('/healthcheck/')
@controller('/healthcheck')
export class InversifyExpressHealthCheckController extends BaseHttpController {
@httpGet('/')
public async get(): Promise<string> {
return 'OK'
}

View File

@@ -1,16 +1,17 @@
import { Request, Response } from 'express'
import { BaseHttpController, httpDelete, httpGet, results } from 'inversify-express-utils'
import { BaseHttpController, controller, httpDelete, httpGet, results } from 'inversify-express-utils'
import { inject } from 'inversify'
import TYPES from '../../Bootstrap/Types'
import { RevisionsController } from '../../Controller/RevisionsController'
@controller('/items/:itemUuid/revisions')
export class InversifyExpressRevisionsController extends BaseHttpController {
constructor(@inject(TYPES.RevisionsController) private revisionsController: RevisionsController) {
super()
}
@httpGet('/items/:itemUuid/revisions/', TYPES.ApiGatewayAuthMiddleware)
@httpGet('/')
public async getRevisions(req: Request, response: Response): Promise<results.JsonResult> {
const result = await this.revisionsController.getRevisions({
itemUuid: req.params.itemUuid,
@@ -20,7 +21,7 @@ export class InversifyExpressRevisionsController extends BaseHttpController {
return this.json(result.data, result.status)
}
@httpGet('/items/:itemUuid/revisions/:uuid', TYPES.ApiGatewayAuthMiddleware)
@httpGet('/:uuid')
public async getRevision(req: Request, response: Response): Promise<results.JsonResult> {
const result = await this.revisionsController.getRevision({
revisionUuid: req.params.uuid,
@@ -30,7 +31,7 @@ export class InversifyExpressRevisionsController extends BaseHttpController {
return this.json(result.data, result.status)
}
@httpDelete('/items/:itemUuid/revisions/:uuid', TYPES.ApiGatewayAuthMiddleware)
@httpDelete('/:uuid')
public async deleteRevision(req: Request, response: Response): Promise<results.JsonResult> {
const result = await this.revisionsController.deleteRevision({
revisionUuid: req.params.uuid,