Compare commits

..

28 Commits

Author SHA1 Message Date
standardci
c9c496c63f chore(release): publish new version
- @standardnotes/api-gateway@1.2.2
 - @standardnotes/auth-server@1.3.1
 - @standardnotes/files-server@1.1.7
 - @standardnotes/scheduler-server@1.2.2
 - @standardnotes/syncing-server@1.1.7
2022-06-27 21:57:06 +00:00
Mo
b1c9f8ca6e Merge pull request #1 from standardnotes/chore/snjs-workflow
chore: upgrade snjs event workflow
2022-06-27 16:56:33 -05:00
Mo
e84bd73a39 chore: add snjs workflow event handler 2022-06-27 16:53:57 -05:00
Mo
c69d1b02fb chore: add ini dep for ncu 2022-06-27 16:52:20 -05:00
Mo
b590d33b88 chore: ncu version 2022-06-27 16:48:02 -05:00
Mo
c1e7a3eb7e chore: add ncu to each package 2022-06-27 16:47:19 -05:00
Mo
fd743a9d5e chore: add npm-check-updates dev dep 2022-06-27 16:44:43 -05:00
standardci
4c40fd5186 chore(release): publish new version
- @standardnotes/api-gateway@1.2.1
2022-06-27 10:27:36 +00:00
Karol Sójko
2cb470b99e fix: issue with NaN error code responses 2022-06-27 12:27:00 +02:00
standardci
b6539f8795 chore(release): publish new version
- @standardnotes/auth-server@1.3.0
2022-06-27 10:18:23 +00:00
Karol Sójko
6d7de4a8da feat: add endpoint for muting marketing emails 2022-06-27 12:17:47 +02:00
standardci
41999f36f0 chore(release): publish new version
- @standardnotes/api-gateway@1.2.0
 - @standardnotes/auth-server@1.2.1
2022-06-27 10:07:19 +00:00
Karol Sójko
fa2a8da17b feat: add endpoint to mute marketing emails 2022-06-27 12:06:33 +02:00
Karol Sójko
214684eae7 fix: add setting uuid to email requests 2022-06-27 12:06:33 +02:00
standardci
b3a92af04d chore(release): publish new version
- @standardnotes/auth-server@1.2.0
2022-06-27 09:57:22 +00:00
Karol Sójko
210a314c81 feat: add docker commands to start sending emails 2022-06-27 11:56:42 +02:00
standardci
46cba52bcb chore(release): publish new version
- @standardnotes/auth-server@1.1.7
2022-06-27 08:44:03 +00:00
Karol Sójko
bf14ec05f9 fix: add sending out email campaigns 2022-06-27 10:43:23 +02:00
standardci
6f88a96c3e chore(release): publish new version
- @standardnotes/scheduler-server@1.2.1
2022-06-27 07:42:47 +00:00
Karol Sójko
e12c9c47a7 fix: change subscription encouragement scheduled from 14 to 30 days 2022-06-27 09:42:08 +02:00
standardci
83085052f8 chore(release): publish new version
- @standardnotes/api-gateway@1.1.6
 - @standardnotes/auth-server@1.1.6
 - @standardnotes/files-server@1.1.6
 - @standardnotes/scheduler-server@1.2.0
 - @standardnotes/syncing-server@1.1.6
2022-06-27 07:25:46 +00:00
Karol Sójko
eda618d845 Merge branch 'main' of github.com:standardnotes/server 2022-06-27 09:25:04 +02:00
Karol Sójko
8d4280f4ca feat: add context for requesting email message 2022-06-27 09:24:43 +02:00
standardci
b57816bba4 chore(release): publish new version
- @standardnotes/api-gateway@1.1.5
 - @standardnotes/auth-server@1.1.5
 - @standardnotes/files-server@1.1.5
 - @standardnotes/scheduler-server@1.1.5
 - @standardnotes/syncing-server@1.1.5
2022-06-27 04:59:52 +00:00
Karol Sójko
b6db194a22 fix: upgrade sentry node sdk 2022-06-27 06:59:15 +02:00
standardci
8f708164cd chore(release): publish new version
- @standardnotes/api-gateway@1.1.4
 - @standardnotes/auth-server@1.1.4
 - @standardnotes/files-server@1.1.4
 - @standardnotes/scheduler-server@1.1.4
 - @standardnotes/syncing-server@1.1.4
2022-06-24 13:19:23 +00:00
Karol Sójko
ff09ae0a47 fix: newrelic deps and setup db and cache for local development purposes 2022-06-24 15:18:41 +02:00
Karol Sójko
d21d752029 fix: newrelic deploy markers on syncing-server 2022-06-23 19:42:23 +02:00
96 changed files with 1428 additions and 589 deletions

6
.env.sample Normal file
View File

@@ -0,0 +1,6 @@
DB_PORT=3306
DB_USERNAME=std_notes_user
DB_PASSWORD=changeme123
DB_DATABASE=standard_notes_db
REDIS_PORT=6379

View File

@@ -0,0 +1,46 @@
name: Update SNJS Packages
on:
workflow_dispatch:
repository_dispatch:
types: [snjs-updated-event]
jobs:
SNJSUpdateEvent:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: main
token: ${{ secrets.CI_PAT_TOKEN }}
- uses: actions/setup-node@v3
with:
registry-url: 'https://registry.npmjs.org'
- name: Setup git config
run: |
git config --global user.name "standardci"
git config --global user.email "ci@standardnotes.com"
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- run: yarn install
- run: |
yarn upgrade:snjs
yarn install --no-immutable
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.CI_PAT_TOKEN }}
title: "${{ 'chore(deps): upgrade snjs' }}"
body: Updates all packages prefixed with "@standardnotes/"
commit-message: "${{ 'chore(deps): upgrade snjs' }}"
delete-branch: true
committer: standardci <ci@standardnotes.com>
author: standardci <ci@standardnotes.com>

View File

@@ -185,25 +185,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: DEV - 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_SYNCING_SERVER_WEB_DEV }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: DEV - 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_SYNCING_SERVER_WORKER_DEV }}
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: PROD - Create New Relic deployment marker for Web
- name: Create New Relic deployment marker for Web
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}
@@ -212,7 +194,7 @@ jobs:
revision: "${{ github.sha }}"
description: "Automated Deployment via Github Actions"
user: "${{ github.actor }}"
- name: PROD - Create New Relic deployment marker for Worker
- name: Create New Relic deployment marker for Worker
uses: newrelic/deployment-marker-action@v1
with:
accountId: ${{ secrets.NEW_RELIC_ACCOUNT_ID }}

3
.gitignore vendored
View File

