mirror of
https://github.com/standardnotes/server
synced 2026-02-03 11:01:13 -05:00
Compare commits
19 Commits
@standardn
...
@standardn
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2707e87554 | ||
|
|
4b40c59e7e | ||
|
|
f2e8579f95 | ||
|
|
57118c85e3 | ||
|
|
8ddc7b0a58 | ||
|
|
bc63d0aeea | ||
|
|
9def26e809 | ||
|
|
74ac709bb5 | ||
|
|
1f749fad49 | ||
|
|
13c85d4331 | ||
|
|
77d2099cdb | ||
|
|
56a312f217 | ||
|
|
aa2b3dac49 | ||
|
|
1a8daef79d | ||
|
|
a83d133f93 | ||
|
|
b0d01dffd9 | ||
|
|
b74e7ce86d | ||
|
|
671f7a7074 | ||
|
|
55fd873b37 |
BIN
.yarn/cache/@isaacs-string-locale-compare-npm-1.1.0-3911094464-1850e9aace.zip
vendored
Normal file
BIN
.yarn/cache/@isaacs-string-locale-compare-npm-1.1.0-3911094464-1850e9aace.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@lerna-lite-cli-npm-2.4.0-e29fb88577-49ba068860.zip
vendored
Normal file
BIN
.yarn/cache/@lerna-lite-cli-npm-2.4.0-e29fb88577-49ba068860.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@lerna-lite-core-npm-2.4.0-31a2234f99-2020a69410.zip
vendored
Normal file
BIN
.yarn/cache/@lerna-lite-core-npm-2.4.0-31a2234f99-2020a69410.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@lerna-lite-init-npm-2.4.0-5b6724cede-3d22543c85.zip
vendored
Normal file
BIN
.yarn/cache/@lerna-lite-init-npm-2.4.0-5b6724cede-3d22543c85.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@lerna-lite-publish-npm-2.4.0-49c294ccfe-6602eea941.zip
vendored
Normal file
BIN
.yarn/cache/@lerna-lite-publish-npm-2.4.0-49c294ccfe-6602eea941.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@lerna-lite-version-npm-2.4.0-02c72ba459-d3168a7847.zip
vendored
Normal file
BIN
.yarn/cache/@lerna-lite-version-npm-2.4.0-02c72ba459-d3168a7847.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-arborist-npm-6.2.9-20cd372bfb-8153cac1b5.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-arborist-npm-6.2.9-20cd372bfb-8153cac1b5.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-map-workspaces-npm-3.0.4-b07359726d-a4bb13f082.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-map-workspaces-npm-3.0.4-b07359726d-a4bb13f082.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-metavuln-calculator-npm-5.0.1-b28e316793-7aba3fb70b.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-metavuln-calculator-npm-5.0.1-b28e316793-7aba3fb70b.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-name-from-folder-npm-2.0.0-18e2dba870-bb8e989c76.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-name-from-folder-npm-2.0.0-18e2dba870-bb8e989c76.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-package-json-npm-3.1.0-ba411bfc47-ebfa841624.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-package-json-npm-3.1.0-ba411bfc47-ebfa841624.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-query-npm-3.0.0-53c05bcb30-595d5e705d.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-query-npm-3.0.0-53c05bcb30-595d5e705d.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@npmcli-run-script-npm-6.0.2-6a98dec431-783cc4dd14.zip
vendored
Normal file
BIN
.yarn/cache/@npmcli-run-script-npm-6.0.2-6a98dec431-783cc4dd14.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@octokit-core-npm-4.2.1-ed461a1d34-684a190793.zip
vendored
Normal file
BIN
.yarn/cache/@octokit-core-npm-4.2.1-ed461a1d34-684a190793.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@octokit-openapi-types-npm-17.2.0-e9456595e7-5f3e3df6a2.zip
vendored
Normal file
BIN
.yarn/cache/@octokit-openapi-types-npm-17.2.0-e9456595e7-5f3e3df6a2.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@octokit-plugin-paginate-rest-npm-6.1.2-3b2443d1e8-f3132eecfe.zip
vendored
Normal file
BIN
.yarn/cache/@octokit-plugin-paginate-rest-npm-6.1.2-3b2443d1e8-f3132eecfe.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.1.2-a791f6ceb4-9c58ca45d7.zip
vendored
Normal file
BIN
.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-7.1.2-a791f6ceb4-9c58ca45d7.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@octokit-rest-npm-19.0.11-6a50f10c37-f9a8d44d12.zip
vendored
Normal file
BIN
.yarn/cache/@octokit-rest-npm-19.0.11-6a50f10c37-f9a8d44d12.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@octokit-tsconfig-npm-1.0.2-abab4615e2-63ee1320dd.zip
vendored
Normal file
BIN
.yarn/cache/@octokit-tsconfig-npm-1.0.2-abab4615e2-63ee1320dd.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/@octokit-types-npm-9.2.3-7489397f39-8c780a0a0d.zip
vendored
Normal file
BIN
.yarn/cache/@octokit-types-npm-9.2.3-7489397f39-8c780a0a0d.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/abbrev-npm-2.0.0-0eb38a17e5-e407d8fbca.zip
vendored
Normal file
BIN
.yarn/cache/abbrev-npm-2.0.0-0eb38a17e5-e407d8fbca.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/bin-links-npm-4.0.1-08882d205f-e1beccbd80.zip
vendored
Normal file
BIN
.yarn/cache/bin-links-npm-4.0.1-08882d205f-e1beccbd80.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/byte-size-npm-8.1.1-d16084355d-01b87f5bce.zip
vendored
Normal file
BIN
.yarn/cache/byte-size-npm-8.1.1-d16084355d-01b87f5bce.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/cacache-npm-17.1.3-f75f768a29-19b4f65a5b.zip
vendored
Normal file
BIN
.yarn/cache/cacache-npm-17.1.3-f75f768a29-19b4f65a5b.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/cmd-shim-npm-6.0.1-87ebf774a0-4da4389704.zip
vendored
Normal file
BIN
.yarn/cache/cmd-shim-npm-6.0.1-87ebf774a0-4da4389704.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/common-ancestor-path-npm-1.0.1-27534e68da-4cacc5522d.zip
vendored
Normal file
BIN
.yarn/cache/common-ancestor-path-npm-1.0.1-27534e68da-4cacc5522d.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/cssesc-npm-3.0.0-15ec56f86f-5e8fcfb6a0.zip
vendored
Normal file
BIN
.yarn/cache/cssesc-npm-3.0.0-15ec56f86f-5e8fcfb6a0.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/glob-npm-10.2.6-dcc609070c-edd296a1a2.zip
vendored
Normal file
BIN
.yarn/cache/glob-npm-10.2.6-dcc609070c-edd296a1a2.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/inquirer-npm-9.2.6-f7257ad8c1-bf38d97063.zip
vendored
Normal file
BIN
.yarn/cache/inquirer-npm-9.2.6-f7257ad8c1-bf38d97063.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/json-stringify-nice-npm-1.1.4-0b0ddb188b-16655d05f3.zip
vendored
Normal file
BIN
.yarn/cache/json-stringify-nice-npm-1.1.4-0b0ddb188b-16655d05f3.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/just-diff-apply-npm-5.5.0-04951e29f4-4eb46fb13c.zip
vendored
Normal file
BIN
.yarn/cache/just-diff-apply-npm-5.5.0-04951e29f4-4eb46fb13c.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/just-diff-npm-6.0.2-f73771d84e-d6e071e531.zip
vendored
Normal file
BIN
.yarn/cache/just-diff-npm-6.0.2-f73771d84e-d6e071e531.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/libnpmaccess-npm-7.0.2-57b91bfda5-1f3ca15577.zip
vendored
Normal file
BIN
.yarn/cache/libnpmaccess-npm-7.0.2-57b91bfda5-1f3ca15577.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/libnpmpublish-npm-7.2.0-20e435842a-ae1c23f524.zip
vendored
Normal file
BIN
.yarn/cache/libnpmpublish-npm-7.2.0-20e435842a-ae1c23f524.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/minimatch-npm-9.0.1-277fdc6fbd-6648745fd9.zip
vendored
Normal file
BIN
.yarn/cache/minimatch-npm-9.0.1-277fdc6fbd-6648745fd9.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/minipass-npm-6.0.2-a7fca64b94-9d8e7a2dc7.zip
vendored
Normal file
BIN
.yarn/cache/minipass-npm-6.0.2-a7fca64b94-9d8e7a2dc7.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/nopt-npm-7.1.0-8189bf0f5a-911351c85f.zip
vendored
Normal file
BIN
.yarn/cache/nopt-npm-7.1.0-8189bf0f5a-911351c85f.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/pacote-npm-15.2.0-b9ed3321e9-246cea3e74.zip
vendored
Normal file
BIN
.yarn/cache/pacote-npm-15.2.0-b9ed3321e9-246cea3e74.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/parse-conflict-json-npm-3.0.1-9455a1ad04-e01557cee1.zip
vendored
Normal file
BIN
.yarn/cache/parse-conflict-json-npm-3.0.1-9455a1ad04-e01557cee1.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/postcss-selector-parser-npm-6.0.13-f732d92326-1ffd229360.zip
vendored
Normal file
BIN
.yarn/cache/postcss-selector-parser-npm-6.0.13-f732d92326-1ffd229360.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/promise-all-reject-late-npm-1.0.1-19ba0dce9c-9cc3755c99.zip
vendored
Normal file
BIN
.yarn/cache/promise-all-reject-late-npm-1.0.1-19ba0dce9c-9cc3755c99.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/promise-call-limit-npm-1.0.2-2a84fbc485-ea473cc712.zip
vendored
Normal file
BIN
.yarn/cache/promise-call-limit-npm-1.0.2-2a84fbc485-ea473cc712.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/read-cmd-shim-npm-4.0.0-2339b15fb0-c005572ad9.zip
vendored
Normal file
BIN
.yarn/cache/read-cmd-shim-npm-4.0.0-2339b15fb0-c005572ad9.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/run-async-npm-3.0.0-bfba9a6e47-18831602b5.zip
vendored
Normal file
BIN
.yarn/cache/run-async-npm-3.0.0-bfba9a6e47-18831602b5.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/semver-npm-7.5.1-0736382fb9-20fce78943.zip
vendored
Normal file
BIN
.yarn/cache/semver-npm-7.5.1-0736382fb9-20fce78943.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/sigstore-npm-1.5.2-b102310995-92977e20a4.zip
vendored
Normal file
BIN
.yarn/cache/sigstore-npm-1.5.2-b102310995-92977e20a4.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/slash-npm-5.1.0-718a84282e-b690dceaaf.zip
vendored
Normal file
BIN
.yarn/cache/slash-npm-5.1.0-718a84282e-b690dceaaf.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/tar-npm-6.1.15-44c3e71720-815c25f881.zip
vendored
Normal file
BIN
.yarn/cache/tar-npm-6.1.15-44c3e71720-815c25f881.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/treeverse-npm-3.0.0-6c6d119afd-630728f9c3.zip
vendored
Normal file
BIN
.yarn/cache/treeverse-npm-3.0.0-6c6d119afd-630728f9c3.zip
vendored
Normal file
Binary file not shown.
BIN
.yarn/cache/walk-up-path-npm-3.0.1-67ab100d5d-0416c26e4f.zip
vendored
Normal file
BIN
.yarn/cache/walk-up-path-npm-3.0.1-67ab100d5d-0416c26e4f.zip
vendored
Normal file
Binary file not shown.
@@ -24,6 +24,7 @@
|
||||
"@commitlint/config-conventional": "^17.0.2",
|
||||
"@lerna-lite/cli": "^2.3.0",
|
||||
"@lerna-lite/list": "^2.3.0",
|
||||
"@lerna-lite/publish": "^2.4.0",
|
||||
"@lerna-lite/run": "^2.3.0",
|
||||
"@lerna-lite/version": "^2.3.0",
|
||||
"@types/jest": "^29.5.1",
|
||||
|
||||
@@ -3,6 +3,26 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.23.5](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.23.4...@standardnotes/analytics@2.23.5) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/analytics
|
||||
|
||||
## [2.23.4](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.23.3...@standardnotes/analytics@2.23.4) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/analytics
|
||||
|
||||
## [2.23.3](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.23.2...@standardnotes/analytics@2.23.3) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/analytics
|
||||
|
||||
## [2.23.2](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.23.1...@standardnotes/analytics@2.23.2) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/analytics
|
||||
|
||||
## [2.23.1](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.23.0...@standardnotes/analytics@2.23.1) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/analytics
|
||||
|
||||
# [2.23.0](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.22.5...@standardnotes/analytics@2.23.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/analytics",
|
||||
"version": "2.23.0",
|
||||
"version": "2.23.5",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,50 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.62.2](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.62.1...@standardnotes/api-gateway@1.62.2) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||
|
||||
## [1.62.1](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.62.0...@standardnotes/api-gateway@1.62.1) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/api-gateway
|
||||
|
||||
# [1.62.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.61.5...@standardnotes/api-gateway@1.62.0) (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **home-server:** add custom home server logs ([#619](https://github.com/standardnotes/api-gateway/issues/619)) ([bc63d0a](https://github.com/standardnotes/api-gateway/commit/bc63d0aeea86abbb4a144b2682b7070d7bdfe878))
|
||||
|
||||
## [1.61.5](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.61.4...@standardnotes/api-gateway@1.61.5) (2023-05-31)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "Revert "feat: make home server components publishable (#617)"" ([13c85d4](https://github.com/standardnotes/api-gateway/commit/13c85d43318caa0fb53726f13ea581ba4a5f816b)), closes [#617](https://github.com/standardnotes/api-gateway/issues/617)
|
||||
|
||||
## [1.61.4](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.61.3...@standardnotes/api-gateway@1.61.4) (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **home-server:** make the package publishable ([56a312f](https://github.com/standardnotes/api-gateway/commit/56a312f21730b32b766c358a5ceb0865722bac46))
|
||||
|
||||
## [1.61.3](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.61.2...@standardnotes/api-gateway@1.61.3) (2023-05-30)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "feat: make home server components publishable (#617)" ([1a8daef](https://github.com/standardnotes/api-gateway/commit/1a8daef79d55a8cdee1632b294b897176af64b26)), closes [#617](https://github.com/standardnotes/api-gateway/issues/617)
|
||||
|
||||
## [1.61.2](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.61.0...@standardnotes/api-gateway@1.61.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/api-gateway/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [1.61.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.60.0...@standardnotes/api-gateway@1.61.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* make home server components publishable ([#617](https://github.com/standardnotes/api-gateway/issues/617)) ([55fd873](https://github.com/standardnotes/api-gateway/commit/55fd873b375e204dc9b0477b2cc6ed4582e5b603))
|
||||
|
||||
# [1.60.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.59.0...@standardnotes/api-gateway@1.60.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
{
|
||||
"name": "@standardnotes/api-gateway",
|
||||
"version": "1.60.0",
|
||||
"version": "1.62.2",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"description": "API Gateway For Standard Notes Services",
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
@@ -13,8 +12,11 @@
|
||||
"dist/src/**/*.d.ts"
|
||||
],
|
||||
"repository": "git@github.com:standardnotes/api-gateway.git",
|
||||
"author": "Karol Sójko <karolsojko@standardnotes.com>",
|
||||
"author": "Karol Sójko <karol@standardnotes.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -fr dist",
|
||||
"build": "tsc --build",
|
||||
@@ -52,6 +54,7 @@
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/jsonwebtoken": "^9.0.1",
|
||||
"@types/newrelic": "^9.13.0",
|
||||
"@types/node": "^20.2.5",
|
||||
"@types/prettyjson": "^0.0.30",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
|
||||
@@ -21,12 +21,13 @@ import { EndpointResolverInterface } from '../Service/Resolver/EndpointResolverI
|
||||
import { EndpointResolver } from '../Service/Resolver/EndpointResolver'
|
||||
import { RequiredCrossServiceTokenMiddleware } from '../Controller/RequiredCrossServiceTokenMiddleware'
|
||||
import { OptionalCrossServiceTokenMiddleware } from '../Controller/OptionalCrossServiceTokenMiddleware'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const newrelicFormatter = require('@newrelic/winston-enricher')
|
||||
|
||||
export class ContainerConfigLoader {
|
||||
async load(serviceContainer?: ServiceContainerInterface): Promise<Container> {
|
||||
async load(configuration?: { serviceContainer?: ServiceContainerInterface; logger?: Transform }): Promise<Container> {
|
||||
const env: Env = new Env()
|
||||
env.load()
|
||||
|
||||
@@ -40,13 +41,17 @@ export class ContainerConfigLoader {
|
||||
winstonFormatters.push(newrelicWinstonFormatter())
|
||||
}
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'api-gateway' },
|
||||
})
|
||||
container.bind<winston.Logger>(TYPES.Logger).toConstantValue(logger)
|
||||
if (configuration?.logger) {
|
||||
container.bind<winston.Logger>(TYPES.Logger).toConstantValue(configuration.logger as winston.Logger)
|
||||
} else {
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'api-gateway' },
|
||||
})
|
||||
container.bind<winston.Logger>(TYPES.Logger).toConstantValue(logger)
|
||||
}
|
||||
|
||||
if (!isConfiguredForHomeServer) {
|
||||
const redisUrl = env.get('REDIS_URL')
|
||||
@@ -91,12 +96,14 @@ export class ContainerConfigLoader {
|
||||
|
||||
// Services
|
||||
if (isConfiguredForHomeServer) {
|
||||
if (!serviceContainer) {
|
||||
if (!configuration?.serviceContainer) {
|
||||
throw new Error('Service container is required when configured for home server')
|
||||
}
|
||||
container
|
||||
.bind<ServiceProxyInterface>(TYPES.ServiceProxy)
|
||||
.toConstantValue(new DirectCallServiceProxy(serviceContainer, container.get(TYPES.FILES_SERVER_URL)))
|
||||
.toConstantValue(
|
||||
new DirectCallServiceProxy(configuration.serviceContainer, container.get(TYPES.FILES_SERVER_URL)),
|
||||
)
|
||||
} else {
|
||||
container.bind<ServiceProxyInterface>(TYPES.ServiceProxy).to(HttpServiceProxy)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import { ServiceContainerInterface, ServiceIdentifier, ServiceInterface } from '@standardnotes/domain-core'
|
||||
|
||||
import { ContainerConfigLoader } from './Container'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
export class Service implements ServiceInterface {
|
||||
private logger: Transform | undefined
|
||||
|
||||
constructor(private serviceContainer: ServiceContainerInterface) {
|
||||
this.serviceContainer.register(this.getId(), this)
|
||||
}
|
||||
|
||||
setLogger(logger: Transform): void {
|
||||
this.logger = logger
|
||||
}
|
||||
|
||||
async handleRequest(_request: never, _response: never, _endpointOrMethodIdentifier: string): Promise<unknown> {
|
||||
throw new Error('Requests are handled via inversify-express at ApiGateway level')
|
||||
}
|
||||
@@ -14,7 +21,10 @@ export class Service implements ServiceInterface {
|
||||
async getContainer(): Promise<unknown> {
|
||||
const config = new ContainerConfigLoader()
|
||||
|
||||
return config.load(this.serviceContainer)
|
||||
return config.load({
|
||||
serviceContainer: this.serviceContainer,
|
||||
logger: this.logger,
|
||||
})
|
||||
}
|
||||
|
||||
getId(): ServiceIdentifier {
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
export * from './Service'
|
||||
export * from './Types'
|
||||
|
||||
@@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.115.2](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.115.1...@standardnotes/auth-server@1.115.2) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/auth-server
|
||||
|
||||
## [1.115.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.115.0...@standardnotes/auth-server@1.115.1) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/auth-server
|
||||
|
||||
# [1.115.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.114.6...@standardnotes/auth-server@1.115.0) (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **home-server:** add custom home server logs ([#619](https://github.com/standardnotes/server/issues/619)) ([bc63d0a](https://github.com/standardnotes/server/commit/bc63d0aeea86abbb4a144b2682b7070d7bdfe878))
|
||||
|
||||
## [1.114.6](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.114.5...@standardnotes/auth-server@1.114.6) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/auth-server
|
||||
|
||||
## [1.114.5](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.114.4...@standardnotes/auth-server@1.114.5) (2023-05-31)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "Revert "feat: make home server components publishable (#617)"" ([13c85d4](https://github.com/standardnotes/server/commit/13c85d43318caa0fb53726f13ea581ba4a5f816b)), closes [#617](https://github.com/standardnotes/server/issues/617)
|
||||
|
||||
## [1.114.4](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.114.3...@standardnotes/auth-server@1.114.4) (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **home-server:** make the package publishable ([56a312f](https://github.com/standardnotes/server/commit/56a312f21730b32b766c358a5ceb0865722bac46))
|
||||
|
||||
## [1.114.3](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.114.2...@standardnotes/auth-server@1.114.3) (2023-05-30)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "feat: make home server components publishable (#617)" ([1a8daef](https://github.com/standardnotes/server/commit/1a8daef79d55a8cdee1632b294b897176af64b26)), closes [#617](https://github.com/standardnotes/server/issues/617)
|
||||
|
||||
## [1.114.2](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.114.0...@standardnotes/auth-server@1.114.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/server/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [1.114.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.113.0...@standardnotes/auth-server@1.114.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* make home server components publishable ([#617](https://github.com/standardnotes/server/issues/617)) ([55fd873](https://github.com/standardnotes/server/commit/55fd873b375e204dc9b0477b2cc6ed4582e5b603))
|
||||
|
||||
# [1.113.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.112.0...@standardnotes/auth-server@1.113.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
{
|
||||
"name": "@standardnotes/auth-server",
|
||||
"version": "1.113.0",
|
||||
"version": "1.115.2",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"description": "Auth Server",
|
||||
"main": "dist/src/index.js",
|
||||
"typings": "dist/src/index.d.ts",
|
||||
"author": "Karol Sójko <karolsojko@standardnotes.com>",
|
||||
"author": "Karol Sójko <karol@standardnotes.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -fr dist",
|
||||
"setup:env": "cp .env.sample .env",
|
||||
@@ -80,6 +82,7 @@
|
||||
"@types/ioredis": "^5.0.0",
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/newrelic": "^9.13.0",
|
||||
"@types/node": "^20.2.5",
|
||||
"@types/otplib": "^10.0.0",
|
||||
"@types/prettyjson": "^0.0.30",
|
||||
"@types/ua-parser-js": "^0.7.36",
|
||||
|
||||
@@ -250,6 +250,7 @@ import { HomeServerUsersController } from '../Infra/InversifyExpressUtils/HomeSe
|
||||
import { HomeServerValetTokenController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerValetTokenController'
|
||||
import { HomeServerWebSocketsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerWebSocketsController'
|
||||
import { HomeServerSessionsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerSessionsController'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const newrelicFormatter = require('@newrelic/winston-enricher')
|
||||
@@ -258,6 +259,7 @@ export class ContainerConfigLoader {
|
||||
async load(configuration?: {
|
||||
controllerConatiner?: ControllerContainerInterface
|
||||
directCallDomainEventPublisher?: DirectCallDomainEventPublisher
|
||||
logger?: Transform
|
||||
}): Promise<Container> {
|
||||
const directCallDomainEventPublisher =
|
||||
configuration?.directCallDomainEventPublisher ?? new DirectCallDomainEventPublisher()
|
||||
@@ -290,13 +292,17 @@ export class ContainerConfigLoader {
|
||||
winstonFormatters.push(newrelicWinstonFormatter())
|
||||
}
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'auth' },
|
||||
})
|
||||
container.bind<winston.Logger>(TYPES.Auth_Logger).toConstantValue(logger)
|
||||
if (configuration?.logger) {
|
||||
container.bind<winston.Logger>(TYPES.Auth_Logger).toConstantValue(configuration.logger as winston.Logger)
|
||||
} else {
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'auth' },
|
||||
})
|
||||
container.bind<winston.Logger>(TYPES.Auth_Logger).toConstantValue(logger)
|
||||
}
|
||||
|
||||
container.bind<TimerInterface>(TYPES.Auth_Timer).toConstantValue(new Timer())
|
||||
|
||||
|
||||
@@ -7,8 +7,11 @@ import {
|
||||
|
||||
import { ContainerConfigLoader } from './Container'
|
||||
import { DirectCallDomainEventPublisher } from '@standardnotes/domain-events-infra'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
export class Service implements ServiceInterface {
|
||||
private logger: Transform | undefined
|
||||
|
||||
constructor(
|
||||
private serviceContainer: ServiceContainerInterface,
|
||||
private controllerContainer: ControllerContainerInterface,
|
||||
@@ -17,6 +20,10 @@ export class Service implements ServiceInterface {
|
||||
this.serviceContainer.register(this.getId(), this)
|
||||
}
|
||||
|
||||
setLogger(logger: Transform): void {
|
||||
this.logger = logger
|
||||
}
|
||||
|
||||
async handleRequest(request: never, response: never, endpointOrMethodIdentifier: string): Promise<unknown> {
|
||||
const method = this.controllerContainer.get(endpointOrMethodIdentifier)
|
||||
|
||||
@@ -33,6 +40,7 @@ export class Service implements ServiceInterface {
|
||||
return config.load({
|
||||
controllerConatiner: this.controllerContainer,
|
||||
directCallDomainEventPublisher: this.directCallDomainEventPublisher,
|
||||
logger: this.logger,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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.48.2](https://github.com/standardnotes/server/compare/@standardnotes/common@1.48.0...@standardnotes/common@1.48.2) (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **common:** bump version ([74ac709](https://github.com/standardnotes/server/commit/74ac709bb5e78aa5a01db34592873a42674ce138))
|
||||
|
||||
# [1.48.0](https://github.com/standardnotes/server/compare/@standardnotes/common@1.47.1...@standardnotes/common@1.48.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/common",
|
||||
"version": "1.48.0",
|
||||
"version": "1.48.2",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [1.17.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.16.2...@standardnotes/domain-core@1.17.0) (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **home-server:** add custom home server logs ([#619](https://github.com/standardnotes/server/issues/619)) ([bc63d0a](https://github.com/standardnotes/server/commit/bc63d0aeea86abbb4a144b2682b7070d7bdfe878))
|
||||
|
||||
## [1.16.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.16.0...@standardnotes/domain-core@1.16.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/server/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [1.16.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-core@1.15.0...@standardnotes/domain-core@1.16.0) (2023-05-29)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/domain-core",
|
||||
"version": "1.16.0",
|
||||
"version": "1.17.0",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
@@ -27,6 +27,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/node": "^20.2.5",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { ServiceIdentifier } from './ServiceIdentifier'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
export interface ServiceInterface {
|
||||
getContainer(): Promise<unknown>
|
||||
setLogger(logger: Transform): void
|
||||
getId(): ServiceIdentifier
|
||||
handleRequest(request: never, response: never, endpointOrMethodIdentifier: string): Promise<unknown>
|
||||
}
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.12.3](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.12.2...@standardnotes/domain-events-infra@1.12.3) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/domain-events-infra
|
||||
|
||||
## [1.12.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.12.0...@standardnotes/domain-events-infra@1.12.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/server/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [1.12.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.11.2...@standardnotes/domain-events-infra@1.12.0) (2023-05-17)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/domain-events-infra",
|
||||
"version": "1.12.0",
|
||||
"version": "1.12.3",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,16 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [2.111.3](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.111.2...@standardnotes/domain-events@2.111.3) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/domain-events
|
||||
|
||||
## [2.111.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.111.0...@standardnotes/domain-events@2.111.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/server/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [2.111.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.110.2...@standardnotes/domain-events@2.111.0) (2023-05-17)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/domain-events",
|
||||
"version": "2.111.0",
|
||||
"version": "2.111.3",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -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.9.4](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.9.3...@standardnotes/event-store@1.9.4) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/event-store
|
||||
|
||||
## [1.9.3](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.9.2...@standardnotes/event-store@1.9.3) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/event-store
|
||||
|
||||
## [1.9.2](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.9.1...@standardnotes/event-store@1.9.2) (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **home-server:** make the package publishable ([56a312f](https://github.com/standardnotes/server/commit/56a312f21730b32b766c358a5ceb0865722bac46))
|
||||
|
||||
## [1.9.1](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.9.0...@standardnotes/event-store@1.9.1) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/event-store
|
||||
|
||||
# [1.9.0](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.8.3...@standardnotes/event-store@1.9.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/event-store",
|
||||
"version": "1.9.0",
|
||||
"version": "1.9.4",
|
||||
"description": "Event Store Service",
|
||||
"private": true,
|
||||
"main": "dist/src/index.js",
|
||||
@@ -16,7 +16,7 @@
|
||||
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
|
||||
"worker": "yarn node dist/bin/worker.js"
|
||||
},
|
||||
"author": "Karol Sójko <karolsojko@standardnotes.com>",
|
||||
"author": "Karol Sójko <karol@standardnotes.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@types/ioredis": "^5.0.0",
|
||||
|
||||
@@ -3,6 +3,44 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.16.2](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.16.1...@standardnotes/files-server@1.16.2) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/files-server
|
||||
|
||||
## [1.16.1](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.16.0...@standardnotes/files-server@1.16.1) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/files-server
|
||||
|
||||
# [1.16.0](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.15.4...@standardnotes/files-server@1.16.0) (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **home-server:** add custom home server logs ([#619](https://github.com/standardnotes/files/issues/619)) ([bc63d0a](https://github.com/standardnotes/files/commit/bc63d0aeea86abbb4a144b2682b7070d7bdfe878))
|
||||
|
||||
## [1.15.4](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.15.3...@standardnotes/files-server@1.15.4) (2023-05-31)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "Revert "feat: make home server components publishable (#617)"" ([13c85d4](https://github.com/standardnotes/files/commit/13c85d43318caa0fb53726f13ea581ba4a5f816b)), closes [#617](https://github.com/standardnotes/files/issues/617)
|
||||
|
||||
## [1.15.3](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.15.2...@standardnotes/files-server@1.15.3) (2023-05-30)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "feat: make home server components publishable (#617)" ([1a8daef](https://github.com/standardnotes/files/commit/1a8daef79d55a8cdee1632b294b897176af64b26)), closes [#617](https://github.com/standardnotes/files/issues/617)
|
||||
|
||||
## [1.15.2](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.15.0...@standardnotes/files-server@1.15.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/files/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [1.15.0](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.14.0...@standardnotes/files-server@1.15.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* make home server components publishable ([#617](https://github.com/standardnotes/files/issues/617)) ([55fd873](https://github.com/standardnotes/files/commit/55fd873b375e204dc9b0477b2cc6ed4582e5b603))
|
||||
|
||||
# [1.14.0](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.13.0...@standardnotes/files-server@1.14.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
{
|
||||
"name": "@standardnotes/files-server",
|
||||
"version": "1.14.0",
|
||||
"version": "1.16.2",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"description": "Standard Notes Files Server",
|
||||
"main": "dist/src/index.js",
|
||||
"typings": "dist/src/index.d.ts",
|
||||
@@ -13,6 +12,9 @@
|
||||
"Karol Sójko <karol@standardnotes.com>"
|
||||
],
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -fr dist",
|
||||
"setup:env": "cp .env.sample .env",
|
||||
@@ -62,6 +64,7 @@
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/jsonwebtoken": "^9.0.1",
|
||||
"@types/newrelic": "^9.13.0",
|
||||
"@types/node": "^20.2.5",
|
||||
"@types/prettyjson": "^0.0.30",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
|
||||
@@ -47,9 +47,13 @@ import { MarkFilesToBeRemoved } from '../Domain/UseCase/MarkFilesToBeRemoved/Mar
|
||||
import { AccountDeletionRequestedEventHandler } from '../Domain/Handler/AccountDeletionRequestedEventHandler'
|
||||
import { SharedSubscriptionInvitationCanceledEventHandler } from '../Domain/Handler/SharedSubscriptionInvitationCanceledEventHandler'
|
||||
import { InMemoryUploadRepository } from '../Infra/InMemory/InMemoryUploadRepository'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
export class ContainerConfigLoader {
|
||||
async load(configuration?: { directCallDomainEventPublisher?: DirectCallDomainEventPublisher }): Promise<Container> {
|
||||
async load(configuration?: {
|
||||
directCallDomainEventPublisher?: DirectCallDomainEventPublisher
|
||||
logger?: Transform
|
||||
}): Promise<Container> {
|
||||
const directCallDomainEventPublisher =
|
||||
configuration?.directCallDomainEventPublisher ?? new DirectCallDomainEventPublisher()
|
||||
|
||||
@@ -60,8 +64,11 @@ export class ContainerConfigLoader {
|
||||
|
||||
const isConfiguredForHomeServer = env.get('CACHE_TYPE') === 'memory'
|
||||
|
||||
const logger = this.createLogger({ env })
|
||||
container.bind<winston.Logger>(TYPES.Files_Logger).toConstantValue(logger)
|
||||
if (configuration?.logger) {
|
||||
container.bind<winston.Logger>(TYPES.Files_Logger).toConstantValue(configuration.logger as winston.Logger)
|
||||
} else {
|
||||
container.bind<winston.Logger>(TYPES.Files_Logger).toConstantValue(this.createLogger({ env }))
|
||||
}
|
||||
|
||||
container.bind<TimerInterface>(TYPES.Files_Timer).toConstantValue(new Timer())
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ import { ServiceContainerInterface, ServiceIdentifier, ServiceInterface } from '
|
||||
import { DirectCallDomainEventPublisher } from '@standardnotes/domain-events-infra'
|
||||
|
||||
import { ContainerConfigLoader } from './Container'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
export class Service implements ServiceInterface {
|
||||
private logger: Transform | undefined
|
||||
|
||||
constructor(
|
||||
private serviceContainer: ServiceContainerInterface,
|
||||
private directCallDomainEventPublisher: DirectCallDomainEventPublisher,
|
||||
@@ -11,6 +14,10 @@ export class Service implements ServiceInterface {
|
||||
this.serviceContainer.register(this.getId(), this)
|
||||
}
|
||||
|
||||
setLogger(logger: Transform): void {
|
||||
this.logger = logger
|
||||
}
|
||||
|
||||
async handleRequest(_request: never, _response: never, _endpointOrMethodIdentifier: string): Promise<unknown> {
|
||||
throw new Error('Requests are handled via inversify-express at ApiGateway level')
|
||||
}
|
||||
@@ -20,6 +27,7 @@ export class Service implements ServiceInterface {
|
||||
|
||||
return config.load({
|
||||
directCallDomainEventPublisher: this.directCallDomainEventPublisher,
|
||||
logger: this.logger,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,46 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.7.2](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.7.1...@standardnotes/home-server@1.7.2) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
## [1.7.1](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.7.0...@standardnotes/home-server@1.7.1) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
# [1.7.0](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.7...@standardnotes/home-server@1.7.0) (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **home-server:** add custom home server logs ([#619](https://github.com/standardnotes/server/issues/619)) ([bc63d0a](https://github.com/standardnotes/server/commit/bc63d0aeea86abbb4a144b2682b7070d7bdfe878))
|
||||
|
||||
## [1.6.7](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.6...@standardnotes/home-server@1.6.7) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
## [1.6.6](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.5...@standardnotes/home-server@1.6.6) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
## [1.6.5](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.4...@standardnotes/home-server@1.6.5) (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **home-server:** make the package publishable ([56a312f](https://github.com/standardnotes/server/commit/56a312f21730b32b766c358a5ceb0865722bac46))
|
||||
|
||||
## [1.6.4](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.3...@standardnotes/home-server@1.6.4) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
## [1.6.3](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.2...@standardnotes/home-server@1.6.3) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
## [1.6.2](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.1...@standardnotes/home-server@1.6.2) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
## [1.6.1](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.6.0...@standardnotes/home-server@1.6.1) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/home-server
|
||||
|
||||
@@ -1,108 +1,8 @@
|
||||
import 'reflect-metadata'
|
||||
import { HomeServer } from '../src/Server/HomeServer'
|
||||
|
||||
import { ControllerContainer, ServiceContainer } from '@standardnotes/domain-core'
|
||||
import { Service as ApiGatewayService, TYPES as ApiGatewayTYPES } from '@standardnotes/api-gateway'
|
||||
import { Service as FilesService } from '@standardnotes/files-server'
|
||||
import { DirectCallDomainEventPublisher } from '@standardnotes/domain-events-infra'
|
||||
import { Service as AuthService } from '@standardnotes/auth-server'
|
||||
import { Service as SyncingService } from '@standardnotes/syncing-server'
|
||||
import { Service as RevisionsService } from '@standardnotes/revisions-server'
|
||||
import { Container } from 'inversify'
|
||||
import { InversifyExpressServer } from 'inversify-express-utils'
|
||||
import helmet from 'helmet'
|
||||
import * as cors from 'cors'
|
||||
import { text, json, Request, Response, NextFunction } from 'express'
|
||||
import * as winston from 'winston'
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const robots = require('express-robots-txt')
|
||||
const homeServer = new HomeServer()
|
||||
|
||||
import { Env } from '../src/Bootstrap/Env'
|
||||
|
||||
const startServer = async (): Promise<void> => {
|
||||
const controllerContainer = new ControllerContainer()
|
||||
const serviceContainer = new ServiceContainer()
|
||||
const directCallDomainEventPublisher = new DirectCallDomainEventPublisher()
|
||||
|
||||
const apiGatewayService = new ApiGatewayService(serviceContainer)
|
||||
const authService = new AuthService(serviceContainer, controllerContainer, directCallDomainEventPublisher)
|
||||
const syncingService = new SyncingService(serviceContainer, controllerContainer, directCallDomainEventPublisher)
|
||||
const revisionsService = new RevisionsService(serviceContainer, controllerContainer, directCallDomainEventPublisher)
|
||||
const filesService = new FilesService(serviceContainer, directCallDomainEventPublisher)
|
||||
|
||||
const container = Container.merge(
|
||||
(await apiGatewayService.getContainer()) as Container,
|
||||
(await authService.getContainer()) as Container,
|
||||
(await syncingService.getContainer()) as Container,
|
||||
(await revisionsService.getContainer()) as Container,
|
||||
(await filesService.getContainer()) as Container,
|
||||
)
|
||||
|
||||
const env: Env = new Env()
|
||||
env.load()
|
||||
|
||||
const server = new InversifyExpressServer(container)
|
||||
|
||||
server.setConfig((app) => {
|
||||
/* eslint-disable */
|
||||
app.use(helmet({
|
||||
contentSecurityPolicy: {
|
||||
directives: {
|
||||
defaultSrc: ["https: 'self'"],
|
||||
baseUri: ["'self'"],
|
||||
childSrc: ["*", "blob:"],
|
||||
connectSrc: ["*"],
|
||||
fontSrc: ["*", "'self'"],
|
||||
formAction: ["'self'"],
|
||||
frameAncestors: ["*", "*.standardnotes.org", "*.standardnotes.com"],
|
||||
frameSrc: ["*", "blob:"],
|
||||
imgSrc: ["'self'", "*", "data:"],
|
||||
manifestSrc: ["'self'"],
|
||||
mediaSrc: ["'self'"],
|
||||
objectSrc: ["'self'"],
|
||||
scriptSrc: ["'self'"],
|
||||
styleSrc: ["'self'"]
|
||||
}
|
||||
}
|
||||
}))
|
||||
/* eslint-enable */
|
||||
app.use(json({ limit: '50mb' }))
|
||||
app.use(
|
||||
text({
|
||||
type: ['text/plain', 'application/x-www-form-urlencoded', 'application/x-www-form-urlencoded; charset=utf-8'],
|
||||
}),
|
||||
)
|
||||
app.use(cors())
|
||||
app.use(
|
||||
robots({
|
||||
UserAgent: '*',
|
||||
Disallow: '/',
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
const logger: winston.Logger = container.get(ApiGatewayTYPES.Logger)
|
||||
|
||||
server.setErrorConfig((app) => {
|
||||
app.use((error: Record<string, unknown>, _request: Request, response: Response, _next: NextFunction) => {
|
||||
logger.error(error.stack)
|
||||
|
||||
response.status(500).send({
|
||||
error: {
|
||||
message:
|
||||
"Unfortunately, we couldn't handle your request. Please try again or contact our support if the error persists.",
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const serverInstance = server.build()
|
||||
|
||||
serverInstance.listen(env.get('PORT', true) ? +env.get('PORT', true) : 3000)
|
||||
|
||||
logger.info(`Server started on port ${process.env.PORT}`)
|
||||
}
|
||||
|
||||
Promise.resolve(startServer()).catch((error) => {
|
||||
Promise.resolve(homeServer.start()).catch((error) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Could not start server: ${error.message}`)
|
||||
})
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
{
|
||||
"name": "@standardnotes/home-server",
|
||||
"version": "1.6.1",
|
||||
"version": "1.7.2",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"description": "Standard Notes Home Server",
|
||||
"main": "dist/src/index.js",
|
||||
"typings": "dist/src/index.d.ts",
|
||||
"repository": "git@github.com:standardnotes/server.git",
|
||||
"author": "Karol Sójko <karolsojko@standardnotes.com>",
|
||||
"author": "Karol Sójko <karol@standardnotes.com>",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"scripts": {
|
||||
"clean": "rm -fr dist",
|
||||
|
||||
164
packages/home-server/src/Server/HomeServer.ts
Normal file
164
packages/home-server/src/Server/HomeServer.ts
Normal file
@@ -0,0 +1,164 @@
|
||||
import 'reflect-metadata'
|
||||
|
||||
import { ControllerContainer, ServiceContainer } from '@standardnotes/domain-core'
|
||||
import { Service as ApiGatewayService } from '@standardnotes/api-gateway'
|
||||
import { Service as FilesService } from '@standardnotes/files-server'
|
||||
import { DirectCallDomainEventPublisher } from '@standardnotes/domain-events-infra'
|
||||
import { Service as AuthService } from '@standardnotes/auth-server'
|
||||
import { Service as SyncingService } from '@standardnotes/syncing-server'
|
||||
import { Service as RevisionsService } from '@standardnotes/revisions-server'
|
||||
import { Container } from 'inversify'
|
||||
import { InversifyExpressServer } from 'inversify-express-utils'
|
||||
import helmet from 'helmet'
|
||||
import * as cors from 'cors'
|
||||
import * as http from 'http'
|
||||
import { text, json, Request, Response, NextFunction } from 'express'
|
||||
import * as winston from 'winston'
|
||||
import { PassThrough } from 'stream'
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const robots = require('express-robots-txt')
|
||||
|
||||
import { Env } from '../Bootstrap/Env'
|
||||
import { HomeServerInterface } from './HomeServerInterface'
|
||||
|
||||
export class HomeServer implements HomeServerInterface {
|
||||
private serverInstance: http.Server | undefined
|
||||
|
||||
async start(): Promise<void> {
|
||||
const controllerContainer = new ControllerContainer()
|
||||
const serviceContainer = new ServiceContainer()
|
||||
const directCallDomainEventPublisher = new DirectCallDomainEventPublisher()
|
||||
|
||||
const env: Env = new Env()
|
||||
env.load()
|
||||
|
||||
this.configureLoggers(env)
|
||||
|
||||
const apiGatewayService = new ApiGatewayService(serviceContainer)
|
||||
apiGatewayService.setLogger(winston.loggers.get('api-gateway'))
|
||||
const authService = new AuthService(serviceContainer, controllerContainer, directCallDomainEventPublisher)
|
||||
authService.setLogger(winston.loggers.get('auth-server'))
|
||||
const syncingService = new SyncingService(serviceContainer, controllerContainer, directCallDomainEventPublisher)
|
||||
syncingService.setLogger(winston.loggers.get('syncing-server'))
|
||||
const revisionsService = new RevisionsService(serviceContainer, controllerContainer, directCallDomainEventPublisher)
|
||||
revisionsService.setLogger(winston.loggers.get('revisions-server'))
|
||||
const filesService = new FilesService(serviceContainer, directCallDomainEventPublisher)
|
||||
filesService.setLogger(winston.loggers.get('files-server'))
|
||||
|
||||
const container = Container.merge(
|
||||
(await apiGatewayService.getContainer()) as Container,
|
||||
(await authService.getContainer()) as Container,
|
||||
(await syncingService.getContainer()) as Container,
|
||||
(await revisionsService.getContainer()) as Container,
|
||||
(await filesService.getContainer()) as Container,
|
||||
)
|
||||
|
||||
const server = new InversifyExpressServer(container)
|
||||
|
||||
server.setConfig((app) => {
|
||||
/* eslint-disable */
|
||||
app.use(helmet({
|
||||
contentSecurityPolicy: {
|
||||
directives: {
|
||||
defaultSrc: ["https: 'self'"],
|
||||
baseUri: ["'self'"],
|
||||
childSrc: ["*", "blob:"],
|
||||
connectSrc: ["*"],
|
||||
fontSrc: ["*", "'self'"],
|
||||
formAction: ["'self'"],
|
||||
frameAncestors: ["*", "*.standardnotes.org", "*.standardnotes.com"],
|
||||
frameSrc: ["*", "blob:"],
|
||||
imgSrc: ["'self'", "*", "data:"],
|
||||
manifestSrc: ["'self'"],
|
||||
mediaSrc: ["'self'"],
|
||||
objectSrc: ["'self'"],
|
||||
scriptSrc: ["'self'"],
|
||||
styleSrc: ["'self'"]
|
||||
}
|
||||
}
|
||||
}))
|
||||
/* eslint-enable */
|
||||
app.use(json({ limit: '50mb' }))
|
||||
app.use(
|
||||
text({
|
||||
type: ['text/plain', 'application/x-www-form-urlencoded', 'application/x-www-form-urlencoded; charset=utf-8'],
|
||||
}),
|
||||
)
|
||||
app.use(cors())
|
||||
app.use(
|
||||
robots({
|
||||
UserAgent: '*',
|
||||
Disallow: '/',
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
const logger: winston.Logger = winston.loggers.get('home-server')
|
||||
|
||||
server.setErrorConfig((app) => {
|
||||
app.use((error: Record<string, unknown>, _request: Request, response: Response, _next: NextFunction) => {
|
||||
logger.error(error.stack)
|
||||
|
||||
response.status(500).send({
|
||||
error: {
|
||||
message:
|
||||
"Unfortunately, we couldn't handle your request. Please try again or contact our support if the error persists.",
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
this.serverInstance = server.build().listen(env.get('PORT', true) ? +env.get('PORT', true) : 3000)
|
||||
|
||||
logger.info(`Server started on port ${process.env.PORT}`)
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
if (this.serverInstance) {
|
||||
this.serverInstance.close()
|
||||
}
|
||||
}
|
||||
|
||||
async restart(): Promise<void> {
|
||||
await this.stop()
|
||||
await this.start()
|
||||
}
|
||||
|
||||
async isRunning(): Promise<boolean> {
|
||||
if (!this.serverInstance) {
|
||||
return false
|
||||
}
|
||||
|
||||
return this.serverInstance.address() !== null
|
||||
}
|
||||
|
||||
logs(): NodeJS.ReadableStream {
|
||||
const passThroughStream = new PassThrough()
|
||||
|
||||
for (const logger of winston.loggers.loggers.values()) {
|
||||
logger.stream({ start: -1 }).pipe(passThroughStream, { end: false })
|
||||
}
|
||||
|
||||
return passThroughStream
|
||||
}
|
||||
|
||||
private configureLoggers(env: Env): void {
|
||||
const winstonFormatters = [winston.format.splat(), winston.format.json()]
|
||||
|
||||
for (const loggerName of [
|
||||
'auth-server',
|
||||
'syncing-server',
|
||||
'revisions-server',
|
||||
'files-server',
|
||||
'api-gateway',
|
||||
'home-server',
|
||||
]) {
|
||||
winston.loggers.add(loggerName, {
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: loggerName },
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
7
packages/home-server/src/Server/HomeServerInterface.ts
Normal file
7
packages/home-server/src/Server/HomeServerInterface.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface HomeServerInterface {
|
||||
start(): Promise<void>
|
||||
stop(): Promise<void>
|
||||
restart(): Promise<void>
|
||||
isRunning(): Promise<boolean>
|
||||
logs(): NodeJS.ReadableStream
|
||||
}
|
||||
2
packages/home-server/src/Server/index.ts
Normal file
2
packages/home-server/src/Server/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './HomeServer'
|
||||
export * from './HomeServerInterface'
|
||||
1
packages/home-server/src/index.ts
Normal file
1
packages/home-server/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './Server'
|
||||
@@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.20.2](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.20.1...@standardnotes/revisions-server@1.20.2) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/revisions-server
|
||||
|
||||
## [1.20.1](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.20.0...@standardnotes/revisions-server@1.20.1) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/revisions-server
|
||||
|
||||
# [1.20.0](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.19.6...@standardnotes/revisions-server@1.20.0) (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **home-server:** add custom home server logs ([#619](https://github.com/standardnotes/server/issues/619)) ([bc63d0a](https://github.com/standardnotes/server/commit/bc63d0aeea86abbb4a144b2682b7070d7bdfe878))
|
||||
|
||||
## [1.19.6](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.19.5...@standardnotes/revisions-server@1.19.6) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/revisions-server
|
||||
|
||||
## [1.19.5](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.19.4...@standardnotes/revisions-server@1.19.5) (2023-05-31)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "Revert "feat: make home server components publishable (#617)"" ([13c85d4](https://github.com/standardnotes/server/commit/13c85d43318caa0fb53726f13ea581ba4a5f816b)), closes [#617](https://github.com/standardnotes/server/issues/617)
|
||||
|
||||
## [1.19.4](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.19.3...@standardnotes/revisions-server@1.19.4) (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **home-server:** make the package publishable ([56a312f](https://github.com/standardnotes/server/commit/56a312f21730b32b766c358a5ceb0865722bac46))
|
||||
|
||||
## [1.19.3](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.19.2...@standardnotes/revisions-server@1.19.3) (2023-05-30)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "feat: make home server components publishable (#617)" ([1a8daef](https://github.com/standardnotes/server/commit/1a8daef79d55a8cdee1632b294b897176af64b26)), closes [#617](https://github.com/standardnotes/server/issues/617)
|
||||
|
||||
## [1.19.2](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.19.0...@standardnotes/revisions-server@1.19.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/server/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [1.19.0](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.18.0...@standardnotes/revisions-server@1.19.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* make home server components publishable ([#617](https://github.com/standardnotes/server/issues/617)) ([55fd873](https://github.com/standardnotes/server/commit/55fd873b375e204dc9b0477b2cc6ed4582e5b603))
|
||||
|
||||
# [1.18.0](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.17.0...@standardnotes/revisions-server@1.18.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{
|
||||
"name": "@standardnotes/revisions-server",
|
||||
"version": "1.18.0",
|
||||
"version": "1.20.2",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"description": "Revisions Server",
|
||||
"main": "dist/src/index.js",
|
||||
"typings": "dist/src/index.d.ts",
|
||||
"repository": "git@github.com:standardnotes/server.git",
|
||||
"author": "Karol Sójko <karolsojko@standardnotes.com>",
|
||||
"author": "Karol Sójko <karol@standardnotes.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -fr dist",
|
||||
"setup:env": "cp .env.sample .env",
|
||||
@@ -52,6 +54,7 @@
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/newrelic": "^9.13.0",
|
||||
"@types/node": "^20.2.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
"eslint": "^8.39.0",
|
||||
|
||||
@@ -46,6 +46,7 @@ import { FSDumpRepository } from '../Infra/FS/FSDumpRepository'
|
||||
import { S3DumpRepository } from '../Infra/S3/S3ItemDumpRepository'
|
||||
import { RevisionItemStringMapper } from '../Mapping/RevisionItemStringMapper'
|
||||
import { HomeServerRevisionsController } from '../Infra/InversifyExpress/HomeServer/HomeServerRevisionsController'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const newrelicFormatter = require('@newrelic/winston-enricher')
|
||||
@@ -54,6 +55,7 @@ export class ContainerConfigLoader {
|
||||
async load(configuration?: {
|
||||
controllerConatiner?: ControllerContainerInterface
|
||||
directCallDomainEventPublisher?: DirectCallDomainEventPublisher
|
||||
logger?: Transform
|
||||
}): Promise<Container> {
|
||||
const directCallDomainEventPublisher =
|
||||
configuration?.directCallDomainEventPublisher ?? new DirectCallDomainEventPublisher()
|
||||
@@ -71,24 +73,28 @@ export class ContainerConfigLoader {
|
||||
|
||||
container.bind<Env>(TYPES.Revisions_Env).toConstantValue(env)
|
||||
|
||||
container.bind<winston.Logger>(TYPES.Revisions_Logger).toDynamicValue((context: interfaces.Context) => {
|
||||
const env: Env = context.container.get(TYPES.Revisions_Env)
|
||||
if (configuration?.logger) {
|
||||
container.bind<winston.Logger>(TYPES.Revisions_Logger).toConstantValue(configuration.logger as winston.Logger)
|
||||
} else {
|
||||
container.bind<winston.Logger>(TYPES.Revisions_Logger).toDynamicValue((context: interfaces.Context) => {
|
||||
const env: Env = context.container.get(TYPES.Revisions_Env)
|
||||
|
||||
const newrelicWinstonFormatter = newrelicFormatter(winston)
|
||||
const winstonFormatters = [winston.format.splat(), winston.format.json()]
|
||||
if (env.get('NEW_RELIC_ENABLED', true) === 'true') {
|
||||
winstonFormatters.push(newrelicWinstonFormatter())
|
||||
}
|
||||
const newrelicWinstonFormatter = newrelicFormatter(winston)
|
||||
const winstonFormatters = [winston.format.splat(), winston.format.json()]
|
||||
if (env.get('NEW_RELIC_ENABLED', true) === 'true') {
|
||||
winstonFormatters.push(newrelicWinstonFormatter())
|
||||
}
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'revisions' },
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'revisions' },
|
||||
})
|
||||
|
||||
return logger
|
||||
})
|
||||
|
||||
return logger
|
||||
})
|
||||
}
|
||||
|
||||
container.bind(TYPES.Revisions_NEW_RELIC_ENABLED).toConstantValue(env.get('NEW_RELIC_ENABLED', true))
|
||||
container.bind(TYPES.Revisions_VERSION).toConstantValue(env.get('VERSION'))
|
||||
|
||||
@@ -7,8 +7,11 @@ import {
|
||||
|
||||
import { ContainerConfigLoader } from './Container'
|
||||
import { DirectCallDomainEventPublisher } from '@standardnotes/domain-events-infra'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
export class Service implements ServiceInterface {
|
||||
private logger: Transform | undefined
|
||||
|
||||
constructor(
|
||||
private serviceContainer: ServiceContainerInterface,
|
||||
private controllerContainer: ControllerContainerInterface,
|
||||
@@ -17,6 +20,10 @@ export class Service implements ServiceInterface {
|
||||
this.serviceContainer.register(this.getId(), this)
|
||||
}
|
||||
|
||||
setLogger(logger: Transform): void {
|
||||
this.logger = logger
|
||||
}
|
||||
|
||||
async handleRequest(request: never, response: never, endpointOrMethodIdentifier: string): Promise<unknown> {
|
||||
const method = this.controllerContainer.get(endpointOrMethodIdentifier)
|
||||
|
||||
@@ -33,6 +40,7 @@ export class Service implements ServiceInterface {
|
||||
return config.load({
|
||||
controllerConatiner: this.controllerContainer,
|
||||
directCallDomainEventPublisher: this.directCallDomainEventPublisher,
|
||||
logger: this.logger,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,22 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.19.4](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.19.3...@standardnotes/scheduler-server@1.19.4) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||
|
||||
## [1.19.3](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.19.2...@standardnotes/scheduler-server@1.19.3) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||
|
||||
## [1.19.2](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.19.1...@standardnotes/scheduler-server@1.19.2) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||
|
||||
## [1.19.1](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.19.0...@standardnotes/scheduler-server@1.19.1) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||
|
||||
# [1.19.0](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.18.5...@standardnotes/scheduler-server@1.19.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/scheduler-server",
|
||||
"version": "1.19.0",
|
||||
"version": "1.19.4",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -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.7.10](https://github.com/standardnotes/server/compare/@standardnotes/security@1.7.8...@standardnotes/security@1.7.10) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/security
|
||||
|
||||
## [1.7.8](https://github.com/standardnotes/server/compare/@standardnotes/security@1.7.7...@standardnotes/security@1.7.8) (2023-05-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/security",
|
||||
"version": "1.7.8",
|
||||
"version": "1.7.10",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.21.7](https://github.com/standardnotes/server/compare/@standardnotes/settings@1.21.6...@standardnotes/settings@1.21.7) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/settings
|
||||
|
||||
## [1.21.6](https://github.com/standardnotes/server/compare/@standardnotes/settings@1.21.5...@standardnotes/settings@1.21.6) (2023-05-30)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/settings
|
||||
|
||||
## [1.21.5](https://github.com/standardnotes/server/compare/@standardnotes/settings@1.21.4...@standardnotes/settings@1.21.5) (2023-05-29)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/settings
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@standardnotes/settings",
|
||||
"version": "1.21.5",
|
||||
"version": "1.21.7",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
|
||||
@@ -3,6 +3,54 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.41.2](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.41.1...@standardnotes/syncing-server@1.41.2) (2023-06-01)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||
|
||||
## [1.41.1](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.41.0...@standardnotes/syncing-server@1.41.1) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||
|
||||
# [1.41.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.40.6...@standardnotes/syncing-server@1.41.0) (2023-05-31)
|
||||
|
||||
### Features
|
||||
|
||||
* **home-server:** add custom home server logs ([#619](https://github.com/standardnotes/syncing-server-js/issues/619)) ([bc63d0a](https://github.com/standardnotes/syncing-server-js/commit/bc63d0aeea86abbb4a144b2682b7070d7bdfe878))
|
||||
|
||||
## [1.40.6](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.40.5...@standardnotes/syncing-server@1.40.6) (2023-05-31)
|
||||
|
||||
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||
|
||||
## [1.40.5](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.40.4...@standardnotes/syncing-server@1.40.5) (2023-05-31)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "Revert "feat: make home server components publishable (#617)"" ([13c85d4](https://github.com/standardnotes/syncing-server-js/commit/13c85d43318caa0fb53726f13ea581ba4a5f816b)), closes [#617](https://github.com/standardnotes/syncing-server-js/issues/617)
|
||||
|
||||
## [1.40.4](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.40.3...@standardnotes/syncing-server@1.40.4) (2023-05-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **home-server:** make the package publishable ([56a312f](https://github.com/standardnotes/syncing-server-js/commit/56a312f21730b32b766c358a5ceb0865722bac46))
|
||||
|
||||
## [1.40.3](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.40.2...@standardnotes/syncing-server@1.40.3) (2023-05-30)
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "feat: make home server components publishable (#617)" ([1a8daef](https://github.com/standardnotes/syncing-server-js/commit/1a8daef79d55a8cdee1632b294b897176af64b26)), closes [#617](https://github.com/standardnotes/syncing-server-js/issues/617)
|
||||
|
||||
## [1.40.2](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.40.0...@standardnotes/syncing-server@1.40.2) (2023-05-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* bump version manually to publish packages ([b0d01df](https://github.com/standardnotes/syncing-server-js/commit/b0d01dffd91557c67eac2940d9270bca208c1128))
|
||||
|
||||
# [1.40.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.39.0...@standardnotes/syncing-server@1.40.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
* make home server components publishable ([#617](https://github.com/standardnotes/syncing-server-js/issues/617)) ([55fd873](https://github.com/standardnotes/syncing-server-js/commit/55fd873b375e204dc9b0477b2cc6ed4582e5b603))
|
||||
|
||||
# [1.39.0](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.38.0...@standardnotes/syncing-server@1.39.0) (2023-05-30)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{
|
||||
"name": "@standardnotes/syncing-server",
|
||||
"version": "1.39.0",
|
||||
"version": "1.41.2",
|
||||
"engines": {
|
||||
"node": ">=18.0.0 <21.0.0"
|
||||
},
|
||||
"private": true,
|
||||
"description": "Syncing Server",
|
||||
"main": "dist/src/index.js",
|
||||
"typings": "dist/src/index.d.ts",
|
||||
"repository": "git@github.com:standardnotes/syncing-server-js.git",
|
||||
"author": "Karol Sójko <karolsojko@standardnotes.com>",
|
||||
"author": "Karol Sójko <karol@standardnotes.com>",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "rm -fr dist",
|
||||
"setup:env": "cp .env.sample .env",
|
||||
@@ -64,6 +66,7 @@
|
||||
"@types/jest": "^29.5.1",
|
||||
"@types/jsonwebtoken": "^9.0.1",
|
||||
"@types/newrelic": "^9.13.0",
|
||||
"@types/node": "^20.2.5",
|
||||
"@types/prettyjson": "^0.0.30",
|
||||
"@types/ua-parser-js": "^0.7.36",
|
||||
"@types/uuid": "^8.3.0",
|
||||
|
||||
@@ -72,6 +72,7 @@ import { AuthHttpService } from '../Infra/HTTP/AuthHttpService'
|
||||
import { S3ItemBackupService } from '../Infra/S3/S3ItemBackupService'
|
||||
import { ControllerContainer, ControllerContainerInterface } from '@standardnotes/domain-core'
|
||||
import { HomeServerItemsController } from '../Infra/InversifyExpressUtils/HomeServer/HomeServerItemsController'
|
||||
import { Transform } from 'stream'
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const newrelicFormatter = require('@newrelic/winston-enricher')
|
||||
|
||||
@@ -83,6 +84,7 @@ export class ContainerConfigLoader {
|
||||
async load(configuration?: {
|
||||
controllerConatiner?: ControllerContainerInterface
|
||||
directCallDomainEventPublisher?: DirectCallDomainEventPublisher
|
||||
logger?: Transform
|
||||
}): Promise<Container> {
|
||||
const directCallDomainEventPublisher =
|
||||
configuration?.directCallDomainEventPublisher ?? new DirectCallDomainEventPublisher()
|
||||
@@ -100,24 +102,28 @@ export class ContainerConfigLoader {
|
||||
|
||||
container.bind<Env>(TYPES.Sync_Env).toConstantValue(env)
|
||||
|
||||
container.bind<winston.Logger>(TYPES.Sync_Logger).toDynamicValue((context: interfaces.Context) => {
|
||||
const env: Env = context.container.get(TYPES.Sync_Env)
|
||||
if (configuration?.logger) {
|
||||
container.bind<winston.Logger>(TYPES.Sync_Logger).toConstantValue(configuration.logger as winston.Logger)
|
||||
} else {
|
||||
container.bind<winston.Logger>(TYPES.Sync_Logger).toDynamicValue((context: interfaces.Context) => {
|
||||
const env: Env = context.container.get(TYPES.Sync_Env)
|
||||
|
||||
const newrelicWinstonFormatter = newrelicFormatter(winston)
|
||||
const winstonFormatters = [winston.format.splat(), winston.format.json()]
|
||||
if (env.get('NEW_RELIC_ENABLED', true) === 'true') {
|
||||
winstonFormatters.push(newrelicWinstonFormatter())
|
||||
}
|
||||
const newrelicWinstonFormatter = newrelicFormatter(winston)
|
||||
const winstonFormatters = [winston.format.splat(), winston.format.json()]
|
||||
if (env.get('NEW_RELIC_ENABLED', true) === 'true') {
|
||||
winstonFormatters.push(newrelicWinstonFormatter())
|
||||
}
|
||||
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'syncing-server' },
|
||||
const logger = winston.createLogger({
|
||||
level: env.get('LOG_LEVEL') || 'info',
|
||||
format: winston.format.combine(...winstonFormatters),
|
||||
transports: [new winston.transports.Console({ level: env.get('LOG_LEVEL') || 'info' })],
|
||||
defaultMeta: { service: 'syncing-server' },
|
||||
})
|
||||
|
||||
return logger
|
||||
})
|
||||
|
||||
return logger
|
||||
})
|
||||
}
|
||||
|
||||
if (isConfiguredForHomeServer) {
|
||||
container
|
||||
|
||||
@@ -7,8 +7,11 @@ import {
|
||||
|
||||
import { ContainerConfigLoader } from './Container'
|
||||
import { DirectCallDomainEventPublisher } from '@standardnotes/domain-events-infra'
|
||||
import { Transform } from 'stream'
|
||||
|
||||
export class Service implements ServiceInterface {
|
||||
private logger: Transform | undefined
|
||||
|
||||
constructor(
|
||||
private serviceContainer: ServiceContainerInterface,
|
||||
private controllerContainer: ControllerContainerInterface,
|
||||
@@ -17,6 +20,10 @@ export class Service implements ServiceInterface {
|
||||
this.serviceContainer.register(this.getId(), this)
|
||||
}
|
||||
|
||||
setLogger(logger: Transform): void {
|
||||
this.logger = logger
|
||||
}
|
||||
|
||||
async handleRequest(request: never, response: never, endpointOrMethodIdentifier: string): Promise<unknown> {
|
||||
const method = this.controllerContainer.get(endpointOrMethodIdentifier)
|
||||
|
||||
@@ -33,6 +40,7 @@ export class Service implements ServiceInterface {
|
||||
return config.load({
|
||||
controllerConatiner: this.controllerContainer,
|
||||
directCallDomainEventPublisher: this.directCallDomainEventPublisher,
|
||||
logger: this.logger,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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.14.6](https://github.com/standardnotes/server/compare/@standardnotes/time@1.14.4...@standardnotes/time@1.14.6) (2023-06-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **time:** bump version ([4b40c59](https://github.com/standardnotes/server/commit/4b40c59e7e5935fbf5d5c94ad7dee1cbe3c183cb))
|
||||
|
||||
## [1.14.4](https://github.com/standardnotes/server/compare/@standardnotes/time@1.14.3...@standardnotes/time@1.14.4) (2023-05-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user