mirror of
https://github.com/standardnotes/server
synced 2026-06-10 21:45:19 -04:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b6cfed6fa | |||
| bb53e88a4e | |||
| cfd04a5b39 | |||
| e0f2d5e202 | |||
| 3035cbc5de | |||
| 7c271be310 | |||
| ba373ebc6b | |||
| 2450d88a29 | |||
| 376a59c182 | |||
| d584ca57f1 | |||
| c50662849b | |||
| 82da690139 | |||
| b11a9b0eac | |||
| d7653474c3 | |||
| ce2fd86ca3 | |||
| c9c496c63f | |||
| b1c9f8ca6e | |||
| e84bd73a39 | |||
| c69d1b02fb | |||
| b590d33b88 | |||
| c1e7a3eb7e | |||
| fd743a9d5e | |||
| 4c40fd5186 | |||
| 2cb470b99e |
@@ -0,0 +1,72 @@
|
|||||||
|
# For most projects, this workflow file will not need changing; you simply need
|
||||||
|
# to commit it to your repository.
|
||||||
|
#
|
||||||
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
|
# or to provide custom queries or build logic.
|
||||||
|
#
|
||||||
|
# ******** NOTE ********
|
||||||
|
# We have attempted to detect the languages in your repository. Please check
|
||||||
|
# the `language` matrix defined below to confirm you have the correct set of
|
||||||
|
# supported CodeQL languages.
|
||||||
|
#
|
||||||
|
name: "CodeQL"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
# The branches below must be a subset of the branches above
|
||||||
|
branches: [ "main" ]
|
||||||
|
schedule:
|
||||||
|
- cron: '44 8 * * 2'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
contents: read
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
language: [ 'javascript' ]
|
||||||
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||||
|
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Initializes the CodeQL tools for scanning.
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@v2
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||||
|
# By default, queries listed here will override any specified in a config file.
|
||||||
|
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||||
|
|
||||||
|
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||||
|
# queries: security-extended,security-and-quality
|
||||||
|
|
||||||
|
|
||||||
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
|
- name: Autobuild
|
||||||
|
uses: github/codeql-action/autobuild@v2
|
||||||
|
|
||||||
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
|
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||||
|
|
||||||
|
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||||
|
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||||
|
|
||||||
|
# - run: |
|
||||||
|
# echo "Run, Build Application using script"
|
||||||
|
# ./location_of_script_within_repo/buildscript.sh
|
||||||
|
|
||||||
|
- name: Perform CodeQL Analysis
|
||||||
|
uses: github/codeql-action/analyze@v2
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
name: Pull Request
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --immutable
|
||||||
|
- name: ESLint
|
||||||
|
run: yarn lint
|
||||||
|
- name: Build
|
||||||
|
run: yarn build
|
||||||
|
- name: Test
|
||||||
|
run: yarn test
|
||||||
@@ -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>
|
||||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
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.
+4
-1
@@ -39,7 +39,8 @@
|
|||||||
"start:files-worker": "yarn workspace @standardnotes/files-server worker",
|
"start:files-worker": "yarn workspace @standardnotes/files-server worker",
|
||||||
"start:api-gateway": "yarn workspace @standardnotes/api-gateway start",
|
"start:api-gateway": "yarn workspace @standardnotes/api-gateway start",
|
||||||
"release:prod": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish new version\"",
|
"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": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^17.0.2",
|
"@commitlint/cli": "^17.0.2",
|
||||||
@@ -53,6 +54,8 @@
|
|||||||
"@typescript-eslint/parser": "^5.29.0",
|
"@typescript-eslint/parser": "^5.29.0",
|
||||||
"eslint": "^8.17.0",
|
"eslint": "^8.17.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
|
"ini": "^3.0.0",
|
||||||
|
"npm-check-updates": "^14.1.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"ts-node": "^10.8.1",
|
"ts-node": "^10.8.1",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
|
|||||||
@@ -3,6 +3,28 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.3.1](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.3.0...@standardnotes/api-gateway@1.3.1) (2022-06-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add origin meta property to daily analytics event ([376a59c](https://github.com/standardnotes/api-gateway/commit/376a59c1827411164a536157fc591a15e0a5b0b2))
|
||||||
|
|
||||||
|
# [1.3.0](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.2.2...@standardnotes/api-gateway@1.3.0) (2022-06-28)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* remove api metadata decorating html responses ([3035cbc](https://github.com/standardnotes/api-gateway/commit/3035cbc5ded1408bc4b8646563c4992ba5f27c75))
|
||||||
|
|
||||||
|
## [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)
|
# [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
|
### Features
|
||||||
|
|||||||
@@ -7,7 +7,11 @@ import { Logger } from 'winston'
|
|||||||
import { ContainerConfigLoader } from '../src/Bootstrap/Container'
|
import { ContainerConfigLoader } from '../src/Bootstrap/Container'
|
||||||
import TYPES from '../src/Bootstrap/Types'
|
import TYPES from '../src/Bootstrap/Types'
|
||||||
import { Env } from '../src/Bootstrap/Env'
|
import { Env } from '../src/Bootstrap/Env'
|
||||||
import { DomainEventPublisherInterface, DailyAnalyticsReportGeneratedEvent } from '@standardnotes/domain-events'
|
import {
|
||||||
|
DomainEventPublisherInterface,
|
||||||
|
DailyAnalyticsReportGeneratedEvent,
|
||||||
|
DomainEventService,
|
||||||
|
} from '@standardnotes/domain-events'
|
||||||
import { AnalyticsActivity, AnalyticsStoreInterface, Period, StatisticsStoreInterface } from '@standardnotes/analytics'
|
import { AnalyticsActivity, AnalyticsStoreInterface, Period, StatisticsStoreInterface } from '@standardnotes/analytics'
|
||||||
|
|
||||||
const requestReport = async (
|
const requestReport = async (
|
||||||
@@ -23,6 +27,7 @@ const requestReport = async (
|
|||||||
userIdentifier: '',
|
userIdentifier: '',
|
||||||
userIdentifierType: 'uuid',
|
userIdentifierType: 'uuid',
|
||||||
},
|
},
|
||||||
|
origin: DomainEventService.ApiGateway,
|
||||||
},
|
},
|
||||||
payload: {
|
payload: {
|
||||||
applicationStatistics: await statisticsStore.getYesterdayApplicationUsage(),
|
applicationStatistics: await statisticsStore.getYesterdayApplicationUsage(),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/api-gateway",
|
"name": "@standardnotes/api-gateway",
|
||||||
"version": "1.2.0",
|
"version": "1.3.1",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
@@ -17,16 +17,17 @@
|
|||||||
"lint": "eslint . --ext .ts",
|
"lint": "eslint . --ext .ts",
|
||||||
"setup:env": "cp .env.sample .env",
|
"setup:env": "cp .env.sample .env",
|
||||||
"start": "yarn node dist/bin/server.js",
|
"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": {
|
"dependencies": {
|
||||||
"@newrelic/winston-enricher": "^2.1.0",
|
"@newrelic/winston-enricher": "^2.1.0",
|
||||||
"@sentry/node": "^7.3.0",
|
"@sentry/node": "^7.3.0",
|
||||||
"@standardnotes/analytics": "^1.4.0",
|
"@standardnotes/analytics": "^1.6.0",
|
||||||
"@standardnotes/auth": "3.19.2",
|
"@standardnotes/auth": "3.19.4",
|
||||||
"@standardnotes/domain-events": "2.29.0",
|
"@standardnotes/domain-events": "2.32.5",
|
||||||
"@standardnotes/domain-events-infra": "1.4.127",
|
"@standardnotes/domain-events-infra": "1.5.5",
|
||||||
"@standardnotes/time": "^1.7.0",
|
"@standardnotes/time": "^1.7.1",
|
||||||
"aws-sdk": "^2.1160.0",
|
"aws-sdk": "^2.1160.0",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
@@ -55,6 +56,7 @@
|
|||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"jest": "^28.1.1",
|
"jest": "^28.1.1",
|
||||||
"nodemon": "^2.0.16",
|
"nodemon": "^2.0.16",
|
||||||
|
"npm-check-updates": "^14.1.1",
|
||||||
"ts-jest": "^28.0.1"
|
"ts-jest": "^28.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,10 @@ export class AuthMiddleware extends BaseMiddleware {
|
|||||||
response.setHeader('content-type', (error as AxiosError).response?.headers['content-type'] as string)
|
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)
|
response.status(errorCode).send(errorMessage)
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,10 @@ export class SubscriptionTokenAuthMiddleware extends BaseMiddleware {
|
|||||||
response.setHeader('content-type', (error as AxiosError).response?.headers['content-type'] as string)
|
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)
|
response.status(errorCode).send(errorMessage)
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,10 @@ export class HttpService implements HttpServiceInterface {
|
|||||||
response.setHeader('content-type', (error as AxiosError).response?.headers['content-type'] as string)
|
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)
|
response.status(errorCode).send(errorMessage)
|
||||||
}
|
}
|
||||||
@@ -159,6 +162,12 @@ export class HttpService implements HttpServiceInterface {
|
|||||||
|
|
||||||
this.applyResponseHeaders(serviceResponse, response)
|
this.applyResponseHeaders(serviceResponse, response)
|
||||||
|
|
||||||
|
if (this.responseShouldNotBeDecorated(serviceResponse)) {
|
||||||
|
response.status(serviceResponse.status).send(serviceResponse.data)
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
response.status(serviceResponse.status).send({
|
response.status(serviceResponse.status).send({
|
||||||
meta: {
|
meta: {
|
||||||
auth: {
|
auth: {
|
||||||
@@ -210,6 +219,10 @@ export class HttpService implements HttpServiceInterface {
|
|||||||
return payload
|
return payload
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private responseShouldNotBeDecorated(serviceResponse: AxiosResponse): boolean {
|
||||||
|
return serviceResponse.headers['content-type'].toLowerCase().includes('text/html')
|
||||||
|
}
|
||||||
|
|
||||||
private applyResponseHeaders(serviceResponse: AxiosResponse, response: Response): void {
|
private applyResponseHeaders(serviceResponse: AxiosResponse, response: Response): void {
|
||||||
const returnedHeadersFromUnderlyingService = [
|
const returnedHeadersFromUnderlyingService = [
|
||||||
'access-control-allow-methods',
|
'access-control-allow-methods',
|
||||||
|
|||||||
@@ -3,6 +3,24 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.3.4](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.3.3...@standardnotes/auth-server@1.3.4) (2022-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/auth-server
|
||||||
|
|
||||||
|
## [1.3.3](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.3.2...@standardnotes/auth-server@1.3.3) (2022-06-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* change response type to html for muting marketing emails ([ba373eb](https://github.com/standardnotes/auth/commit/ba373ebc6b3038f7de2fab40f0429a655dbe2499))
|
||||||
|
|
||||||
|
## [1.3.2](https://github.com/standardnotes/auth/compare/@standardnotes/auth-server@1.3.1...@standardnotes/auth-server@1.3.2) (2022-06-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/auth-server
|
||||||
|
|
||||||
|
## [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)
|
# [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
|
### Features
|
||||||
|
|||||||
+14
-12
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/auth-server",
|
"name": "@standardnotes/auth-server",
|
||||||
"version": "1.3.0",
|
"version": "1.3.4",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
@@ -26,24 +26,25 @@
|
|||||||
"daily-backup:one_drive": "yarn node dist/bin/backup.js one_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",
|
"weekly-backup:email": "yarn node dist/bin/backup.js email weekly",
|
||||||
"email-campaign": "yarn node dist/bin/email.js",
|
"email-campaign": "yarn node dist/bin/email.js",
|
||||||
"typeorm": "typeorm-ts-node-commonjs"
|
"typeorm": "typeorm-ts-node-commonjs",
|
||||||
|
"upgrade:snjs": "yarn ncu -u '@standardnotes/*'"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@newrelic/winston-enricher": "^2.1.0",
|
"@newrelic/winston-enricher": "^2.1.0",
|
||||||
"@sentry/node": "^7.3.0",
|
"@sentry/node": "^7.3.0",
|
||||||
"@standardnotes/analytics": "^1.6.0",
|
"@standardnotes/analytics": "^1.6.0",
|
||||||
"@standardnotes/api": "^1.1.13",
|
"@standardnotes/api": "^1.1.18",
|
||||||
"@standardnotes/auth": "^3.19.2",
|
"@standardnotes/auth": "^3.19.4",
|
||||||
"@standardnotes/common": "^1.23.1",
|
"@standardnotes/common": "^1.23.1",
|
||||||
"@standardnotes/domain-events": "^2.32.4",
|
"@standardnotes/domain-events": "^2.32.5",
|
||||||
"@standardnotes/domain-events-infra": "^1.4.135",
|
"@standardnotes/domain-events-infra": "^1.5.5",
|
||||||
"@standardnotes/features": "^1.45.2",
|
"@standardnotes/features": "^1.46.0",
|
||||||
"@standardnotes/responses": "^1.6.15",
|
"@standardnotes/responses": "^1.6.38",
|
||||||
"@standardnotes/scheduler": "^1.1.1",
|
"@standardnotes/scheduler": "^1.1.2",
|
||||||
"@standardnotes/settings": "^1.15.0",
|
"@standardnotes/settings": "^1.15.0",
|
||||||
"@standardnotes/sncrypto-common": "^1.8.1",
|
"@standardnotes/sncrypto-common": "^1.9.0",
|
||||||
"@standardnotes/sncrypto-node": "^1.8.1",
|
"@standardnotes/sncrypto-node": "^1.8.3",
|
||||||
"@standardnotes/time": "^1.6.8",
|
"@standardnotes/time": "^1.7.1",
|
||||||
"aws-sdk": "^2.1159.0",
|
"aws-sdk": "^2.1159.0",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
@@ -81,6 +82,7 @@
|
|||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"jest": "^28.1.1",
|
"jest": "^28.1.1",
|
||||||
"nodemon": "^2.0.16",
|
"nodemon": "^2.0.16",
|
||||||
|
"npm-check-updates": "^14.1.1",
|
||||||
"ts-jest": "^28.0.1"
|
"ts-jest": "^28.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ describe('InternalController', () => {
|
|||||||
let muteMarketingEmails: MuteMarketingEmails
|
let muteMarketingEmails: MuteMarketingEmails
|
||||||
|
|
||||||
let request: express.Request
|
let request: express.Request
|
||||||
|
let response: express.Response
|
||||||
let user: User
|
let user: User
|
||||||
|
|
||||||
const createController = () =>
|
const createController = () =>
|
||||||
@@ -48,6 +49,11 @@ describe('InternalController', () => {
|
|||||||
body: {},
|
body: {},
|
||||||
params: {},
|
params: {},
|
||||||
} as jest.Mocked<express.Request>
|
} as jest.Mocked<express.Request>
|
||||||
|
|
||||||
|
response = {} as jest.Mocked<express.Response>
|
||||||
|
response.setHeader = jest.fn()
|
||||||
|
response.status = jest.fn().mockReturnThis()
|
||||||
|
response.send = jest.fn()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should get user features', async () => {
|
it('should get user features', async () => {
|
||||||
@@ -170,26 +176,27 @@ describe('InternalController', () => {
|
|||||||
it('should mute marketing emails user setting', async () => {
|
it('should mute marketing emails user setting', async () => {
|
||||||
request.params.settingUuid = '1-2-3'
|
request.params.settingUuid = '1-2-3'
|
||||||
|
|
||||||
muteMarketingEmails.execute = jest.fn().mockReturnValue({ success: true })
|
muteMarketingEmails.execute = jest.fn().mockReturnValue({ success: true, message: 'foobar' })
|
||||||
|
|
||||||
const httpResponse = <results.JsonResult>await createController().muteMarketingEmails(request)
|
await createController().muteMarketingEmails(request, response)
|
||||||
const result = await httpResponse.executeAsync()
|
|
||||||
|
|
||||||
expect(muteMarketingEmails.execute).toHaveBeenCalledWith({ settingUuid: '1-2-3' })
|
expect(muteMarketingEmails.execute).toHaveBeenCalledWith({ settingUuid: '1-2-3' })
|
||||||
|
|
||||||
expect(result.statusCode).toEqual(200)
|
expect(response.setHeader).toHaveBeenCalledWith('content-type', 'text/html')
|
||||||
|
expect(response.send).toHaveBeenCalledWith('foobar')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should not mute marketing emails user setting if it does not exist', async () => {
|
it('should not mute marketing emails user setting if it does not exist', async () => {
|
||||||
request.params.settingUuid = '1-2-3'
|
request.params.settingUuid = '1-2-3'
|
||||||
|
|
||||||
muteMarketingEmails.execute = jest.fn().mockReturnValue({ success: false })
|
muteMarketingEmails.execute = jest.fn().mockReturnValue({ success: false, message: 'foobar' })
|
||||||
|
|
||||||
const httpResponse = <results.JsonResult>await createController().muteMarketingEmails(request)
|
await createController().muteMarketingEmails(request, response)
|
||||||
const result = await httpResponse.executeAsync()
|
|
||||||
|
|
||||||
expect(muteMarketingEmails.execute).toHaveBeenCalledWith({ settingUuid: '1-2-3' })
|
expect(muteMarketingEmails.execute).toHaveBeenCalledWith({ settingUuid: '1-2-3' })
|
||||||
|
|
||||||
expect(result.statusCode).toEqual(404)
|
expect(response.setHeader).toHaveBeenCalledWith('content-type', 'text/html')
|
||||||
|
expect(response.status).toHaveBeenCalledWith(404)
|
||||||
|
expect(response.send).toHaveBeenCalledWith('foobar')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Request } from 'express'
|
import { Request, Response } from 'express'
|
||||||
import { inject } from 'inversify'
|
import { inject } from 'inversify'
|
||||||
import {
|
import {
|
||||||
BaseHttpController,
|
BaseHttpController,
|
||||||
@@ -84,16 +84,20 @@ export class InternalController extends BaseHttpController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@httpGet('/settings/marketing-emails/:settingUuid/mute')
|
@httpGet('/settings/marketing-emails/:settingUuid/mute')
|
||||||
async muteMarketingEmails(request: Request): Promise<results.JsonResult> {
|
async muteMarketingEmails(request: Request, response: Response): Promise<void> {
|
||||||
const { settingUuid } = request.params
|
const { settingUuid } = request.params
|
||||||
const result = await this.doMuteMarketingEmails.execute({
|
const result = await this.doMuteMarketingEmails.execute({
|
||||||
settingUuid,
|
settingUuid,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
response.setHeader('content-type', 'text/html')
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
return this.json({ message: result.message })
|
response.send(result.message)
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.json({ message: result.message }, 404)
|
response.status(404).send(result.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.1.8](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.1.7...@standardnotes/files-server@1.1.8) (2022-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/files-server
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
**Note:** Version bump only for package @standardnotes/files-server
|
||||||
|
|||||||
+12
-10
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/files-server",
|
"name": "@standardnotes/files-server",
|
||||||
"version": "1.1.6",
|
"version": "1.1.8",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
@@ -21,17 +21,18 @@
|
|||||||
"pretest": "yarn lint && yarn build",
|
"pretest": "yarn lint && yarn build",
|
||||||
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
|
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
|
||||||
"start": "yarn node dist/bin/server.js",
|
"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": {
|
"dependencies": {
|
||||||
"@sentry/node": "^7.3.0",
|
"@sentry/node": "^7.3.0",
|
||||||
"@standardnotes/auth": "^3.18.9",
|
"@standardnotes/auth": "^3.19.4",
|
||||||
"@standardnotes/common": "^1.19.4",
|
"@standardnotes/common": "^1.23.1",
|
||||||
"@standardnotes/domain-events": "^2.27.6",
|
"@standardnotes/domain-events": "^2.32.5",
|
||||||
"@standardnotes/domain-events-infra": "^1.4.93",
|
"@standardnotes/domain-events-infra": "^1.5.5",
|
||||||
"@standardnotes/sncrypto-common": "^1.3.0",
|
"@standardnotes/sncrypto-common": "^1.9.0",
|
||||||
"@standardnotes/sncrypto-node": "^1.3.0",
|
"@standardnotes/sncrypto-node": "^1.8.3",
|
||||||
"@standardnotes/time": "^1.4.5",
|
"@standardnotes/time": "^1.7.1",
|
||||||
"aws-sdk": "^2.1158.0",
|
"aws-sdk": "^2.1158.0",
|
||||||
"connect-busboy": "^1.0.0",
|
"connect-busboy": "^1.0.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
@@ -52,7 +53,7 @@
|
|||||||
"winston": "^3.3.3"
|
"winston": "^3.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@standardnotes/config": "2.0.1",
|
"@standardnotes/config": "2.4.3",
|
||||||
"@types/connect-busboy": "^1.0.0",
|
"@types/connect-busboy": "^1.0.0",
|
||||||
"@types/cors": "^2.8.9",
|
"@types/cors": "^2.8.9",
|
||||||
"@types/express": "^4.17.11",
|
"@types/express": "^4.17.11",
|
||||||
@@ -67,6 +68,7 @@
|
|||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"jest": "^28.1.1",
|
"jest": "^28.1.1",
|
||||||
"nodemon": "^2.0.16",
|
"nodemon": "^2.0.16",
|
||||||
|
"npm-check-updates": "^14.1.1",
|
||||||
"ts-jest": "^28.0.1",
|
"ts-jest": "^28.0.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.2.3](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.2.2...@standardnotes/scheduler-server@1.2.3) (2022-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/scheduler-server
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
### Bug Fixes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/scheduler-server",
|
"name": "@standardnotes/scheduler-server",
|
||||||
"version": "1.2.1",
|
"version": "1.2.3",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
@@ -19,16 +19,17 @@
|
|||||||
"worker": "yarn node dist/bin/worker.js",
|
"worker": "yarn node dist/bin/worker.js",
|
||||||
"verify:jobs": "yarn node dist/bin/verify.js",
|
"verify:jobs": "yarn node dist/bin/verify.js",
|
||||||
"setup:env": "cp .env.sample .env",
|
"setup:env": "cp .env.sample .env",
|
||||||
"typeorm": "typeorm-ts-node-commonjs"
|
"typeorm": "typeorm-ts-node-commonjs",
|
||||||
|
"upgrade:snjs": "yarn ncu -u '@standardnotes/*'"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@newrelic/winston-enricher": "^2.1.0",
|
"@newrelic/winston-enricher": "^2.1.0",
|
||||||
"@sentry/node": "^7.3.0",
|
"@sentry/node": "^7.3.0",
|
||||||
"@standardnotes/common": "^1.23.0",
|
"@standardnotes/common": "^1.23.1",
|
||||||
"@standardnotes/domain-events": "^2.32.3",
|
"@standardnotes/domain-events": "^2.32.5",
|
||||||
"@standardnotes/domain-events-infra": "^1.5.0",
|
"@standardnotes/domain-events-infra": "^1.5.5",
|
||||||
"@standardnotes/scheduler": "^1.1.0",
|
"@standardnotes/scheduler": "^1.1.2",
|
||||||
"@standardnotes/time": "^1.7.0",
|
"@standardnotes/time": "^1.7.1",
|
||||||
"aws-sdk": "^2.1158.0",
|
"aws-sdk": "^2.1158.0",
|
||||||
"dayjs": "^1.11.3",
|
"dayjs": "^1.11.3",
|
||||||
"dotenv": "8.2.0",
|
"dotenv": "8.2.0",
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
"@typescript-eslint/eslint-plugin": "^5.29.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"jest": "^28.1.1",
|
"jest": "^28.1.1",
|
||||||
|
"npm-check-updates": "^14.1.1",
|
||||||
"ts-jest": "^28.0.5"
|
"ts-jest": "^28.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.1.8](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.1.7...@standardnotes/syncing-server@1.1.8) (2022-06-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||||
|
|
||||||
|
## [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)
|
## [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
|
**Note:** Version bump only for package @standardnotes/syncing-server
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@standardnotes/syncing-server",
|
"name": "@standardnotes/syncing-server",
|
||||||
"version": "1.1.6",
|
"version": "1.1.8",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
@@ -19,19 +19,20 @@
|
|||||||
"pretest": "yarn lint && yarn build",
|
"pretest": "yarn lint && yarn build",
|
||||||
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
|
"test": "jest --coverage --config=./jest.config.js --maxWorkers=50%",
|
||||||
"start": "yarn node dist/bin/server.js",
|
"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": {
|
"dependencies": {
|
||||||
"@newrelic/winston-enricher": "^2.1.0",
|
"@newrelic/winston-enricher": "^2.1.0",
|
||||||
"@sentry/node": "^7.3.0",
|
"@sentry/node": "^7.3.0",
|
||||||
"@standardnotes/analytics": "^1.6.0",
|
"@standardnotes/analytics": "^1.6.0",
|
||||||
"@standardnotes/auth": "^3.19.2",
|
"@standardnotes/auth": "^3.19.4",
|
||||||
"@standardnotes/common": "^1.22.0",
|
"@standardnotes/common": "^1.23.1",
|
||||||
"@standardnotes/domain-events": "^2.32.2",
|
"@standardnotes/domain-events": "^2.32.5",
|
||||||
"@standardnotes/domain-events-infra": "^1.5.2",
|
"@standardnotes/domain-events-infra": "^1.5.5",
|
||||||
"@standardnotes/payloads": "^1.5.1",
|
"@standardnotes/payloads": "^1.5.1",
|
||||||
"@standardnotes/responses": "^1.6.15",
|
"@standardnotes/responses": "^1.6.38",
|
||||||
"@standardnotes/settings": "1.14.3",
|
"@standardnotes/settings": "1.15.0",
|
||||||
"@standardnotes/time": "^1.7.1",
|
"@standardnotes/time": "^1.7.1",
|
||||||
"aws-sdk": "^2.1159.0",
|
"aws-sdk": "^2.1159.0",
|
||||||
"axios": "0.24.0",
|
"axios": "0.24.0",
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
"eslint": "^8.14.0",
|
"eslint": "^8.14.0",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"jest": "^28.1.1",
|
"jest": "^28.1.1",
|
||||||
|
"npm-check-updates": "^14.1.1",
|
||||||
"ts-jest": "^28.0.1"
|
"ts-jest": "^28.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user