Compare commits

...
Author SHA1 Message Date
StandardNotes CI 39fdac270e chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
2022-09-13 13:11:32 +00:00
Karol Sójko 66d364ff36 feat(features): add subscription sharing 2022-09-13 14:32:22 +02:00
StandardNotes CI 27b7f4e597 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
2022-09-13 08:58:14 +00:00
StandardNotes CI 8d04c2fb55 chore(release): components 2022-09-13 08:57:59 +00:00
Karol Sójko 55b1409a80 feat: add subscription manager to handle subscription sharing (#1517)
* feat: add subscription manager to handle subscription sharing

* fix(services): add missing methods to the interface

* fix(services): add subscription manager specs

* feat(snjs): add subscriptions e2e tests

* fix(snjs): add wait in subscription cancelling test

* fix(snjs): checking for canceled invitations in tests

* fix(snjs): add e2e test for restored limit of subscription invitations

* chore(lint): fix linter issues
2022-09-13 10:28:11 +02:00
StandardNotes CI 2b830c0fae chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
2022-09-12 16:52:03 +00:00
Aman Harwara 39d0ee9181 feat: update mobile design (#1526) 2022-09-12 21:48:47 +05:30
StandardNotes CI 9fa093280d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-12 09:41:53 +00:00
Vardan Hakobyan 73ef93c1db fix: ability to open a new tab on iOS Safari (#1516)
* fix: ability to open a new tab on iOS Safari

* chore: fix `https deprecation` warning

* chore: better variable naming
2022-09-12 13:11:48 +04:00
StandardNotes CI 5d39934e47 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-09 08:32:54 +00:00
Aman Harwara 320fc3fd96 feat(mobile): add setting to always open web view on launch (#1500) 2022-09-09 13:32:23 +05:30
StandardNotes CI e2715709d4 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-09 07:19:45 +00:00
Aman Harwara 1efc352da5 fix: note/file list item longpress on iOS (#1506) 2022-09-09 12:16:15 +05:30
StandardNotes CI 1f27f0f790 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-08 20:13:43 +00:00
Vardan Hakobyan 461ebc2768 fix: let Android to correctly recognize the NativeMobileWeb environment when opening WebView on Android (#1503) 2022-09-09 01:15:32 +05:30
StandardNotes CI 1d93210f81 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-08 16:30:09 +00:00
Aman Harwara 91d5980a7e fix(web): autolock option style when selected (#1501) 2022-09-08 21:29:50 +05:30
StandardNotes CI 8ea069cf5c chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-08 14:12:55 +00:00
Aman Harwara 9267e580b5 fix: note panel resizing (#1497) 2022-09-08 18:26:47 +05:30
StandardNotes CI 17131f7d67 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-07 13:06:48 +00:00
Aman Harwara ecd870cdaa fix: file preview & selected items panel size on mobile (#1492) 2022-09-07 18:02:37 +05:30
Aman Harwara 4617afe14e fix: footer and prefs dropdown cutoff by screen on some phones (#1491) 2022-09-07 17:36:49 +05:30
StandardNotes CI f21269fc69 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-07 07:11:27 +00:00
StandardNotes CI 3afbce385b chore(release): components 2022-09-07 07:11:13 +00:00
Aman Harwara 0e86b13a8f fix: add min-height to task textarea (#1490) 2022-09-07 12:09:53 +05:30
StandardNotes CI 9719c6fcac chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected].6
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
2022-09-01 09:10:28 +00:00
Karol Sójko 8792771d27 fix(encryption): make package public for resolution on @standardnotes/api package 2022-09-01 10:42:18 +02:00
121 changed files with 1334 additions and 399 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -29,6 +29,7 @@
"build:mobile": "yarn workspaces foreach -pt --verbose -R --from @standardnotes/mobile --exclude @standardnotes/components-meta run build",
"build:snjs": "yarn workspaces foreach -pt --verbose -R --from @standardnotes/snjs --exclude @standardnotes/components-meta run build",
"build:services": "yarn workspaces foreach -pt --verbose -R --from @standardnotes/services --exclude @standardnotes/components-meta run build",
"build:api": "yarn workspaces foreach -pt --verbose -R --from @standardnotes/api --exclude @standardnotes/components-meta run build",
"start:server:web": "lerna run start --scope=@standardnotes/web",
"start:server:e2e": "lerna run start:test-server --scope=@standardnotes/snjs",
"prepare": "husky install",
+18
View File
@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.7.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/api
# [1.7.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.6.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/api
## [1.6.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/api
# [1.6.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
### Features
+2 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.6.0",
"version": "1.7.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -35,12 +35,11 @@
"ts-jest": "^28.0.5"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/security": "^1.1.0",
"@standardnotes/services": "workspace:*",
"@standardnotes/utils": "workspace:*",
"reflect-metadata": "^0.1.13"
}
@@ -1,4 +1,5 @@
import { Environment } from '@standardnotes/services'
import { Environment } from '@standardnotes/models'
import { HttpResponseMeta } from './HttpResponseMeta'
import { HttpService } from './HttpService'
@@ -24,4 +25,14 @@ describe('HttpService', () => {
expect(service['host']).toEqual('http://foo')
})
it('should set and use the authorization token', () => {
const service = createService()
expect(service['authorizationToken']).toBeUndefined()
service.setAuthorizationToken('foo-bar')
expect(service['authorizationToken']).toEqual('foo-bar')
})
})
+37 -6
View File
@@ -1,5 +1,5 @@
import { isString, joinPaths } from '@standardnotes/utils'
import { Environment } from '@standardnotes/services'
import { Environment } from '@standardnotes/models'
import { HttpRequestParams } from './HttpRequestParams'
import { HttpVerb } from './HttpVerb'
import { HttpRequest } from './HttpRequest'
@@ -12,6 +12,8 @@ import { HttpResponseMeta } from './HttpResponseMeta'
import { HttpErrorResponseBody } from './HttpErrorResponseBody'
export class HttpService implements HttpServiceInterface {
private authorizationToken?: string
constructor(
private environment: Environment,
private appVersion: string,
@@ -20,28 +22,57 @@ export class HttpService implements HttpServiceInterface {
private updateMetaCallback: (meta: HttpResponseMeta) => void,
) {}
setAuthorizationToken(authorizationToken: string): void {
this.authorizationToken = authorizationToken
}
setHost(host: string): void {
this.host = host
}
async get(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse> {
return this.runHttp({ url: joinPaths(this.host, path), params, verb: HttpVerb.Get, authentication })
return this.runHttp({
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Get,
authentication: authentication ?? this.authorizationToken,
})
}
async post(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse> {
return this.runHttp({ url: joinPaths(this.host, path), params, verb: HttpVerb.Post, authentication })
return this.runHttp({
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Post,
authentication: authentication ?? this.authorizationToken,
})
}
async put(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse> {
return this.runHttp({ url: joinPaths(this.host, path), params, verb: HttpVerb.Put, authentication })
return this.runHttp({
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Put,
authentication: authentication ?? this.authorizationToken,
})
}
async patch(path: string, params: HttpRequestParams, authentication?: string): Promise<HttpResponse> {
return this.runHttp({ url: joinPaths(this.host, path), params, verb: HttpVerb.Patch, authentication })
return this.runHttp({
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Patch,
authentication: authentication ?? this.authorizationToken,
})
}
async delete(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse> {
return this.runHttp({ url: joinPaths(this.host, path), params, verb: HttpVerb.Delete, authentication })
return this.runHttp({
url: joinPaths(this.host, path),
params,
verb: HttpVerb.Delete,
authentication: authentication ?? this.authorizationToken,
})
}
private async runHttp(httpRequest: HttpRequest): Promise<HttpResponse> {
@@ -3,6 +3,7 @@ import { HttpResponse } from './HttpResponse'
export interface HttpServiceInterface {
setHost(host: string): void
setAuthorizationToken(authorizationToken: string): void
get(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse>
post(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse>
put(path: string, params?: HttpRequestParams, authentication?: string): Promise<HttpResponse>
@@ -1,7 +1,9 @@
import { Either } from '@standardnotes/common'
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteAcceptResponseBody } from './SubscriptionInviteAcceptResponseBody'
export interface SubscriptionInviteAcceptResponse extends HttpResponse {
data: SubscriptionInviteAcceptResponseBody | HttpErrorResponseBody
data: Either<SubscriptionInviteAcceptResponseBody, HttpErrorResponseBody>
}
@@ -1,7 +1,9 @@
import { Either } from '@standardnotes/common'
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteCancelResponseBody } from './SubscriptionInviteCancelResponseBody'
export interface SubscriptionInviteCancelResponse extends HttpResponse {
data: SubscriptionInviteCancelResponseBody | HttpErrorResponseBody
data: Either<SubscriptionInviteCancelResponseBody, HttpErrorResponseBody>
}
@@ -1,7 +1,9 @@
import { Either } from '@standardnotes/common'
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteDeclineResponseBody } from './SubscriptionInviteDeclineResponseBody'
export interface SubscriptionInviteDeclineResponse extends HttpResponse {
data: SubscriptionInviteDeclineResponseBody | HttpErrorResponseBody
data: Either<SubscriptionInviteDeclineResponseBody, HttpErrorResponseBody>
}
@@ -1,7 +1,9 @@
import { Either } from '@standardnotes/common'
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteListResponseBody } from './SubscriptionInviteListResponseBody'
export interface SubscriptionInviteListResponse extends HttpResponse {
data: SubscriptionInviteListResponseBody | HttpErrorResponseBody
data: Either<SubscriptionInviteListResponseBody, HttpErrorResponseBody>
}
@@ -1,7 +1,9 @@
import { Either } from '@standardnotes/common'
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteResponseBody } from './SubscriptionInviteResponseBody'
export interface SubscriptionInviteResponse extends HttpResponse {
data: SubscriptionInviteResponseBody | HttpErrorResponseBody
data: Either<SubscriptionInviteResponseBody, HttpErrorResponseBody>
}
+2 -1
View File
@@ -1,3 +1,4 @@
export * from './User/Paths'
export * from './Subscription/SubscriptionServer'
export * from './Subscription/SubscriptionServerInterface'
export * from './User/UserServer'
export * from './User/UserServerInterface'
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.7.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/components-meta
## [2.7.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/components-meta
## [2.7.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
### Bug Fixes
* add min-height to task textarea ([#1490](https://github.com/standardnotes/app/issues/1490)) ([0e86b13](https://github.com/standardnotes/app/commit/0e86b13a8f3b11ed99cdc49b3a44665396bfca98))
## [2.7.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/components-meta
File diff suppressed because one or more lines are too long
+6 -6
View File
@@ -75,9 +75,9 @@
"binary": "c4479f8768f5f6cda41850212a8e03927990adfa33ebd36e29ee6de2335e8e46"
},
"org.standardnotes.simple-task-editor": {
"version": "1.4.3",
"base64": "5e8f767ac00d5a5af9b3650e56230a2446db4656515fb88ee5293da989b0f172",
"binary": "7c6f499b8107f80ec5fd84e591c2c33291d1fc6db85f098df4f8308a0cda901d"
"version": "1.4.4",
"base64": "4beb1432ffbe1ad40ba7446953cc3b97493a044e6cf095897f6381b6fbfe6f94",
"binary": "9df983a144b9686f4f58b03bf78bf1f84f53aea60251621a75586722bf576475"
},
"org.standardnotes.token-vault": {
"version": "2.2.4",
@@ -90,9 +90,9 @@
"binary": "54a01414a21e46c67fa59c69189a3d34a6548de7539699f2cf0248f9c5059d37"
},
"org.standardnotes.advanced-checklist": {
"version": "0.2.4",
"base64": "eaa8225677b18448cf6e8191cbf8a23c012590054d60434730cad20fd5b056f0",
"binary": "22db0aba7937234f8e0617a508a46de6a517c3e34be7deee87bc80533065f36c"
"version": "0.2.5",
"base64": "077a56ef75958105bc9dc16376bcea2e89aee57b512b43f9e1b33e1d32ea8358",
"binary": "e903a5c592bd03ca28d205d09dcbc7e4329c7cd57fb74b4e0e5fa724c2321a61"
},
"org.standardnotes.file-safe": {
"version": "2.0.16",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/components-meta",
"version": "2.7.9",
"version": "2.7.12",
"private": true,
"author": "Standard Notes.",
"main": "dist",
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.2.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/advanced-checklist
## [0.2.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/advanced-checklist
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/advanced-checklist",
"version": "0.2.4",
"version": "0.2.5",
"description": "A task editor with grouping functionality.",
"author": "Standard Notes.",
"keywords": [
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
### Bug Fixes
* add min-height to task textarea ([#1490](https://github.com/standardnotes/app/issues/1490)) ([0e86b13](https://github.com/standardnotes/app/commit/0e86b13a8f3b11ed99cdc49b3a44665396bfca98))
## [1.4.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-14)
### Bug Fixes
@@ -116,6 +116,7 @@ body {
resize: none;
overflow: hidden;
background-color: transparent;
min-height: 22px;
}
}
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/simple-task-editor",
"private": true,
"version": "1.4.3",
"version": "1.4.4",
"main": "dist/dist.js",
"scripts": {
"components:compile": "webpack --config webpack.prod.js",
+44
View File
@@ -3,6 +3,50 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.23.117](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.116](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.115](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.114](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.113](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.112](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.111](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.110](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.109](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.108](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.107](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.106](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/desktop
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.23.106",
"version": "3.23.117",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.15.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/encryption
# [1.15.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.14.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
### Bug Fixes
* **encryption:** make package public for resolution on @standardnotes/api package ([8792771](https://github.com/standardnotes/app/commit/8792771d27ba926b83bc7b89749c4b1982871c1b))
## [1.14.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/encryption
+2 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.14.3",
"version": "1.15.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -11,7 +11,6 @@
"files": [
"dist"
],
"private": true,
"license": "AGPL-3.0-or-later",
"scripts": {
"clean": "rm -fr dist",
@@ -36,7 +35,7 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/sncrypto-common": "workspace:*",
+12
View File
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.52.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* **features:** add subscription sharing ([66d364f](https://github.com/standardnotes/app/commit/66d364ff369afa0dcd11ac835512a7af9b25c8d2))
# [1.51.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.50.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/features
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/features",
"version": "1.50.5",
"version": "1.52.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -26,7 +26,7 @@
},
"dependencies": {
"@standardnotes/auth": "^3.19.4",
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"@standardnotes/security": "^1.2.0",
"reflect-metadata": "^0.1.13"
},
@@ -17,6 +17,7 @@ export enum FeatureIdentifier {
SmartFilters = 'org.standardnotes.smart-filters',
TagNesting = 'org.standardnotes.tag-nesting',
TwoFactorAuth = 'org.standardnotes.two-factor-auth',
SubscriptionSharing = 'org.standardnotes.subscription-sharing',
AutobiographyTheme = 'org.standardnotes.theme-autobiography',
DynamicTheme = 'org.standardnotes.theme-dynamic',
@@ -60,5 +60,10 @@ export function serverFeatures(): ServerFeatureDescription[] {
identifier: FeatureIdentifier.FilesLowStorageTier,
permission_name: PermissionName.FilesLowStorageTier,
},
{
availableInSubscriptions: [SubscriptionName.ProPlan],
identifier: FeatureIdentifier.SubscriptionSharing,
permission_name: PermissionName.SubscriptionSharing,
},
]
}
@@ -39,4 +39,5 @@ export enum PermissionName {
TitaniumTheme = 'theme:titanium',
TokenVaultEditor = 'editor:token-vault',
TwoFactorAuth = 'server:two-factor-auth',
SubscriptionSharing = 'server:subscription-sharing',
}
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.23.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/filepicker
# [1.23.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.22.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.22.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/filepicker
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.22.3",
"version": "1.23.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -31,7 +31,7 @@
"ts-node": "^10.5.0"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"@standardnotes/files": "workspace:*",
"@standardnotes/utils": "workspace:*",
"@types/wicg-file-system-access": "^2020.9.5",
+14
View File
@@ -3,6 +3,20 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.10.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/files
# [1.10.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.9.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/files
## [1.9.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/files
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.9.3",
"version": "1.10.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -30,7 +30,7 @@
"ts-jest": "^28.0.5"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
+52
View File
@@ -3,6 +3,58 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.32.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/mobile
## [3.32.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/mobile
## [3.32.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
**Note:** Version bump only for package @standardnotes/mobile
## [3.32.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
**Note:** Version bump only for package @standardnotes/mobile
# [3.32.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
### Features
* **mobile:** add setting to always open web view on launch ([#1500](https://github.com/standardnotes/app/issues/1500)) ([320fc3f](https://github.com/standardnotes/app/commit/320fc3fd9630731aabc9ecf30999afa7b74c277f))
## [3.31.29](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.28](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
### Bug Fixes
* let Android to correctly recognize the NativeMobileWeb environment when opening WebView on Android ([#1503](https://github.com/standardnotes/app/issues/1503)) ([461ebc2](https://github.com/standardnotes/app/commit/461ebc27689a6e7dff65ae7345fc8eebf1daf703))
## [3.31.27](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.26](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.25](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.24](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/mobile
@@ -2,11 +2,12 @@
class WebProcessDeviceInterface {
constructor(messageSender) {
this.appVersion = '1.2.3'
this.environment = 1
this.environment = 4
this.databases = []
this.messageSender = messageSender
}
// eslint-disable-next-line @typescript-eslint/no-empty-function
setApplication() {}
sendMessage(functionName, args) {
@@ -3,6 +3,7 @@ class WebProcessMessageSender {
constructor() {
this.pendingMessages = []
window.addEventListener('message', this.handleMessageFromReactNative.bind(this))
document.addEventListener('message', this.handleMessageFromReactNative.bind(this))
}
handleMessageFromReactNative(event) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.31.22",
"version": "3.32.4",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",
+26 -3
View File
@@ -1,18 +1,19 @@
import { AppStateEventType, AppStateType, TabletModeChangeData } from '@Lib/ApplicationState'
import { AlwaysOpenWebAppOnLaunchKey } from '@Lib/constants'
import { useHasEditor, useIsLocked } from '@Lib/SnjsHelperHooks'
import { ScreenStatus } from '@Lib/StatusManager'
import { IsDev } from '@Lib/Utils'
import { CompositeNavigationProp, RouteProp } from '@react-navigation/native'
import { CompositeNavigationProp, RouteProp, useNavigation } from '@react-navigation/native'
import { createStackNavigator, StackNavigationProp } from '@react-navigation/stack'
import { HeaderTitleView } from '@Root/Components/HeaderTitleView'
import { IoniconsHeaderButton } from '@Root/Components/IoniconsHeaderButton'
import { Compose } from '@Root/Screens/Compose/Compose'
import { SCREEN_COMPOSE, SCREEN_NOTES, SCREEN_VIEW_PROTECTED_NOTE } from '@Root/Screens/screens'
import { SCREEN_COMPOSE, SCREEN_NOTES, SCREEN_VIEW_PROTECTED_NOTE, SCREEN_WEB_APP } from '@Root/Screens/screens'
import { MainSideMenu } from '@Root/Screens/SideMenu/MainSideMenu'
import { NoteSideMenu } from '@Root/Screens/SideMenu/NoteSideMenu'
import { ViewProtectedNote } from '@Root/Screens/ViewProtectedNote/ViewProtectedNote'
import { Root } from '@Screens/Root'
import { UuidString } from '@standardnotes/snjs'
import { ApplicationEvent, StorageValueModes, UuidString } from '@standardnotes/snjs'
import { ICON_MENU } from '@Style/Icons'
import { ThemeService } from '@Style/ThemeService'
import { getDefaultDrawerWidth } from '@Style/Utils'
@@ -123,6 +124,28 @@ export const AppStackComponent = (props: ModalStackNavigationProp<'AppStack'>) =
[application],
)
const navigation = useNavigation<ModalStackNavigationProp<'AppStack'>['navigation']>()
useEffect(() => {
if (!application) {
return
}
const removeObserver = application.addEventObserver(async (event) => {
if (event === ApplicationEvent.Launched) {
const value = (await application.getValue(AlwaysOpenWebAppOnLaunchKey, StorageValueModes.Nonwrapped)) as
| boolean
| undefined
const shouldAlwaysOpenWebAppOnLaunch = value ?? false
if (shouldAlwaysOpenWebAppOnLaunch) {
navigation.push(SCREEN_WEB_APP)
}
}
})
return removeObserver
}, [application, navigation])
return (
<DrawerLayout
ref={drawerRef}
+1 -3
View File
@@ -1,7 +1,5 @@
import { IsDev } from '@Lib/Utils'
export enum ErrorMessage {
GeneralText = 'An error occurred. Please try again later.',
}
export const WebAppOptionEnabled = IsDev
export const AlwaysOpenWebAppOnLaunchKey = 'AlwaysOpenWebAppOnLaunch'
@@ -37,7 +37,7 @@ export const MobileWebAppContainer = () => {
class WebProcessDeviceInterface {
constructor(messageSender) {
this.appVersion = '1.2.3'
this.environment = 1
this.environment = 4
this.databases = []
this.messageSender = messageSender
}
@@ -57,6 +57,7 @@ export const MobileWebAppContainer = () => {
constructor() {
this.pendingMessages = []
window.addEventListener('message', this.handleMessageFromReactNative.bind(this))
document.addEventListener('message', this.handleMessageFromReactNative.bind(this))
}
handleMessageFromReactNative(event) {
@@ -128,7 +129,7 @@ export const MobileWebAppContainer = () => {
onMessage={onMessage}
allowFileAccess={true}
allowUniversalAccessFromFileURLs={true}
injectedJavaScript={injectedJS}
injectedJavaScriptBeforeContentLoaded={injectedJS}
/>
)
/* eslint-enable @typescript-eslint/no-empty-function */
@@ -1,4 +1,4 @@
import { WebAppOptionEnabled } from '@Lib/constants'
import { AlwaysOpenWebAppOnLaunchKey } from '@Lib/constants'
import { useSignedIn } from '@Lib/SnjsHelperHooks'
import { useNavigation } from '@react-navigation/native'
import { ButtonCell } from '@Root/Components/ButtonCell'
@@ -9,9 +9,9 @@ import { TableSection } from '@Root/Components/TableSection'
import { useSafeApplicationContext } from '@Root/Hooks/useSafeApplicationContext'
import { ModalStackNavigationProp } from '@Root/ModalStack'
import { SCREEN_MANAGE_SESSIONS, SCREEN_SETTINGS, SCREEN_WEB_APP } from '@Root/Screens/screens'
import { ButtonType, PrefKey } from '@standardnotes/snjs'
import { ButtonType, PrefKey, StorageValueModes } from '@standardnotes/snjs'
import moment from 'moment'
import React, { useCallback, useMemo, useState } from 'react'
import React, { useCallback, useEffect, useMemo, useState } from 'react'
import { Platform } from 'react-native'
import DocumentPicker from 'react-native-document-picker'
import RNFS from 'react-native-fs'
@@ -183,6 +183,18 @@ export const OptionsSection = ({ title, encryptionAvailable }: Props) => {
)
}, [application.alertService])
const [shouldAlwaysOpenWebAppOnLaunch, setShouldAlwaysOpenWebAppOnLaunch] = useState(false)
useEffect(() => {
const getSetting = async () => {
const value = (await application.getValue(AlwaysOpenWebAppOnLaunchKey, StorageValueModes.Nonwrapped)) as
| boolean
| undefined
setShouldAlwaysOpenWebAppOnLaunch(value ?? false)
}
void getSetting()
}, [application])
const openWebApp = useCallback(() => {
navigation.push(SCREEN_WEB_APP)
}, [navigation])
@@ -226,9 +238,16 @@ export const OptionsSection = ({ title, encryptionAvailable }: Props) => {
onPress={onExportPress}
/>
{WebAppOptionEnabled && (
<ButtonCell testID="openWebApp" leftAligned title={'Open Web App'} onPress={() => openWebApp()} />
)}
<ButtonCell testID="openWebApp" leftAligned title="Open Web App" onPress={() => openWebApp()} />
<SectionedAccessoryTableCell
onPress={() => {
const newValue = !shouldAlwaysOpenWebAppOnLaunch
setShouldAlwaysOpenWebAppOnLaunch(newValue)
void application.setValue(AlwaysOpenWebAppOnLaunchKey, newValue, StorageValueModes.Nonwrapped)
}}
text="Always Open Web App On Launch"
selected={() => shouldAlwaysOpenWebAppOnLaunch}
/>
{!signedIn && (
<SectionedAccessoryTableCell
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.18.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/models
# [1.18.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
# [1.17.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
### Features
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.17.0",
"version": "1.18.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -32,7 +32,7 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"@standardnotes/features": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/utils": "workspace:*",
@@ -0,0 +1,6 @@
export enum Environment {
Web = 1,
Desktop = 2,
Mobile = 3,
NativeMobileWeb = 4,
}
@@ -1,9 +1,3 @@
export enum Environment {
Web = 1,
Desktop = 2,
Mobile = 3,
}
export enum Platform {
Ios = 1,
Android = 2,
+2
View File
@@ -28,6 +28,8 @@ export * from './Api/Subscription/Invitation'
export * from './Api/Subscription/InvitationStatus'
export * from './Api/Subscription/InviteeIdentifierType'
export * from './Api/Subscription/InviterIdentifierType'
export * from './Device/Environment'
export * from './Device/Platform'
export * from './Local/KeyParams/RootKeyParamsInterface'
export * from './Local/RootKey/KeychainTypes'
export * from './Local/RootKey/RootKeyContent'
+48
View File
@@ -3,6 +3,54 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.3.40](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.39](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.38](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.37](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.36](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.35](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.34](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.33](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.32](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.31](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.30](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.29](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.28](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.28",
"version": "1.3.40",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+10
View File
@@ -3,6 +3,16 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.10.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/responses
# [1.10.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.9.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/responses
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/responses",
"version": "1.9.4",
"version": "1.10.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -31,7 +31,7 @@
"ts-jest": "^28.0.5"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"@standardnotes/features": "workspace:*",
"@standardnotes/security": "^1.1.0",
"reflect-metadata": "^0.1.13"
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.19.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/services
# [1.19.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
# [1.18.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
### Features
* **mobile:** add setting to always open web view on launch ([#1500](https://github.com/standardnotes/app/issues/1500)) ([320fc3f](https://github.com/standardnotes/app/commit/320fc3fd9630731aabc9ecf30999afa7b74c277f))
## [1.17.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/services
## [1.17.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/services
+2 -2
View File
@@ -11,8 +11,8 @@ module.exports = {
coverageThreshold: {
global: {
branches: 9,
functions: 9,
lines: 16,
functions: 10,
lines: 17,
statements: 16
}
}
+5 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.17.3",
"version": "1.19.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -20,11 +20,13 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"test": "jest spec --coverage"
},
"dependencies": {
"@standardnotes/api": "workspace:^",
"@standardnotes/auth": "^3.19.4",
"@standardnotes/common": "^1.30.0",
"@standardnotes/common": "^1.32.0",
"@standardnotes/encryption": "workspace:^",
"@standardnotes/files": "workspace:^",
"@standardnotes/models": "workspace:^",
@@ -37,6 +39,7 @@
"@types/jest": "^28.1.5",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.12.1",
"eslint": "^8.23.1",
"eslint-plugin-prettier": "*",
"jest": "^28.1.2",
"ts-jest": "^28.0.5"
@@ -1,13 +1,13 @@
import { ApplicationIdentifier, ContentType } from '@standardnotes/common'
import { BackupFile, DecryptedItemInterface, ItemStream, PrefKey, PrefValue } from '@standardnotes/models'
import { BackupFile, DecryptedItemInterface, ItemStream, Platform, PrefKey, PrefValue } from '@standardnotes/models'
import { FilesClientInterface } from '@standardnotes/files'
import { AlertService } from '../Alert/AlertService'
import { ComponentManagerInterface } from '../Component/ComponentManagerInterface'
import { Platform } from '../Device/Environments'
import { ApplicationEvent } from '../Event/ApplicationEvent'
import { ApplicationEventCallback } from '../Event/ApplicationEventCallback'
import { FeaturesClientInterface } from '../Feature/FeaturesClientInterface'
import { SubscriptionClientInterface } from '../Subscription/SubscriptionClientInterface'
import { ItemsClientInterface } from '../Item/ItemsClientInterface'
import { MutatorClientInterface } from '../Mutator/MutatorClientInterface'
import { StorageValueModes } from '../Storage/StorageTypes'
@@ -48,6 +48,7 @@ export interface ApplicationInterface {
get mutator(): MutatorClientInterface
get user(): UserClientInterface
get files(): FilesClientInterface
get subscriptions(): SubscriptionClientInterface
readonly identifier: ApplicationIdentifier
readonly platform: Platform
deviceInterface: DeviceInterface
@@ -1,6 +1,7 @@
import { Environment } from '@standardnotes/models'
import { WebClientRequiresDesktopMethods } from './DesktopWebCommunication'
import { DeviceInterface } from './DeviceInterface'
import { Environment } from './Environments'
import { WebOrDesktopDeviceInterface } from './WebOrDesktopDeviceInterface'
/* istanbul ignore file */
@@ -1,10 +1,10 @@
import { Environment } from './Environments'
import { ApplicationIdentifier } from '@standardnotes/common'
import {
FullyFormedTransferPayload,
TransferPayload,
LegacyRawKeychainValue,
NamespacedRootKeyInKeychain,
Environment,
} from '@standardnotes/models'
/**
@@ -1,6 +1,5 @@
import { DeviceInterface } from './DeviceInterface'
import { Environment } from './Environments'
import { RawKeychainValue } from '@standardnotes/models'
import { Environment, RawKeychainValue } from '@standardnotes/models'
export interface MobileDeviceInterface extends DeviceInterface {
environment: Environment.Mobile
@@ -1,5 +1,6 @@
import { Environment } from '@standardnotes/models'
import { DeviceInterface } from './DeviceInterface'
import { Environment } from './Environments'
import { MobileDeviceInterface } from './MobileDeviceInterface'
import { isMobileDevice } from './TypeCheck'
@@ -1,6 +1,6 @@
import { Environment } from './Environments'
import { MobileDeviceInterface } from './MobileDeviceInterface'
import { DeviceInterface } from './DeviceInterface'
import { Environment } from '@standardnotes/models'
/* istanbul ignore file */
@@ -0,0 +1,8 @@
import { Uuid } from '@standardnotes/common'
import { Invitation } from '@standardnotes/models'
export interface SubscriptionClientInterface {
listSubscriptionInvitations(): Promise<Invitation[]>
inviteToSubscription(inviteeEmail: string): Promise<boolean>
cancelInvitation(inviteUuid: Uuid): Promise<boolean>
}
@@ -0,0 +1,83 @@
import { SubscriptionApiServiceInterface } from '@standardnotes/api'
import { Invitation } from '@standardnotes/models'
import { InternalEventBusInterface } from '..'
import { SubscriptionManager } from './SubscriptionManager'
describe('SubscriptionManager', () => {
let subscriptionApiService: SubscriptionApiServiceInterface
let internalEventBus: InternalEventBusInterface
const createManager = () => new SubscriptionManager(subscriptionApiService, internalEventBus)
beforeEach(() => {
subscriptionApiService = {} as jest.Mocked<SubscriptionApiServiceInterface>
subscriptionApiService.cancelInvite = jest.fn()
subscriptionApiService.invite = jest.fn()
subscriptionApiService.listInvites = jest.fn()
internalEventBus = {} as jest.Mocked<InternalEventBusInterface>
})
it('should invite user by email to a shared subscription', async () => {
subscriptionApiService.invite = jest.fn().mockReturnValue({ data: { success: true } })
expect(await createManager().inviteToSubscription('[email protected]')).toBeTruthy()
})
it('should not invite user by email if the api fails to do so', async () => {
subscriptionApiService.invite = jest.fn().mockReturnValue({ data: { error: 'foobar' } })
expect(await createManager().inviteToSubscription('[email protected]')).toBeFalsy()
})
it('should not invite user by email if the api throws an error', async () => {
subscriptionApiService.invite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
expect(await createManager().inviteToSubscription('[email protected]')).toBeFalsy()
})
it('should cancel invite to a shared subscription', async () => {
subscriptionApiService.cancelInvite = jest.fn().mockReturnValue({ data: { success: true } })
expect(await createManager().cancelInvitation('1-2-3')).toBeTruthy()
})
it('should not cancel invite if the api fails to do so', async () => {
subscriptionApiService.cancelInvite = jest.fn().mockReturnValue({ data: { error: 'foobar' } })
expect(await createManager().cancelInvitation('1-2-3')).toBeFalsy()
})
it('should not cancel invite if the api throws an error', async () => {
subscriptionApiService.cancelInvite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
expect(await createManager().cancelInvitation('1-2-3')).toBeFalsy()
})
it('should list invites to a shared subscription', async () => {
const invitation = {
uuid: '1-2-3',
} as jest.Mocked<Invitation>
subscriptionApiService.listInvites = jest.fn().mockReturnValue({ data: { invitations: [invitation] } })
expect(await createManager().listSubscriptionInvitations()).toEqual([invitation])
})
it('should return an empty list of invites if the api fails to fetch them', async () => {
subscriptionApiService.listInvites = jest.fn().mockReturnValue({ data: { error: 'foobar' } })
expect(await createManager().listSubscriptionInvitations()).toEqual([])
})
it('should return an empty list of invites if the api throws an error', async () => {
subscriptionApiService.listInvites = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
expect(await createManager().listSubscriptionInvitations()).toEqual([])
})
})
@@ -0,0 +1,45 @@
import { Invitation } from '@standardnotes/models'
import { SubscriptionApiServiceInterface } from '@standardnotes/api'
import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface'
import { AbstractService } from '../Service/AbstractService'
import { SubscriptionClientInterface } from './SubscriptionClientInterface'
import { Uuid } from '@standardnotes/common'
export class SubscriptionManager extends AbstractService implements SubscriptionClientInterface {
constructor(
private subscriptionApiService: SubscriptionApiServiceInterface,
protected override internalEventBus: InternalEventBusInterface,
) {
super(internalEventBus)
}
async listSubscriptionInvitations(): Promise<Invitation[]> {
try {
const response = await this.subscriptionApiService.listInvites()
return response.data.invitations ?? []
} catch (error) {
return []
}
}
async inviteToSubscription(inviteeEmail: string): Promise<boolean> {
try {
const result = await this.subscriptionApiService.invite(inviteeEmail)
return result.data.success === true
} catch (error) {
return false
}
}
async cancelInvitation(inviteUuid: Uuid): Promise<boolean> {
try {
const result = await this.subscriptionApiService.cancelInvite(inviteUuid)
return result.data.success === true
} catch (error) {
return false
}
}
}
+2 -1
View File
@@ -17,7 +17,6 @@ export * from './Device/DesktopDeviceInterface'
export * from './Device/DesktopManagerInterface'
export * from './Device/DesktopWebCommunication'
export * from './Device/DeviceInterface'
export * from './Device/Environments'
export * from './Device/MobileDeviceInterface'
export * from './Device/TypeCheck'
export * from './Device/WebOrDesktopDeviceInterface'
@@ -67,6 +66,8 @@ export * from './Storage/InMemoryStore'
export * from './Storage/KeyValueStoreInterface'
export * from './Storage/StorageServiceInterface'
export * from './Storage/StorageTypes'
export * from './Subscription/SubscriptionClientInterface'
export * from './Subscription/SubscriptionManager'
export * from './Sync/SyncMode'
export * from './Sync/SyncOptions'
export * from './Sync/SyncQueueStrategy'
+20
View File
@@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.127.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/snjs
# [2.127.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
# [2.126.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
### Features
* **mobile:** add setting to always open web view on launch ([#1500](https://github.com/standardnotes/app/issues/1500)) ([320fc3f](https://github.com/standardnotes/app/commit/320fc3fd9630731aabc9ecf30999afa7b74c277f))
## [2.125.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/snjs
## [2.125.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/snjs
@@ -1,13 +1,7 @@
import { SNLog } from './../Log'
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
import {
AlertService,
DeviceInterface,
Environment,
namespacedKey,
Platform,
RawStorageKey,
} from '@standardnotes/services'
import { AlertService, DeviceInterface, namespacedKey, RawStorageKey } from '@standardnotes/services'
import { Environment, Platform } from '@standardnotes/models'
import { SNApplication } from './Application'
describe('application', () => {
+40 -3
View File
@@ -1,6 +1,10 @@
import {
HttpService,
HttpServiceInterface,
SubscriptionApiService,
SubscriptionApiServiceInterface,
SubscriptionServer,
SubscriptionServerInterface,
UserApiService,
UserApiServiceInterface,
UserRegistrationResponseBody,
@@ -23,9 +27,7 @@ import {
ChallengeValidation,
ComponentManagerInterface,
DiagnosticInfo,
Environment,
isDesktopDevice,
Platform,
ChallengeValue,
StorageKey,
ChallengeReason,
@@ -37,11 +39,20 @@ import {
EncryptionServiceEvent,
FilesBackupService,
FileService,
SubscriptionClientInterface,
SubscriptionManager,
} from '@standardnotes/services'
import { FilesClientInterface } from '@standardnotes/files'
import { ComputePrivateWorkspaceIdentifier } from '@standardnotes/encryption'
import { useBoolean } from '@standardnotes/utils'
import { BackupFile, DecryptedItemInterface, EncryptedItemInterface, ItemStream } from '@standardnotes/models'
import {
BackupFile,
DecryptedItemInterface,
EncryptedItemInterface,
Environment,
ItemStream,
Platform,
} from '@standardnotes/models'
import { ClientDisplayableError } from '@standardnotes/responses'
import { SnjsVersion } from './../Version'
@@ -92,6 +103,9 @@ export class SNApplication
private apiService!: InternalServices.SNApiService
private declare userApiService: UserApiServiceInterface
private declare userServer: UserServerInterface
private declare subscriptionApiService: SubscriptionApiServiceInterface
private declare subscriptionServer: SubscriptionServerInterface
private declare subscriptionManager: SubscriptionClientInterface
private sessionManager!: InternalServices.SNSessionManager
private syncService!: InternalServices.SNSyncService
private challengeService!: InternalServices.ChallengeService
@@ -187,6 +201,10 @@ export class SNApplication
this.defineInternalEventHandlers()
}
get subscriptions(): ExternalServices.SubscriptionClientInterface {
return this.subscriptionManager
}
public get files(): FilesClientInterface {
return this.fileService
}
@@ -1031,6 +1049,9 @@ export class SNApplication
this.createHttpService()
this.createUserServer()
this.createUserApiService()
this.createSubscriptionServer()
this.createSubscriptionApiService()
this.createSubscriptionManager()
this.createWebSocketsService()
this.createSessionManager()
this.createHistoryManager()
@@ -1069,6 +1090,9 @@ export class SNApplication
;(this.apiService as unknown) = undefined
;(this.userApiService as unknown) = undefined
;(this.userServer as unknown) = undefined
;(this.subscriptionApiService as unknown) = undefined
;(this.subscriptionServer as unknown) = undefined
;(this.subscriptionManager as unknown) = undefined
;(this.sessionManager as unknown) = undefined
;(this.syncService as unknown) = undefined
;(this.challengeService as unknown) = undefined
@@ -1262,6 +1286,18 @@ export class SNApplication
this.userServer = new UserServer(this.httpService)
}
private createSubscriptionApiService() {
this.subscriptionApiService = new SubscriptionApiService(this.subscriptionServer)
}
private createSubscriptionServer() {
this.subscriptionServer = new SubscriptionServer(this.httpService)
}
private createSubscriptionManager() {
this.subscriptionManager = new SubscriptionManager(this.subscriptionApiService, this.internalEventBus)
}
private createItemManager() {
this.itemManager = new InternalServices.ItemManager(this.payloadManager, this.options, this.internalEventBus)
this.services.push(this.itemManager)
@@ -1377,6 +1413,7 @@ export class SNApplication
this.protocolService,
this.challengeService,
this.webSocketsService,
this.httpService,
this.internalEventBus,
)
this.serviceObservers.push(
@@ -1,5 +1,6 @@
import { Environment, Platform } from '@standardnotes/models'
import { ApplicationIdentifier } from '@standardnotes/common'
import { AlertService, DeviceInterface, Environment, Platform } from '@standardnotes/services'
import { AlertService, DeviceInterface } from '@standardnotes/services'
import { PureCryptoInterface } from '@standardnotes/sncrypto-common'
export interface RequiredApplicationOptions {
+3 -1
View File
@@ -1,4 +1,4 @@
import { Environment, Platform } from '@standardnotes/services'
import { Environment, Platform } from '@standardnotes/models'
export function platformFromString(string: string) {
const map: Record<string, Platform> = {
@@ -33,6 +33,7 @@ export function environmentFromString(string: string) {
web: Environment.Web,
desktop: Environment.Desktop,
mobile: Environment.Mobile,
nativeMobileWeb: Environment.NativeMobileWeb,
}
return map[string]
}
@@ -42,6 +43,7 @@ export function environmentToString(environment: Environment) {
[Environment.Web]: 'web',
[Environment.Desktop]: 'desktop',
[Environment.Mobile]: 'mobile',
[Environment.NativeMobileWeb]: 'native-mobile-web',
}
return map[environment]
}
@@ -1,7 +1,9 @@
import { Environment } from '@standardnotes/models'
import { DeviceInterface, InternalEventBusInterface, EncryptionService } from '@standardnotes/services'
import { SNSessionManager } from '../Services/Session/SessionManager'
import { ApplicationIdentifier } from '@standardnotes/common'
import { ItemManager } from '@Lib/Services/Items/ItemManager'
import { DeviceInterface, InternalEventBusInterface, Environment, EncryptionService } from '@standardnotes/services'
import { ChallengeService, SNSingletonManager, SNFeaturesService, DiskStorageService } from '@Lib/Services'
export type MigrationServices = {
@@ -1,6 +1,7 @@
import { ApplicationIdentifier } from '@standardnotes/common'
import { Environment } from '@standardnotes/models'
import { compareSemVersions, isRightVersionGreaterThanLeft } from '@Lib/Version'
import { DeviceInterface, Environment } from '@standardnotes/services'
import { DeviceInterface } from '@standardnotes/services'
import { StorageReader } from './Reader'
import * as ReaderClasses from './Versions'
@@ -1,5 +1,6 @@
import { Environment } from '@standardnotes/models'
import { ApplicationIdentifier } from '@standardnotes/common'
import { DeviceInterface, Environment } from '@standardnotes/services'
import { DeviceInterface } from '@standardnotes/services'
/**
* A storage reader reads storage via a device interface
@@ -2,7 +2,8 @@ import { API_MESSAGE_RATE_LIMITED, UNKNOWN_ERROR } from './Messages'
import { HttpResponse, StatusCode } from '@standardnotes/responses'
import { isString } from '@standardnotes/utils'
import { SnjsVersion } from '@Lib/Version'
import { AbstractService, InternalEventBusInterface, Environment } from '@standardnotes/services'
import { AbstractService, InternalEventBusInterface } from '@standardnotes/services'
import { Environment } from '@standardnotes/models'
export enum HttpVerb {
Get = 'GET',
@@ -11,14 +11,8 @@ import {
FeatureIdentifier,
} from '@standardnotes/features'
import { ContentType } from '@standardnotes/common'
import { GenericItem, SNComponent } from '@standardnotes/models'
import {
DesktopManagerInterface,
InternalEventBusInterface,
Environment,
Platform,
AlertService,
} from '@standardnotes/services'
import { GenericItem, SNComponent, Environment, Platform } from '@standardnotes/models'
import { DesktopManagerInterface, InternalEventBusInterface, AlertService } from '@standardnotes/services'
import { ItemManager } from '@Lib/Services/Items/ItemManager'
import { SNFeaturesService } from '@Lib/Services/Features/FeaturesService'
import { SNComponentManager } from './ComponentManager'
@@ -11,6 +11,8 @@ import {
ComponentMutator,
PayloadEmitSource,
PermissionDialog,
Environment,
Platform,
} from '@standardnotes/models'
import { SNSyncService } from '@Lib/Services/Sync/SyncService'
import find from 'lodash/find'
@@ -26,8 +28,6 @@ import {
ComponentViewerInterface,
DesktopManagerInterface,
InternalEventBusInterface,
Environment,
Platform,
AlertService,
} from '@standardnotes/services'
@@ -291,11 +291,15 @@ export class SNComponentManager
}
const isWeb = this.environment === Environment.Web
const isMobileWebView = this.environment === Environment.NativeMobileWeb
if (nativeFeature) {
if (!isWeb) {
if (!isWeb && !isMobileWebView) {
throw Error('Mobile must override urlForComponent to handle native paths')
}
const baseUrlRequiredForThemesInsideEditors = window.location.origin
let baseUrlRequiredForThemesInsideEditors = window.location.origin
if (isMobileWebView) {
baseUrlRequiredForThemesInsideEditors = window.location.href.split('/index.html')[0]
}
return `${baseUrlRequiredForThemesInsideEditors}/components/assets/${component.identifier}/${nativeFeature.index_path}`
}
@@ -2,10 +2,8 @@ import { SNPreferencesService } from '../Preferences/PreferencesService'
import {
ComponentViewerInterface,
ComponentViewerError,
Environment,
FeatureStatus,
FeaturesEvent,
Platform,
AlertService,
} from '@standardnotes/services'
import { SNFeaturesService } from '@Lib/Services'
@@ -34,6 +32,8 @@ import {
PayloadTimestampDefaults,
IncomingComponentItemPayload,
MessageData,
Environment,
Platform,
} from '@standardnotes/models'
import find from 'lodash/find'
import uniq from 'lodash/uniq'
@@ -38,6 +38,7 @@ import {
ApiCallError,
ErrorMessage,
HttpErrorResponseBody,
HttpServiceInterface,
UserApiServiceInterface,
UserRegistrationResponseBody,
} from '@standardnotes/api'
@@ -77,6 +78,7 @@ export class SNSessionManager extends AbstractService<SessionEvent> implements S
private protocolService: EncryptionService,
private challengeService: ChallengeService,
private webSocketsService: SNWebSocketsService,
private httpService: HttpServiceInterface,
protected override internalEventBus: InternalEventBusInterface,
) {
super(internalEventBus)
@@ -617,6 +619,10 @@ export class SNSessionManager extends AbstractService<SessionEvent> implements S
void this.apiService.setHost(host)
this.httpService.setHost(host)
this.httpService.setAuthorizationToken(session.authorizationValue)
await this.setSession(session)
this.webSocketsService.startWebSocketConnection(session.authorizationValue)
@@ -4,7 +4,7 @@ import { SNLog } from '../../Log'
import { isErrorDecryptingParameters, SNRootKey } from '@standardnotes/encryption'
import * as Encryption from '@standardnotes/encryption'
import * as Services from '@standardnotes/services'
import { DiagnosticInfo, Environment } from '@standardnotes/services'
import { DiagnosticInfo } from '@standardnotes/services'
import {
CreateDecryptedLocalStorageContextPayload,
CreateDeletedLocalStorageContextPayload,
@@ -19,6 +19,7 @@ import {
DeletedPayloadInterface,
PayloadTimestampDefaults,
LocalStorageEncryptedContextualPayload,
Environment,
} from '@standardnotes/models'
/**
+110
View File
@@ -0,0 +1,110 @@
import * as Factory from './lib/factory.js'
chai.use(chaiAsPromised)
const expect = chai.expect
describe('subscriptions', function () {
this.timeout(Factory.TwentySecondTimeout)
let application
let context
let subscriptionManager
afterEach(async function () {
await Factory.safeDeinit(application)
localStorage.clear()
})
beforeEach(async function () {
localStorage.clear()
context = await Factory.createAppContextWithFakeCrypto()
await context.launch()
application = context.application
subscriptionManager = context.application.subscriptionManager
const result = await Factory.registerUserToApplication({
application: application,
email: context.email,
password: context.password,
})
await Factory.publishMockedEvent('SUBSCRIPTION_PURCHASED', {
userEmail: context.email,
subscriptionId: 1,
subscriptionName: 'PRO_PLAN',
subscriptionExpiresAt: (new Date().getTime() + 3_600_000) * 1_000,
timestamp: Date.now(),
offline: false,
})
await Factory.sleep(0.25)
})
it('should invite a user by email to a shared subscription', async () => {
await subscriptionManager.inviteToSubscription('[email protected]')
const existingInvites = await subscriptionManager.listSubscriptionInvitations()
const newlyCreatedInvite = existingInvites.find(invite => invite.inviteeIdentifier === '[email protected]')
expect(newlyCreatedInvite.status).to.equal('sent')
})
it('should not invite a user by email if the limit of shared subscription is breached', async () => {
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
let existingInvites = await subscriptionManager.listSubscriptionInvitations()
expect(existingInvites.length).to.equal(5)
expect(await subscriptionManager.inviteToSubscription('[email protected]')).to.equal(false)
existingInvites = await subscriptionManager.listSubscriptionInvitations()
expect(existingInvites.length).to.equal(5)
})
it('should cancel a user invitation to a shared subscription', async () => {
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
let existingInvites = await subscriptionManager.listSubscriptionInvitations()
expect (existingInvites.length).to.equal(2)
const newlyCreatedInvite = existingInvites.find(invite => invite.inviteeIdentifier === '[email protected]')
await subscriptionManager.cancelInvitation(newlyCreatedInvite.uuid)
existingInvites = await subscriptionManager.listSubscriptionInvitations()
expect (existingInvites.length).to.equal(2)
expect(existingInvites.filter(invite => invite.status === 'canceled').length).to.equal(1)
})
it('should invite a user by email if the limit of shared subscription is restored', async () => {
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
await subscriptionManager.inviteToSubscription('[email protected]')
let existingInvites = await subscriptionManager.listSubscriptionInvitations()
expect(existingInvites.length).to.equal(5)
await subscriptionManager.cancelInvitation(existingInvites[0].uuid)
expect(await subscriptionManager.inviteToSubscription('[email protected]')).to.equal(true)
existingInvites = await subscriptionManager.listSubscriptionInvitations()
expect(existingInvites.find(invite => invite.inviteeIdentifier === '[email protected]')).not.to.equal(undefined)
})
})
+1
View File
@@ -91,6 +91,7 @@
<script type="module" src="session-sharing.test.js"></script>
<script type="module" src="files.test.js"></script>
<script type="module" src="session.test.js"></script>
<script type="module" src="subscriptions.test.js"></script>
<script type="module">
mocha.run();
</script>
+3 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.125.5",
"version": "2.127.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -24,6 +24,7 @@
"tsc": "tsc --project lib/tsconfig.json && tscpaths -p lib/tsconfig.json -s lib -o dist/@types",
"lint": "yarn lint:tsc && yarn lint:eslint",
"lint:eslint": "eslint --ext .ts lib/",
"lint:fix": "eslint --fix --ext .ts lib/",
"lint:tsc": "tsc --noEmit --emitDeclarationOnly false --project lib/tsconfig.json",
"test": "jest spec --coverage",
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand"
@@ -67,7 +68,7 @@
},
"dependencies": {
"@standardnotes/api": "workspace:*",
"@standardnotes/common": "^1.25.0",
"@standardnotes/common": "^1.32.0",
"@standardnotes/domain-events": "^2.39.0",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/features": "workspace:*",
+18
View File
@@ -3,6 +3,24 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.2.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/ui-services
# [1.2.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.1.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.1.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.1.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/ui-services
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.1.4",
"version": "1.2.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -23,7 +23,7 @@
"test": "jest spec --coverage --passWithNoTests"
},
"dependencies": {
"@standardnotes/common": "^1.30.0",
"@standardnotes/common": "^1.32.0",
"@standardnotes/filepicker": "workspace:^",
"@standardnotes/services": "workspace:^",
"@standardnotes/styles": "workspace:^",
+6
View File
@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.9.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
### Features
* add subscription manager to handle subscription sharing ([#1517](https://github.com/standardnotes/app/issues/1517)) ([55b1409](https://github.com/standardnotes/app/commit/55b1409a805c21ada70bf482a02cfe718a4c6576))
## [1.8.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/utils
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/utils",
"version": "1.8.3",
"version": "1.9.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -25,7 +25,7 @@
"test": "jest spec"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
"@standardnotes/common": "^1.32.0",
"dompurify": "^2.3.8",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13"
+57
View File
@@ -3,6 +3,63 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [3.46.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/web
## [3.46.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-13)
**Note:** Version bump only for package @standardnotes/web
# [3.46.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
### Features
* update mobile design ([#1526](https://github.com/standardnotes/app/issues/1526)) ([39d0ee9](https://github.com/standardnotes/app/commit/39d0ee9181255ad71500f4322f63b962af92b861))
## [3.45.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-12)
### Bug Fixes
* ability to open a new tab on iOS Safari ([#1516](https://github.com/standardnotes/app/issues/1516)) ([73ef93c](https://github.com/standardnotes/app/commit/73ef93c1db0c1d073ddd110459848740ba2f8543))
## [3.45.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
**Note:** Version bump only for package @standardnotes/web
## [3.45.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-09)
### Bug Fixes
* note/file list item longpress on iOS ([#1506](https://github.com/standardnotes/app/issues/1506)) ([1efc352](https://github.com/standardnotes/app/commit/1efc352da5b0f449196b56bdf607e40d6e228cd4))
## [3.45.15](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
### Bug Fixes
* **web:** autolock option style when selected ([#1501](https://github.com/standardnotes/app/issues/1501)) ([91d5980](https://github.com/standardnotes/app/commit/91d5980a7e5d7bdada74175474d6d8c1a0ecba7e))
## [3.45.14](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-08)
### Bug Fixes
* note panel resizing ([#1497](https://github.com/standardnotes/app/issues/1497)) ([9267e58](https://github.com/standardnotes/app/commit/9267e580b56fc815a5eb289c225af55f5cf7a4b1))
## [3.45.13](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
### Bug Fixes
* file preview & selected items panel size on mobile ([#1492](https://github.com/standardnotes/app/issues/1492)) ([ecd870c](https://github.com/standardnotes/app/commit/ecd870cdaa86c7ec71a0db58643390fe5d597146))
* footer and prefs dropdown cutoff by screen on some phones ([#1491](https://github.com/standardnotes/app/issues/1491)) ([4617afe](https://github.com/standardnotes/app/commit/4617afe14ea1931ba150be5597656c22e2116e73))
## [3.45.12](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-07)
**Note:** Version bump only for package @standardnotes/web
## [3.45.11](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-09-01)
**Note:** Version bump only for package @standardnotes/web
## [3.45.10](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/web
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.45.10",
"version": "3.46.2",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
@@ -14,6 +14,7 @@
"format": "prettier --write src/javascripts",
"lint": "NODE_OPTIONS=\"--max-old-space-size=4096\" eslint src/javascripts",
"start": "webpack-dev-server --config web.webpack.dev.js",
"start-secure": "yarn start --server-type https",
"test": "jest --config jest.config.js --coverage",
"tsc": "tsc --project tsconfig.json",
"upgrade:snjs": "ncu -u '@standardnotes/*'",
+1
View File
@@ -66,6 +66,7 @@ const startApplication: StartApplication = async function startApplication(
root = createRoot(appendedRootNode)
disableIosTextFieldZoom()
document.documentElement.style.setProperty('--viewport-height', `${window.innerHeight}px`)
root.render(
<ApplicationGroupView
@@ -68,7 +68,7 @@ const ContentList: FunctionComponent<Props> = ({
return (
<div
className={classNames(
'infinite-scroll max-h-[75vh] overflow-y-auto overflow-x-hidden focus:shadow-none focus:outline-none',
'infinite-scroll overflow-y-auto overflow-x-hidden focus:shadow-none focus:outline-none',
'md:max-h-full md:overflow-y-hidden md:hover:overflow-y-auto',
'md:hover:[overflow-y:_overlay]',
)}
@@ -185,13 +185,13 @@ const ContentListView: FunctionComponent<Props> = ({
<div
id="items-column"
className={classNames(
'sn-component section app-column flex flex-col border-b border-solid border-border ',
'xl:w-87.5 xsm-only:!w-full sm-only:!w-full md-only:!w-52 lg-only:!w-52',
'sn-component section app-column flex h-screen flex-col md:h-full',
'xl:w-87.5 xsm-only:!w-full sm-only:!w-full pointer-coarse:md-only:!w-52 pointer-coarse:lg-only:!w-52',
)}
aria-label={'Notes & Files'}
ref={itemsViewPanelRef}
>
<ResponsivePaneContent paneId={AppPaneId.Items} contentClassName="min-h-[85vh]">
<ResponsivePaneContent paneId={AppPaneId.Items} className="min-h-[85vh]">
<div id="items-title-bar" className="section-title-bar border-b border-solid border-border">
<div id="items-title-bar-container">
<input
@@ -4,6 +4,7 @@ import Icon from '../../Icon/Icon'
import { classNames } from '@/Utils/ConcatenateClassNames'
import Popover from '@/Components/Popover/Popover'
import DisplayOptionsMenu from './DisplayOptionsMenu'
import { NavigationMenuButton } from '@/Components/NavigationMenu/NavigationMenu'
type Props = {
application: {
@@ -35,7 +36,8 @@ const ContentListHeader = ({
}, [])
return (
<div className="section-title-bar-header gap-1">
<div className="section-title-bar-header items-start gap-1">
<NavigationMenuButton />
<div className="flex flex-grow flex-col">
<div className="text-lg font-semibold text-text">{panelTitle}</div>
{optionsSubtitle && <div className="text-xs text-passive-0">{optionsSubtitle}</div>}
@@ -60,7 +60,9 @@ const FileViewWithoutProtection = ({ application, viewControllerManager, file }:
</div>
</div>
</div>
<FilePreview file={file} application={application} key={file.uuid} />
<div className="flex min-h-0 flex-grow flex-col">
<FilePreview file={file} application={application} key={file.uuid} />
</div>
</div>
)
}
@@ -33,8 +33,8 @@ const AccountMenuButton = ({
'flex h-full w-8 cursor-pointer items-center justify-center rounded-full',
)}
>
<div className={hasError ? 'text-danger' : (user ? 'text-info' : 'text-neutral') + ' h-5 w-5'}>
<Icon type="account-circle" className="max-h-5 hover:text-info" />
<div className={hasError ? 'text-danger' : user ? 'text-info' : 'text-neutral'}>
<Icon type="account-circle" className="h-5 w-5 hover:text-info" />
</div>
</button>
<Popover anchorElement={buttonRef.current} open={isOpen} togglePopover={toggleMenu} side="top" className="py-2">
@@ -341,7 +341,7 @@ class Footer extends PureComponent<Props, State> {
<div className="sn-component">
<footer
id="footer-bar"
className="z-footer-bar flex h-6 w-full select-none items-center justify-between border-t border-border bg-contrast px-3 text-text"
className="z-footer-bar hidden h-8 w-full select-none items-center justify-between border-t border-border bg-contrast px-3 text-text md:flex"
>
<div className="left flex h-full">
<div className="sk-app-bar-item relative z-footer-bar-item ml-0 select-none">

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