feat: add responses package
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -23,6 +23,7 @@ packages/models/dist
|
|||||||
packages/services/dist
|
packages/services/dist
|
||||||
packages/utils/dist
|
packages/utils/dist
|
||||||
packages/api/dist
|
packages/api/dist
|
||||||
|
packages/responses/dist
|
||||||
|
|
||||||
**/.pnp.*
|
**/.pnp.*
|
||||||
**/.yarn/*
|
**/.yarn/*
|
||||||
|
|||||||
Binary file not shown.
@@ -5,11 +5,11 @@
|
|||||||
"node": ">=16.0.0 <17.0.0"
|
"node": ">=16.0.0 <17.0.0"
|
||||||
},
|
},
|
||||||
"description": "Interfaces for dealing with SN server-side API",
|
"description": "Interfaces for dealing with SN server-side API",
|
||||||
"main": "dist/src/index.js",
|
"main": "dist/index.js",
|
||||||
"author": "Standard Notes",
|
"author": "Standard Notes",
|
||||||
"types": "dist/src/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/src"
|
"dist"
|
||||||
],
|
],
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "files-demo",
|
"name": "files-demo",
|
||||||
"main": "dist/src/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/src/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/src"
|
"dist"
|
||||||
],
|
],
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
|
|||||||
2
packages/responses/.eslintignore
Normal file
2
packages/responses/.eslintignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
6
packages/responses/.eslintrc
Normal file
6
packages/responses/.eslintrc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../.eslintrc",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": "./linter.tsconfig.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
352
packages/responses/CHANGELOG.md
Normal file
352
packages/responses/CHANGELOG.md
Normal file
@@ -0,0 +1,352 @@
|
|||||||
|
# Change Log
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
# [1.7.0](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.40...@standardnotes/responses@1.7.0) (2022-07-05)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* remove features package in favor of standardnotes/app repository ([bb8226b](https://github.com/standardnotes/snjs/commit/bb8226b77550707c2a981778a78fe3dccf1aaa03))
|
||||||
|
|
||||||
|
## [1.6.40](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.39...@standardnotes/responses@1.6.40) (2022-07-04)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add missing reflect-metadata package to all packages ([ce3a5bb](https://github.com/standardnotes/snjs/commit/ce3a5bbf3f1d2276ac4abc3eec3c6a44c8c3ba9b))
|
||||||
|
|
||||||
|
## [1.6.39](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.38...@standardnotes/responses@1.6.39) (2022-06-29)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.38](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.37...@standardnotes/responses@1.6.38) (2022-06-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.37](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.36...@standardnotes/responses@1.6.37) (2022-06-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.36](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.35...@standardnotes/responses@1.6.36) (2022-06-16)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.35](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.34...@standardnotes/responses@1.6.35) (2022-06-16)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.34](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.33...@standardnotes/responses@1.6.34) (2022-06-15)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.33](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.32...@standardnotes/responses@1.6.33) (2022-06-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.32](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.31...@standardnotes/responses@1.6.32) (2022-06-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.31](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.30...@standardnotes/responses@1.6.31) (2022-06-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.30](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.29...@standardnotes/responses@1.6.30) (2022-06-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.29](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.28...@standardnotes/responses@1.6.29) (2022-05-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.28](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.27...@standardnotes/responses@1.6.28) (2022-05-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.27](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.26...@standardnotes/responses@1.6.27) (2022-05-24)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.26](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.25...@standardnotes/responses@1.6.26) (2022-05-24)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.25](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.24...@standardnotes/responses@1.6.25) (2022-05-22)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.24](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.23...@standardnotes/responses@1.6.24) (2022-05-20)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.23](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.22...@standardnotes/responses@1.6.23) (2022-05-17)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.22](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.21...@standardnotes/responses@1.6.22) (2022-05-17)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.21](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.20...@standardnotes/responses@1.6.21) (2022-05-16)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.20](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.19...@standardnotes/responses@1.6.20) (2022-05-16)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.19](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.18...@standardnotes/responses@1.6.19) (2022-05-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.18](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.17...@standardnotes/responses@1.6.18) (2022-05-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.17](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.16...@standardnotes/responses@1.6.17) (2022-05-05)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.16](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.14...@standardnotes/responses@1.6.16) (2022-05-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.15](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.14...@standardnotes/responses@1.6.15) (2022-05-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.14](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.13...@standardnotes/responses@1.6.14) (2022-05-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.13](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.12...@standardnotes/responses@1.6.13) (2022-05-02)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.12](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.11...@standardnotes/responses@1.6.12) (2022-04-27)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.11](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.10...@standardnotes/responses@1.6.11) (2022-04-25)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.10](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.9...@standardnotes/responses@1.6.10) (2022-04-22)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.9](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.8...@standardnotes/responses@1.6.9) (2022-04-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.8](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.7...@standardnotes/responses@1.6.8) (2022-04-20)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.7](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.6...@standardnotes/responses@1.6.7) (2022-04-20)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.6](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.5...@standardnotes/responses@1.6.6) (2022-04-18)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* make timestamps required in payload construction ([#695](https://github.com/standardnotes/snjs/issues/695)) ([b3326c0](https://github.com/standardnotes/snjs/commit/b3326c0a998cd9d44a76afc377f182885ef48275))
|
||||||
|
|
||||||
|
## [1.6.5](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.4...@standardnotes/responses@1.6.5) (2022-04-15)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.4](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.3...@standardnotes/responses@1.6.4) (2022-04-15)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.3](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.2...@standardnotes/responses@1.6.3) (2022-04-12)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.2](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.1...@standardnotes/responses@1.6.2) (2022-04-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.6.1](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.6.0...@standardnotes/responses@1.6.1) (2022-04-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
# [1.6.0](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.5.1...@standardnotes/responses@1.6.0) (2022-04-01)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* content interfaces and model type strictness ([#685](https://github.com/standardnotes/snjs/issues/685)) ([e2450c5](https://github.com/standardnotes/snjs/commit/e2450c59e8309d7080efaa03905b2abc728d9403))
|
||||||
|
|
||||||
|
## [1.5.1](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.5.0...@standardnotes/responses@1.5.1) (2022-03-31)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
# [1.5.0](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.4.3...@standardnotes/responses@1.5.0) (2022-03-31)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* encryption and models packages ([#679](https://github.com/standardnotes/snjs/issues/679)) ([5e03d48](https://github.com/standardnotes/snjs/commit/5e03d48aba7e3dd266117201139ab869b1f70cc9))
|
||||||
|
|
||||||
|
## [1.4.3](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.4.2...@standardnotes/responses@1.4.3) (2022-03-31)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.4.2](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.4.1...@standardnotes/responses@1.4.2) (2022-03-30)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.4.1](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.4.0...@standardnotes/responses@1.4.1) (2022-03-25)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add uuid and sync error types ([239faaf](https://github.com/standardnotes/snjs/commit/239faaf00be8739c9a0b03f9fdb9dad0705b1019))
|
||||||
|
|
||||||
|
# [1.4.0](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.21...@standardnotes/responses@1.4.0) (2022-03-24)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* handle sync readonly errors ([65c4f52](https://github.com/standardnotes/snjs/commit/65c4f521c31417601cb647a8f9031e914ad4bbc8))
|
||||||
|
|
||||||
|
## [1.3.21](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.20...@standardnotes/responses@1.3.21) (2022-03-23)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.20](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.19...@standardnotes/responses@1.3.20) (2022-03-23)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.19](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.18...@standardnotes/responses@1.3.19) (2022-03-22)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.18](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.17...@standardnotes/responses@1.3.18) (2022-03-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.17](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.16...@standardnotes/responses@1.3.17) (2022-03-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.16](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.15...@standardnotes/responses@1.3.16) (2022-03-21)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.15](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.14...@standardnotes/responses@1.3.15) (2022-03-18)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.14](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.13...@standardnotes/responses@1.3.14) (2022-03-16)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.13](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.11...@standardnotes/responses@1.3.13) (2022-03-16)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.12](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.11...@standardnotes/responses@1.3.12) (2022-03-16)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.11](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.10...@standardnotes/responses@1.3.11) (2022-03-14)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.10](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.9...@standardnotes/responses@1.3.10) (2022-03-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.9](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.8...@standardnotes/responses@1.3.9) (2022-03-11)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add invalid parameters to create valet token response data ([#649](https://github.com/standardnotes/snjs/issues/649)) ([6156f56](https://github.com/standardnotes/snjs/commit/6156f5637abc6f54fa062123ec54ea0c01ce4520))
|
||||||
|
|
||||||
|
## [1.3.8](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.7...@standardnotes/responses@1.3.8) (2022-03-11)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.7](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.6...@standardnotes/responses@1.3.7) (2022-03-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.6](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.5...@standardnotes/responses@1.3.6) (2022-03-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.5](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.4...@standardnotes/responses@1.3.5) (2022-03-10)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.4](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.3...@standardnotes/responses@1.3.4) (2022-03-09)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add missing legacy email field on key params data ([#642](https://github.com/standardnotes/snjs/issues/642)) ([fa43779](https://github.com/standardnotes/snjs/commit/fa4377979730c907c05dbddf68b5215282a19016))
|
||||||
|
|
||||||
|
## [1.3.3](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.2...@standardnotes/responses@1.3.3) (2022-03-09)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.2](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.1...@standardnotes/responses@1.3.2) (2022-03-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.3.1](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.3.0...@standardnotes/responses@1.3.1) (2022-03-08)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
# [1.3.0](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.2.1...@standardnotes/responses@1.3.0) (2022-03-08)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* determine files host dynamically ([#637](https://github.com/standardnotes/snjs/issues/637)) ([8ae8d32](https://github.com/standardnotes/snjs/commit/8ae8d32a2469cc6b5b42bfc68ec63200d6bc49ed))
|
||||||
|
|
||||||
|
## [1.2.1](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.2.0...@standardnotes/responses@1.2.1) (2022-03-07)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
# [1.2.0](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.7...@standardnotes/responses@1.2.0) (2022-03-07)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* integrity service ([#626](https://github.com/standardnotes/snjs/issues/626)) ([c5854fb](https://github.com/standardnotes/snjs/commit/c5854fb912dbe585516eeac3dde73573586c4e67))
|
||||||
|
|
||||||
|
## [1.1.7](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.6...@standardnotes/responses@1.1.7) (2022-03-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.1.6](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.5...@standardnotes/responses@1.1.6) (2022-03-04)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.1.5](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.4...@standardnotes/responses@1.1.5) (2022-03-03)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.1.4](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.3...@standardnotes/responses@1.1.4) (2022-03-01)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.1.3](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.2...@standardnotes/responses@1.1.3) (2022-02-28)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @standardnotes/responses
|
||||||
|
|
||||||
|
## [1.1.2](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.0...@standardnotes/responses@1.1.2) (2022-02-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add pseudo change to get lerna to trigger ([41e6817](https://github.com/standardnotes/snjs/commit/41e6817bbf726b0932cdf16f58622328b9e42803))
|
||||||
|
|
||||||
|
## [1.1.1](https://github.com/standardnotes/snjs/compare/@standardnotes/responses@1.1.0...@standardnotes/responses@1.1.1) (2022-02-28)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* add pseudo change to get lerna to trigger ([41e6817](https://github.com/standardnotes/snjs/commit/41e6817bbf726b0932cdf16f58622328b9e42803))
|
||||||
|
|
||||||
|
# 1.1.0 (2022-02-28)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* extract responses package ([#617](https://github.com/standardnotes/snjs/issues/617)) ([1169747](https://github.com/standardnotes/snjs/commit/11697471052f94b37202df7fb560a79c5d65d573))
|
||||||
11
packages/responses/jest.config.js
Normal file
11
packages/responses/jest.config.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
|
const base = require('../../node_modules/@standardnotes/config/src/jest.json');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
...base,
|
||||||
|
globals: {
|
||||||
|
'ts-jest': {
|
||||||
|
tsconfig: 'tsconfig.json',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
4
packages/responses/linter.tsconfig.json
Normal file
4
packages/responses/linter.tsconfig.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig.json",
|
||||||
|
"exclude": ["dist"]
|
||||||
|
}
|
||||||
39
packages/responses/package.json
Normal file
39
packages/responses/package.json
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "@standardnotes/responses",
|
||||||
|
"version": "1.8.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0 <17.0.0"
|
||||||
|
},
|
||||||
|
"description": "Common http responses used between Standard Notes clients and servers",
|
||||||
|
"main": "dist/index.js",
|
||||||
|
"types": "dist/index.d.ts",
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"license": "AGPL-3.0-or-later",
|
||||||
|
"scripts": {
|
||||||
|
"clean": "rm -fr dist",
|
||||||
|
"prestart": "yarn clean",
|
||||||
|
"start": "tsc -p tsconfig.json --watch",
|
||||||
|
"prebuild": "yarn clean",
|
||||||
|
"build": "tsc -p tsconfig.json",
|
||||||
|
"lint": "eslint . --ext .ts",
|
||||||
|
"test:unit": "jest spec --coverage --passWithNoTests"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/jest": "^27.4.1",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.30.0",
|
||||||
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"jest": "^27.5.1",
|
||||||
|
"ts-jest": "^27.1.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@standardnotes/common": "^1.23.1",
|
||||||
|
"@standardnotes/features": "workspace:*",
|
||||||
|
"@standardnotes/security": "^1.1.0",
|
||||||
|
"reflect-metadata": "^0.1.13"
|
||||||
|
}
|
||||||
|
}
|
||||||
11
packages/responses/src/Domain/Auth/ChangeCredentialsData.ts
Normal file
11
packages/responses/src/Domain/Auth/ChangeCredentialsData.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { AnyKeyParamsContent } from '@standardnotes/common'
|
||||||
|
import { SessionBody } from './SessionBody'
|
||||||
|
import { User } from './User'
|
||||||
|
|
||||||
|
export type ChangeCredentialsData = {
|
||||||
|
session?: SessionBody
|
||||||
|
/** Represents legacy JWT token */
|
||||||
|
token?: string
|
||||||
|
user?: User
|
||||||
|
key_params?: AnyKeyParamsContent
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { ChangeCredentialsData } from './ChangeCredentialsData'
|
||||||
|
|
||||||
|
export type ChangeCredentialsResponse = HttpResponse & {
|
||||||
|
data: ChangeCredentialsData
|
||||||
|
}
|
||||||
17
packages/responses/src/Domain/Auth/KeyParamsData.ts
Normal file
17
packages/responses/src/Domain/Auth/KeyParamsData.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { KeyParamsOrigination, ProtocolVersion } from '@standardnotes/common'
|
||||||
|
|
||||||
|
export type KeyParamsData = {
|
||||||
|
identifier?: string
|
||||||
|
pw_cost?: number
|
||||||
|
pw_nonce?: string
|
||||||
|
version?: ProtocolVersion
|
||||||
|
/** Legacy V002 */
|
||||||
|
pw_salt?: string
|
||||||
|
email?: string
|
||||||
|
/** Legacy V001 */
|
||||||
|
pw_func?: string
|
||||||
|
pw_alg?: string
|
||||||
|
pw_key_size?: number
|
||||||
|
origination?: KeyParamsOrigination
|
||||||
|
created?: string
|
||||||
|
}
|
||||||
6
packages/responses/src/Domain/Auth/KeyParamsResponse.ts
Normal file
6
packages/responses/src/Domain/Auth/KeyParamsResponse.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { KeyParamsData } from './KeyParamsData'
|
||||||
|
|
||||||
|
export type KeyParamsResponse = HttpResponse & {
|
||||||
|
data: KeyParamsData
|
||||||
|
}
|
||||||
9
packages/responses/src/Domain/Auth/RegistrationData.ts
Normal file
9
packages/responses/src/Domain/Auth/RegistrationData.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { SessionBody } from './SessionBody'
|
||||||
|
import { User } from './User'
|
||||||
|
|
||||||
|
export type RegistrationData = {
|
||||||
|
session?: SessionBody
|
||||||
|
/** Represents legacy JWT token */
|
||||||
|
token?: string
|
||||||
|
user?: User
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { RegistrationData } from './RegistrationData'
|
||||||
|
|
||||||
|
export type RegistrationResponse = HttpResponse & {
|
||||||
|
data: RegistrationData
|
||||||
|
}
|
||||||
7
packages/responses/src/Domain/Auth/SessionBody.ts
Normal file
7
packages/responses/src/Domain/Auth/SessionBody.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export type SessionBody = {
|
||||||
|
access_token: string
|
||||||
|
refresh_token: string
|
||||||
|
access_expiration: number
|
||||||
|
refresh_expiration: number
|
||||||
|
readonly_access: boolean
|
||||||
|
}
|
||||||
8
packages/responses/src/Domain/Auth/SessionListEntry.ts
Normal file
8
packages/responses/src/Domain/Auth/SessionListEntry.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
export type SessionListEntry = {
|
||||||
|
uuid: string
|
||||||
|
current: boolean
|
||||||
|
api_version: string
|
||||||
|
created_at: string
|
||||||
|
updated_at: string
|
||||||
|
device_info: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { SessionListEntry } from './SessionListEntry'
|
||||||
|
|
||||||
|
export type SessionListResponse = HttpResponse & { data: SessionListEntry[] }
|
||||||
5
packages/responses/src/Domain/Auth/SessionRenewalData.ts
Normal file
5
packages/responses/src/Domain/Auth/SessionRenewalData.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { SessionBody } from './SessionBody'
|
||||||
|
|
||||||
|
export type SessionRenewalData = {
|
||||||
|
session?: SessionBody
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { SessionRenewalData } from './SessionRenewalData'
|
||||||
|
|
||||||
|
export type SessionRenewalResponse = HttpResponse & {
|
||||||
|
data: SessionRenewalData
|
||||||
|
}
|
||||||
11
packages/responses/src/Domain/Auth/SignInData.ts
Normal file
11
packages/responses/src/Domain/Auth/SignInData.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { AnyKeyParamsContent } from '@standardnotes/common'
|
||||||
|
import { SessionBody } from './SessionBody'
|
||||||
|
import { User } from './User'
|
||||||
|
|
||||||
|
export type SignInData = {
|
||||||
|
session?: SessionBody
|
||||||
|
/** Represents legacy JWT token */
|
||||||
|
token?: string
|
||||||
|
user?: User
|
||||||
|
key_params?: AnyKeyParamsContent
|
||||||
|
}
|
||||||
6
packages/responses/src/Domain/Auth/SignInResponse.ts
Normal file
6
packages/responses/src/Domain/Auth/SignInResponse.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { SignInData } from './SignInData'
|
||||||
|
|
||||||
|
export type SignInResponse = HttpResponse & {
|
||||||
|
data: SignInData
|
||||||
|
}
|
||||||
3
packages/responses/src/Domain/Auth/SignOutResponse.ts
Normal file
3
packages/responses/src/Domain/Auth/SignOutResponse.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
|
||||||
|
export type SignOutResponse = HttpResponse & Record<string, unknown>
|
||||||
4
packages/responses/src/Domain/Auth/User.ts
Normal file
4
packages/responses/src/Domain/Auth/User.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export type User = {
|
||||||
|
uuid: string
|
||||||
|
email: string
|
||||||
|
}
|
||||||
11
packages/responses/src/Domain/Error/ClientError.ts
Normal file
11
packages/responses/src/Domain/Error/ClientError.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { Error } from '../Http/Error'
|
||||||
|
|
||||||
|
export class ClientDisplayableError {
|
||||||
|
constructor(public text: string, public title?: string, public tag?: string) {
|
||||||
|
console.error('Client Displayable Error:', text, title || '', tag || '')
|
||||||
|
}
|
||||||
|
|
||||||
|
static FromError(error: Error) {
|
||||||
|
return new ClientDisplayableError(error.message, undefined, error.tag)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type CloseUploadSessionResponse = MinimalHttpResponse & {
|
||||||
|
success: boolean
|
||||||
|
message: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export type CreateValetTokenPayload = {
|
||||||
|
operation: 'read' | 'write' | 'delete'
|
||||||
|
resources: Array<{
|
||||||
|
remoteIdentifier: string
|
||||||
|
unencryptedFileSize?: number
|
||||||
|
}>
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
import { CreateValetTokenResponseData } from './CreateValetTokenResponseData'
|
||||||
|
|
||||||
|
export type CreateValetTokenResponse = MinimalHttpResponse & {
|
||||||
|
data: CreateValetTokenResponseData
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export type CreateValetTokenResponseData =
|
||||||
|
| {
|
||||||
|
success: true
|
||||||
|
valetToken: string
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
success: false
|
||||||
|
reason: 'no-subscription' | 'expired-subscription' | 'invalid-parameters'
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type DownloadFileChunkResponse = MinimalHttpResponse & {
|
||||||
|
data: ArrayBuffer
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type StartUploadSessionResponse = MinimalHttpResponse & {
|
||||||
|
success: boolean
|
||||||
|
uploadId: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type UploadFileChunkResponse = MinimalHttpResponse & {
|
||||||
|
success: boolean
|
||||||
|
}
|
||||||
10
packages/responses/src/Domain/Http/Error.ts
Normal file
10
packages/responses/src/Domain/Http/Error.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export type Error = {
|
||||||
|
message: string
|
||||||
|
status: number
|
||||||
|
tag?: string
|
||||||
|
/** In the case of MFA required responses,
|
||||||
|
* the required prompt is returned as part of the error */
|
||||||
|
payload?: {
|
||||||
|
mfa_key?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
6
packages/responses/src/Domain/Http/Functions.ts
Normal file
6
packages/responses/src/Domain/Http/Functions.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from './HttpResponse'
|
||||||
|
import { StatusCode } from './StatusCode'
|
||||||
|
|
||||||
|
export function isErrorResponseExpiredToken(errorResponse: HttpResponse): boolean {
|
||||||
|
return errorResponse.status === StatusCode.HttpStatusExpiredAccessToken
|
||||||
|
}
|
||||||
13
packages/responses/src/Domain/Http/HttpResponse.ts
Normal file
13
packages/responses/src/Domain/Http/HttpResponse.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { StatusCode } from './StatusCode'
|
||||||
|
import { Error } from './Error'
|
||||||
|
import { ResponseMeta } from './ResponseMeta'
|
||||||
|
|
||||||
|
export type HttpResponse = {
|
||||||
|
status?: StatusCode
|
||||||
|
error?: Error
|
||||||
|
data?: {
|
||||||
|
error?: Error
|
||||||
|
}
|
||||||
|
meta?: ResponseMeta
|
||||||
|
headers?: Map<string, string | null>
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { StatusCode } from './StatusCode'
|
||||||
|
import { Error } from './Error'
|
||||||
|
|
||||||
|
export type MinimalHttpResponse = {
|
||||||
|
status?: StatusCode
|
||||||
|
error?: Error
|
||||||
|
headers?: Map<string, string | null>
|
||||||
|
}
|
||||||
12
packages/responses/src/Domain/Http/ResponseMeta.ts
Normal file
12
packages/responses/src/Domain/Http/ResponseMeta.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Role } from '@standardnotes/security'
|
||||||
|
import { Uuid } from '@standardnotes/common'
|
||||||
|
|
||||||
|
export type ResponseMeta = {
|
||||||
|
auth: {
|
||||||
|
userUuid?: Uuid
|
||||||
|
roles?: Role[]
|
||||||
|
}
|
||||||
|
server: {
|
||||||
|
filesServerUrl?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
16
packages/responses/src/Domain/Http/StatusCode.ts
Normal file
16
packages/responses/src/Domain/Http/StatusCode.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
export enum StatusCode {
|
||||||
|
LocalValidationError = 10,
|
||||||
|
CanceledMfa = 11,
|
||||||
|
UnknownError = 12,
|
||||||
|
|
||||||
|
HttpStatusMinSuccess = 200,
|
||||||
|
HttpStatusNoContent = 204,
|
||||||
|
HttpStatusMaxSuccess = 299,
|
||||||
|
/** The session's access token is expired, but the refresh token is valid */
|
||||||
|
HttpStatusExpiredAccessToken = 498,
|
||||||
|
/** The session's access token and refresh token are expired, user must reauthenticate */
|
||||||
|
HttpStatusInvalidSession = 401,
|
||||||
|
/** User's IP is rate-limited. */
|
||||||
|
HttpStatusForbidden = 403,
|
||||||
|
HttpBadRequest = 400,
|
||||||
|
}
|
||||||
7
packages/responses/src/Domain/Item/ApiEndpointParam.ts
Normal file
7
packages/responses/src/Domain/Item/ApiEndpointParam.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export enum ApiEndpointParam {
|
||||||
|
LastSyncToken = 'sync_token',
|
||||||
|
PaginationToken = 'cursor_token',
|
||||||
|
SyncDlLimit = 'limit',
|
||||||
|
SyncPayloads = 'items',
|
||||||
|
ApiVersion = 'api',
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
import { IntegrityPayload } from './IntegrityPayload'
|
||||||
|
|
||||||
|
export type CheckIntegrityResponse = MinimalHttpResponse & {
|
||||||
|
data: {
|
||||||
|
mismatches: IntegrityPayload[]
|
||||||
|
}
|
||||||
|
}
|
||||||
11
packages/responses/src/Domain/Item/ConflictParams.ts
Normal file
11
packages/responses/src/Domain/Item/ConflictParams.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { ConflictType } from './ConflictType'
|
||||||
|
import { ServerItemResponse } from './ServerItemResponse'
|
||||||
|
|
||||||
|
export type ConflictParams = {
|
||||||
|
type: ConflictType
|
||||||
|
server_item?: ServerItemResponse
|
||||||
|
unsaved_item?: ServerItemResponse
|
||||||
|
|
||||||
|
/** @legacay */
|
||||||
|
item?: ServerItemResponse
|
||||||
|
}
|
||||||
9
packages/responses/src/Domain/Item/ConflictType.ts
Normal file
9
packages/responses/src/Domain/Item/ConflictType.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export enum ConflictType {
|
||||||
|
ConflictingData = 'sync_conflict',
|
||||||
|
UuidConflict = 'uuid_conflict',
|
||||||
|
ContentTypeError = 'content_type_error',
|
||||||
|
ContentError = 'content_error',
|
||||||
|
ReadOnlyError = 'readonly_error',
|
||||||
|
UuidError = 'uuid_error',
|
||||||
|
SyncError = 'sync_error',
|
||||||
|
}
|
||||||
14
packages/responses/src/Domain/Item/GetSingleItemResponse.ts
Normal file
14
packages/responses/src/Domain/Item/GetSingleItemResponse.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
import { ServerItemResponse } from './ServerItemResponse'
|
||||||
|
|
||||||
|
export type GetSingleItemResponse = MinimalHttpResponse & {
|
||||||
|
data:
|
||||||
|
| {
|
||||||
|
success: true
|
||||||
|
item: ServerItemResponse
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
success: false
|
||||||
|
message: string
|
||||||
|
}
|
||||||
|
}
|
||||||
6
packages/responses/src/Domain/Item/IntegrityPayload.ts
Normal file
6
packages/responses/src/Domain/Item/IntegrityPayload.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { MicrosecondsTimestamp, Uuid } from '@standardnotes/common'
|
||||||
|
|
||||||
|
export type IntegrityPayload = {
|
||||||
|
uuid: Uuid
|
||||||
|
updated_at_timestamp: MicrosecondsTimestamp
|
||||||
|
}
|
||||||
14
packages/responses/src/Domain/Item/RawSyncData.ts
Normal file
14
packages/responses/src/Domain/Item/RawSyncData.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { ApiEndpointParam } from './ApiEndpointParam'
|
||||||
|
import { ConflictParams } from './ConflictParams'
|
||||||
|
import { ServerItemResponse } from './ServerItemResponse'
|
||||||
|
|
||||||
|
export type RawSyncData = {
|
||||||
|
error?: unknown
|
||||||
|
[ApiEndpointParam.LastSyncToken]?: string
|
||||||
|
[ApiEndpointParam.PaginationToken]?: string
|
||||||
|
retrieved_items?: ServerItemResponse[]
|
||||||
|
saved_items?: ServerItemResponse[]
|
||||||
|
conflicts?: ConflictParams[]
|
||||||
|
unsaved?: ConflictParams[]
|
||||||
|
status?: number
|
||||||
|
}
|
||||||
4
packages/responses/src/Domain/Item/RawSyncResponse.ts
Normal file
4
packages/responses/src/Domain/Item/RawSyncResponse.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { RawSyncData } from './RawSyncData'
|
||||||
|
|
||||||
|
export type RawSyncResponse = HttpResponse & { data: RawSyncData }
|
||||||
10
packages/responses/src/Domain/Item/RevisionListEntry.ts
Normal file
10
packages/responses/src/Domain/Item/RevisionListEntry.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { RoleName } from '@standardnotes/common'
|
||||||
|
|
||||||
|
export type RevisionListEntry = {
|
||||||
|
content_type: string
|
||||||
|
created_at: string
|
||||||
|
updated_at: string
|
||||||
|
/** The uuid of the revision */
|
||||||
|
uuid: string
|
||||||
|
required_role: RoleName
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { RevisionListEntry } from './RevisionListEntry'
|
||||||
|
|
||||||
|
export type RevisionListResponse = HttpResponse & { data: RevisionListEntry[] }
|
||||||
15
packages/responses/src/Domain/Item/ServerItemResponse.ts
Normal file
15
packages/responses/src/Domain/Item/ServerItemResponse.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { ContentType, Uuid } from '@standardnotes/common'
|
||||||
|
|
||||||
|
export interface ServerItemResponse {
|
||||||
|
content_type: ContentType
|
||||||
|
content: string | undefined
|
||||||
|
created_at_timestamp: number
|
||||||
|
created_at: Date
|
||||||
|
deleted: boolean
|
||||||
|
duplicate_of?: Uuid
|
||||||
|
enc_item_key: string
|
||||||
|
items_key_id?: string
|
||||||
|
updated_at_timestamp: number
|
||||||
|
updated_at: Date
|
||||||
|
uuid: string
|
||||||
|
}
|
||||||
15
packages/responses/src/Domain/Item/SingleRevision.ts
Normal file
15
packages/responses/src/Domain/Item/SingleRevision.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { ContentType, Uuid } from '@standardnotes/common'
|
||||||
|
|
||||||
|
export type SingleRevision = {
|
||||||
|
auth_hash?: string
|
||||||
|
content_type: ContentType
|
||||||
|
content: string
|
||||||
|
created_at: string
|
||||||
|
enc_item_key: string
|
||||||
|
/** The uuid of the item this revision was created with */
|
||||||
|
item_uuid: string
|
||||||
|
items_key_id: string
|
||||||
|
updated_at: string
|
||||||
|
/** The uuid of the revision */
|
||||||
|
uuid: Uuid
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { SingleRevision } from './SingleRevision'
|
||||||
|
|
||||||
|
export type SingleRevisionResponse = HttpResponse & {
|
||||||
|
data: SingleRevision
|
||||||
|
}
|
||||||
13
packages/responses/src/Domain/Listed/ActionResponse.ts
Normal file
13
packages/responses/src/Domain/Listed/ActionResponse.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { AnyKeyParamsContent, ContentType } from '@standardnotes/common'
|
||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { ServerItemResponse } from '../Item/ServerItemResponse'
|
||||||
|
|
||||||
|
export type ActionResponse = HttpResponse & {
|
||||||
|
description: string
|
||||||
|
supported_types: ContentType[]
|
||||||
|
deprecation?: string
|
||||||
|
actions: unknown[]
|
||||||
|
item?: ServerItemResponse
|
||||||
|
keyParams?: AnyKeyParamsContent
|
||||||
|
auth_params?: AnyKeyParamsContent
|
||||||
|
}
|
||||||
5
packages/responses/src/Domain/Listed/ListedAccount.ts
Normal file
5
packages/responses/src/Domain/Listed/ListedAccount.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export type ListedAccount = {
|
||||||
|
secret: string
|
||||||
|
authorId: string
|
||||||
|
hostUrl: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { ActionResponse } from './ActionResponse'
|
||||||
|
|
||||||
|
export type ListedAccountInfo = ActionResponse & {
|
||||||
|
display_name: string
|
||||||
|
author_url: string
|
||||||
|
settings_url: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { ListedAccountInfo } from './ListedAccountInfo'
|
||||||
|
|
||||||
|
export type ListedAccountInfoResponse = HttpResponse & {
|
||||||
|
data: ListedAccountInfo
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type ListedRegistrationResponse = MinimalHttpResponse & {
|
||||||
|
data?: unknown
|
||||||
|
}
|
||||||
13
packages/responses/src/Domain/User/AvailableSubscriptions.ts
Normal file
13
packages/responses/src/Domain/User/AvailableSubscriptions.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { FeatureDescription } from '@standardnotes/features'
|
||||||
|
import { SubscriptionName } from '@standardnotes/common'
|
||||||
|
|
||||||
|
export type AvailableSubscriptions = {
|
||||||
|
[key in SubscriptionName]: {
|
||||||
|
name: string
|
||||||
|
pricing: {
|
||||||
|
price: number
|
||||||
|
period: string
|
||||||
|
}[]
|
||||||
|
features: FeatureDescription[]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type DeleteSettingResponse = MinimalHttpResponse
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
import { AvailableSubscriptions } from './AvailableSubscriptions'
|
||||||
|
|
||||||
|
export type GetAvailableSubscriptionsResponse = MinimalHttpResponse & {
|
||||||
|
data?: AvailableSubscriptions
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { FeatureDescription } from '@standardnotes/features'
|
||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type GetOfflineFeaturesResponse = MinimalHttpResponse & {
|
||||||
|
data?: {
|
||||||
|
features: FeatureDescription[]
|
||||||
|
}
|
||||||
|
}
|
||||||
9
packages/responses/src/Domain/User/GetSettingResponse.ts
Normal file
9
packages/responses/src/Domain/User/GetSettingResponse.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
import { SettingData } from './SettingData'
|
||||||
|
|
||||||
|
export type GetSettingResponse = MinimalHttpResponse & {
|
||||||
|
data?: {
|
||||||
|
success?: boolean
|
||||||
|
setting?: SettingData
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { Subscription } from '@standardnotes/security'
|
||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type GetSubscriptionResponse = MinimalHttpResponse & {
|
||||||
|
data?: {
|
||||||
|
subscription?: Subscription
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
import { SettingData } from './SettingData'
|
||||||
|
|
||||||
|
export type ListSettingsResponse = MinimalHttpResponse & {
|
||||||
|
data?: {
|
||||||
|
settings?: SettingData[]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type PostSubscriptionTokensResponse = MinimalHttpResponse & {
|
||||||
|
data?: {
|
||||||
|
token: string
|
||||||
|
}
|
||||||
|
}
|
||||||
6
packages/responses/src/Domain/User/SettingData.ts
Normal file
6
packages/responses/src/Domain/User/SettingData.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export type SettingData = {
|
||||||
|
uuid: string
|
||||||
|
name: string
|
||||||
|
value: string
|
||||||
|
sensitive?: boolean
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
|
||||||
|
|
||||||
|
export type UpdateSettingResponse = MinimalHttpResponse
|
||||||
5
packages/responses/src/Domain/User/UserFeaturesData.ts
Normal file
5
packages/responses/src/Domain/User/UserFeaturesData.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import { FeatureDescription } from '@standardnotes/features'
|
||||||
|
|
||||||
|
export type UserFeaturesData = {
|
||||||
|
features: FeatureDescription[]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { HttpResponse } from '../Http/HttpResponse'
|
||||||
|
import { UserFeaturesData } from './UserFeaturesData'
|
||||||
|
|
||||||
|
export type UserFeaturesResponse = HttpResponse & {
|
||||||
|
data: UserFeaturesData
|
||||||
|
}
|
||||||
59
packages/responses/src/Domain/index.ts
Normal file
59
packages/responses/src/Domain/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
export * from './Auth/ChangeCredentialsData'
|
||||||
|
export * from './Auth/ChangeCredentialsResponse'
|
||||||
|
export * from './Auth/KeyParamsData'
|
||||||
|
export * from './Auth/KeyParamsResponse'
|
||||||
|
export * from './Auth/RegistrationData'
|
||||||
|
export * from './Auth/RegistrationResponse'
|
||||||
|
export * from './Auth/SessionBody'
|
||||||
|
export * from './Auth/SessionListEntry'
|
||||||
|
export * from './Auth/SessionListResponse'
|
||||||
|
export * from './Auth/SessionRenewalData'
|
||||||
|
export * from './Auth/SessionRenewalResponse'
|
||||||
|
export * from './Auth/SignInData'
|
||||||
|
export * from './Auth/SignInResponse'
|
||||||
|
export * from './Auth/SignOutResponse'
|
||||||
|
export * from './Auth/User'
|
||||||
|
export * from './Error/ClientError'
|
||||||
|
export * from './Files/CloseUploadSessionResponse'
|
||||||
|
export * from './Files/CreateValetTokenPayload'
|
||||||
|
export * from './Files/CreateValetTokenResponse'
|
||||||
|
export * from './Files/CreateValetTokenResponseData'
|
||||||
|
export * from './Files/DownloadFileChunkResponse'
|
||||||
|
export * from './Files/StartUploadSessionResponse'
|
||||||
|
export * from './Files/UploadFileChunkResponse'
|
||||||
|
export * from './Http/Error'
|
||||||
|
export * from './Http/Functions'
|
||||||
|
export * from './Http/HttpResponse'
|
||||||
|
export * from './Http/MinimalHttpResponses'
|
||||||
|
export * from './Http/ResponseMeta'
|
||||||
|
export * from './Http/StatusCode'
|
||||||
|
export * from './Item/ApiEndpointParam'
|
||||||
|
export * from './Item/CheckIntegrityResponse'
|
||||||
|
export * from './Item/ConflictParams'
|
||||||
|
export * from './Item/ConflictType'
|
||||||
|
export * from './Item/GetSingleItemResponse'
|
||||||
|
export * from './Item/RawSyncData'
|
||||||
|
export * from './Item/RawSyncResponse'
|
||||||
|
export * from './Item/RevisionListEntry'
|
||||||
|
export * from './Item/RevisionListResponse'
|
||||||
|
export * from './Item/ServerItemResponse'
|
||||||
|
export * from './Item/SingleRevision'
|
||||||
|
export * from './Item/SingleRevisionResponse'
|
||||||
|
export * from './Item/IntegrityPayload'
|
||||||
|
export * from './Listed/ActionResponse'
|
||||||
|
export * from './Listed/ListedAccount'
|
||||||
|
export * from './Listed/ListedAccountInfo'
|
||||||
|
export * from './Listed/ListedAccountInfoResponse'
|
||||||
|
export * from './Listed/ListedRegistrationResponse'
|
||||||
|
export * from './User/AvailableSubscriptions'
|
||||||
|
export * from './User/DeleteSettingResponse'
|
||||||
|
export * from './User/GetAvailableSubscriptionsResponse'
|
||||||
|
export * from './User/GetOfflineFeaturesResponse'
|
||||||
|
export * from './User/GetSettingResponse'
|
||||||
|
export * from './User/GetSubscriptionResponse'
|
||||||
|
export * from './User/ListSettingsResponse'
|
||||||
|
export * from './User/PostSubscriptionTokensResponse'
|
||||||
|
export * from './User/SettingData'
|
||||||
|
export * from './User/UpdateSettingResponse'
|
||||||
|
export * from './User/UserFeaturesData'
|
||||||
|
export * from './User/UserFeaturesResponse'
|
||||||
1
packages/responses/src/index.ts
Normal file
1
packages/responses/src/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './Domain'
|
||||||
13
packages/responses/tsconfig.json
Normal file
13
packages/responses/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../node_modules/@standardnotes/config/src/tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"rootDir": "./src",
|
||||||
|
"outDir": "./dist",
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src/**/*"
|
||||||
|
],
|
||||||
|
"references": [],
|
||||||
|
"exclude": ["**/*.spec.ts", "dist", "node_modules"]
|
||||||
|
}
|
||||||
21
yarn.lock
21
yarn.lock
@@ -7038,16 +7038,21 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@standardnotes/responses@npm:^1.6.39":
|
"@standardnotes/responses@^1.6.39, @standardnotes/responses@workspace:packages/responses":
|
||||||
version: 1.6.39
|
version: 0.0.0-use.local
|
||||||
resolution: "@standardnotes/responses@npm:1.6.39"
|
resolution: "@standardnotes/responses@workspace:packages/responses"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@standardnotes/auth": ^3.19.4
|
|
||||||
"@standardnotes/common": ^1.23.1
|
"@standardnotes/common": ^1.23.1
|
||||||
"@standardnotes/features": ^1.47.0
|
"@standardnotes/features": "workspace:*"
|
||||||
checksum: 0ea1d4d5b88f51e6b1b0b6d1ba3b0226f53969ed2be2985b4d2e42914a2ba29121be950f9fccfc590778a7765dcb729eeea75f10cf35237e15d46e4413b83672
|
"@standardnotes/security": ^1.1.0
|
||||||
languageName: node
|
"@types/jest": ^27.4.1
|
||||||
linkType: hard
|
"@typescript-eslint/eslint-plugin": ^5.30.0
|
||||||
|
eslint-plugin-prettier: ^4.2.1
|
||||||
|
jest: ^27.5.1
|
||||||
|
reflect-metadata: ^0.1.13
|
||||||
|
ts-jest: ^27.1.3
|
||||||
|
languageName: unknown
|
||||||
|
linkType: soft
|
||||||
|
|
||||||
"@standardnotes/rich-text@workspace:packages/components/src/Packages/Editors/org.standardnotes.plus-editor":
|
"@standardnotes/rich-text@workspace:packages/components/src/Packages/Editors/org.standardnotes.plus-editor":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
|
|||||||
Reference in New Issue
Block a user