Compare commits

..

19 Commits

Author SHA1 Message Date
standardci
16d0ed505b chore(release): publish new version
- @standardnotes/auth-server@1.89.5
 - @standardnotes/revisions-server@1.12.7
 - @standardnotes/syncing-server@1.31.8
 - @standardnotes/websockets-server@1.6.6
2023-03-01 20:05:36 +00:00
Mo
9de09c55f8 chore: upgrade api and responses dependencies (#459) 2023-03-01 13:51:26 -06:00
standardci
c3d7a33aa2 chore(release): publish new version
- @standardnotes/auth-server@1.89.4
2023-03-01 12:01:59 +00:00
Karol Sójko
a9cc00a478 fix(auth): updating counter post authenticator verification 2023-03-01 12:48:10 +01:00
standardci
ec035ba648 chore(release): publish new version
- @standardnotes/auth-server@1.89.3
2023-02-27 10:59:56 +00:00
Karol Sójko
5446f3cae4 chore: upgrade @simplewebauthn lib 2023-02-27 11:46:00 +01:00
standardci
6a550092c2 chore(release): publish new version
- @standardnotes/api-gateway@1.49.4
2023-02-25 15:14:24 +00:00
Mo
1b691f6bcd refactor: remove explicit route since subscription token no longer required 2023-02-25 09:00:07 -06:00
standardci
98f45cc4c2 chore(release): publish new version
- @standardnotes/auth-server@1.89.2
2023-02-24 10:59:33 +00:00
Karol Sójko
edc4a20859 fix(auth): add cross-platform authenticator selection option 2023-02-24 11:45:33 +01:00
standardci
74e1380df8 chore(release): publish new version
- @standardnotes/api-gateway@1.49.3
2023-02-24 07:35:22 +00:00
Karol Sójko
dfa5187ff7 fix(api-gateywa): remove stale proxy references 2023-02-24 08:21:22 +01:00
Karol Sójko
c99c4425cd chore: update yarn lock 2023-02-24 08:14:33 +01:00
Karol Sójko
2d8919a079 chore: remove proxy service 2023-02-24 08:14:17 +01:00
standardci
f638287213 chore(release): publish new version
- @standardnotes/analytics@2.21.1
 - @standardnotes/api-gateway@1.49.2
 - @standardnotes/auth-server@1.89.1
 - @standardnotes/common@1.46.6
 - @standardnotes/domain-events-infra@1.9.72
 - @standardnotes/domain-events@2.108.1
 - @standardnotes/event-store@1.7.4
 - @standardnotes/files-server@1.10.5
 - @standardnotes/revisions-server@1.12.6
 - @standardnotes/scheduler-server@1.17.5
 - @standardnotes/syncing-server@1.31.7
 - @standardnotes/websockets-server@1.6.5
2023-02-23 13:01:18 +00:00
Karol Sójko
991d885b63 chore: fix faulty import 2023-02-23 13:47:06 +01:00
Karol Sójko
bb17efa817 chore: fix yarn lock 2023-02-23 13:35:06 +01:00
Karol Sójko
deec29c1b4 chore: remove workspaces from code base 2023-02-23 13:30:39 +01:00
Karol Sójko
9d872008a7 fix(analytics): add general activity metric to mixpanel 2023-02-23 13:21:12 +01:00
197 changed files with 332 additions and 4695 deletions

View File

@@ -95,11 +95,6 @@ updates:
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/packages/workspace"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:

View File

@@ -94,81 +94,3 @@ jobs:
name: E2E
uses: standardnotes/server/.github/workflows/common-e2e.yml@main
secrets: inherit
legacy_e2e:
needs: build
name: Legacy E2E
strategy:
matrix:
application:
- { "service_name": "api-gateway", "workspace_name": "@standardnotes/api-gateway", "e2e_tag_parameter_name": "api_gateway_image_tag", "package_path": "packages/api-gateway" }
- { "service_name": "auth", "workspace_name": "@standardnotes/auth-server", "e2e_tag_parameter_name": "auth_image_tag", "package_path": "packages/auth" }
- { "service_name": "files", "workspace_name": "@standardnotes/files-server", "e2e_tag_parameter_name": "files_image_tag", "package_path": "packages/files" }
- { "service_name": "revisions", "workspace_name": "@standardnotes/revisions-server", "e2e_tag_parameter_name": "revisions_image_tag", "package_path": "packages/revisions"}
- { "service_name": "syncing-server-js", "workspace_name": "@standardnotes/syncing-server", "e2e_tag_parameter_name": "syncing_server_js_image_tag", "package_path": "packages/syncing-server" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Bundle Dir
id: bundle-dir
run: echo "temp_dir=$(mktemp -d -t ${{ matrix.application.service_name }}-${{ github.sha }}-XXXXXXX)" >> $GITHUB_OUTPUT
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: |
packages/**/dist
${{ needs.legacy_e2e.outputs.temp_dir }}
key: ${{ runner.os }}-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
- name: Bundle
run: yarn workspace ${{ matrix.application.workspace_name }} bundle --no-compress --output-directory ${{ steps.bundle-dir.outputs.temp_dir }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Publish Docker image for E2E testing
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
context: ${{ steps.bundle-dir.outputs.temp_dir }}
file: ${{ steps.bundle-dir.outputs.temp_dir }}/${{ matrix.application.package_path }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: standardnotes/${{ matrix.application.service_name }}:${{ github.sha }}
- name: Run E2E test suite
uses: convictional/trigger-workflow-and-wait@master
with:
owner: standardnotes
repo: self-hosted
github_token: ${{ secrets.CI_PAT_TOKEN }}
workflow_file_name: testing-with-updating-client-and-server.yml
wait_interval: 30
client_payload: '{"${{ matrix.application.e2e_tag_parameter_name }}": "${{ github.sha }}"}'
propagate_failure: true
trigger_workflow: true
wait_workflow: true

View File

@@ -1,22 +0,0 @@
name: Proxy Server
concurrency:
group: proxy_server
cancel-in-progress: true
on:
push:
tags:
- '*standardnotes/proxy-server*'
workflow_dispatch:
jobs:
call_server_application_workflow:
name: Server Application
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
with:
service_name: proxy
workspace_name: "@standardnotes/proxy-server"
deploy_worker: false
package_path: packages/proxy
secrets: inherit

View File

@@ -1,47 +0,0 @@
name: Workspace Server
concurrency:
group: workspace
cancel-in-progress: true
on:
push:
tags:
- '*standardnotes/workspace-server*'
workflow_dispatch:
jobs:
call_server_application_workflow:
name: Server Application
uses: standardnotes/server/.github/workflows/common-server-application.yml@main
with:
service_name: workspace
workspace_name: "@standardnotes/workspace-server"
package_path: packages/workspace
secrets: inherit
newrelic:
needs: call_server_application_workflow
runs-on: ubuntu-latest
steps:
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_WORKSPACE_WEB_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
apiKey: ${{ secrets.NEW_RELIC_API_KEY }}
applicationId: ${{ secrets.NEW_RELIC_APPLICATION_ID_WORKSPACE_WORKER_PROD }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"

177
.pnp.cjs generated
View File

@@ -53,10 +53,6 @@ const RAW_RUNTIME_STATE =
"name": "@standardnotes/predicates",\
"reference": "workspace:packages/predicates"\
},\
{\
"name": "@standardnotes/proxy-server",\
"reference": "workspace:packages/proxy"\
},\
{\
"name": "@standardnotes/revisions-server",\
"reference": "workspace:packages/revisions"\
@@ -88,10 +84,6 @@ const RAW_RUNTIME_STATE =
{\
"name": "@standardnotes/websockets-server",\
"reference": "workspace:packages/websockets"\
},\
{\
"name": "@standardnotes/workspace-server",\
"reference": "workspace:packages/workspace"\
}\
],\
"enableTopLevelFallback": true,\
@@ -107,7 +99,6 @@ const RAW_RUNTIME_STATE =
["@standardnotes/event-store", ["workspace:packages/event-store"]],\
["@standardnotes/files-server", ["workspace:packages/files"]],\
["@standardnotes/predicates", ["workspace:packages/predicates"]],\
["@standardnotes/proxy-server", ["workspace:packages/proxy"]],\
["@standardnotes/revisions-server", ["workspace:packages/revisions"]],\
["@standardnotes/scheduler-server", ["workspace:packages/scheduler"]],\
["@standardnotes/security", ["workspace:packages/security"]],\
@@ -116,8 +107,7 @@ const RAW_RUNTIME_STATE =
["@standardnotes/sncrypto-node", ["workspace:packages/sncrypto-node"]],\
["@standardnotes/syncing-server", ["workspace:packages/syncing-server"]],\
["@standardnotes/time", ["workspace:packages/time"]],\
["@standardnotes/websockets-server", ["workspace:packages/websockets"]],\
["@standardnotes/workspace-server", ["workspace:packages/workspace"]]\
["@standardnotes/websockets-server", ["workspace:packages/websockets"]]\
],\
"fallbackPool": [\
],\
@@ -3970,26 +3960,26 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["@simplewebauthn/iso-webcrypto", [\
["npm:7.0.0", {\
"packageLocation": "./.yarn/cache/@simplewebauthn-iso-webcrypto-npm-7.0.0-352babf4a0-c1644f9b68.zip/node_modules/@simplewebauthn/iso-webcrypto/",\
["npm:7.0.1", {\
"packageLocation": "./.yarn/cache/@simplewebauthn-iso-webcrypto-npm-7.0.1-bae5f6738c-ed506490e0.zip/node_modules/@simplewebauthn/iso-webcrypto/",\
"packageDependencies": [\
["@simplewebauthn/iso-webcrypto", "npm:7.0.0"]\
["@simplewebauthn/iso-webcrypto", "npm:7.0.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@simplewebauthn/server", [\
["npm:7.0.0", {\
"packageLocation": "./.yarn/cache/@simplewebauthn-server-npm-7.0.0-e34589f137-836eb9fb97.zip/node_modules/@simplewebauthn/server/",\
["npm:7.0.1", {\
"packageLocation": "./.yarn/cache/@simplewebauthn-server-npm-7.0.1-ac81233d49-d11c708008.zip/node_modules/@simplewebauthn/server/",\
"packageDependencies": [\
["@simplewebauthn/server", "npm:7.0.0"],\
["@simplewebauthn/server", "npm:7.0.1"],\
["@hexagon/base64", "npm:1.1.25"],\
["@peculiar/asn1-android", "npm:2.3.3"],\
["@peculiar/asn1-ecc", "npm:2.3.4"],\
["@peculiar/asn1-rsa", "npm:2.3.4"],\
["@peculiar/asn1-schema", "npm:2.3.3"],\
["@peculiar/asn1-x509", "npm:2.3.4"],\
["@simplewebauthn/iso-webcrypto", "npm:7.0.0"],\
["@simplewebauthn/iso-webcrypto", "npm:7.0.1"],\
["cbor-x", "npm:1.5.0"],\
["cross-fetch", "npm:3.1.5"],\
["debug", "virtual:b86a9fb34323a98c6519528ed55faa0d9b44ca8879307c0b29aa384bde47ff59a7d0c9051b31246f14521dfb71ba3c5d6d0b35c29fffc17bf875aa6ad977d9e8#npm:4.3.4"]\
@@ -4093,17 +4083,17 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["@standardnotes/api", [\
["npm:1.24.10", {\
"packageLocation": "./.yarn/cache/@standardnotes-api-npm-1.24.10-63391538ba-1b9a97fdd8.zip/node_modules/@standardnotes/api/",\
["npm:1.25.3", {\
"packageLocation": "./.yarn/cache/@standardnotes-api-npm-1.25.3-29ba336725-bc7953c440.zip/node_modules/@standardnotes/api/",\
"packageDependencies": [\
["@standardnotes/api", "npm:1.24.10"],\
["@standardnotes/api", "npm:1.25.3"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
["@standardnotes/encryption", "npm:1.21.9"],\
["@standardnotes/models", "npm:1.42.11"],\
["@standardnotes/responses", "npm:1.13.6"],\
["@standardnotes/encryption", "npm:1.21.17"],\
["@standardnotes/models", "npm:1.43.5"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/security", "workspace:packages/security"],\
["@standardnotes/utils", "npm:1.16.3"],\
["@standardnotes/utils", "npm:1.16.4"],\
["reflect-metadata", "npm:0.1.13"]\
],\
"linkType": "HARD"\
@@ -4166,16 +4156,16 @@ const RAW_RUNTIME_STATE =
["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.0"],\
["@sentry/node", "npm:7.28.1"],\
["@sentry/tracing", "npm:7.28.1"],\
["@simplewebauthn/server", "npm:7.0.0"],\
["@simplewebauthn/server", "npm:7.0.1"],\
["@simplewebauthn/typescript-types", "npm:7.0.0"],\
["@standardnotes/api", "npm:1.24.10"],\
["@standardnotes/api", "npm:1.25.3"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
["@standardnotes/domain-events", "workspace:packages/domain-events"],\
["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\
["@standardnotes/features", "npm:1.58.4"],\
["@standardnotes/predicates", "workspace:packages/predicates"],\
["@standardnotes/responses", "npm:1.13.4"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/security", "workspace:packages/security"],\
["@standardnotes/settings", "workspace:packages/settings"],\
["@standardnotes/sncrypto-common", "npm:1.13.0"],\
@@ -4312,15 +4302,15 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["@standardnotes/encryption", [\
["npm:1.21.9", {\
"packageLocation": "./.yarn/cache/@standardnotes-encryption-npm-1.21.9-092bc2cb51-dc1336cc05.zip/node_modules/@standardnotes/encryption/",\
["npm:1.21.17", {\
"packageLocation": "./.yarn/cache/@standardnotes-encryption-npm-1.21.17-0801937c9c-ece7ac644e.zip/node_modules/@standardnotes/encryption/",\
"packageDependencies": [\
["@standardnotes/encryption", "npm:1.21.9"],\
["@standardnotes/encryption", "npm:1.21.17"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/models", "npm:1.42.11"],\
["@standardnotes/responses", "npm:1.13.6"],\
["@standardnotes/models", "npm:1.43.5"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/sncrypto-common", "npm:1.13.3"],\
["@standardnotes/utils", "npm:1.16.3"],\
["@standardnotes/utils", "npm:1.16.4"],\
["reflect-metadata", "npm:0.1.13"]\
],\
"linkType": "HARD"\
@@ -4369,10 +4359,10 @@ const RAW_RUNTIME_STATE =
],\
"linkType": "HARD"\
}],\
["npm:1.58.6", {\
"packageLocation": "./.yarn/cache/@standardnotes-features-npm-1.58.6-7b1e198c39-98550416f1.zip/node_modules/@standardnotes/features/",\
["npm:1.58.8", {\
"packageLocation": "./.yarn/cache/@standardnotes-features-npm-1.58.8-d97ff2aae1-77bac7d0a0.zip/node_modules/@standardnotes/features/",\
"packageDependencies": [\
["@standardnotes/features", "npm:1.58.6"],\
["@standardnotes/features", "npm:1.58.8"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
["@standardnotes/security", "workspace:packages/security"],\
@@ -4438,14 +4428,14 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["@standardnotes/models", [\
["npm:1.42.11", {\
"packageLocation": "./.yarn/cache/@standardnotes-models-npm-1.42.11-7db16001ef-6ff3409f70.zip/node_modules/@standardnotes/models/",\
["npm:1.43.5", {\
"packageLocation": "./.yarn/cache/@standardnotes-models-npm-1.43.5-5180388ed4-fd8e3b60bd.zip/node_modules/@standardnotes/models/",\
"packageDependencies": [\
["@standardnotes/models", "npm:1.42.11"],\
["@standardnotes/models", "npm:1.43.5"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/features", "npm:1.58.6"],\
["@standardnotes/responses", "npm:1.13.6"],\
["@standardnotes/utils", "npm:1.16.3"],\
["@standardnotes/features", "npm:1.58.8"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/utils", "npm:1.16.4"],\
["lodash", "npm:4.17.21"]\
],\
"linkType": "HARD"\
@@ -4466,40 +4456,13 @@ const RAW_RUNTIME_STATE =
"linkType": "SOFT"\
}]\
]],\
["@standardnotes/proxy-server", [\
["workspace:packages/proxy", {\
"packageLocation": "./packages/proxy/",\
"packageDependencies": [\
["@standardnotes/proxy-server", "workspace:packages/proxy"],\
["@types/newrelic", "npm:9.4.0"],\
["@types/node", "npm:18.14.0"],\
["@typescript-eslint/eslint-plugin", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:5.48.2"],\
["eslint", "npm:8.32.0"],\
["eslint-plugin-prettier", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.2.1"],\
["newrelic", "npm:9.8.0"],\
["typescript", "patch:typescript@npm%3A4.8.4#optional!builtin<compat/typescript>::version=4.8.4&hash=701156"]\
],\
"linkType": "SOFT"\
}]\
]],\
["@standardnotes/responses", [\
["npm:1.13.4", {\
"packageLocation": "./.yarn/cache/@standardnotes-responses-npm-1.13.4-70cbd72561-4803ee14bd.zip/node_modules/@standardnotes/responses/",\
["npm:1.13.9", {\
"packageLocation": "./.yarn/cache/@standardnotes-responses-npm-1.13.9-5b1858da5d-5cb5daf9f3.zip/node_modules/@standardnotes/responses/",\
"packageDependencies": [\
["@standardnotes/responses", "npm:1.13.4"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/features", "npm:1.58.4"],\
["@standardnotes/security", "workspace:packages/security"],\
["reflect-metadata", "npm:0.1.13"]\
],\
"linkType": "HARD"\
}],\
["npm:1.13.6", {\
"packageLocation": "./.yarn/cache/@standardnotes-responses-npm-1.13.6-5df25fe3dd-c57e3e1fa1.zip/node_modules/@standardnotes/responses/",\
"packageDependencies": [\
["@standardnotes/responses", "npm:1.13.6"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/features", "npm:1.58.6"],\
["@standardnotes/features", "npm:1.58.8"],\
["@standardnotes/security", "workspace:packages/security"],\
["reflect-metadata", "npm:0.1.13"]\
],\
@@ -4515,11 +4478,12 @@ const RAW_RUNTIME_STATE =
["@aws-sdk/client-sqs", "npm:3.259.0"],\
["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.0"],\
["@sentry/node", "npm:7.28.1"],\
["@standardnotes/api", "npm:1.24.10"],\
["@standardnotes/api", "npm:1.25.3"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
["@standardnotes/domain-events", "workspace:packages/domain-events"],\
["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/security", "workspace:packages/security"],\
["@standardnotes/time", "workspace:packages/time"],\
["@types/cors", "npm:2.8.12"],\
@@ -4694,12 +4658,12 @@ const RAW_RUNTIME_STATE =
["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.0"],\
["@sentry/node", "npm:7.28.1"],\
["@sentry/tracing", "npm:7.28.1"],\
["@standardnotes/api", "npm:1.24.10"],\
["@standardnotes/api", "npm:1.25.3"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
["@standardnotes/domain-events", "workspace:packages/domain-events"],\
["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\
["@standardnotes/responses", "npm:1.13.4"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/security", "workspace:packages/security"],\
["@standardnotes/settings", "workspace:packages/settings"],\
["@standardnotes/time", "workspace:packages/time"],\
@@ -4772,10 +4736,10 @@ const RAW_RUNTIME_STATE =
],\
"linkType": "HARD"\
}],\
["npm:1.16.3", {\
"packageLocation": "./.yarn/cache/@standardnotes-utils-npm-1.16.3-87b47ad954-5c34beaafb.zip/node_modules/@standardnotes/utils/",\
["npm:1.16.4", {\
"packageLocation": "./.yarn/cache/@standardnotes-utils-npm-1.16.4-d7c627b154-ed29da54cb.zip/node_modules/@standardnotes/utils/",\
"packageDependencies": [\
["@standardnotes/utils", "npm:1.16.3"],\
["@standardnotes/utils", "npm:1.16.4"],\
["@standardnotes/common", "workspace:packages/common"],\
["dompurify", "npm:2.4.3"],\
["lodash", "npm:4.17.21"],\
@@ -4792,11 +4756,12 @@ const RAW_RUNTIME_STATE =
["@aws-sdk/client-sqs", "npm:3.259.0"],\
["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.0"],\
["@sentry/node", "npm:7.28.1"],\
["@standardnotes/api", "npm:1.24.10"],\
["@standardnotes/api", "npm:1.25.3"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
["@standardnotes/domain-events", "workspace:packages/domain-events"],\
["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\
["@standardnotes/responses", "npm:1.13.9"],\
["@standardnotes/security", "workspace:packages/security"],\
["@standardnotes/utils", "npm:1.16.2"],\
["@types/cors", "npm:2.8.12"],\
@@ -4826,49 +4791,6 @@ const RAW_RUNTIME_STATE =
"linkType": "SOFT"\
}]\
]],\
["@standardnotes/workspace-server", [\
["workspace:packages/workspace", {\
"packageLocation": "./packages/workspace/",\
"packageDependencies": [\
["@standardnotes/workspace-server", "workspace:packages/workspace"],\
["@aws-sdk/client-sns", "npm:3.259.0"],\
["@aws-sdk/client-sqs", "npm:3.259.0"],\
["@newrelic/winston-enricher", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.0.0"],\
["@sentry/node", "npm:7.28.1"],\
["@standardnotes/api", "npm:1.24.10"],\
["@standardnotes/common", "workspace:packages/common"],\
["@standardnotes/domain-core", "workspace:packages/domain-core"],\
["@standardnotes/domain-events", "workspace:packages/domain-events"],\
["@standardnotes/domain-events-infra", "workspace:packages/domain-events-infra"],\
["@standardnotes/models", "npm:1.42.11"],\
["@standardnotes/security", "workspace:packages/security"],\
["@standardnotes/time", "workspace:packages/time"],\
["@types/cors", "npm:2.8.12"],\
["@types/express", "npm:4.17.14"],\
["@types/ioredis", "npm:5.0.0"],\
["@types/jest", "npm:29.1.1"],\
["@types/newrelic", "npm:9.4.0"],\
["@typescript-eslint/eslint-plugin", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:5.48.2"],\
["cors", "npm:2.8.5"],\
["dotenv", "npm:16.0.1"],\
["eslint", "npm:8.32.0"],\
["eslint-plugin-prettier", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:4.2.1"],\
["express", "npm:4.18.2"],\
["inversify", "npm:6.0.1"],\
["inversify-express-utils", "npm:6.4.3"],\
["ioredis", "npm:5.2.4"],\
["jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.1.2"],\
["mysql2", "npm:3.0.1"],\
["newrelic", "npm:9.8.0"],\
["reflect-metadata", "npm:0.1.13"],\
["ts-jest", "virtual:fd909b174d079e30b336c4ce72c38a88c1e447767b1a8dd7655e07719a1e31b97807f0931368724fc78897ff15e6a6d00b83316c0f76d11f85111f342e08bb79#npm:29.0.3"],\
["typeorm", "virtual:c66bf20e88479ada0172094776519a9f51acc4731d22079b60a295bcec7ea42d5545cbce58a77a50d932bf953298799135e99707486e343da6d99ba1d167bdbd#npm:0.3.10"],\
["typescript", "patch:typescript@npm%3A4.8.4#optional!builtin<compat/typescript>::version=4.8.4&hash=701156"],\
["winston", "npm:3.8.2"]\
],\
"linkType": "SOFT"\
}]\
]],\
["@szmarczak/http-timer", [\
["npm:5.0.1", {\
"packageLocation": "./.yarn/cache/@szmarczak-http-timer-npm-5.0.1-52261e5986-67236cba79.zip/node_modules/@szmarczak/http-timer/",\
@@ -5272,13 +5194,6 @@ const RAW_RUNTIME_STATE =
["@types/node", "npm:18.11.9"]\
],\
"linkType": "HARD"\
}],\
["npm:18.14.0", {\
"packageLocation": "./.yarn/cache/@types-node-npm-18.14.0-ddc1a221d2-d17dff07c7.zip/node_modules/@types/node/",\
"packageDependencies": [\
["@types/node", "npm:18.14.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["@types/nodemailer", [\

Binary file not shown.

View File

@@ -327,7 +327,7 @@ endif
quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); /Users/mo/Desktop/sn/dev/server/.yarn/unplugged/node-gyp-npm-9.0.0-0eccfca4d1/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/mo/Library/Caches/node-gyp/18.13.0" "-Dnode_gyp_dir=/Users/mo/Desktop/sn/dev/server/.yarn/unplugged/node-gyp-npm-9.0.0-0eccfca4d1/node_modules/node-gyp" "-Dnode_lib_file=/Users/mo/Library/Caches/node-gyp/18.13.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/mo/Desktop/sn/dev/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/Users/mo/Desktop/sn/dev/server/.yarn/unplugged/@newrelic-native-metrics-npm-9.0.0-590d2e713a/node_modules/@newrelic/native-metrics/build/config.gypi -I/Users/mo/Desktop/sn/dev/server/.yarn/unplugged/node-gyp-npm-9.0.0-0eccfca4d1/node_modules/node-gyp/addon.gypi -I/Users/mo/Library/Caches/node-gyp/18.13.0/include/node/common.gypi "--toplevel-dir=." binding.gyp
Makefile: $(srcdir)/binding.gyp $(srcdir)/build/config.gypi $(srcdir)/../../../../node-gyp-npm-9.0.0-0eccfca4d1/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../../../../../../Library/Caches/node-gyp/18.13.0/include/node/common.gypi
Makefile: $(srcdir)/../../../../node-gyp-npm-9.0.0-0eccfca4d1/node_modules/node-gyp/addon.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../../../../../../Library/Caches/node-gyp/18.13.0/include/node/common.gypi $(srcdir)/build/config.gypi
$(call do_cmd,regen_makefile)
# "all" is a concatenation of the "all" targets from all the included

View File

@@ -349,7 +349,6 @@ export API_GATEWAY_NEW_RELIC_NO_CONFIG_FILE=true
export API_GATEWAY_SYNCING_SERVER_JS_URL=http://localhost:$SYNCING_SERVER_PORT
export API_GATEWAY_AUTH_SERVER_URL=http://localhost:$AUTH_SERVER_PORT
export API_GATEWAY_WORKSPACE_SERVER_URL=http://localhost:3004
export API_GATEWAY_REVISIONS_SERVER_URL=http://localhost:3005
if [ -z "$PUBLIC_FILES_SERVER_URL" ]; then
export PUBLIC_FILES_SERVER_URL=http://localhost:3125

View File

@@ -91,13 +91,6 @@ TOPIC_CREATED_RESULT=$(create_topic ${SCHEDULER_TOPIC_NAME})
echo "created topic: $TOPIC_CREATED_RESULT"
SCHEDULER_TOPIC_ARN=$(get_topic_arn_from_name $SCHEDULER_TOPIC_NAME)
WORKSPACE_TOPIC_NAME="workspace-local-topic"
echo "creating topic $WORKSPACE_TOPIC_NAME"
TOPIC_CREATED_RESULT=$(create_topic ${WORKSPACE_TOPIC_NAME})
echo "created topic: $TOPIC_CREATED_RESULT"
WORKSPACE_TOPIC_ARN=$(get_topic_arn_from_name $WORKSPACE_TOPIC_NAME)
QUEUE_NAME="analytics-local-queue"
echo "creating queue $QUEUE_NAME"
@@ -182,13 +175,6 @@ QUEUE_URL=$(create_queue ${QUEUE_NAME})
echo "created queue: $QUEUE_URL"
SCHEDULER_QUEUE_ARN=$(get_queue_arn_from_name $QUEUE_NAME)
QUEUE_NAME="workspace-local-queue"
echo "creating queue $QUEUE_NAME"
QUEUE_URL=$(create_queue ${QUEUE_NAME})
echo "created queue: $QUEUE_URL"
WORKSPACE_QUEUE_ARN=$(get_queue_arn_from_name $QUEUE_NAME)
echo "all topics are:"
echo "$(get_all_topics)"

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.
## [2.21.1](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.21.0...@standardnotes/analytics@2.21.1) (2023-02-23)
### Bug Fixes
* **analytics:** add general activity metric to mixpanel ([9d87200](https://github.com/standardnotes/server/commit/9d872008a7df7ccdd9afe7e7d99ccb0f12680319))
# [2.21.0](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.20.3...@standardnotes/analytics@2.21.0) (2023-02-23)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/analytics",
"version": "2.21.0",
"version": "2.21.1",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -19,6 +19,10 @@ export class SessionCreatedEventHandler implements DomainEventHandlerInterface {
this.mixpanelClient.track(event.type, {
distinct_id: analyticsId.toString(),
})
this.mixpanelClient.track('GENERAL_ACTIVITY', {
distinct_id: analyticsId.toString(),
})
}
}
}

View File

@@ -19,6 +19,10 @@ export class SessionRefreshedEventHandler implements DomainEventHandlerInterface
this.mixpanelClient.track(event.type, {
distinct_id: analyticsId.toString(),
})
this.mixpanelClient.track('GENERAL_ACTIVITY', {
distinct_id: analyticsId.toString(),
})
}
}
}

View File

@@ -6,7 +6,6 @@ PORT=3000
SYNCING_SERVER_JS_URL=http://syncing_server_js:3000
AUTH_SERVER_URL=http://auth:3000
WORKSPACE_SERVER_URL=http://workspace:3000
WEB_SOCKET_SERVER_URL=http://websockets:3000
PAYMENTS_SERVER_URL=http://payments:3000
FILES_SERVER_URL=http://files:3000

View File

@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.49.4](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.49.3...@standardnotes/api-gateway@1.49.4) (2023-02-25)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.49.3](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.49.2...@standardnotes/api-gateway@1.49.3) (2023-02-24)
### Bug Fixes
* **api-gateywa:** remove stale proxy references ([dfa5187](https://github.com/standardnotes/api-gateway/commit/dfa5187ff73833bf981d273da79f78ae0309a493))
## [1.49.2](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.49.1...@standardnotes/api-gateway@1.49.2) (2023-02-23)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.49.1](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.49.0...@standardnotes/api-gateway@1.49.1) (2023-02-23)
**Note:** Version bump only for package @standardnotes/api-gateway

View File

@@ -19,10 +19,7 @@ import '../src/Controller/v1/TokensController'
import '../src/Controller/v1/OfflineController'
import '../src/Controller/v1/FilesController'
import '../src/Controller/v1/SubscriptionInvitesController'
import '../src/Controller/v1/WorkspacesController'
import '../src/Controller/v1/InvitesController'
import '../src/Controller/v1/AuthenticatorsController'
import '../src/Controller/v1/ProxyController'
import '../src/Controller/v2/PaymentsControllerV2'
import '../src/Controller/v2/ActionsControllerV2'

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api-gateway",
"version": "1.49.1",
"version": "1.49.4",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -59,9 +59,7 @@ export class ContainerConfigLoader {
container.bind(TYPES.PAYMENTS_SERVER_URL).toConstantValue(env.get('PAYMENTS_SERVER_URL', true))
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', true))
container.bind(TYPES.WEB_SOCKET_SERVER_URL).toConstantValue(env.get('WEB_SOCKET_SERVER_URL', true))
container.bind(TYPES.PROXY_SERVER_URL).toConstantValue(env.get('PROXY_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

@@ -9,9 +9,7 @@ const TYPES = {
FILES_SERVER_URL: Symbol.for('FILES_SERVER_URL'),
REVISIONS_SERVER_URL: Symbol.for('REVISIONS_SERVER_URL'),
EMAIL_SERVER_URL: Symbol.for('EMAIL_SERVER_URL'),
WORKSPACE_SERVER_URL: Symbol.for('WORKSPACE_SERVER_URL'),
WEB_SOCKET_SERVER_URL: Symbol.for('WEB_SOCKET_SERVER_URL'),
PROXY_SERVER_URL: Symbol.for('PROXY_SERVER_URL'),
AUTH_JWT_SECRET: Symbol.for('AUTH_JWT_SECRET'),
HTTP_CALL_TIMEOUT: Symbol.for('HTTP_CALL_TIMEOUT'),
VERSION: Symbol.for('VERSION'),

View File

@@ -1,23 +0,0 @@
import { inject } from 'inversify'
import { Request, Response } from 'express'
import { controller, BaseHttpController, httpPost } from 'inversify-express-utils'
import TYPES from '../../Bootstrap/Types'
import { HttpServiceInterface } from '../../Service/Http/HttpServiceInterface'
@controller('/v1/invites', TYPES.AuthMiddleware)
export class InvitesController extends BaseHttpController {
constructor(@inject(TYPES.HTTPService) private httpService: HttpServiceInterface) {
super()
}
@httpPost('/:inviteUuid/accept')
async accept(request: Request, response: Response): Promise<void> {
await this.httpService.callWorkspaceServer(
request,
response,
`invites/${request.params.inviteUuid}/accept`,
request.body,
)
}
}

View File

@@ -145,11 +145,6 @@ export class PaymentsController extends BaseHttpController {
await this.httpService.callPaymentsServer(request, response, 'api/pro_users/stripe-setup-intent', request.body)
}
@httpGet('/pro_users/cp-prepayment-info', TYPES.SubscriptionTokenAuthMiddleware)
async coinpaymentsPrepaymentInfo(request: Request, response: Response): Promise<void> {
await this.httpService.callPaymentsServer(request, response, 'api/pro_users/cp-prepayment-info', request.body)
}
@all('/pro_users(/*)?')
async proUsers(request: Request, response: Response): Promise<void> {
await this.httpService.callPaymentsServer(request, response, request.path.replace('v1', 'api'), request.body)

View File

@@ -1,18 +0,0 @@
import { Request, Response } from 'express'
import { inject } from 'inversify'
import { all, BaseHttpController, controller } from 'inversify-express-utils'
import TYPES from '../../Bootstrap/Types'
import { HttpServiceInterface } from '../../Service/Http/HttpServiceInterface'
@controller('/v1/proxy')
export class ProxyController extends BaseHttpController {
constructor(@inject(TYPES.HTTPService) private httpService: HttpServiceInterface) {
super()
}
@all('*', TYPES.AuthMiddleware)
async createToken(request: Request, response: Response): Promise<void> {
await this.httpService.callProxyServer(request, response, request.path.replace('/v1/proxy', ''), request.body)
}
}

View File

@@ -1,53 +0,0 @@
import { inject } from 'inversify'
import { Request, Response } from 'express'
import { controller, BaseHttpController, httpPost, httpGet } from 'inversify-express-utils'
import TYPES from '../../Bootstrap/Types'
import { HttpServiceInterface } from '../../Service/Http/HttpServiceInterface'
@controller('/v1/workspaces', TYPES.AuthMiddleware)
export class WorkspacesController extends BaseHttpController {
constructor(@inject(TYPES.HTTPService) private httpService: HttpServiceInterface) {
super()
}
@httpPost('/')
async create(request: Request, response: Response): Promise<void> {
await this.httpService.callWorkspaceServer(request, response, 'workspaces', request.body)
}
@httpGet('/:workspaceUuid/users')
async listWorkspaceUsers(request: Request, response: Response): Promise<void> {
await this.httpService.callWorkspaceServer(
request,
response,
`workspaces/${request.params.workspaceUuid}/users`,
request.body,
)
}
@httpPost('/:workspaceUuid/users/:userUuid/keyshare')
async initiateKeyshare(request: Request, response: Response): Promise<void> {
await this.httpService.callWorkspaceServer(
request,
response,
`workspaces/${request.params.workspaceUuid}/users/${request.params.userUuid}/keyshare`,
request.body,
)
}
@httpGet('/')
async listWorkspaces(request: Request, response: Response): Promise<void> {
await this.httpService.callWorkspaceServer(request, response, 'workspaces', request.body)
}
@httpPost('/:workspaceUuid/invites')
async invite(request: Request, response: Response): Promise<void> {
await this.httpService.callWorkspaceServer(
request,
response,
`workspaces/${request.params.workspaceUuid}/invites`,
request.body,
)
}
}

View File

@@ -16,11 +16,9 @@ export class HttpService implements HttpServiceInterface {
@inject(TYPES.SYNCING_SERVER_JS_URL) private syncingServerJsUrl: string,
@inject(TYPES.PAYMENTS_SERVER_URL) private paymentsServerUrl: string,
@inject(TYPES.FILES_SERVER_URL) private filesServerUrl: string,
@inject(TYPES.WORKSPACE_SERVER_URL) private workspaceServerUrl: string,
@inject(TYPES.WEB_SOCKET_SERVER_URL) private webSocketServerUrl: string,
@inject(TYPES.REVISIONS_SERVER_URL) private revisionsServerUrl: string,
@inject(TYPES.EMAIL_SERVER_URL) private emailServerUrl: string,
@inject(TYPES.PROXY_SERVER_URL) private proxyServerUrl: string,
@inject(TYPES.HTTP_CALL_TIMEOUT) private httpCallTimeout: number,
@inject(TYPES.CrossServiceTokenCache) private crossServiceTokenCache: CrossServiceTokenCacheInterface,
@inject(TYPES.Logger) private logger: Logger,
@@ -82,21 +80,6 @@ export class HttpService implements HttpServiceInterface {
await this.callServer(this.emailServerUrl, request, response, endpoint, payload)
}
async callWorkspaceServer(
request: Request,
response: Response,
endpoint: string,
payload?: Record<string, unknown> | string,
): Promise<void> {
if (!this.workspaceServerUrl) {
response.status(400).send({ message: 'Workspace Server not configured' })
return
}
await this.callServer(this.workspaceServerUrl, request, response, endpoint, payload)
}
async callWebSocketServer(
request: Request,
response: Response,
@@ -112,21 +95,6 @@ export class HttpService implements HttpServiceInterface {
await this.callServer(this.webSocketServerUrl, request, response, endpoint, payload)
}
async callProxyServer(
request: Request,
response: Response,
endpoint: string,
payload?: Record<string, unknown> | string,
): Promise<void> {
if (!this.proxyServerUrl) {
this.logger.debug('Proxy Server URL not defined. Skipped request to Proxy.')
return
}
await this.callServer(this.proxyServerUrl, request, response, endpoint, payload)
}
async callPaymentsServer(
request: Request,
response: Response,

View File

@@ -43,22 +43,10 @@ export interface HttpServiceInterface {
endpoint: string,
payload?: Record<string, unknown> | string,
): Promise<void>
callWorkspaceServer(
request: Request,
response: Response,
endpoint: string,
payload?: Record<string, unknown> | string,
): Promise<void>
callWebSocketServer(
request: Request,
response: Response,
endpoint: string,
payload?: Record<string, unknown> | string,
): Promise<void>
callProxyServer(
request: Request,
response: Response,
endpoint: string,
payload?: Record<string, unknown> | string,
): Promise<void>
}

View File

@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.89.5](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.89.4...@standardnotes/auth-server@1.89.5) (2023-03-01)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.89.4](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.89.3...@standardnotes/auth-server@1.89.4) (2023-03-01)
### Bug Fixes
* **auth:** updating counter post authenticator verification ([a9cc00a](https://github.com/standardnotes/server/commit/a9cc00a4783c12e71eb181a3ccf3218b418750d9))
## [1.89.3](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.89.2...@standardnotes/auth-server@1.89.3) (2023-02-27)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.89.2](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.89.1...@standardnotes/auth-server@1.89.2) (2023-02-24)
### Bug Fixes
* **auth:** add cross-platform authenticator selection option ([edc4a20](https://github.com/standardnotes/server/commit/edc4a2085952efe0b83c8e837a52555087714ef7))
## [1.89.1](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.89.0...@standardnotes/auth-server@1.89.1) (2023-02-23)
**Note:** Version bump only for package @standardnotes/auth-server
# [1.89.0](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.88.3...@standardnotes/auth-server@1.89.0) (2023-02-23)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.89.0",
"version": "1.89.5",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
@@ -39,15 +39,15 @@
"@newrelic/winston-enricher": "^4.0.0",
"@sentry/node": "^7.28.1",
"@sentry/tracing": "^7.28.1",
"@simplewebauthn/server": "^7.0.0",
"@standardnotes/api": "^1.24.10",
"@simplewebauthn/server": "^7.0.1",
"@standardnotes/api": "^1.25.3",
"@standardnotes/common": "workspace:*",
"@standardnotes/domain-core": "workspace:^",
"@standardnotes/domain-events": "workspace:*",
"@standardnotes/domain-events-infra": "workspace:*",
"@standardnotes/features": "^1.58.4",
"@standardnotes/predicates": "workspace:*",
"@standardnotes/responses": "^1.13.4",
"@standardnotes/responses": "^1.13.9",
"@standardnotes/security": "workspace:*",
"@standardnotes/settings": "workspace:*",
"@standardnotes/sncrypto-common": "^1.9.0",

View File

@@ -2,12 +2,12 @@ import { inject, injectable } from 'inversify'
import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
import {
ApiVersion,
HttpStatusCode,
UserDeletionResponse,
UserRegistrationRequestParams,
UserRegistrationResponse,
UserServerInterface,
UserDeletionResponseBody,
UserRegistrationResponseBody,
} from '@standardnotes/api'
import { HttpResponse, HttpStatusCode } from '@standardnotes/responses'
import { ProtocolVersion } from '@standardnotes/common'
import TYPES from '../Bootstrap/Types'
@@ -16,13 +16,13 @@ import { Register } from '../Domain/UseCase/Register'
import { DomainEventFactoryInterface } from '../Domain/Event/DomainEventFactoryInterface'
import { SignInWithRecoveryCodes } from '../Domain/UseCase/SignInWithRecoveryCodes/SignInWithRecoveryCodes'
import { SignInWithRecoveryCodesRequestParams } from '../Infra/Http/Request/SignInWithRecoveryCodesRequestParams'
import { SignInWithRecoveryCodesResponse } from '../Infra/Http/Response/SignInWithRecoveryCodesResponse'
import { GetUserKeyParamsRecovery } from '../Domain/UseCase/GetUserKeyParamsRecovery/GetUserKeyParamsRecovery'
import { RecoveryKeyParamsRequestParams } from '../Infra/Http/Request/RecoveryKeyParamsRequestParams'
import { RecoveryKeyParamsResponse } from '../Infra/Http/Response/RecoveryKeyParamsResponse'
import { SignInWithRecoveryCodesResponseBody } from '../Infra/Http/Response/SignInWithRecoveryCodesResponseBody'
import { RecoveryKeyParamsResponseBody } from '../Infra/Http/Response/RecoveryKeyParamsResponseBody'
import { GenerateRecoveryCodesResponseBody } from '../Infra/Http/Response/GenerateRecoveryCodesResponseBody'
import { GenerateRecoveryCodes } from '../Domain/UseCase/GenerateRecoveryCodes/GenerateRecoveryCodes'
import { GenerateRecoveryCodesRequestParams } from '../Infra/Http/Request/GenerateRecoveryCodesRequestParams'
import { GenerateRecoveryCodesResponse } from '../Infra/Http/Response/GenerateRecoveryCodesResponse'
import { Logger } from 'winston'
@injectable()
@@ -38,11 +38,11 @@ export class AuthController implements UserServerInterface {
@inject(TYPES.Logger) private logger: Logger,
) {}
async deleteAccount(_params: never): Promise<UserDeletionResponse> {
async deleteAccount(_params: never): Promise<HttpResponse<UserDeletionResponseBody>> {
throw new Error('This method is implemented on the payments server.')
}
async register(params: UserRegistrationRequestParams): Promise<UserRegistrationResponse> {
async register(params: UserRegistrationRequestParams): Promise<HttpResponse<UserRegistrationResponseBody>> {
if (!params.email || !params.password) {
return {
status: HttpStatusCode.BadRequest,
@@ -93,7 +93,9 @@ export class AuthController implements UserServerInterface {
}
}
async generateRecoveryCodes(params: GenerateRecoveryCodesRequestParams): Promise<GenerateRecoveryCodesResponse> {
async generateRecoveryCodes(
params: GenerateRecoveryCodesRequestParams,
): Promise<HttpResponse<GenerateRecoveryCodesResponseBody>> {
const result = await this.doGenerateRecoveryCodes.execute({
userUuid: params.userUuid,
})
@@ -119,7 +121,7 @@ export class AuthController implements UserServerInterface {
async signInWithRecoveryCodes(
params: SignInWithRecoveryCodesRequestParams,
): Promise<SignInWithRecoveryCodesResponse> {
): Promise<HttpResponse<SignInWithRecoveryCodesResponseBody>> {
if (params.apiVersion !== ApiVersion.v0) {
return {
status: HttpStatusCode.BadRequest,
@@ -158,7 +160,9 @@ export class AuthController implements UserServerInterface {
}
}
async recoveryKeyParams(params: RecoveryKeyParamsRequestParams): Promise<RecoveryKeyParamsResponse> {
async recoveryKeyParams(
params: RecoveryKeyParamsRequestParams,
): Promise<HttpResponse<RecoveryKeyParamsResponseBody>> {
if (params.apiVersion !== ApiVersion.v0) {
return {
status: HttpStatusCode.BadRequest,

View File

@@ -1,4 +1,4 @@
import { HttpStatusCode } from '@standardnotes/api'
import { HttpResponse, HttpStatusCode } from '@standardnotes/responses'
import { MapperInterface } from '@standardnotes/domain-core'
import { Authenticator } from '../Domain/Authenticator/Authenticator'
import { DeleteAuthenticator } from '../Domain/UseCase/DeleteAuthenticator/DeleteAuthenticator'
@@ -13,11 +13,11 @@ import { GenerateAuthenticatorAuthenticationOptionsRequestParams } from '../Infr
import { GenerateAuthenticatorRegistrationOptionsRequestParams } from '../Infra/Http/Request/GenerateAuthenticatorRegistrationOptionsRequestParams'
import { ListAuthenticatorsRequestParams } from '../Infra/Http/Request/ListAuthenticatorsRequestParams'
import { VerifyAuthenticatorRegistrationResponseRequestParams } from '../Infra/Http/Request/VerifyAuthenticatorRegistrationResponseRequestParams'
import { DeleteAuthenticatorResponse } from '../Infra/Http/Response/DeleteAuthenticatorResponse'
import { GenerateAuthenticatorAuthenticationOptionsResponse } from '../Infra/Http/Response/GenerateAuthenticatorAuthenticationOptionsResponse'
import { GenerateAuthenticatorRegistrationOptionsResponse } from '../Infra/Http/Response/GenerateAuthenticatorRegistrationOptionsResponse'
import { ListAuthenticatorsResponse } from '../Infra/Http/Response/ListAuthenticatorsResponse'
import { VerifyAuthenticatorRegistrationResponseResponse } from '../Infra/Http/Response/VerifyAuthenticatorRegistrationResponseResponse'
import { DeleteAuthenticatorResponseBody } from '../Infra/Http/Response/DeleteAuthenticatorResponseBody'
import { GenerateAuthenticatorAuthenticationOptionsResponseBody } from '../Infra/Http/Response/GenerateAuthenticatorAuthenticationOptionsResponseBody'
import { GenerateAuthenticatorRegistrationOptionsResponseBody } from '../Infra/Http/Response/GenerateAuthenticatorRegistrationOptionsResponseBody'
import { ListAuthenticatorsResponseBody } from '../Infra/Http/Response/ListAuthenticatorsResponseBody'
import { VerifyAuthenticatorRegistrationResponseResponseBody } from '../Infra/Http/Response/VerifyAuthenticatorRegistrationResponseResponseBody'
export class AuthenticatorsController {
constructor(
@@ -29,7 +29,7 @@ export class AuthenticatorsController {
private authenticatorHttpMapper: MapperInterface<Authenticator, AuthenticatorHttpProjection>,
) {}
async list(params: ListAuthenticatorsRequestParams): Promise<ListAuthenticatorsResponse> {
async list(params: ListAuthenticatorsRequestParams): Promise<HttpResponse<ListAuthenticatorsResponseBody>> {
const result = await this.listAuthenticators.execute({
userUuid: params.userUuid,
})
@@ -44,7 +44,7 @@ export class AuthenticatorsController {
}
}
async delete(params: DeleteAuthenticatorRequestParams): Promise<DeleteAuthenticatorResponse> {
async delete(params: DeleteAuthenticatorRequestParams): Promise<HttpResponse<DeleteAuthenticatorResponseBody>> {
const result = await this.deleteAuthenticator.execute({
userUuid: params.userUuid,
authenticatorId: params.authenticatorId,
@@ -60,7 +60,7 @@ export class AuthenticatorsController {
async generateRegistrationOptions(
params: GenerateAuthenticatorRegistrationOptionsRequestParams,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
): Promise<HttpResponse<GenerateAuthenticatorRegistrationOptionsResponseBody>> {
const result = await this.generateAuthenticatorRegistrationOptions.execute({
userUuid: params.userUuid,
username: params.username,
@@ -85,7 +85,7 @@ export class AuthenticatorsController {
async verifyRegistrationResponse(
params: VerifyAuthenticatorRegistrationResponseRequestParams,
): Promise<VerifyAuthenticatorRegistrationResponseResponse> {
): Promise<HttpResponse<VerifyAuthenticatorRegistrationResponseResponseBody>> {
const result = await this.verifyAuthenticatorRegistrationResponse.execute({
userUuid: params.userUuid,
name: params.name,
@@ -111,7 +111,7 @@ export class AuthenticatorsController {
async generateAuthenticationOptions(
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
): Promise<HttpResponse<GenerateAuthenticatorAuthenticationOptionsResponseBody>> {
const result = await this.generateAuthenticatorAuthenticationOptions.execute({
username: params.username,
})

View File

@@ -4,7 +4,7 @@ import { BaseHttpController, controller, httpPost, results } from 'inversify-exp
import { Request, Response } from 'express'
import TYPES from '../Bootstrap/Types'
import { CreateListedAccount } from '../Domain/UseCase/CreateListedAccount/CreateListedAccount'
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
@controller('/listed')
export class ListedController extends BaseHttpController {

View File

@@ -1,4 +1,4 @@
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
import { Request, Response } from 'express'
import { inject } from 'inversify'
import {

View File

@@ -1,4 +1,4 @@
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
import { Request, Response } from 'express'
import { inject } from 'inversify'
import {

View File

@@ -1,19 +1,19 @@
import {
AppleIAPConfirmRequestParams,
AppleIAPConfirmResponse,
HttpStatusCode,
AppleIAPConfirmResponseBody,
SubscriptionInviteAcceptRequestParams,
SubscriptionInviteAcceptResponse,
SubscriptionInviteAcceptResponseBody,
SubscriptionInviteCancelRequestParams,
SubscriptionInviteCancelResponse,
SubscriptionInviteCancelResponseBody,
SubscriptionInviteDeclineRequestParams,
SubscriptionInviteDeclineResponse,
SubscriptionInviteDeclineResponseBody,
SubscriptionInviteListRequestParams,
SubscriptionInviteListResponse,
SubscriptionInviteListResponseBody,
SubscriptionInviteRequestParams,
SubscriptionInviteResponse,
SubscriptionInviteResponseBody,
SubscriptionServerInterface,
} from '@standardnotes/api'
import { HttpResponse, HttpStatusCode } from '@standardnotes/responses'
import { inject, injectable } from 'inversify'
import TYPES from '../Bootstrap/Types'
@@ -37,11 +37,13 @@ export class SubscriptionInvitesController implements SubscriptionServerInterfac
private listSharedSubscriptionInvitations: ListSharedSubscriptionInvitations,
) {}
async confirmAppleIAP(_params: AppleIAPConfirmRequestParams): Promise<AppleIAPConfirmResponse> {
async confirmAppleIAP(_params: AppleIAPConfirmRequestParams): Promise<HttpResponse<AppleIAPConfirmResponseBody>> {
throw new Error('Method implemented on the payments service.')
}
async acceptInvite(params: SubscriptionInviteAcceptRequestParams): Promise<SubscriptionInviteAcceptResponse> {
async acceptInvite(
params: SubscriptionInviteAcceptRequestParams,
): Promise<HttpResponse<SubscriptionInviteAcceptResponseBody>> {
const result = await this.acceptSharedSubscriptionInvitation.execute({
sharedSubscriptionInvitationUuid: params.inviteUuid,
})
@@ -59,7 +61,9 @@ export class SubscriptionInvitesController implements SubscriptionServerInterfac
}
}
async declineInvite(params: SubscriptionInviteDeclineRequestParams): Promise<SubscriptionInviteDeclineResponse> {
async declineInvite(
params: SubscriptionInviteDeclineRequestParams,
): Promise<HttpResponse<SubscriptionInviteDeclineResponseBody>> {
const result = await this.declineSharedSubscriptionInvitation.execute({
sharedSubscriptionInvitationUuid: params.inviteUuid,
})
@@ -77,7 +81,7 @@ export class SubscriptionInvitesController implements SubscriptionServerInterfac
}
}
async invite(params: SubscriptionInviteRequestParams): Promise<SubscriptionInviteResponse> {
async invite(params: SubscriptionInviteRequestParams): Promise<HttpResponse<SubscriptionInviteResponseBody>> {
if (!params.identifier) {
return {
status: HttpStatusCode.BadRequest,
@@ -109,7 +113,9 @@ export class SubscriptionInvitesController implements SubscriptionServerInterfac
}
}
async cancelInvite(params: SubscriptionInviteCancelRequestParams): Promise<SubscriptionInviteCancelResponse> {
async cancelInvite(
params: SubscriptionInviteCancelRequestParams,
): Promise<HttpResponse<SubscriptionInviteCancelResponseBody>> {
const result = await this.cancelSharedSubscriptionInvitation.execute({
sharedSubscriptionInvitationUuid: params.inviteUuid,
inviterEmail: params.inviterEmail as string,
@@ -128,7 +134,9 @@ export class SubscriptionInvitesController implements SubscriptionServerInterfac
}
}
async listInvites(params: SubscriptionInviteListRequestParams): Promise<SubscriptionInviteListResponse> {
async listInvites(
params: SubscriptionInviteListRequestParams,
): Promise<HttpResponse<SubscriptionInviteListResponseBody>> {
const result = await this.listSharedSubscriptionInvitations.execute({
inviterEmail: params.inviterEmail as string,
})

View File

@@ -1,5 +1,5 @@
import { CrossServiceTokenData, TokenEncoderInterface } from '@standardnotes/security'
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
import { SettingName } from '@standardnotes/settings'
import { Request, Response } from 'express'
import { inject } from 'inversify'

View File

@@ -1,9 +1,5 @@
import {
HttpStatusCode,
UserRequestRequestParams,
UserRequestResponse,
UserRequestServerInterface,
} from '@standardnotes/api'
import { UserRequestRequestParams, UserRequestResponseBody, UserRequestServerInterface } from '@standardnotes/api'
import { HttpResponse, HttpStatusCode } from '@standardnotes/responses'
import { inject, injectable } from 'inversify'
import TYPES from '../Bootstrap/Types'
import { ProcessUserRequest } from '../Domain/UseCase/ProcessUserRequest/ProcessUserRequest'
@@ -12,7 +8,7 @@ import { ProcessUserRequest } from '../Domain/UseCase/ProcessUserRequest/Process
export class UserRequestsController implements UserRequestServerInterface {
constructor(@inject(TYPES.ProcessUserRequest) private processUserRequest: ProcessUserRequest) {}
async submitUserRequest(params: UserRequestRequestParams): Promise<UserRequestResponse> {
async submitUserRequest(params: UserRequestRequestParams): Promise<HttpResponse<UserRequestResponseBody>> {
const result = await this.processUserRequest.execute({
requestType: params.requestType,
userEmail: params.userEmail as string,

View File

@@ -1,6 +1,6 @@
import { Request, Response } from 'express'
import { inject } from 'inversify'
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
import {
BaseHttpController,
controller,

View File

@@ -7,8 +7,7 @@ import {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
results,
} from 'inversify-express-utils'
import { CreateValetTokenPayload } from '@standardnotes/responses'
import { ErrorTag } from '@standardnotes/api'
import { CreateValetTokenPayload, ErrorTag } from '@standardnotes/responses'
import { ValetTokenOperation } from '@standardnotes/security'
import { Uuid } from '@standardnotes/domain-core'

View File

@@ -7,6 +7,7 @@ export interface AuthenticatorRepositoryInterface {
findById(id: UniqueEntityId): Promise<Authenticator | null>
findByUserUuidAndCredentialId(userUuid: Uuid, credentialId: string): Promise<Authenticator | null>
save(authenticator: Authenticator): Promise<void>
updateCounter(id: UniqueEntityId, counter: number): Promise<void>
remove(authenticator: Authenticator): Promise<void>
removeByUserUuid(userUuid: Uuid): Promise<void>
}

View File

@@ -38,7 +38,7 @@ export class GenerateAuthenticatorAuthenticationOptions implements UseCaseInterf
transports: [],
},
],
userVerification: 'preferred',
userVerification: 'discouraged',
})
return Result.ok(options)
@@ -57,7 +57,7 @@ export class GenerateAuthenticatorAuthenticationOptions implements UseCaseInterf
type: 'public-key',
transports: authenticator.props.transports,
})),
userVerification: 'preferred',
userVerification: 'discouraged',
})
const authenticatorChallengeOrError = AuthenticatorChallenge.create({

View File

@@ -34,6 +34,10 @@ export class GenerateAuthenticatorRegistrationOptions implements UseCaseInterfac
userID: userUuid.value,
userName: username.value,
attestationType: 'none',
authenticatorSelection: {
authenticatorAttachment: 'cross-platform',
userVerification: 'discouraged',
},
excludeCredentials: authenticators.map((authenticator) => ({
id: authenticator.props.credentialId,
type: 'public-key',

View File

@@ -16,7 +16,7 @@ import { PKCERepositoryInterface } from '../User/PKCERepositoryInterface'
import { CrypterInterface } from '../Encryption/CrypterInterface'
import { SignInDTOV2Challenged } from './SignInDTOV2Challenged'
import { leftVersionGreaterThanOrEqualToRight, ProtocolVersion } from '@standardnotes/common'
import { HttpStatusCode } from '@standardnotes/api'
import { HttpStatusCode } from '@standardnotes/responses'
import { EmailLevel } from '@standardnotes/domain-core'
import { getBody, getSubject } from '../Email/UserSignedIn'

View File

@@ -1,4 +1,4 @@
import { HttpStatusCode } from '@standardnotes/api'
import { HttpStatusCode } from '@standardnotes/responses'
import { AuthResponse20161215 } from '../Auth/AuthResponse20161215'
import { AuthResponse20200115 } from '../Auth/AuthResponse20200115'

View File

@@ -36,7 +36,7 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
authenticatorRepository = {} as jest.Mocked<AuthenticatorRepositoryInterface>
authenticatorRepository.findByUserUuidAndCredentialId = jest.fn().mockReturnValue(authenticator)
authenticatorRepository.save = jest.fn()
authenticatorRepository.updateCounter = jest.fn()
authenticatorChallengeRepository = {} as jest.Mocked<AuthenticatorChallengeRepositoryInterface>
authenticatorChallengeRepository.findByUserUuid = jest.fn().mockReturnValue({
@@ -221,6 +221,6 @@ describe('VerifyAuthenticatorAuthenticationResponse', () => {
})
expect(result.isFailed()).toBeFalsy()
expect(authenticatorRepository.save).toHaveBeenCalled()
expect(authenticatorRepository.updateCounter).toHaveBeenCalled()
})
})

View File

@@ -60,9 +60,7 @@ export class VerifyAuthenticatorAuthenticationResponse implements UseCaseInterfa
return Result.fail(`Could not verify authenticator authentication response: ${(error as Error).message}`)
}
authenticator.props.counter = verification.authenticationInfo.newCounter as number
await this.authenticatorRepository.save(authenticator)
await this.authenticatorRepository.updateCounter(authenticator.id, verification.authenticationInfo.newCounter)
return Result.ok(true)
}

View File

@@ -1,5 +1,5 @@
import * as crypto from 'crypto'
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
import { SettingName } from '@standardnotes/settings'
import { v4 as uuidv4 } from 'uuid'
import { inject, injectable } from 'inversify'

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { DeleteAuthenticatorResponseBody } from './DeleteAuthenticatorResponseBody'
export interface DeleteAuthenticatorResponse extends HttpResponse {
data: Either<DeleteAuthenticatorResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { GenerateAuthenticatorAuthenticationOptionsResponseBody } from './GenerateAuthenticatorAuthenticationOptionsResponseBody'
export interface GenerateAuthenticatorAuthenticationOptionsResponse extends HttpResponse {
data: Either<GenerateAuthenticatorAuthenticationOptionsResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { GenerateAuthenticatorRegistrationOptionsResponseBody } from './GenerateAuthenticatorRegistrationOptionsResponseBody'
export interface GenerateAuthenticatorRegistrationOptionsResponse extends HttpResponse {
data: Either<GenerateAuthenticatorRegistrationOptionsResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { GenerateRecoveryCodesResponseBody } from './GenerateRecoveryCodesResponseBody'
export interface GenerateRecoveryCodesResponse extends HttpResponse {
data: Either<GenerateRecoveryCodesResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { ListAuthenticatorsResponseBody } from './ListAuthenticatorsResponseBody'
export interface ListAuthenticatorsResponse extends HttpResponse {
data: Either<ListAuthenticatorsResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { RecoveryKeyParamsResponseBody } from './RecoveryKeyParamsResponseBody'
export interface RecoveryKeyParamsResponse extends HttpResponse {
data: Either<RecoveryKeyParamsResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { SignInWithRecoveryCodesResponseBody } from './SignInWithRecoveryCodesResponseBody'
export interface SignInWithRecoveryCodesResponse extends HttpResponse {
data: Either<SignInWithRecoveryCodesResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { VerifyAuthenticatorAuthenticationResponseResponseBody } from './VerifyAuthenticatorAuthenticationResponseResponseBody'
export interface VerifyAuthenticatorAuthenticationResponseResponse extends HttpResponse {
data: Either<VerifyAuthenticatorAuthenticationResponseResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,8 +0,0 @@
import { HttpErrorResponseBody, HttpResponse } from '@standardnotes/api'
import { Either } from '@standardnotes/common'
import { VerifyAuthenticatorRegistrationResponseResponseBody } from './VerifyAuthenticatorRegistrationResponseResponseBody'
export interface VerifyAuthenticatorRegistrationResponseResponse extends HttpResponse {
data: Either<VerifyAuthenticatorRegistrationResponseResponseBody, HttpErrorResponseBody>
}

View File

@@ -1,5 +1,5 @@
import { Request, Response } from 'express'
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
import {
BaseHttpController,
controller,

View File

@@ -1,4 +1,4 @@
import { ErrorTag } from '@standardnotes/api'
import { ErrorTag } from '@standardnotes/responses'
import { TokenDecoderInterface, WebSocketConnectionTokenData } from '@standardnotes/security'
import { Request } from 'express'
import { inject } from 'inversify'

View File

@@ -11,6 +11,19 @@ export class MySQLAuthenticatorRepository implements AuthenticatorRepositoryInte
private mapper: MapperInterface<Authenticator, TypeORMAuthenticator>,
) {}
async updateCounter(id: UniqueEntityId, counter: number): Promise<void> {
await this.ormRepository
.createQueryBuilder()
.update()
.set({
counter,
})
.where('uuid = :uuid', {
uuid: id.toString(),
})
.execute()
}
async removeByUserUuid(userUuid: Uuid): Promise<void> {
await this.ormRepository
.createQueryBuilder()

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.46.6](https://github.com/standardnotes/server/compare/@standardnotes/common@1.46.5...@standardnotes/common@1.46.6) (2023-02-23)
**Note:** Version bump only for package @standardnotes/common
## [1.46.5](https://github.com/standardnotes/server/compare/@standardnotes/common@1.46.4...@standardnotes/common@1.46.5) (2023-01-24)
**Note:** Version bump only for package @standardnotes/common

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/common",
"version": "1.46.5",
"version": "1.46.6",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -26,7 +26,6 @@ export enum EmailMessageIdentifier {
REFUND_NOTICE = 'REFUND_NOTICE',
REFUND_REQUESTED = 'REFUND_REQUESTED',
RATE_ADJUSTMENT_NOTICE = 'RATE_ADJUSTMENT_NOTICE',
WORKSPACE_INVITE_CREATED = 'WORKSPACE_INVITE_CREATED',
EXIT_DISCOUNT = 'EXIT_DISCOUNT',
SUBSCRIPTION_CANCELLED = 'SUBSCRIPTION_CANCELLED',
}

View File

@@ -1,6 +0,0 @@
export enum WorkspaceAccessLevel {
Owner = 'owner',
Admin = 'admin',
ReadOnly = 'read-only',
WriteAndRead = 'write-and-read',
}

View File

@@ -1,5 +0,0 @@
export enum WorkspaceType {
Root = 'root',
Team = 'team',
Private = 'private',
}

View File

@@ -1,4 +0,0 @@
export enum WorkspaceUserStatus {
Active = 'active',
PendingKeyshare = 'pending-keyshare',
}

View File

@@ -20,6 +20,3 @@ export * from './Subscription/SubscriptionName'
export * from './Type/Either'
export * from './Type/Only'
export * from './User/UserRequestType'
export * from './Workspace/WorkspaceAccessLevel'
export * from './Workspace/WorkspaceType'
export * from './Workspace/WorkspaceUserStatus'

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.9.72](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.71...@standardnotes/domain-events-infra@1.9.72) (2023-02-23)
**Note:** Version bump only for package @standardnotes/domain-events-infra
## [1.9.71](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.9.70...@standardnotes/domain-events-infra@1.9.71) (2023-02-23)
**Note:** Version bump only for package @standardnotes/domain-events-infra

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events-infra",
"version": "1.9.71",
"version": "1.9.72",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.108.1](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.108.0...@standardnotes/domain-events@2.108.1) (2023-02-23)
**Note:** Version bump only for package @standardnotes/domain-events
# [2.108.0](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.107.1...@standardnotes/domain-events@2.108.0) (2023-02-23)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events",
"version": "2.108.0",
"version": "2.108.1",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -8,7 +8,6 @@ export enum DomainEventService {
ApiGateway = 'api-gateway',
Files = 'files',
Scheduler = 'scheduler',
Workspace = 'workspace',
Analytics = 'analytics',
Revisions = 'revisions',
Email = 'email',

View File

@@ -1,7 +0,0 @@
import { DomainEventInterface } from './DomainEventInterface'
import { WorkspaceInviteAcceptedEventPayload } from './WorkspaceInviteAcceptedEventPayload'
export interface WorkspaceInviteAcceptedEvent extends DomainEventInterface {
type: 'WORKSPACE_INVITE_ACCEPTED'
payload: WorkspaceInviteAcceptedEventPayload
}

View File

@@ -1,5 +0,0 @@
export interface WorkspaceInviteAcceptedEventPayload {
inviterUuid: string
inviteeUuid: string
workspaceUuid: string
}

View File

@@ -92,8 +92,6 @@ export * from './Event/UserRolesChangedEvent'
export * from './Event/UserRolesChangedEventPayload'
export * from './Event/WebSocketMessageRequestedEvent'
export * from './Event/WebSocketMessageRequestedEventPayload'
export * from './Event/WorkspaceInviteAcceptedEvent'
export * from './Event/WorkspaceInviteAcceptedEventPayload'
export * from './Handler/DomainEventHandlerInterface'
export * from './Handler/DomainEventMessageHandlerInterface'

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.7.4](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.7.3...@standardnotes/event-store@1.7.4) (2023-02-23)
**Note:** Version bump only for package @standardnotes/event-store
## [1.7.3](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.7.2...@standardnotes/event-store@1.7.3) (2023-02-23)
**Note:** Version bump only for package @standardnotes/event-store

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/event-store",
"version": "1.7.3",
"version": "1.7.4",
"description": "Event Store Service",
"private": true,
"main": "dist/src/index.js",

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.10.5](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.10.4...@standardnotes/files-server@1.10.5) (2023-02-23)
**Note:** Version bump only for package @standardnotes/files-server
## [1.10.4](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.10.3...@standardnotes/files-server@1.10.4) (2023-02-23)
**Note:** Version bump only for package @standardnotes/files-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files-server",
"version": "1.10.4",
"version": "1.10.5",
"engines": {
"node": ">=18.0.0 <19.0.0"
},

View File

@@ -1 +0,0 @@
dist

View File

@@ -1,6 +0,0 @@
{
"extends": "../../.eslintrc",
"parserOptions": {
"project": "./linter.tsconfig.json"
}
}

View File

@@ -1,40 +0,0 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.6](https://github.com/standardnotes/server/compare/@standardnotes/proxy-server@1.1.5...@standardnotes/proxy-server@1.1.6) (2023-02-23)
### Bug Fixes
* **proxy:** make healthcheck endpoint accessible at all times ([b1122a3](https://github.com/standardnotes/server/commit/b1122a3da5d0fe02b80b91da5e96cffbad994ce2))
## [1.1.5](https://github.com/standardnotes/server/compare/@standardnotes/proxy-server@1.1.4...@standardnotes/proxy-server@1.1.5) (2023-02-22)
**Note:** Version bump only for package @standardnotes/proxy-server
## [1.1.4](https://github.com/standardnotes/server/compare/@standardnotes/proxy-server@1.1.3...@standardnotes/proxy-server@1.1.4) (2023-02-22)
**Note:** Version bump only for package @standardnotes/proxy-server
## [1.1.3](https://github.com/standardnotes/server/compare/@standardnotes/proxy-server@1.1.2...@standardnotes/proxy-server@1.1.3) (2023-02-22)
**Note:** Version bump only for package @standardnotes/proxy-server
## [1.1.2](https://github.com/standardnotes/server/compare/@standardnotes/proxy-server@1.1.1...@standardnotes/proxy-server@1.1.2) (2023-02-22)
**Note:** Version bump only for package @standardnotes/proxy-server
## [1.1.1](https://github.com/standardnotes/server/compare/@standardnotes/proxy-server@1.1.0...@standardnotes/proxy-server@1.1.1) (2023-02-22)
**Note:** Version bump only for package @standardnotes/proxy-server
# 1.1.0 (2023-02-22)
### Bug Fixes
* **proxy:** prevent from passing auth tokens to proxy destination ([91c70a5](https://github.com/standardnotes/server/commit/91c70a51a067c606afc3570764367a6d60910ce3))
### Features
* **proxy:** add proxy server ([dfe30d7](https://github.com/standardnotes/server/commit/dfe30d7f5e8598ec1886db0e061b7d593cc27e29))

View File

@@ -1,17 +0,0 @@
FROM node:18.13.0-alpine
RUN apk add --update \
curl \
&& rm -rf /var/cache/apk/*
ENV NODE_ENV production
RUN corepack enable
COPY ./ /workspace
WORKDIR /workspace/packages/proxy
ENTRYPOINT [ "/workspace/packages/proxy/docker/entrypoint.sh" ]
CMD [ "start-web" ]

View File

@@ -1,91 +0,0 @@
import * as http from 'http'
import * as https from 'https'
import * as path from 'path'
const MAX_IMAGE_SIZE = 10 * 1024 * 1024
const ENABLED = false
http
.createServer((req, res) => {
if (req.url === '/healthcheck') {
res.writeHead(200)
res.end()
return
}
if (!ENABLED) {
res.writeHead(404)
res.end()
return
}
res.setHeader('Access-Control-Allow-Origin', '*')
res.setHeader('Access-Control-Request-Method', '*')
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET')
res.setHeader('Access-Control-Allow-Headers', '*')
if (req.method === 'OPTIONS') {
res.writeHead(200)
res.end()
return
}
delete req.headers.authorization
delete req.headers['x-auth-token']
delete req.headers['x-auth-offline-token']
/** Remove / or // prefixes */
const target = (req.url as string).replace(/^\/+/, '')
try {
const url = new URL(target)
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
throw new Error('Invalid URL protocol')
}
if (url.hostname === '') {
throw new Error('Invalid URL hostname')
}
const ext = path.extname(url.pathname)
if (!['.jpg', '.jpeg', '.png', '.gif'].includes(ext)) {
res.writeHead(400)
res.end('Only image files can be proxied')
return
}
const library = url.protocol === 'http:' ? http : https
const proxyRequest = library
.get(url.href, (targetRes) => {
let totalSize = 0
targetRes.on('data', (chunk) => {
totalSize += chunk.length
if (totalSize > MAX_IMAGE_SIZE) {
proxyRequest.destroy(new Error('Image size exceeds the limit.'))
}
})
targetRes.on('end', () => {
const contentType = targetRes.headers['content-type']
if (!contentType || !contentType.startsWith('image/')) {
res.writeHead(400, { 'Content-Type': 'text/plain' })
res.end(`Invalid content type: ${contentType}`)
return
}
res.writeHead(targetRes.statusCode as number, targetRes.headers)
targetRes.pipe(res)
})
})
.on('error', (error) => {
res.writeHead(500)
res.end(`Error: ${error.message}`)
})
} catch (error) {
res.writeHead(500)
res.end(`Invalid URL: ${target} Error: ${error}`)
}
})
.listen(3000)

View File

@@ -1,11 +0,0 @@
'use strict'
const path = require('path')
const pnp = require(path.normalize(path.resolve(__dirname, '../../..', '.pnp.cjs'))).setup()
const index = require(path.normalize(path.resolve(__dirname, '../dist/bin/server.js')))
Object.defineProperty(exports, '__esModule', { value: true })
exports.default = index

View File

@@ -1,17 +0,0 @@
#!/bin/sh
set -e
COMMAND=$1 && shift 1
case "$COMMAND" in
'start-web' )
echo "[Docker] Starting Web..."
node docker/entrypoint-server.js
;;
* )
echo "Unknown command"
;;
esac
exec "$@"

View File

@@ -1,4 +0,0 @@
{
"extends": "./tsconfig.json",
"exclude": ["dist"]
}

View File

@@ -1,32 +0,0 @@
{
"name": "@standardnotes/proxy-server",
"version": "1.1.6",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
"private": true,
"description": "Proxy 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>",
"license": "AGPL-3.0-or-later",
"scripts": {
"clean": "rm -fr dist",
"build": "tsc --build",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"start": "yarn node dist/bin/server.js"
},
"dependencies": {
"newrelic": "^9.8.0"
},
"devDependencies": {
"@types/newrelic": "^9.4.0",
"@types/node": "^18.14.0",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"eslint": "^8.32.0",
"eslint-plugin-prettier": "^4.0.0",
"typescript": "^4.8.4"
}
}

View File

@@ -1,11 +0,0 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "./dist",
},
"include": [
"bin/**/*",
],
"references": []
}

View File

@@ -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.12.7](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.12.6...@standardnotes/revisions-server@1.12.7) (2023-03-01)
**Note:** Version bump only for package @standardnotes/revisions-server
## [1.12.6](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.12.5...@standardnotes/revisions-server@1.12.6) (2023-02-23)
**Note:** Version bump only for package @standardnotes/revisions-server
## [1.12.5](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.12.4...@standardnotes/revisions-server@1.12.5) (2023-02-23)
**Note:** Version bump only for package @standardnotes/revisions-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/revisions-server",
"version": "1.12.5",
"version": "1.12.7",
"engines": {
"node": ">=18.0.0 <19.0.0"
},
@@ -27,11 +27,12 @@
"@aws-sdk/client-sqs": "^3.259.0",
"@newrelic/winston-enricher": "^4.0.0",
"@sentry/node": "^7.28.1",
"@standardnotes/api": "^1.24.10",
"@standardnotes/api": "^1.25.3",
"@standardnotes/common": "workspace:^",
"@standardnotes/domain-core": "workspace:^",
"@standardnotes/domain-events": "workspace:*",
"@standardnotes/domain-events-infra": "workspace:*",
"@standardnotes/responses": "^1.13.9",
"@standardnotes/security": "workspace:^",
"@standardnotes/time": "workspace:^",
"cors": "2.8.5",

Some files were not shown because too many files have changed in this diff Show More