@@ -18,3 +18,6 @@ newrelic_agent.log
packages/files/uploads/*
!packages/files/uploads/.gitkeep
data/*
!data/.gitkeep

605
.pnp.cjs generated
View File

@@ -63,11 +63,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@lerna-lite/cli", "npm:1.5.1"],\
["@lerna-lite/list", "npm:1.5.1"],\
["@lerna-lite/run", "npm:1.5.1"],\
["@sentry/node", "npm:7.3.0"],\
["@types/jest", "npm:28.1.3"],\
["@types/newrelic", "npm:7.0.3"],\
["@types/node", "npm:18.0.0"],\
["@typescript-eslint/parser", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:5.29.0"],\
["eslint", "npm:8.18.0"],\
["eslint-config-prettier", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:8.5.0"],\
["ini", "npm:3.0.0"],\
["newrelic", "npm:8.14.1"],\
["npm-check-updates", "npm:14.1.1"],\
["prettier", "npm:2.7.1"],\
["ts-node", "virtual:9e9d2b94dac68914cfc6173c41e92914f6d1fe30b9ab6e163c2043744960a73d771c78f37827a8773b7adeb75f4b67f907cd8c18197a7807ce979a4aea3b2602#npm:10.8.1"],\
["typescript", "patch:typescript@npm%3A4.7.4#~builtin<compat/typescript>::version=4.7.4&hash=7ad353"]\
@@ -1100,15 +1105,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["@grpc/proto-loader", [\
["npm:0.5.6", {\
"packageLocation": "./.yarn/cache/@grpc-proto-loader-npm-0.5.6-ef97ffeb0b-13fe76d84a.zip/node_modules/@grpc/proto-loader/",\
"packageDependencies": [\
["@grpc/proto-loader", "npm:0.5.6"],\
["lodash.camelcase", "npm:4.3.0"],\
["protobufjs", "npm:6.11.3"]\
],\
"linkType": "HARD"\
}],\
["npm:0.6.13", {\
"packageLocation": "./.yarn/cache/@grpc-proto-loader-npm-0.6.13-658ac26dfb-863417e961.zip/node_modules/@grpc/proto-loader/",\
"packageDependencies": [\
@@ -1730,13 +1726,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["@newrelic/aws-sdk", [\
["npm:3.1.0", {\
"packageLocation": "./.yarn/cache/@newrelic-aws-sdk-npm-3.1.0-7c3485a153-5601d90c78.zip/node_modules/@newrelic/aws-sdk/",\
"packageDependencies": [\
["@newrelic/aws-sdk", "npm:3.1.0"]\
],\
"linkType": "SOFT"\
}],\
["npm:4.1.2", {\
"packageLocation": "./.yarn/cache/@newrelic-aws-sdk-npm-4.1.2-9930120a02-610f6353a7.zip/node_modules/@newrelic/aws-sdk/",\
"packageDependencies": [\
@@ -1744,20 +1733,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
],\
"linkType": "SOFT"\
}],\
["virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:4.1.2", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-aws-sdk-virtual-b2151ed930/0/cache/@newrelic-aws-sdk-npm-4.1.2-9930120a02-610f6353a7.zip/node_modules/@newrelic/aws-sdk/",\
"packageDependencies": [\
["@newrelic/aws-sdk", "virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:4.1.2"],\
["@types/newrelic", null],\
["newrelic", "npm:8.6.0"],\
["semver", "npm:7.3.7"]\
],\
"packagePeers": [\
"@types/newrelic",\
"newrelic"\
],\
"linkType": "HARD"\
}],\
["virtual:b659d4d19ce37732618223b586685dc7b27d11c52dca80d8411fdda38a4e6a7967776a5d7bdcce0be779cd6a41e2d84f8bbd3d3b5c06ce5ae40ad814517dfcfb#npm:4.1.2", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-aws-sdk-virtual-a259cc13ec/0/cache/@newrelic-aws-sdk-npm-4.1.2-9930120a02-610f6353a7.zip/node_modules/@newrelic/aws-sdk/",\
"packageDependencies": [\
@@ -1771,29 +1746,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"newrelic"\
],\
"linkType": "HARD"\
}],\
["virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:3.1.0", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-aws-sdk-virtual-9720173dde/0/cache/@newrelic-aws-sdk-npm-3.1.0-7c3485a153-5601d90c78.zip/node_modules/@newrelic/aws-sdk/",\
"packageDependencies": [\
["@newrelic/aws-sdk", "virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:3.1.0"],\
["@types/newrelic", null],\
["newrelic", "npm:7.5.2"]\
],\
"packagePeers": [\
"@types/newrelic",\
"newrelic"\
],\
"linkType": "HARD"\
}]\
]],\
["@newrelic/koa", [\
["npm:5.0.0", {\
"packageLocation": "./.yarn/cache/@newrelic-koa-npm-5.0.0-c9c6a0e1dc-e98d921b96.zip/node_modules/@newrelic/koa/",\
"packageDependencies": [\
["@newrelic/koa", "npm:5.0.0"]\
],\
"linkType": "SOFT"\
}],\
["npm:6.1.2", {\
"packageLocation": "./.yarn/cache/@newrelic-koa-npm-6.1.2-df0f7c71b5-e269d37b13.zip/node_modules/@newrelic/koa/",\
"packageDependencies": [\
@@ -1801,19 +1756,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
],\
"linkType": "SOFT"\
}],\
["virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:6.1.2", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-koa-virtual-94b8735dec/0/cache/@newrelic-koa-npm-6.1.2-df0f7c71b5-e269d37b13.zip/node_modules/@newrelic/koa/",\
"packageDependencies": [\
["@newrelic/koa", "virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:6.1.2"],\
["@types/newrelic", null],\
["newrelic", "npm:8.6.0"]\
],\
"packagePeers": [\
"@types/newrelic",\
"newrelic"\
],\
"linkType": "HARD"\
}],\
["virtual:b659d4d19ce37732618223b586685dc7b27d11c52dca80d8411fdda38a4e6a7967776a5d7bdcce0be779cd6a41e2d84f8bbd3d3b5c06ce5ae40ad814517dfcfb#npm:6.1.2", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-koa-virtual-2df93240b5/0/cache/@newrelic-koa-npm-6.1.2-df0f7c71b5-e269d37b13.zip/node_modules/@newrelic/koa/",\
"packageDependencies": [\
@@ -1826,54 +1768,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"newrelic"\
],\
"linkType": "HARD"\
}],\
["virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:5.0.0", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-koa-virtual-2873d18af2/0/cache/@newrelic-koa-npm-5.0.0-c9c6a0e1dc-e98d921b96.zip/node_modules/@newrelic/koa/",\
"packageDependencies": [\
["@newrelic/koa", "virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:5.0.0"],\
["@types/newrelic", null],\
["methods", "npm:1.1.2"],\
["newrelic", "npm:7.5.2"]\
],\
"packagePeers": [\
"@types/newrelic",\
"newrelic"\
],\
"linkType": "HARD"\
}]\
]],\
["@newrelic/native-metrics", [\
["npm:6.0.2", {\
"packageLocation": "./.yarn/unplugged/@newrelic-native-metrics-npm-6.0.2-805c5534f5/node_modules/@newrelic/native-metrics/",\
"packageDependencies": [\
["@newrelic/native-metrics", "npm:6.0.2"],\
["nan", "npm:2.16.0"],\
["node-gyp", "npm:9.0.0"],\
["semver", "npm:5.7.1"]\
],\
"linkType": "HARD"\
}],\
["npm:7.0.2", {\
"packageLocation": "./.yarn/unplugged/@newrelic-native-metrics-npm-7.0.2-b4dcec08eb/node_modules/@newrelic/native-metrics/",\
"packageDependencies": [\
["@newrelic/native-metrics", "npm:7.0.2"],\
["nan", "npm:2.16.0"],\
["node-gyp", "npm:9.0.0"],\
["semver", "npm:5.7.1"]\
],\
"linkType": "HARD"\
}],\
["npm:7.1.2", {\
"packageLocation": "./.yarn/unplugged/@newrelic-native-metrics-npm-7.1.2-0e5392c2f6/node_modules/@newrelic/native-metrics/",\
"packageDependencies": [\
["@newrelic/native-metrics", "npm:7.1.2"],\
["https-proxy-agent", "npm:5.0.1"],\
["nan", "npm:2.16.0"],\
["node-gyp", "npm:9.0.0"],\
["semver", "npm:5.7.1"]\
],\
"linkType": "HARD"\
}],\
["npm:8.0.0", {\
"packageLocation": "./.yarn/unplugged/@newrelic-native-metrics-npm-8.0.0-c254393d6e/node_modules/@newrelic/native-metrics/",\
"packageDependencies": [\
@@ -1887,13 +1784,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["@newrelic/superagent", [\
["npm:4.0.0", {\
"packageLocation": "./.yarn/cache/@newrelic-superagent-npm-4.0.0-6cc7e8ec57-5fb257ac05.zip/node_modules/@newrelic/superagent/",\
"packageDependencies": [\
["@newrelic/superagent", "npm:4.0.0"]\
],\
"linkType": "SOFT"\
}],\
["npm:5.1.1", {\
"packageLocation": "./.yarn/cache/@newrelic-superagent-npm-5.1.1-0d3c1fccf8-b43f7b9bb6.zip/node_modules/@newrelic/superagent/",\
"packageDependencies": [\
@@ -1901,19 +1791,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
],\
"linkType": "SOFT"\
}],\
["virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:5.1.1", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-superagent-virtual-82e2d8818c/0/cache/@newrelic-superagent-npm-5.1.1-0d3c1fccf8-b43f7b9bb6.zip/node_modules/@newrelic/superagent/",\
"packageDependencies": [\
["@newrelic/superagent", "virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:5.1.1"],\
["@types/newrelic", null],\
["newrelic", "npm:8.6.0"]\
],\
"packagePeers": [\
"@types/newrelic",\
"newrelic"\
],\
"linkType": "HARD"\
}],\
["virtual:b659d4d19ce37732618223b586685dc7b27d11c52dca80d8411fdda38a4e6a7967776a5d7bdcce0be779cd6a41e2d84f8bbd3d3b5c06ce5ae40ad814517dfcfb#npm:5.1.1", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-superagent-virtual-d7de4099d8/0/cache/@newrelic-superagent-npm-5.1.1-0d3c1fccf8-b43f7b9bb6.zip/node_modules/@newrelic/superagent/",\
"packageDependencies": [\
@@ -1926,20 +1803,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"newrelic"\
],\
"linkType": "HARD"\
}],\
["virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:4.0.0", {\
"packageLocation": "./.yarn/__virtual__/@newrelic-superagent-virtual-05297db2ec/0/cache/@newrelic-superagent-npm-4.0.0-6cc7e8ec57-5fb257ac05.zip/node_modules/@newrelic/superagent/",\
"packageDependencies": [\
["@newrelic/superagent", "virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:4.0.0"],\
["@types/newrelic", null],\
["methods", "npm:1.1.2"],\
["newrelic", "npm:7.5.2"]\
],\
"packagePeers": [\
"@types/newrelic",\
"newrelic"\
],\
"linkType": "HARD"\
}]\
]],\
["@newrelic/winston-enricher", [\
@@ -1956,7 +1819,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@newrelic/winston-enricher", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:2.1.2"],\
["@types/newrelic", "npm:7.0.3"],\
["@types/winston", null],\
["newrelic", "npm:8.6.0"],\
["newrelic", "npm:8.14.1"],\
["winston", "npm:3.3.3"]\
],\
"packagePeers": [\
@@ -2445,52 +2308,39 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["@sentry/core", [\
["npm:6.19.7", {\
"packageLocation": "./.yarn/cache/@sentry-core-npm-6.19.7-4cbb62d040-d212e8ef07.zip/node_modules/@sentry/core/",\
["npm:7.3.0", {\
"packageLocation": "./.yarn/cache/@sentry-core-npm-7.3.0-8e7d2a21e6-1768568404.zip/node_modules/@sentry/core/",\
"packageDependencies": [\
["@sentry/core", "npm:6.19.7"],\
["@sentry/hub", "npm:6.19.7"],\
["@sentry/minimal", "npm:6.19.7"],\
["@sentry/types", "npm:6.19.7"],\
["@sentry/utils", "npm:6.19.7"],\
["@sentry/core", "npm:7.3.0"],\
["@sentry/hub", "npm:7.3.0"],\
["@sentry/types", "npm:7.3.0"],\
["@sentry/utils", "npm:7.3.0"],\
["tslib", "npm:1.14.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@sentry/hub", [\
["npm:6.19.7", {\
"packageLocation": "./.yarn/cache/@sentry-hub-npm-6.19.7-6469362c23-10bb1c5cba.zip/node_modules/@sentry/hub/",\
["npm:7.3.0", {\
"packageLocation": "./.yarn/cache/@sentry-hub-npm-7.3.0-b5d4219eb3-a052a7c940.zip/node_modules/@sentry/hub/",\
"packageDependencies": [\
["@sentry/hub", "npm:6.19.7"],\
["@sentry/types", "npm:6.19.7"],\
["@sentry/utils", "npm:6.19.7"],\
["tslib", "npm:1.14.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@sentry/minimal", [\
["npm:6.19.7", {\
"packageLocation": "./.yarn/cache/@sentry-minimal-npm-6.19.7-7527a9814c-9153ac426e.zip/node_modules/@sentry/minimal/",\
"packageDependencies": [\
["@sentry/minimal", "npm:6.19.7"],\
["@sentry/hub", "npm:6.19.7"],\
["@sentry/types", "npm:6.19.7"],\
["@sentry/hub", "npm:7.3.0"],\
["@sentry/types", "npm:7.3.0"],\
["@sentry/utils", "npm:7.3.0"],\
["tslib", "npm:1.14.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@sentry/node", [\
["npm:6.19.7", {\
"packageLocation": "./.yarn/cache/@sentry-node-npm-6.19.7-edcd5da482-2293b0d1d1.zip/node_modules/@sentry/node/",\
["npm:7.3.0", {\
"packageLocation": "./.yarn/cache/@sentry-node-npm-7.3.0-ae73eb5bb5-a92c2d2d1b.zip/node_modules/@sentry/node/",\
"packageDependencies": [\
["@sentry/node", "npm:6.19.7"],\
["@sentry/core", "npm:6.19.7"],\
["@sentry/hub", "npm:6.19.7"],\
["@sentry/types", "npm:6.19.7"],\
["@sentry/utils", "npm:6.19.7"],\
["@sentry/node", "npm:7.3.0"],\
["@sentry/core", "npm:7.3.0"],\
["@sentry/hub", "npm:7.3.0"],\
["@sentry/types", "npm:7.3.0"],\
["@sentry/utils", "npm:7.3.0"],\
["cookie", "npm:0.4.2"],\
["https-proxy-agent", "npm:5.0.1"],\
["lru_map", "npm:0.3.3"],\
@@ -2500,20 +2350,20 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["@sentry/types", [\
["npm:6.19.7", {\
"packageLocation": "./.yarn/cache/@sentry-types-npm-6.19.7-f75535a9f4-f46ef74a33.zip/node_modules/@sentry/types/",\
["npm:7.3.0", {\
"packageLocation": "./.yarn/cache/@sentry-types-npm-7.3.0-4a455bc29c-3ddbc3c7eb.zip/node_modules/@sentry/types/",\
"packageDependencies": [\
["@sentry/types", "npm:6.19.7"]\
["@sentry/types", "npm:7.3.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["@sentry/utils", [\
["npm:6.19.7", {\
"packageLocation": "./.yarn/cache/@sentry-utils-npm-6.19.7-d61c6c8632-a000223b9c.zip/node_modules/@sentry/utils/",\
["npm:7.3.0", {\
"packageLocation": "./.yarn/cache/@sentry-utils-npm-7.3.0-a4b6fc94f0-2696b1bfad.zip/node_modules/@sentry/utils/",\
"packageDependencies": [\
["@sentry/utils", "npm:6.19.7"],\
["@sentry/types", "npm:6.19.7"],\
["@sentry/utils", "npm:7.3.0"],\
["@sentry/types", "npm:7.3.0"],\
["tslib", "npm:1.14.1"]\
],\
"linkType": "HARD"\
@@ -2595,9 +2445,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"packageLocation": "./packages/api-gateway/",\
"packageDependencies": [\
["@standardnotes/api-gateway", "workspace:packages/api-gateway"],\
["@newrelic/native-metrics", "npm:7.0.2"],\
["@newrelic/winston-enricher", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:2.1.2"],\
["@sentry/node", "npm:6.19.7"],\
["@sentry/node", "npm:7.3.0"],\
["@standardnotes/analytics", "npm:1.6.0"],\
["@standardnotes/auth", "npm:3.19.2"],\
["@standardnotes/domain-events", "npm:2.29.0"],\
@@ -2624,8 +2473,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["ioredis", "npm:5.0.6"],\
["jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.1.1"],\
["jsonwebtoken", "npm:8.5.1"],\
["newrelic", "npm:8.6.0"],\
["newrelic", "npm:8.14.1"],\
["nodemon", "npm:2.0.16"],\
["npm-check-updates", "npm:14.1.1"],\
["prettyjson", "npm:1.2.1"],\
["reflect-metadata", "npm:0.1.13"],\
["ts-jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.0.5"],\
@@ -2652,6 +2502,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["jsonwebtoken", "npm:8.5.1"]\
],\
"linkType": "HARD"\
}],\
["npm:3.19.4", {\
"packageLocation": "./.yarn/cache/@standardnotes-auth-npm-3.19.4-29b35c1352-84ac9e669e.zip/node_modules/@standardnotes/auth/",\
"packageDependencies": [\
["@standardnotes/auth", "npm:3.19.4"],\
["@standardnotes/common", "npm:1.23.1"],\
["jsonwebtoken", "npm:8.5.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@standardnotes/auth-server", [\
@@ -2659,19 +2518,18 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"packageLocation": "./packages/auth/",\
"packageDependencies": [\
["@standardnotes/auth-server", "workspace:packages/auth"],\
["@newrelic/native-metrics", "npm:7.0.2"],\
["@newrelic/winston-enricher", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:2.1.2"],\
["@sentry/node", "npm:6.19.7"],\
["@sentry/node", "npm:7.3.0"],\
["@standardnotes/analytics", "npm:1.6.0"],\
["@standardnotes/api", "npm:1.1.13"],\
["@standardnotes/auth", "npm:3.19.3"],\
["@standardnotes/common", "npm:1.23.0"],\
["@standardnotes/domain-events", "npm:2.32.2"],\
["@standardnotes/common", "npm:1.23.1"],\
["@standardnotes/domain-events", "npm:2.32.4"],\
["@standardnotes/domain-events-infra", "npm:1.5.2"],\
["@standardnotes/features", "npm:1.45.5"],\
["@standardnotes/responses", "npm:1.6.36"],\
["@standardnotes/scheduler", "npm:1.1.1"],\
["@standardnotes/settings", "npm:1.14.3"],\
["@standardnotes/settings", "npm:1.15.0"],\
["@standardnotes/sncrypto-common", "npm:1.9.0"],\
["@standardnotes/sncrypto-node", "npm:1.8.3"],\
["@standardnotes/time", "npm:1.7.0"],\
@@ -2701,8 +2559,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["ioredis", "npm:5.0.6"],\
["jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.1.1"],\
["mysql2", "npm:2.3.3"],\
["newrelic", "npm:8.6.0"],\
["newrelic", "npm:8.14.1"],\
["nodemon", "npm:2.0.16"],\
["npm-check-updates", "npm:14.1.1"],\
["otplib", "npm:12.0.1"],\
["prettyjson", "npm:1.2.1"],\
["reflect-metadata", "npm:0.1.13"],\
@@ -2722,6 +2581,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@standardnotes/common", "npm:1.23.0"]\
],\
"linkType": "HARD"\
}],\
["npm:1.23.1", {\
"packageLocation": "./.yarn/cache/@standardnotes-common-npm-1.23.1-ed73dbb679-f498f4c469.zip/node_modules/@standardnotes/common/",\
"packageDependencies": [\
["@standardnotes/common", "npm:1.23.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@standardnotes/config", [\
@@ -2754,6 +2620,26 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@standardnotes/scheduler", "npm:1.1.1"]\
],\
"linkType": "HARD"\
}],\
["npm:2.32.3", {\
"packageLocation": "./.yarn/cache/@standardnotes-domain-events-npm-2.32.3-d2cd9a7c7f-ea6151d137.zip/node_modules/@standardnotes/domain-events/",\
"packageDependencies": [\
["@standardnotes/domain-events", "npm:2.32.3"],\
["@standardnotes/auth", "npm:3.19.3"],\
["@standardnotes/features", "npm:1.45.5"],\
["@standardnotes/scheduler", "npm:1.1.1"]\
],\
"linkType": "HARD"\
}],\
["npm:2.32.4", {\
"packageLocation": "./.yarn/cache/@standardnotes-domain-events-npm-2.32.4-0b0cc85196-9f8a1637aa.zip/node_modules/@standardnotes/domain-events/",\
"packageDependencies": [\
["@standardnotes/domain-events", "npm:2.32.4"],\
["@standardnotes/auth", "npm:3.19.4"],\
["@standardnotes/features", "npm:1.45.6"],\
["@standardnotes/scheduler", "npm:1.1.2"]\
],\
"linkType": "HARD"\
}]\
]],\
["@standardnotes/domain-events-infra", [\
@@ -2807,6 +2693,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@standardnotes/common", "npm:1.23.0"]\
],\
"linkType": "HARD"\
}],\
["npm:1.45.6", {\
"packageLocation": "./.yarn/cache/@standardnotes-features-npm-1.45.6-6f88b4fd2a-572780d6e2.zip/node_modules/@standardnotes/features/",\
"packageDependencies": [\
["@standardnotes/features", "npm:1.45.6"],\
["@standardnotes/auth", "npm:3.19.4"],\
["@standardnotes/common", "npm:1.23.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@standardnotes/files-server", [\
@@ -2814,8 +2709,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"packageLocation": "./packages/files/",\
"packageDependencies": [\
["@standardnotes/files-server", "workspace:packages/files"],\
["@newrelic/native-metrics", "npm:7.0.2"],\
["@sentry/node", "npm:6.19.7"],\
["@sentry/node", "npm:7.3.0"],\
["@standardnotes/auth", "npm:3.19.3"],\
["@standardnotes/common", "npm:1.23.0"],\
["@standardnotes/config", "npm:2.0.1"],\
@@ -2849,8 +2743,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["ioredis", "npm:5.0.6"],\
["jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.1.1"],\
["jsonwebtoken", "npm:8.5.1"],\
["newrelic", "npm:7.5.2"],\
["newrelic", "npm:8.14.1"],\
["nodemon", "npm:2.0.16"],\
["npm-check-updates", "npm:14.1.1"],\
["prettyjson", "npm:1.2.5"],\
["reflect-metadata", "npm:0.1.13"],\
["ts-jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.0.5"],\
@@ -2905,6 +2800,14 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@standardnotes/common", "npm:1.23.0"]\
],\
"linkType": "HARD"\
}],\
["npm:1.1.2", {\
"packageLocation": "./.yarn/cache/@standardnotes-scheduler-npm-1.1.2-78f89314fb-68642a0874.zip/node_modules/@standardnotes/scheduler/",\
"packageDependencies": [\
["@standardnotes/scheduler", "npm:1.1.2"],\
["@standardnotes/common", "npm:1.23.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["@standardnotes/scheduler-server", [\
@@ -2912,10 +2815,10 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"packageLocation": "./packages/scheduler/",\
"packageDependencies": [\
["@standardnotes/scheduler-server", "workspace:packages/scheduler"],\
["@newrelic/native-metrics", "npm:7.0.2"],\
["@newrelic/winston-enricher", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:2.1.2"],\
["@sentry/node", "npm:7.3.0"],\
["@standardnotes/common", "npm:1.23.0"],\
["@standardnotes/domain-events", "npm:2.32.2"],\
["@standardnotes/domain-events", "npm:2.32.3"],\
["@standardnotes/domain-events-infra", "npm:1.5.2"],\
["@standardnotes/scheduler", "npm:1.1.1"],\
["@standardnotes/time", "npm:1.7.0"],\
@@ -2932,7 +2835,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["ioredis", "npm:5.0.6"],\
["jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.1.1"],\
["mysql2", "npm:2.3.3"],\
["newrelic", "npm:8.6.0"],\
["newrelic", "npm:8.14.1"],\
["npm-check-updates", "npm:14.1.1"],\
["reflect-metadata", "npm:0.1.13"],\
["ts-jest", "virtual:16bfd8597041deb71e4581ea0755edd4dcd1b09b8ab14bfbbf5e4d5ca6b5d47ed7fbe2a25cdf57fcbb8e092c30b6beb93d2e7533f9e31c5dc62f7f0e487d1e4b#npm:28.0.5"],\
["typeorm", "virtual:31b5a94a105c89c9294c3d524a7f8929fe63ee5a2efadf21951ca4c0cfd2ecf02e8f4ef5a066bbda091f1e3a56e57c6749069a080618c96b22e51131a330fc4a#npm:0.3.6"],\
@@ -2951,11 +2855,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@lerna-lite/cli", "npm:1.5.1"],\
["@lerna-lite/list", "npm:1.5.1"],\
["@lerna-lite/run", "npm:1.5.1"],\
["@sentry/node", "npm:7.3.0"],\
["@types/jest", "npm:28.1.3"],\
["@types/newrelic", "npm:7.0.3"],\
["@types/node", "npm:18.0.0"],\
["@typescript-eslint/parser", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:5.29.0"],\
["eslint", "npm:8.18.0"],\
["eslint-config-prettier", "virtual:8859b278716fedf3e7458b5628625f7e35678c418626878559a0b816445001b7e24c55546f4677ba4c20b521aa0cf52cc33ac07deff171e383ada6eeab69933f#npm:8.5.0"],\
["ini", "npm:3.0.0"],\
["newrelic", "npm:8.14.1"],\
["npm-check-updates", "npm:14.1.1"],\
["prettier", "npm:2.7.1"],\
["ts-node", "virtual:9e9d2b94dac68914cfc6173c41e92914f6d1fe30b9ab6e163c2043744960a73d771c78f37827a8773b7adeb75f4b67f907cd8c18197a7807ce979a4aea3b2602#npm:10.8.1"],\
["typescript", "patch:typescript@npm%3A4.7.4#~builtin<compat/typescript>::version=4.7.4&hash=7ad353"]\
@@ -2984,6 +2893,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["@standardnotes/settings", "npm:1.14.3"]\
],\
"linkType": "HARD"\
}],\
["npm:1.15.0", {\
"packageLocation": "./.yarn/cache/@standardnotes-settings-npm-1.15.0-bfec86ee49-4397d453a1.zip/node_modules/@standardnotes/settings/",\
"packageDependencies": [\
["@standardnotes/settings", "npm:1.15.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["@standardnotes/sncrypto-common", [\
@@ -3010,9 +2926,8 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"packageLocation": "./packages/syncing-server/",\
"packageDependencies": [\
["@standardnotes/syncing-server", "workspace:packages/syncing-server"],\
["@newrelic/native-metrics", "npm:7.0.2"],\
["@newrelic/winston-enricher", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:2.1.2"],\
["@sentry/node", "npm:6.19.7"],\
["@sentry/node", "npm:7.3.0"],\
["@standardnotes/analytics", "npm:1.6.0"],\
["@standardnotes/auth", "npm:3.19.3"],\
["@standardnotes/common", "npm:1.23.0"],\
@@ -3048,8 +2963,9 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.1.1"],\
["jsonwebtoken", "npm:8.5.1"],\
["mysql2", "npm:2.3.3"],\
["newrelic", "npm:8.6.0"],\
["newrelic", "npm:8.14.1"],\
["nodemon", "npm:2.0.7"],\
["npm-check-updates", "npm:14.1.1"],\
["prettyjson", "npm:1.2.1"],\
["reflect-metadata", "npm:0.1.13"],\
["ts-jest", "virtual:04783e12400851b8a3d76e71495851cc94959db6e62f04cb0a31190080629440b182d8c8eb4d7f2b04e281912f2783a5fd4d2c3c6ab68d38b7097246c93f4c19#npm:28.0.5"],\
@@ -4100,13 +4016,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["agent-base", [\
["npm:5.1.1", {\
"packageLocation": "./.yarn/cache/agent-base-npm-5.1.1-d451a4ad62-61ae789f30.zip/node_modules/agent-base/",\
"packageDependencies": [\
["agent-base", "npm:5.1.1"]\
],\
"linkType": "HARD"\
}],\
["npm:6.0.2", {\
"packageLocation": "./.yarn/cache/agent-base-npm-6.0.2-428f325a93-f52b6872cc.zip/node_modules/agent-base/",\
"packageDependencies": [\
@@ -5053,6 +4962,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["cint", [\
["npm:8.2.1", {\
"packageLocation": "./.yarn/cache/cint-npm-8.2.1-958b3dddeb-5f32feed16.zip/node_modules/cint/",\
"packageDependencies": [\
["cint", "npm:8.2.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["cjs-module-lexer", [\
["npm:1.2.2", {\
"packageLocation": "./.yarn/cache/cjs-module-lexer-npm-1.2.2-473ce063ea-977f3f042b.zip/node_modules/cjs-module-lexer/",\
@@ -5114,6 +5032,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["cli-table", [\
["npm:0.3.11", {\
"packageLocation": "./.yarn/cache/cli-table-npm-0.3.11-f912789cff-59fb61f992.zip/node_modules/cli-table/",\
"packageDependencies": [\
["cli-table", "npm:0.3.11"],\
["colors", "npm:1.0.3"]\
],\
"linkType": "HARD"\
}]\
]],\
["cli-width", [\
["npm:3.0.0", {\
"packageLocation": "./.yarn/cache/cli-width-npm-3.0.0-387b3f68f9-4c94af3769.zip/node_modules/cli-width/",\
@@ -5259,6 +5187,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["colors", [\
["npm:1.0.3", {\
"packageLocation": "./.yarn/cache/colors-npm-1.0.3-6c5d583ab3-234e8d3ab7.zip/node_modules/colors/",\
"packageDependencies": [\
["colors", "npm:1.0.3"]\
],\
"linkType": "HARD"\
}],\
["npm:1.4.0", {\
"packageLocation": "./.yarn/cache/colors-npm-1.4.0-7e2cf12234-98aa2c2418.zip/node_modules/colors/",\
"packageDependencies": [\
@@ -5289,6 +5224,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["commander", [\
["npm:9.3.0", {\
"packageLocation": "./.yarn/cache/commander-npm-9.3.0-1393a6e1f6-d421ce66fe.zip/node_modules/commander/",\
"packageDependencies": [\
["commander", "npm:9.3.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["compare-func", [\
["npm:2.0.0", {\
"packageLocation": "./.yarn/cache/compare-func-npm-2.0.0-9cd7852f23-fb71d70632.zip/node_modules/compare-func/",\
@@ -6697,6 +6641,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["fast-memoize", [\
["npm:2.5.2", {\
"packageLocation": "./.yarn/cache/fast-memoize-npm-2.5.2-f42a7c6940-79fa759719.zip/node_modules/fast-memoize/",\
"packageDependencies": [\
["fast-memoize", "npm:2.5.2"]\
],\
"linkType": "HARD"\
}]\
]],\
["fastq", [\
["npm:1.13.0", {\
"packageLocation": "./.yarn/cache/fastq-npm-1.13.0-a45963881c-32cf15c29a.zip/node_modules/fastq/",\
@@ -6883,6 +6836,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["fp-and-or", [\
["npm:0.1.3", {\
"packageLocation": "./.yarn/cache/fp-and-or-npm-0.1.3-033d5c60bb-d556ad1fb0.zip/node_modules/fp-and-or/",\
"packageDependencies": [\
["fp-and-or", "npm:0.1.3"]\
],\
"linkType": "HARD"\
}]\
]],\
["fresh", [\
["npm:0.5.2", {\
"packageLocation": "./.yarn/cache/fresh-npm-0.5.2-ad2bb4c0a2-13ea8b08f9.zip/node_modules/fresh/",\
@@ -7030,6 +6992,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["get-stdin", [\
["npm:8.0.0", {\
"packageLocation": "./.yarn/cache/get-stdin-npm-8.0.0-920f876bc2-40128b6cd2.zip/node_modules/get-stdin/",\
"packageDependencies": [\
["get-stdin", "npm:8.0.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["get-stream", [\
["npm:4.1.0", {\
"packageLocation": "./.yarn/cache/get-stream-npm-4.1.0-314d430a5d-443e191417.zip/node_modules/get-stream/",\
@@ -7477,15 +7448,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["https-proxy-agent", [\
["npm:4.0.0", {\
"packageLocation": "./.yarn/cache/https-proxy-agent-npm-4.0.0-9021ec873f-19471d5aae.zip/node_modules/https-proxy-agent/",\
"packageDependencies": [\
["https-proxy-agent", "npm:4.0.0"],\
["agent-base", "npm:5.1.1"],\
["debug", "virtual:b86a9fb34323a98c6519528ed55faa0d9b44ca8879307c0b29aa384bde47ff59a7d0c9051b31246f14521dfb71ba3c5d6d0b35c29fffc17bf875aa6ad977d9e8#npm:4.3.4"]\
],\
"linkType": "HARD"\
}],\
["npm:5.0.1", {\
"packageLocation": "./.yarn/cache/https-proxy-agent-npm-5.0.1-42d65f358e-571fccdf38.zip/node_modules/https-proxy-agent/",\
"packageDependencies": [\
@@ -7683,6 +7645,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["ini", "npm:2.0.0"]\
],\
"linkType": "HARD"\
}],\
["npm:3.0.0", {\
"packageLocation": "./.yarn/cache/ini-npm-3.0.0-c2af955701-e92b6b0835.zip/node_modules/ini/",\
"packageDependencies": [\
["ini", "npm:3.0.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["inquirer", [\
@@ -8675,6 +8644,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["jju", [\
["npm:1.4.0", {\
"packageLocation": "./.yarn/cache/jju-npm-1.4.0-670678eaa3-3790481bd2.zip/node_modules/jju/",\
"packageDependencies": [\
["jju", "npm:1.4.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["jmespath", [\
["npm:0.16.0", {\
"packageLocation": "./.yarn/cache/jmespath-npm-0.16.0-d47535c65a-2d602493a1.zip/node_modules/jmespath/",\
@@ -8748,6 +8726,16 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["json-parse-helpfulerror", [\
["npm:1.0.3", {\
"packageLocation": "./.yarn/cache/json-parse-helpfulerror-npm-1.0.3-003666633e-376d85c372.zip/node_modules/json-parse-helpfulerror/",\
"packageDependencies": [\
["json-parse-helpfulerror", "npm:1.0.3"],\
["jju", "npm:1.4.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["json-schema-traverse", [\
["npm:0.4.1", {\
"packageLocation": "./.yarn/cache/json-schema-traverse-npm-0.4.1-4759091693-7486074d3b.zip/node_modules/json-schema-traverse/",\
@@ -8795,6 +8783,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["jsonlines", [\
["npm:0.1.1", {\
"packageLocation": "./.yarn/cache/jsonlines-npm-0.1.1-0b9cdf648d-5408cbdbd3.zip/node_modules/jsonlines/",\
"packageDependencies": [\
["jsonlines", "npm:0.1.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["jsonparse", [\
["npm:1.3.1", {\
"packageLocation": "./.yarn/cache/jsonparse-npm-1.3.1-b6fde74828-6514a7be46.zip/node_modules/jsonparse/",\
@@ -8872,6 +8869,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["kleur", "npm:3.0.3"]\
],\
"linkType": "HARD"\
}],\
["npm:4.1.5", {\
"packageLocation": "./.yarn/cache/kleur-npm-4.1.5-46b6135f41-1dc476e327.zip/node_modules/kleur/",\
"packageDependencies": [\
["kleur", "npm:4.1.5"]\
],\
"linkType": "HARD"\
}]\
]],\
["kuler", [\
@@ -9748,26 +9752,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
}]\
]],\
["newrelic", [\
["npm:7.5.2", {\
"packageLocation": "./.yarn/cache/newrelic-npm-7.5.2-b949bcba7c-f6c67dbb7d.zip/node_modules/newrelic/",\
"packageDependencies": [\
["newrelic", "npm:7.5.2"],\
["@grpc/grpc-js", "npm:1.6.7"],\
["@grpc/proto-loader", "npm:0.5.6"],\
["@newrelic/aws-sdk", "virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:3.1.0"],\
["@newrelic/koa", "virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:5.0.0"],\
["@newrelic/native-metrics", "npm:6.0.2"],\
["@newrelic/superagent", "virtual:b949bcba7c7d71e38bb586c0239fa765beb131ea5f64fec66d133f6e38e6e87926b1ba9f91c8df6bcbc8243f33e33f909381ca14cfb301b09e6526205ac71883#npm:4.0.0"],\
["@tyriar/fibonacci-heap", "npm:2.0.9"],\
["async", "npm:3.2.4"],\
["concat-stream", "npm:2.0.0"],\
["https-proxy-agent", "npm:4.0.0"],\
["json-stringify-safe", "npm:5.0.1"],\
["readable-stream", "npm:3.6.0"],\
["semver", "npm:5.7.1"]\
],\
"linkType": "HARD"\
}],\
["npm:8.14.1", {\
"packageLocation": "./.yarn/cache/newrelic-npm-8.14.1-b659d4d19c-cd12bb2ac9.zip/node_modules/newrelic/",\
"packageDependencies": [\
@@ -9788,26 +9772,6 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["winston-transport", "npm:4.5.0"]\
],\
"linkType": "HARD"\
}],\
["npm:8.6.0", {\
"packageLocation": "./.yarn/cache/newrelic-npm-8.6.0-521e069407-083b65ce8b.zip/node_modules/newrelic/",\
"packageDependencies": [\
["newrelic", "npm:8.6.0"],\
["@grpc/grpc-js", "npm:1.6.7"],\
["@grpc/proto-loader", "npm:0.5.6"],\
["@newrelic/aws-sdk", "virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:4.1.2"],\
["@newrelic/koa", "virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:6.1.2"],\
["@newrelic/native-metrics", "npm:7.1.2"],\
["@newrelic/superagent", "virtual:521e0694077d46afa356663446ae27922a1476b4970c485c08b9223a4c4e82461e801eb01fbc080776dde404fd3a47fe4eac363a37bc89948edf65c92015e615#npm:5.1.1"],\
["@tyriar/fibonacci-heap", "npm:2.0.9"],\
["async", "npm:3.2.4"],\
["concat-stream", "npm:2.0.0"],\
["https-proxy-agent", "npm:5.0.1"],\
["json-stringify-safe", "npm:5.0.1"],\
["readable-stream", "npm:3.6.0"],\
["semver", "npm:5.7.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["node-addon-api", [\
@@ -10030,6 +9994,43 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["npm-check-updates", [\
["npm:14.1.1", {\
"packageLocation": "./.yarn/cache/npm-check-updates-npm-14.1.1-c02bfe3d02-a3ec52312c.zip/node_modules/npm-check-updates/",\
"packageDependencies": [\
["npm-check-updates", "npm:14.1.1"],\
["chalk", "npm:4.1.2"],\
["cint", "npm:8.2.1"],\
["cli-table", "npm:0.3.11"],\
["commander", "npm:9.3.0"],\
["fast-memoize", "npm:2.5.2"],\
["find-up", "npm:5.0.0"],\
["fp-and-or", "npm:0.1.3"],\
["get-stdin", "npm:8.0.0"],\
["globby", "npm:11.1.0"],\
["hosted-git-info", "npm:5.0.0"],\
["json-parse-helpfulerror", "npm:1.0.3"],\
["jsonlines", "npm:0.1.1"],\
["lodash", "npm:4.17.21"],\
["minimatch", "npm:5.1.0"],\
["p-map", "npm:4.0.0"],\
["pacote", "npm:13.6.0"],\
["parse-github-url", "npm:1.0.2"],\
["progress", "npm:2.0.3"],\
["prompts-ncu", "npm:2.5.0"],\
["rc-config-loader", "npm:4.1.0"],\
["remote-git-tags", "npm:3.0.0"],\
["rimraf", "npm:3.0.2"],\
["semver", "npm:7.3.7"],\
["semver-utils", "npm:1.1.4"],\
["source-map-support", "npm:0.5.21"],\
["spawn-please", "npm:1.0.0"],\
["update-notifier", "npm:5.1.0"],\
["yaml", "npm:2.1.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["npm-install-checks", [\
["npm:5.0.0", {\
"packageLocation": "./.yarn/cache/npm-install-checks-npm-5.0.0-ca22f8c8a0-0e7d1aae52.zip/node_modules/npm-install-checks/",\
@@ -10450,6 +10451,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["parse-github-url", [\
["npm:1.0.2", {\
"packageLocation": "./.yarn/cache/parse-github-url-npm-1.0.2-290c32ecbc-a19b8bc6f8.zip/node_modules/parse-github-url/",\
"packageDependencies": [\
["parse-github-url", "npm:1.0.2"]\
],\
"linkType": "HARD"\
}]\
]],\
["parse-json", [\
["npm:4.0.0", {\
"packageLocation": "./.yarn/cache/parse-json-npm-4.0.0-a6f7771010-0fe227d410.zip/node_modules/parse-json/",\
@@ -10777,6 +10787,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["progress", [\
["npm:2.0.3", {\
"packageLocation": "./.yarn/cache/progress-npm-2.0.3-d1f87e2ac6-f67403fe7b.zip/node_modules/progress/",\
"packageDependencies": [\
["progress", "npm:2.0.3"]\
],\
"linkType": "HARD"\
}]\
]],\
["promise-inflight", [\
["npm:1.0.1", {\
"packageLocation": "./.yarn/cache/promise-inflight-npm-1.0.1-5bb925afac-2274948309.zip/node_modules/promise-inflight/",\
@@ -10821,6 +10840,17 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["prompts-ncu", [\
["npm:2.5.0", {\
"packageLocation": "./.yarn/cache/prompts-ncu-npm-2.5.0-5d11c7d5b9-e050961c30.zip/node_modules/prompts-ncu/",\
"packageDependencies": [\
["prompts-ncu", "npm:2.5.0"],\
["kleur", "npm:4.1.5"],\
["sisteransi", "npm:1.0.5"]\
],\
"linkType": "HARD"\
}]\
]],\
["proto-list", [\
["npm:1.2.4", {\
"packageLocation": "./.yarn/cache/proto-list-npm-1.2.4-a96a43df28-4d4826e171.zip/node_modules/proto-list/",\
@@ -11047,6 +11077,19 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["rc-config-loader", [\
["npm:4.1.0", {\
"packageLocation": "./.yarn/cache/rc-config-loader-npm-4.1.0-207fabc6dd-1d07aaf611.zip/node_modules/rc-config-loader/",\
"packageDependencies": [\
["rc-config-loader", "npm:4.1.0"],\
["debug", "virtual:b86a9fb34323a98c6519528ed55faa0d9b44ca8879307c0b29aa384bde47ff59a7d0c9051b31246f14521dfb71ba3c5d6d0b35c29fffc17bf875aa6ad977d9e8#npm:4.3.4"],\
["js-yaml", "npm:4.1.0"],\
["json5", "npm:2.2.1"],\
["require-from-string", "npm:2.0.2"]\
],\
"linkType": "HARD"\
}]\
]],\
["react-is", [\
["npm:18.2.0", {\
"packageLocation": "./.yarn/cache/react-is-npm-18.2.0-0cc5edb910-e72d0ba81b.zip/node_modules/react-is/",\
@@ -11237,6 +11280,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["remote-git-tags", [\
["npm:3.0.0", {\
"packageLocation": "./.yarn/cache/remote-git-tags-npm-3.0.0-d27b051c92-04d87e4c98.zip/node_modules/remote-git-tags/",\
"packageDependencies": [\
["remote-git-tags", "npm:3.0.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["require-directory", [\
["npm:2.1.1", {\
"packageLocation": "./.yarn/cache/require-directory-npm-2.1.1-8608aee50b-fb47e70bf0.zip/node_modules/require-directory/",\
@@ -11246,6 +11298,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["require-from-string", [\
["npm:2.0.2", {\
"packageLocation": "./.yarn/cache/require-from-string-npm-2.0.2-8557e0db12-a03ef68954.zip/node_modules/require-from-string/",\
"packageDependencies": [\
["require-from-string", "npm:2.0.2"]\
],\
"linkType": "HARD"\
}]\
]],\
["resolve", [\
["patch:resolve@npm%3A1.22.1#~builtin<compat/resolve>::version=1.22.1&hash=07638b", {\
"packageLocation": "./.yarn/cache/resolve-patch-46f9469d0d-5656f4d0be.zip/node_modules/resolve/",\
@@ -11465,6 +11526,15 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
"linkType": "HARD"\
}]\
]],\
["semver-utils", [\
["npm:1.1.4", {\
"packageLocation": "./.yarn/cache/semver-utils-npm-1.1.4-61f884e528-93fd955a30.zip/node_modules/semver-utils/",\
"packageDependencies": [\
["semver-utils", "npm:1.1.4"]\
],\
"linkType": "HARD"\
}]\
]],\
["send", [\
["npm:0.17.1", {\
"packageLocation": "./.yarn/cache/send-npm-0.17.1-aad5512679-d214c2fa42.zip/node_modules/send/",\
@@ -11732,6 +11802,24 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["source-map", "npm:0.6.1"]\
],\
"linkType": "HARD"\
}],\
["npm:0.5.21", {\
"packageLocation": "./.yarn/cache/source-map-support-npm-0.5.21-09ca99e250-43e98d700d.zip/node_modules/source-map-support/",\
"packageDependencies": [\
["source-map-support", "npm:0.5.21"],\
["buffer-from", "npm:1.1.2"],\
["source-map", "npm:0.6.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["spawn-please", [\
["npm:1.0.0", {\
"packageLocation": "./.yarn/cache/spawn-please-npm-1.0.0-5731ea7630-b8e1e1dc14.zip/node_modules/spawn-please/",\
"packageDependencies": [\
["spawn-please", "npm:1.0.0"]\
],\
"linkType": "HARD"\
}]\
]],\
["spdx-correct", [\
@@ -13364,6 +13452,13 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
["yaml", "npm:1.10.2"]\
],\
"linkType": "HARD"\
}],\
["npm:2.1.1", {\
"packageLocation": "./.yarn/cache/yaml-npm-2.1.1-e717f9b915-f48bb20991.zip/node_modules/yaml/",\
"packageDependencies": [\
["yaml", "npm:2.1.1"]\
],\
"linkType": "HARD"\
}]\
]],\
["yargs", [\

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
data/.gitkeep Normal file
View File

24
docker-compose.yml Normal file
View File

@@ -0,0 +1,24 @@
version: '3.8'
services:
db:
image: mysql:5.6
environment:
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
expose:
- ${DB_PORT}:3306
restart: unless-stopped
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8 --collation-server=utf8_general_ci
volumes:
- ./data/mysql:/var/lib/mysql
- ./data/import:/docker-entrypoint-initdb.d
cache:
image: redis:6.0-alpine
volumes:
- ./data/redis/:/data
expose:
- ${REDIS_PORT}:6379
restart: unless-stopped

View File

@@ -23,7 +23,7 @@
"test:syncing-server": "yarn workspace @standardnotes/syncing-server test",
"test:files": "yarn workspace @standardnotes/files-server test",
"clean": "yarn workspaces foreach -p --verbose run clean",
"setup:env": "yarn workspaces foreach -p --verbose run setup:env",
"setup:env": "cp .env.sample .env && yarn workspaces foreach -p --verbose run setup:env",
"build": "yarn workspaces foreach -pt -j 10 --verbose run build",
"build:auth": "yarn workspace @standardnotes/auth-server build",
"build:scheduler": "yarn workspace @standardnotes/scheduler-server build",
@@ -39,7 +39,8 @@
"start:files-worker": "yarn workspace @standardnotes/files-server worker",
"start:api-gateway": "yarn workspace @standardnotes/api-gateway start",
"release:prod": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish new version\"",
"postversion": "./scripts/push-tags-one-by-one.sh"
"postversion": "./scripts/push-tags-one-by-one.sh",
"upgrade:snjs": "yarn workspaces foreach --verbose run upgrade:snjs"
},
"devDependencies": {
"@commitlint/cli": "^17.0.2",
@@ -48,13 +49,20 @@
"@lerna-lite/list": "^1.5.1",
"@lerna-lite/run": "^1.5.1",
"@types/jest": "^28.1.3",
"@types/newrelic": "^7.0.3",
"@types/node": "^18.0.0",
"@typescript-eslint/parser": "^5.29.0",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",
"ini": "^3.0.0",
"npm-check-updates": "^14.1.1",
"prettier": "^2.7.1",
"ts-node": "^10.8.1",
"typescript": "^4.7.4"
},
"packageManager": "yarn@3.2.1"
"packageManager": "yarn@3.2.1",
"dependencies": {
"@sentry/node": "^7.3.0",
"newrelic": "^8.14.1"
}
}

View File

@@ -3,6 +3,38 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.2.2](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.2.1...@standardnotes/api-gateway@1.2.2) (2022-06-27)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.2.1](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.2.0...@standardnotes/api-gateway@1.2.1) (2022-06-27)
### Bug Fixes
* issue with NaN error code responses ([2cb470b](https://github.com/standardnotes/api-gateway/commit/2cb470b99edc2fac8d5c38e4eb16201e55fe8753))
# [1.2.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.1.6...@standardnotes/api-gateway@1.2.0) (2022-06-27)
### Features
* add endpoint to mute marketing emails ([fa2a8da](https://github.com/standardnotes/api-gateway/commit/fa2a8da17bc6588021172adbbc4ecae5bd35f33a))
## [1.1.6](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.1.5...@standardnotes/api-gateway@1.1.6) (2022-06-27)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.1.5](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.1.4...@standardnotes/api-gateway@1.1.5) (2022-06-27)
### Bug Fixes
* upgrade sentry node sdk ([b6db194](https://github.com/standardnotes/api-gateway/commit/b6db194a22ff1d0afe96c291d545b408c0a5c373))
## [1.1.4](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.1.3...@standardnotes/api-gateway@1.1.4) (2022-06-24)
### Bug Fixes
* newrelic deps and setup db and cache for local development purposes ([ff09ae0](https://github.com/standardnotes/api-gateway/commit/ff09ae0a47747eaf7977ce5d3937ad385101eaeb))
## [1.1.3](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.1.2...@standardnotes/api-gateway@1.1.3) (2022-06-23)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api-gateway",
"version": "1.1.3",
"version": "1.2.2",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -15,13 +15,14 @@
"prebuild": "yarn clean",
"build": "tsc --rootDir ./",
"lint": "eslint . --ext .ts",
"setup:env": "cp .env.sample .env",
"start": "yarn node dist/bin/server.js",
"report": "yarn node dist/bin/report.js"
"report": "yarn node dist/bin/report.js",
"upgrade:snjs": "yarn ncu -u '@standardnotes/*'"
},
"dependencies": {
"@newrelic/native-metrics": "7.0.2",
"@newrelic/winston-enricher": "^2.1.0",
"@sentry/node": "^6.16.1",
"@sentry/node": "^7.3.0",
"@standardnotes/analytics": "^1.4.0",
"@standardnotes/auth": "3.19.2",
"@standardnotes/domain-events": "2.29.0",
@@ -37,7 +38,7 @@
"inversify-express-utils": "^6.4.3",
"ioredis": "^5.0.6",
"jsonwebtoken": "8.5.1",
"newrelic": "8.6.0",
"newrelic": "^8.14.1",
"prettyjson": "1.2.1",
"reflect-metadata": "0.1.13",
"winston": "3.3.3"
@@ -48,13 +49,14 @@
"@types/ioredis": "^4.28.10",
"@types/jest": "^28.1.3",
"@types/jsonwebtoken": "^8.5.0",
"@types/newrelic": "^7.0.1",
"@types/newrelic": "^7.0.3",
"@types/prettyjson": "^0.0.29",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"eslint": "^8.14.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.1",
"nodemon": "^2.0.16",
"npm-check-updates": "^14.1.1",
"ts-jest": "^28.0.1"
}
}

View File

@@ -99,7 +99,10 @@ export class AuthMiddleware extends BaseMiddleware {
response.setHeader('content-type', (error as AxiosError).response?.headers['content-type'] as string)
}
const errorCode = (error as AxiosError).isAxiosError ? +((error as AxiosError).code as string) : 500
const errorCode =
(error as AxiosError).isAxiosError && !isNaN(+((error as AxiosError).code as string))
? +((error as AxiosError).code as string)
: 500
response.status(errorCode).send(errorMessage)

View File

@@ -88,7 +88,10 @@ export class SubscriptionTokenAuthMiddleware extends BaseMiddleware {
response.setHeader('content-type', (error as AxiosError).response?.headers['content-type'] as string)
}
const errorCode = (error as AxiosError).isAxiosError ? +((error as AxiosError).code as string) : 500
const errorCode =
(error as AxiosError).isAxiosError && !isNaN(+((error as AxiosError).code as string))
? +((error as AxiosError).code as string)
: 500
response.status(errorCode).send(errorMessage)

View File

@@ -49,4 +49,14 @@ export class ActionsController extends BaseHttpController {
request.body,
)
}
@httpGet('/marketing-emails/mute/:settingUuid')
async muteMarketingEmails(request: Request, response: Response): Promise<void> {
await this.httpService.callAuthServer(
request,
response,
`internal/settings/marketing-emails/${request.params.settingUuid}/mute`,
request.body,
)
}
}

View File

@@ -133,7 +133,10 @@ export class HttpService implements HttpServiceInterface {
response.setHeader('content-type', (error as AxiosError).response?.headers['content-type'] as string)
}
const errorCode = (error as AxiosError).isAxiosError ? +((error as AxiosError).code as string) : 500
const errorCode =
(error as AxiosError).isAxiosError && !isNaN(+((error as AxiosError).code as string))
? +((error as AxiosError).code as string)
: 500
response.status(errorCode).send(errorMessage)
}

View File

@@ -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.3.1](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.3.0...@standardnotes/auth-server@1.3.1) (2022-06-27)
**Note:** Version bump only for package @standardnotes/auth-server
# [1.3.0](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.2.1...@standardnotes/auth-server@1.3.0) (2022-06-27)
### Features
* add endpoint for muting marketing emails ([6d7de4a](https://github.com/standardnotes/auth/commit/6d7de4a8daaf7569b8f2e031854e8baaff64a469))
## [1.2.1](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.2.0...@standardnotes/auth-server@1.2.1) (2022-06-27)
### Bug Fixes
* add setting uuid to email requests ([214684e](https://github.com/standardnotes/auth/commit/214684eae733675b7cefa522202e53d9556e5279))
# [1.2.0](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.1.7...@standardnotes/auth-server@1.2.0) (2022-06-27)
### Features
* add docker commands to start sending emails ([210a314](https://github.com/standardnotes/auth/commit/210a314c8199e47e5b6a113bd60401c16bb95291))
## [1.1.7](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.1.6...@standardnotes/auth-server@1.1.7) (2022-06-27)
### Bug Fixes
* add sending out email campaigns ([bf14ec0](https://github.com/standardnotes/auth/commit/bf14ec05f92d893e7c74a4f29ef7e426bee9d768))
## [1.1.6](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.1.5...@standardnotes/auth-server@1.1.6) (2022-06-27)
**Note:** Version bump only for package @standardnotes/auth-server
## [1.1.5](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.1.4...@standardnotes/auth-server@1.1.5) (2022-06-27)
### Bug Fixes
* upgrade sentry node sdk ([b6db194](https://github.com/standardnotes/auth/commit/b6db194a22ff1d0afe96c291d545b408c0a5c373))
## [1.1.4](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.1.3...@standardnotes/auth-server@1.1.4) (2022-06-24)
### Bug Fixes
* newrelic deps and setup db and cache for local development purposes ([ff09ae0](https://github.com/standardnotes/auth/commit/ff09ae0a47747eaf7977ce5d3937ad385101eaeb))
## [1.1.3](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.1.2...@standardnotes/auth-server@1.1.3) (2022-06-23)
### Bug Fixes

147
packages/auth/bin/email.ts Normal file
View File

@@ -0,0 +1,147 @@
import 'reflect-metadata'
import 'newrelic'
import { Stream } from 'stream'
import { Logger } from 'winston'
import * as dayjs from 'dayjs'
import * as utc from 'dayjs/plugin/utc'
import { UserRepositoryInterface } from '../src/Domain/User/UserRepositoryInterface'
import { ContainerConfigLoader } from '../src/Bootstrap/Container'
import TYPES from '../src/Bootstrap/Types'
import { Env } from '../src/Bootstrap/Env'
import { SettingServiceInterface } from '../src/Domain/Setting/SettingServiceInterface'
import { DomainEventFactoryInterface } from '../src/Domain/Event/DomainEventFactoryInterface'
import { UserSubscriptionRepositoryInterface } from '../src/Domain/Subscription/UserSubscriptionRepositoryInterface'
import { DomainEventPublisherInterface } from '@standardnotes/domain-events'
import { MuteMarketingEmailsOption, SettingName } from '@standardnotes/settings'
import { EmailMessageIdentifier } from '@standardnotes/common'
import { User } from '../src/Domain/User/User'
import { EncryptionVersion } from '../src/Domain/Encryption/EncryptionVersion'
import { TimerInterface } from '@standardnotes/time'
const inputArgs = process.argv.slice(2)
const emailMessageIdentifier = inputArgs[0]
const sendEmailCampaign = async (
userRepository: UserRepositoryInterface,
settingService: SettingServiceInterface,
userSubscriptionRepository: UserSubscriptionRepositoryInterface,
timer: TimerInterface,
domainEventFactory: DomainEventFactoryInterface,
domainEventPublisher: DomainEventPublisherInterface,
): Promise<void> => {
const stream = await userRepository.streamAll()
return new Promise((resolve, reject) => {
stream
.pipe(
new Stream.Transform({
objectMode: true,
transform: async (rawUserData, _encoding, callback) => {
let emailsMutedSetting = await settingService.findSettingWithDecryptedValue({
userUuid: rawUserData.user_uuid,
settingName: SettingName.MuteMarketingEmails,
})
if (emailsMutedSetting === null) {
const user = (await userRepository.findOneByUuid(rawUserData.user_uuid)) as User
const { setting } = await settingService.createOrReplace({
user,
props: {
name: SettingName.MuteMarketingEmails,
unencryptedValue: MuteMarketingEmailsOption.NotMuted,
serverEncryptionVersion: EncryptionVersion.Default,
sensitive: false,
},
})
emailsMutedSetting = setting
}
if (emailsMutedSetting.value === MuteMarketingEmailsOption.Muted) {
callback()
return
}
let activeSubscription = false
let subscriptionPlanName = null
const userSubscription = await userSubscriptionRepository.findOneByUserUuid(rawUserData.user_uuid)
if (userSubscription !== null) {
activeSubscription =
!userSubscription.cancelled && userSubscription.endsAt > timer.getTimestampInMicroseconds()
subscriptionPlanName = userSubscription.planName
}
await domainEventPublisher.publish(
domainEventFactory.createEmailMessageRequestedEvent({
userEmail: rawUserData.user_email,
messageIdentifier: emailMessageIdentifier as EmailMessageIdentifier,
context: {
activeSubscription,
subscriptionPlanName,
muteEmailsSettingUuid: emailsMutedSetting.uuid,
},
}),
)
callback()
},
}),
)
.on('finish', resolve)
.on('error', reject)
})
}
const container = new ContainerConfigLoader()
void container.load().then((container) => {
dayjs.extend(utc)
const env: Env = new Env()
env.load()
const logger: Logger = container.get(TYPES.Logger)
logger.info(`Starting email campaign for email ${emailMessageIdentifier} ...`)
if (!emailMessageIdentifier) {
logger.error('No email message identifier passed as argument. Skipped sending.')
process.exit(1)
}
const userRepository: UserRepositoryInterface = container.get(TYPES.UserRepository)
const settingService: SettingServiceInterface = container.get(TYPES.SettingService)
const userSubscriptionRepository: UserSubscriptionRepositoryInterface = container.get(
TYPES.UserSubscriptionRepository,
)
const timer: TimerInterface = container.get(TYPES.Timer)
const domainEventFactory: DomainEventFactoryInterface = container.get(TYPES.DomainEventFactory)
const domainEventPublisher: DomainEventPublisherInterface = container.get(TYPES.DomainEventPublisher)
Promise.resolve(
sendEmailCampaign(
userRepository,
settingService,
userSubscriptionRepository,
timer,
domainEventFactory,
domainEventPublisher,
),
)
.then(() => {
logger.info(`${emailMessageIdentifier} email campaign complete.`)
process.exit(0)
})
.catch((error) => {
logger.error(`Could not finish ${emailMessageIdentifier} email campaign: ${error.message}`)
process.exit(1)
})
})

View File

@@ -44,6 +44,12 @@ case "$COMMAND" in
yarn workspace @standardnotes/auth-server daily-backup:one_drive
;;
'email-campaign' )
echo "Starting Email Campaign Sending..."
MESSAGE_IDENTIFIER=$1 && shift 1
yarn workspace @standardnotes/auth-server email-campaign $MESSAGE_IDENTIFIER
;;
* )
echo "Unknown command"
;;

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.1.3",
"version": "1.3.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -12,6 +12,7 @@
"license": "AGPL-3.0-or-later",
"scripts": {
"clean": "rm -fr dist",
"setup:env": "cp .env.sample .env",
"prebuild": "yarn clean",
"build": "tsc --rootDir ./",
"lint": "eslint . --ext .ts",
@@ -24,22 +25,23 @@
"daily-backup:google_drive": "yarn node dist/bin/backup.js google_drive daily",
"daily-backup:one_drive": "yarn node dist/bin/backup.js one_drive daily",
"weekly-backup:email": "yarn node dist/bin/backup.js email weekly",
"typeorm": "typeorm-ts-node-commonjs"
"email-campaign": "yarn node dist/bin/email.js",
"typeorm": "typeorm-ts-node-commonjs",
"upgrade:snjs": "yarn ncu -u '@standardnotes/*'"
},
"dependencies": {
"@newrelic/native-metrics": "7.0.2",
"@newrelic/winston-enricher": "^2.1.0",
"@sentry/node": "^6.16.1",
"@sentry/node": "^7.3.0",
"@standardnotes/analytics": "^1.6.0",
"@standardnotes/api": "^1.1.13",
"@standardnotes/auth": "^3.19.2",
"@standardnotes/common": "^1.23.0",
"@standardnotes/domain-events": "^2.31.1",
"@standardnotes/common": "^1.23.1",
"@standardnotes/domain-events": "^2.32.4",
"@standardnotes/domain-events-infra": "^1.4.135",
"@standardnotes/features": "^1.45.2",
"@standardnotes/responses": "^1.6.15",
"@standardnotes/scheduler": "^1.1.1",
"@standardnotes/settings": "^1.14.2",
"@standardnotes/settings": "^1.15.0",
"@standardnotes/sncrypto-common": "^1.8.1",
"@standardnotes/sncrypto-node": "^1.8.1",
"@standardnotes/time": "^1.6.8",
@@ -55,7 +57,7 @@
"inversify-express-utils": "^6.4.3",
"ioredis": "^5.0.6",
"mysql2": "^2.3.3",
"newrelic": "8.6.0",
"newrelic": "^8.14.1",
"otplib": "12.0.1",
"prettyjson": "1.2.1",
"reflect-metadata": "0.1.13",
@@ -70,7 +72,7 @@
"@types/express": "^4.17.11",
"@types/ioredis": "^4.28.10",
"@types/jest": "^28.1.3",
"@types/newrelic": "^7.0.2",
"@types/newrelic": "^7.0.3",
"@types/otplib": "^10.0.0",
"@types/prettyjson": "^0.0.29",
"@types/ua-parser-js": "^0.7.36",
@@ -80,6 +82,7 @@
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.1",
"nodemon": "^2.0.16",
"npm-check-updates": "^14.1.1",
"ts-jest": "^28.0.1"
}
}

View File

@@ -190,6 +190,7 @@ import { GetUserAnalyticsId } from '../Domain/UseCase/GetUserAnalyticsId/GetUser
import { AuthController } from '../Controller/AuthController'
import { VerifyPredicate } from '../Domain/UseCase/VerifyPredicate/VerifyPredicate'
import { PredicateVerificationRequestedEventHandler } from '../Domain/Handler/PredicateVerificationRequestedEventHandler'
import { MuteMarketingEmails } from '../Domain/UseCase/MuteMarketingEmails/MuteMarketingEmails'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const newrelicWinstonEnricher = require('@newrelic/winston-enricher')
@@ -409,6 +410,7 @@ export class ContainerConfigLoader {
.to(CreateOfflineSubscriptionToken)
container.bind<MuteFailedBackupsEmails>(TYPES.MuteFailedBackupsEmails).to(MuteFailedBackupsEmails)
container.bind<MuteSignInEmails>(TYPES.MuteSignInEmails).to(MuteSignInEmails)
container.bind<MuteMarketingEmails>(TYPES.MuteMarketingEmails).to(MuteMarketingEmails)
container.bind<CreateValetToken>(TYPES.CreateValetToken).to(CreateValetToken)
container.bind<CreateListedAccount>(TYPES.CreateListedAccount).to(CreateListedAccount)
container.bind<InviteToSharedSubscription>(TYPES.InviteToSharedSubscription).to(InviteToSharedSubscription)

View File

@@ -113,6 +113,7 @@ const TYPES = {
AuthenticateOfflineSubscriptionToken: Symbol.for('AuthenticateOfflineSubscriptionToken'),
MuteFailedBackupsEmails: Symbol.for('MuteFailedBackupsEmails'),
MuteSignInEmails: Symbol.for('MuteSignInEmails'),
MuteMarketingEmails: Symbol.for('MuteMarketingEmails'),
CreateValetToken: Symbol.for('CreateValetToken'),
CreateListedAccount: Symbol.for('CreateListedAccount'),
InviteToSharedSubscription: Symbol.for('InviteToSharedSubscription'),

View File

@@ -9,18 +9,20 @@ import { GetUserFeatures } from '../Domain/UseCase/GetUserFeatures/GetUserFeatur
import { GetSetting } from '../Domain/UseCase/GetSetting/GetSetting'
import { MuteFailedBackupsEmails } from '../Domain/UseCase/MuteFailedBackupsEmails/MuteFailedBackupsEmails'
import { MuteSignInEmails } from '../Domain/UseCase/MuteSignInEmails/MuteSignInEmails'
import { MuteMarketingEmails } from '../Domain/UseCase/MuteMarketingEmails/MuteMarketingEmails'
describe('InternalController', () => {
let getUserFeatures: GetUserFeatures
let getSetting: GetSetting
let muteFailedBackupsEmails: MuteFailedBackupsEmails
let muteSignInEmails: MuteSignInEmails
let muteMarketingEmails: MuteMarketingEmails
let request: express.Request
let user: User
const createController = () =>
new InternalController(getUserFeatures, getSetting, muteFailedBackupsEmails, muteSignInEmails)
new InternalController(getUserFeatures, getSetting, muteFailedBackupsEmails, muteSignInEmails, muteMarketingEmails)
beforeEach(() => {
user = {} as jest.Mocked<User>
@@ -38,6 +40,9 @@ describe('InternalController', () => {
muteSignInEmails = {} as jest.Mocked<MuteSignInEmails>
muteSignInEmails.execute = jest.fn()
muteMarketingEmails = {} as jest.Mocked<MuteMarketingEmails>
muteMarketingEmails.execute = jest.fn()
request = {
headers: {},
body: {},
@@ -161,4 +166,30 @@ describe('InternalController', () => {
expect(result.statusCode).toEqual(404)
})
it('should mute marketing emails user setting', async () => {
request.params.settingUuid = '1-2-3'
muteMarketingEmails.execute = jest.fn().mockReturnValue({ success: true })
const httpResponse = <results.JsonResult>await createController().muteMarketingEmails(request)
const result = await httpResponse.executeAsync()
expect(muteMarketingEmails.execute).toHaveBeenCalledWith({ settingUuid: '1-2-3' })
expect(result.statusCode).toEqual(200)
})
it('should not mute marketing emails user setting if it does not exist', async () => {
request.params.settingUuid = '1-2-3'
muteMarketingEmails.execute = jest.fn().mockReturnValue({ success: false })
const httpResponse = <results.JsonResult>await createController().muteMarketingEmails(request)
const result = await httpResponse.executeAsync()
expect(muteMarketingEmails.execute).toHaveBeenCalledWith({ settingUuid: '1-2-3' })
expect(result.statusCode).toEqual(404)
})
})

View File

@@ -11,6 +11,7 @@ import TYPES from '../Bootstrap/Types'
import { GetSetting } from '../Domain/UseCase/GetSetting/GetSetting'
import { GetUserFeatures } from '../Domain/UseCase/GetUserFeatures/GetUserFeatures'
import { MuteFailedBackupsEmails } from '../Domain/UseCase/MuteFailedBackupsEmails/MuteFailedBackupsEmails'
import { MuteMarketingEmails } from '../Domain/UseCase/MuteMarketingEmails/MuteMarketingEmails'
import { MuteSignInEmails } from '../Domain/UseCase/MuteSignInEmails/MuteSignInEmails'
@controller('/internal')
@@ -20,6 +21,7 @@ export class InternalController extends BaseHttpController {
@inject(TYPES.GetSetting) private doGetSetting: GetSetting,
@inject(TYPES.MuteFailedBackupsEmails) private doMuteFailedBackupsEmails: MuteFailedBackupsEmails,
@inject(TYPES.MuteSignInEmails) private doMuteSignInEmails: MuteSignInEmails,
@inject(TYPES.MuteMarketingEmails) private doMuteMarketingEmails: MuteMarketingEmails,
) {
super()
}
@@ -80,4 +82,18 @@ export class InternalController extends BaseHttpController {
return this.json({ message: result.message }, 404)
}
@httpGet('/settings/marketing-emails/:settingUuid/mute')
async muteMarketingEmails(request: Request): Promise<results.JsonResult> {
const { settingUuid } = request.params
const result = await this.doMuteMarketingEmails.execute({
settingUuid,
})
if (result.success) {
return this.json({ message: result.message })
}
return this.json({ message: result.message }, 404)
}
}

View File

@@ -1,6 +1,6 @@
import 'reflect-metadata'
import { RoleName } from '@standardnotes/common'
import { EmailMessageIdentifier, RoleName } from '@standardnotes/common'
import { PredicateName, PredicateAuthority, PredicateVerificationResult } from '@standardnotes/scheduler'
import { TimerInterface } from '@standardnotes/time'
@@ -18,6 +18,35 @@ describe('DomainEventFactory', () => {
timer.getUTCDate = jest.fn().mockReturnValue(new Date(1))
})
it('should create a EMAIL_MESSAGE_REQUESTED event', () => {
expect(
createFactory().createEmailMessageRequestedEvent({
userEmail: 'test@test.te',
messageIdentifier: EmailMessageIdentifier.ENCOURAGE_EMAIL_BACKUPS,
context: {
foo: 'bar',
},
}),
).toEqual({
createdAt: expect.any(Date),
meta: {
correlation: {
userIdentifier: 'test@test.te',
userIdentifierType: 'email',
},
origin: 'auth',
},
payload: {
messageIdentifier: 'ENCOURAGE_EMAIL_BACKUPS',
userEmail: 'test@test.te',
context: {
foo: 'bar',
},
},
type: 'EMAIL_MESSAGE_REQUESTED',
})
})
it('should create a PREDICATE_VERIFIED event', () => {
expect(
createFactory().createPredicateVerifiedEvent({

View File

@@ -1,4 +1,4 @@
import { RoleName, Uuid } from '@standardnotes/common'
import { EmailMessageIdentifier, RoleName, Uuid } from '@standardnotes/common'
import {
AccountDeletionRequestedEvent,
UserEmailChangedEvent,
@@ -14,6 +14,7 @@ import {
SharedSubscriptionInvitationCanceledEvent,
PredicateVerifiedEvent,
DomainEventService,
EmailMessageRequestedEvent,
} from '@standardnotes/domain-events'
import { Predicate, PredicateVerificationResult } from '@standardnotes/scheduler'
import { TimerInterface } from '@standardnotes/time'
@@ -26,6 +27,25 @@ import { DomainEventFactoryInterface } from './DomainEventFactoryInterface'
export class DomainEventFactory implements DomainEventFactoryInterface {
constructor(@inject(TYPES.Timer) private timer: TimerInterface) {}
createEmailMessageRequestedEvent(dto: {
userEmail: string
messageIdentifier: EmailMessageIdentifier
context: Record<string, unknown>
}): EmailMessageRequestedEvent {
return {
type: 'EMAIL_MESSAGE_REQUESTED',
createdAt: this.timer.getUTCDate(),
meta: {
correlation: {
userIdentifier: dto.userEmail,
userIdentifierType: 'email',
},
origin: DomainEventService.Auth,
},
payload: dto,
}
}
createPredicateVerifiedEvent(dto: {
userUuid: Uuid
predicate: Predicate

View File

@@ -1,4 +1,4 @@
import { Uuid, RoleName } from '@standardnotes/common'
import { Uuid, RoleName, EmailMessageIdentifier } from '@standardnotes/common'
import { Predicate, PredicateVerificationResult } from '@standardnotes/scheduler'
import {
AccountDeletionRequestedEvent,
@@ -14,10 +14,16 @@ import {
SharedSubscriptionInvitationCreatedEvent,
SharedSubscriptionInvitationCanceledEvent,
PredicateVerifiedEvent,
EmailMessageRequestedEvent,
} from '@standardnotes/domain-events'
import { InviteeIdentifierType } from '../SharedSubscription/InviteeIdentifierType'
export interface DomainEventFactoryInterface {
createEmailMessageRequestedEvent(dto: {
userEmail: string
messageIdentifier: EmailMessageIdentifier
context: Record<string, unknown>
}): EmailMessageRequestedEvent
createUserSignedInEvent(dto: {
userUuid: string
userEmail: string

View File

@@ -39,13 +39,13 @@ describe('SettingsAssociationService', () => {
it('should return the default set of settings for a newly registered user', () => {
const settings = createService().getDefaultSettingsAndValuesForNewUser()
const flatSettings = [...(settings as Map<SettingName, SettingDescription>).keys()]
expect(flatSettings).toEqual(['MUTE_SIGN_IN_EMAILS', 'LOG_SESSION_USER_AGENT'])
expect(flatSettings).toEqual(['MUTE_SIGN_IN_EMAILS', 'MUTE_MARKETING_EMAILS', 'LOG_SESSION_USER_AGENT'])
})
it('should return the default set of settings for a newly registered vault account', () => {
const settings = createService().getDefaultSettingsAndValuesForNewVaultAccount()
const flatSettings = [...(settings as Map<SettingName, SettingDescription>).keys()]
expect(flatSettings).toEqual(['MUTE_SIGN_IN_EMAILS', 'LOG_SESSION_USER_AGENT'])
expect(flatSettings).toEqual(['MUTE_SIGN_IN_EMAILS', 'MUTE_MARKETING_EMAILS', 'LOG_SESSION_USER_AGENT'])
expect(settings.get(SettingName.LogSessionUserAgent)?.value).toEqual('disabled')
})

View File

@@ -1,5 +1,10 @@
import { PermissionName } from '@standardnotes/features'
import { LogSessionUserAgentOption, MuteSignInEmailsOption, SettingName } from '@standardnotes/settings'
import {
LogSessionUserAgentOption,
MuteMarketingEmailsOption,
MuteSignInEmailsOption,
SettingName,
} from '@standardnotes/settings'
import { injectable } from 'inversify'
import { EncryptionVersion } from '../Encryption/EncryptionVersion'
@@ -14,6 +19,7 @@ export class SettingsAssociationService implements SettingsAssociationServiceInt
SettingName.MuteFailedBackupsEmails,
SettingName.MuteFailedCloudBackupsEmails,
SettingName.MuteSignInEmails,
SettingName.MuteMarketingEmails,
SettingName.DropboxBackupFrequency,
SettingName.GoogleDriveBackupFrequency,
SettingName.OneDriveBackupFrequency,
@@ -28,6 +34,7 @@ export class SettingsAssociationService implements SettingsAssociationServiceInt
SettingName.MuteFailedBackupsEmails,
SettingName.MuteFailedCloudBackupsEmails,
SettingName.MuteSignInEmails,
SettingName.MuteMarketingEmails,
SettingName.ListedAuthorSecrets,
SettingName.LogSessionUserAgent,
]
@@ -47,6 +54,14 @@ export class SettingsAssociationService implements SettingsAssociationServiceInt
value: MuteSignInEmailsOption.NotMuted,
},
],
[
SettingName.MuteMarketingEmails,
{
sensitive: false,
serverEncryptionVersion: EncryptionVersion.Unencrypted,
value: MuteMarketingEmailsOption.NotMuted,
},
],
[
SettingName.LogSessionUserAgent,
{

View File

@@ -0,0 +1,39 @@
import 'reflect-metadata'
import { Setting } from '../../Setting/Setting'
import { SettingRepositoryInterface } from '../../Setting/SettingRepositoryInterface'
import { MuteMarketingEmails } from './MuteMarketingEmails'
describe('MuteMarketingEmails', () => {
let settingRepository: SettingRepositoryInterface
const createUseCase = () => new MuteMarketingEmails(settingRepository)
beforeEach(() => {
const setting = {} as jest.Mocked<Setting>
settingRepository = {} as jest.Mocked<SettingRepositoryInterface>
settingRepository.findOneByUuidAndNames = jest.fn().mockReturnValue(setting)
settingRepository.save = jest.fn()
})
it('should not succeed if extension setting is not found', async () => {
settingRepository.findOneByUuidAndNames = jest.fn().mockReturnValue(null)
expect(await createUseCase().execute({ settingUuid: '1-2-3' })).toEqual({
success: false,
message: 'Could not find setting setting.',
})
})
it('should update mute email setting on extension setting', async () => {
expect(await createUseCase().execute({ settingUuid: '1-2-3' })).toEqual({
success: true,
message: 'These emails have been muted.',
})
expect(settingRepository.save).toHaveBeenCalledWith({
value: 'muted',
})
})
})

View File

@@ -0,0 +1,34 @@
import { MuteMarketingEmailsOption, SettingName } from '@standardnotes/settings'
import { inject, injectable } from 'inversify'
import TYPES from '../../../Bootstrap/Types'
import { SettingRepositoryInterface } from '../../Setting/SettingRepositoryInterface'
import { UseCaseInterface } from '../UseCaseInterface'
import { MuteMarketingEmailsDTO } from './MuteMarketingEmailsDTO'
import { MuteMarketingEmailsResponse } from './MuteMarketingEmailsResponse'
@injectable()
export class MuteMarketingEmails implements UseCaseInterface {
constructor(@inject(TYPES.SettingRepository) private settingRepository: SettingRepositoryInterface) {}
async execute(dto: MuteMarketingEmailsDTO): Promise<MuteMarketingEmailsResponse> {
const setting = await this.settingRepository.findOneByUuidAndNames(dto.settingUuid, [
SettingName.MuteMarketingEmails,
])
if (setting === null) {
return {
success: false,
message: 'Could not find setting setting.',
}
}
setting.value = MuteMarketingEmailsOption.Muted
await this.settingRepository.save(setting)
return {
success: true,
message: 'These emails have been muted.',
}
}
}

View File

@@ -0,0 +1,3 @@
export type MuteMarketingEmailsDTO = {
settingUuid: string
}

View File

@@ -0,0 +1,4 @@
export type MuteMarketingEmailsResponse = {
success: boolean
message: string
}

View File

@@ -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.
## [1.1.7](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.1.6...@standardnotes/files-server@1.1.7) (2022-06-27)
**Note:** Version bump only for package @standardnotes/files-server
## [1.1.6](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.1.5...@standardnotes/files-server@1.1.6) (2022-06-27)
**Note:** Version bump only for package @standardnotes/files-server
## [1.1.5](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.1.4...@standardnotes/files-server@1.1.5) (2022-06-27)
### Bug Fixes
* upgrade sentry node sdk ([b6db194](https://github.com/standardnotes/files/commit/b6db194a22ff1d0afe96c291d545b408c0a5c373))
## [1.1.4](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.1.3...@standardnotes/files-server@1.1.4) (2022-06-24)
### Bug Fixes
* newrelic deps and setup db and cache for local development purposes ([ff09ae0](https://github.com/standardnotes/files/commit/ff09ae0a47747eaf7977ce5d3937ad385101eaeb))
## [1.1.3](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.1.2...@standardnotes/files-server@1.1.3) (2022-06-23)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files-server",
"version": "1.1.3",
"version": "1.1.7",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -14,17 +14,18 @@
"license": "AGPL-3.0-or-later",
"scripts": {
"clean": "rm -fr dist",
"setup:env": "cp .env.sample .env",
"prebuild": "yarn clean",
"build": "tsc --rootDir ./",
"lint": "eslint . --ext .ts",
"pretest": "yarn lint && yarn build",
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
"start": "yarn node dist/bin/server.js",
"worker": "yarn node dist/bin/worker.js"
"worker": "yarn node dist/bin/worker.js",
"upgrade:snjs": "yarn ncu -u '@standardnotes/*'"
},
"dependencies": {
"@newrelic/native-metrics": "7.0.2",
"@sentry/node": "^6.16.1",
"@sentry/node": "^7.3.0",
"@standardnotes/auth": "^3.18.9",
"@standardnotes/common": "^1.19.4",
"@standardnotes/domain-events": "^2.27.6",
@@ -44,7 +45,7 @@
"inversify-express-utils": "^6.4.3",
"ioredis": "^5.0.6",
"jsonwebtoken": "^8.5.1",
"newrelic": "^7.3.1",
"newrelic": "^8.14.1",
"nodemon": "^2.0.15",
"prettyjson": "^1.2.1",
"reflect-metadata": "^0.1.13",
@@ -59,7 +60,7 @@
"@types/ioredis": "^4.28.10",
"@types/jest": "^28.1.3",
"@types/jsonwebtoken": "^8.5.0",
"@types/newrelic": "^7.0.1",
"@types/newrelic": "^7.0.3",
"@types/prettyjson": "^0.0.29",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
@@ -67,6 +68,7 @@
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.1",
"nodemon": "^2.0.16",
"npm-check-updates": "^14.1.1",
"ts-jest": "^28.0.1",
"uuid": "^8.3.2"
}

View File

@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.2.2](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.2.1...@standardnotes/scheduler-server@1.2.2) (2022-06-27)
**Note:** Version bump only for package @standardnotes/scheduler-server
## [1.2.1](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.2.0...@standardnotes/scheduler-server@1.2.1) (2022-06-27)
### Bug Fixes
* change subscription encouragement scheduled from 14 to 30 days ([e12c9c4](https://github.com/standardnotes/server/commit/e12c9c47a73efa5e5af15144e653195455f90591))
# [1.2.0](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.1.5...@standardnotes/scheduler-server@1.2.0) (2022-06-27)
### Features
* add context for requesting email message ([8d4280f](https://github.com/standardnotes/server/commit/8d4280f4ca57151198880620cc9504aba720f2f3))
## [1.1.5](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.1.4...@standardnotes/scheduler-server@1.1.5) (2022-06-27)
### Bug Fixes
* upgrade sentry node sdk ([b6db194](https://github.com/standardnotes/server/commit/b6db194a22ff1d0afe96c291d545b408c0a5c373))
## [1.1.4](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.1.3...@standardnotes/scheduler-server@1.1.4) (2022-06-24)
### Bug Fixes
* newrelic deps and setup db and cache for local development purposes ([ff09ae0](https://github.com/standardnotes/server/commit/ff09ae0a47747eaf7977ce5d3937ad385101eaeb))
## [1.1.3](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.1.2...@standardnotes/scheduler-server@1.1.3) (2022-06-23)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/scheduler-server",
"version": "1.1.3",
"version": "1.2.2",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -19,13 +19,14 @@
"worker": "yarn node dist/bin/worker.js",
"verify:jobs": "yarn node dist/bin/verify.js",
"setup:env": "cp .env.sample .env",
"typeorm": "typeorm-ts-node-commonjs"
"typeorm": "typeorm-ts-node-commonjs",
"upgrade:snjs": "yarn ncu -u '@standardnotes/*'"
},
"dependencies": {
"@newrelic/native-metrics": "7.0.2",
"@newrelic/winston-enricher": "^2.1.0",
"@sentry/node": "^7.3.0",
"@standardnotes/common": "^1.23.0",
"@standardnotes/domain-events": "^2.32.0",
"@standardnotes/domain-events": "^2.32.3",
"@standardnotes/domain-events-infra": "^1.5.0",
"@standardnotes/scheduler": "^1.1.0",
"@standardnotes/time": "^1.7.0",
@@ -35,7 +36,7 @@
"inversify": "5.0.5",
"ioredis": "^5.0.6",
"mysql2": "^2.3.3",
"newrelic": "8.6.0",
"newrelic": "^8.14.1",
"reflect-metadata": "^0.1.13",
"typeorm": "^0.3.6",
"winston": "3.3.3"
@@ -43,11 +44,12 @@
"devDependencies": {
"@types/ioredis": "^4.28.10",
"@types/jest": "^28.1.2",
"@types/newrelic": "^7.0.2",
"@types/newrelic": "^7.0.3",
"@types/node": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.1",
"npm-check-updates": "^14.1.1",
"ts-jest": "^28.0.5"
}
}

View File

@@ -21,7 +21,13 @@ describe('DomainEventFactory', () => {
it('should create a EMAIL_MESSAGE_REQUESTED event', () => {
expect(
createFactory().createEmailMessageRequestedEvent('test@test.te', EmailMessageIdentifier.ENCOURAGE_EMAIL_BACKUPS),
createFactory().createEmailMessageRequestedEvent({
userEmail: 'test@test.te',
messageIdentifier: EmailMessageIdentifier.ENCOURAGE_EMAIL_BACKUPS,
context: {
foo: 'bar',
},
}),
).toEqual({
createdAt: expect.any(Date),
meta: {
@@ -34,6 +40,9 @@ describe('DomainEventFactory', () => {
payload: {
messageIdentifier: 'ENCOURAGE_EMAIL_BACKUPS',
userEmail: 'test@test.te',
context: {
foo: 'bar',
},
},
type: 'EMAIL_MESSAGE_REQUESTED',
})

View File

@@ -16,24 +16,22 @@ import { DomainEventFactoryInterface } from './DomainEventFactoryInterface'
export class DomainEventFactory implements DomainEventFactoryInterface {
constructor(@inject(TYPES.Timer) private timer: TimerInterface) {}
createEmailMessageRequestedEvent(
userEmail: string,
messageIdentifier: EmailMessageIdentifier,
): EmailMessageRequestedEvent {
createEmailMessageRequestedEvent(dto: {
userEmail: string
messageIdentifier: EmailMessageIdentifier
context: Record<string, unknown>
}): EmailMessageRequestedEvent {
return {
type: 'EMAIL_MESSAGE_REQUESTED',
createdAt: this.timer.getUTCDate(),
meta: {
correlation: {
userIdentifier: userEmail,
userIdentifier: dto.userEmail,
userIdentifierType: 'email',
},
origin: DomainEventService.Scheduler,
},
payload: {
messageIdentifier,
userEmail,
},
payload: dto,
}
}

View File

@@ -6,8 +6,9 @@ import { Predicate } from '../Predicate/Predicate'
export interface DomainEventFactoryInterface {
createPredicateVerificationRequestedEvent(job: Job, predicate: Predicate): PredicateVerificationRequestedEvent
createEmailMessageRequestedEvent(
userEmail: string,
messageIdentifier: EmailMessageIdentifier,
): EmailMessageRequestedEvent
createEmailMessageRequestedEvent(dto: {
userEmail: string
messageIdentifier: EmailMessageIdentifier
context: Record<string, unknown>
}): EmailMessageRequestedEvent
}

View File

@@ -49,7 +49,7 @@ export class UserRegisteredEventHandler implements DomainEventHandlerInterface {
private async scheduleEncourageSubscriptionPurchasing(event: UserRegisteredEvent): Promise<void> {
const job = new Job()
job.name = JobName.ENCOURAGE_SUBSCRIPTION_PURCHASING
job.scheduledAt = this.timer.convertDateToMicroseconds(this.timer.getUTCDateNDaysAhead(14))
job.scheduledAt = this.timer.convertDateToMicroseconds(this.timer.getUTCDateNDaysAhead(30))
job.createdAt = this.timer.getTimestampInMicroseconds()
job.status = JobStatus.Pending
job.userIdentifier = event.payload.email

View File

@@ -67,10 +67,11 @@ describe('JobDoneInterpreter', () => {
await createInterpreter().interpret('1-2-3')
expect(domainEventFactory.createEmailMessageRequestedEvent).toHaveBeenCalledWith(
'test@test.te',
'ENCOURAGE_EMAIL_BACKUPS',
)
expect(domainEventFactory.createEmailMessageRequestedEvent).toHaveBeenCalledWith({
context: {},
messageIdentifier: 'ENCOURAGE_EMAIL_BACKUPS',
userEmail: 'test@test.te',
})
expect(domainEventPublisher.publish).toHaveBeenCalled()
})
@@ -110,6 +111,7 @@ describe('JobDoneInterpreter', () => {
name: JobName.ENCOURAGE_SUBSCRIPTION_PURCHASING,
userIdentifier: 'test@test.te',
userIdentifierType: 'email',
createdAt: 123,
} as jest.Mocked<Job>)
predicateRepository.findByJobUuid = jest
.fn()
@@ -119,10 +121,11 @@ describe('JobDoneInterpreter', () => {
await createInterpreter().interpret('1-2-3')
expect(domainEventFactory.createEmailMessageRequestedEvent).toHaveBeenCalledWith(
'test@test.te',
'ENCOURAGE_SUBSCRIPTION_PURCHASING',
)
expect(domainEventFactory.createEmailMessageRequestedEvent).toHaveBeenCalledWith({
context: { userRegisteredAt: 123 },
messageIdentifier: 'ENCOURAGE_SUBSCRIPTION_PURCHASING',
userEmail: 'test@test.te',
})
expect(domainEventPublisher.publish).toHaveBeenCalled()
})
@@ -148,7 +151,11 @@ describe('JobDoneInterpreter', () => {
await createInterpreter().interpret('1-2-3')
expect(domainEventFactory.createEmailMessageRequestedEvent).toHaveBeenCalledWith('test@test.te', 'EXIT_INTERVIEW')
expect(domainEventFactory.createEmailMessageRequestedEvent).toHaveBeenCalledWith({
context: {},
messageIdentifier: 'EXIT_INTERVIEW',
userEmail: 'test@test.te',
})
expect(domainEventPublisher.publish).toHaveBeenCalled()
})

View File

@@ -41,7 +41,7 @@ export class JobDoneInterpreter implements JobDoneInterpreterInterface {
return
case JobName.ENCOURAGE_SUBSCRIPTION_PURCHASING:
if (job.userIdentifierType === 'email') {
await this.requestSubscriptionPurchaseEncouragementEmail(job.userIdentifier)
await this.requestSubscriptionPurchaseEncouragementEmail(job)
}
return
case JobName.EXIT_INTERVIEW:
@@ -56,25 +56,33 @@ export class JobDoneInterpreter implements JobDoneInterpreterInterface {
private async requestEmailBackupEncouragementEmail(userEmail: string): Promise<void> {
await this.domainEventPublisher.publish(
this.domainEventFactory.createEmailMessageRequestedEvent(
this.domainEventFactory.createEmailMessageRequestedEvent({
userEmail,
EmailMessageIdentifier.ENCOURAGE_EMAIL_BACKUPS,
),
messageIdentifier: EmailMessageIdentifier.ENCOURAGE_EMAIL_BACKUPS,
context: {},
}),
)
}
private async requestSubscriptionPurchaseEncouragementEmail(userEmail: string): Promise<void> {
private async requestSubscriptionPurchaseEncouragementEmail(job: Job): Promise<void> {
await this.domainEventPublisher.publish(
this.domainEventFactory.createEmailMessageRequestedEvent(
userEmail,
EmailMessageIdentifier.ENCOURAGE_SUBSCRIPTION_PURCHASING,
),
this.domainEventFactory.createEmailMessageRequestedEvent({
userEmail: job.userIdentifier,
messageIdentifier: EmailMessageIdentifier.ENCOURAGE_SUBSCRIPTION_PURCHASING,
context: {
userRegisteredAt: job.createdAt,
},
}),
)
}
private async requestExitInterviewEmail(userEmail: string): Promise<void> {
await this.domainEventPublisher.publish(
this.domainEventFactory.createEmailMessageRequestedEvent(userEmail, EmailMessageIdentifier.EXIT_INTERVIEW),
this.domainEventFactory.createEmailMessageRequestedEvent({
userEmail,
messageIdentifier: EmailMessageIdentifier.EXIT_INTERVIEW,
context: {},
}),
)
}

View File

@@ -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.
## [1.1.7](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.1.6...@standardnotes/syncing-server@1.1.7) (2022-06-27)
**Note:** Version bump only for package @standardnotes/syncing-server
## [1.1.6](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.1.5...@standardnotes/syncing-server@1.1.6) (2022-06-27)
**Note:** Version bump only for package @standardnotes/syncing-server
## [1.1.5](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.1.4...@standardnotes/syncing-server@1.1.5) (2022-06-27)
### Bug Fixes
* upgrade sentry node sdk ([b6db194](https://github.com/standardnotes/syncing-server-js/commit/b6db194a22ff1d0afe96c291d545b408c0a5c373))
## [1.1.4](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.1.3...@standardnotes/syncing-server@1.1.4) (2022-06-24)
### Bug Fixes
* newrelic deps and setup db and cache for local development purposes ([ff09ae0](https://github.com/standardnotes/syncing-server-js/commit/ff09ae0a47747eaf7977ce5d3937ad385101eaeb))
## [1.1.3](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.1.2...@standardnotes/syncing-server@1.1.3) (2022-06-23)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.1.3",
"version": "1.1.7",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -12,18 +12,19 @@
"license": "AGPL-3.0-or-later",
"scripts": {
"clean": "rm -fr dist",
"setup:env": "cp .env.sample .env",
"prebuild": "yarn clean",
"build": "tsc --rootDir ./",
"lint": "eslint . --ext .ts",
"pretest": "yarn lint && yarn build",
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
"start": "yarn node dist/bin/server.js",
"worker": "yarn node dist/bin/worker.js"
"worker": "yarn node dist/bin/worker.js",
"upgrade:snjs": "yarn ncu -u '@standardnotes/*'"
},
"dependencies": {
"@newrelic/native-metrics": "7.0.2",
"@newrelic/winston-enricher": "^2.1.0",
"@sentry/node": "^6.16.1",
"@sentry/node": "^7.3.0",
"@standardnotes/analytics": "^1.6.0",
"@standardnotes/auth": "^3.19.2",
"@standardnotes/common": "^1.22.0",
@@ -44,7 +45,7 @@
"ioredis": "^5.0.6",
"jsonwebtoken": "8.5.1",
"mysql2": "^2.3.3",
"newrelic": "8.6.0",
"newrelic": "^8.14.1",
"nodemon": "2.0.7",
"prettyjson": "1.2.1",
"reflect-metadata": "0.1.13",
@@ -61,7 +62,7 @@
"@types/ioredis": "^4.28.10",
"@types/jest": "^28.1.3",
"@types/jsonwebtoken": "^8.5.0",
"@types/newrelic": "^7.0.2",
"@types/newrelic": "^7.0.3",
"@types/prettyjson": "^0.0.29",
"@types/ua-parser-js": "^0.7.36",
"@types/uuid": "^8.3.0",
@@ -69,6 +70,7 @@
"eslint": "^8.14.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^28.1.1",
"npm-check-updates": "^14.1.1",
"ts-jest": "^28.0.1"
}
}

593
yarn.lock

File diff suppressed because it is too large Load Diff