Compare commits

...
Author SHA1 Message Date
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
StandardNotes CI aa7a22c6ac chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
2022-08-31 18:13:02 +00:00
Karol Sójko 91f5694a02 feat(api): add client methods for listing and canceling subscription invites (#1471)
* feat(api): add subscription server and client services and interfaces

* feat(api): add subscriptions invitation operations on server side

* fix(api): linter issues

* feat(api): add client methods for listing and canceling subscription invites

* fix(api): imports
2022-08-31 19:43:43 +02:00
StandardNotes CI 19a95dc404 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].0
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].4
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].9
2022-08-31 14:44:34 +00:00
Karol Sójko 089d3a2e66 feat(api): add subscription server and client services and interfaces (#1470)
* feat(api): add subscription server and client services and interfaces

* fix(api): linter issues

* feat(models): add subscription invitations

* feat(api): add subscriptions invitation operations on server side

* fix(api): linter issues
2022-08-31 16:08:52 +02:00
StandardNotes CI 370ce39eba chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].8
2022-08-29 15:01:54 +00:00
Aman Harwara 876c0e83ca fix: tag autocomplete result not clickable on iOS (#1455) 2022-08-29 20:00:42 +05:30
StandardNotes CI a203faf02d chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].7
2022-08-25 10:00:51 +00:00
Aman Harwara 520b3add0f fix: editor content being hidden under keyboard on mobile (#1410) 2022-08-25 15:01:44 +05:30
StandardNotes CI c336f9de18 chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].6
2022-08-24 11:15:08 +00:00
Karol Sójko 2c69a514a8 fix(snjs): showing archived notes on trashed smart view (#1426) 2022-08-24 12:45:13 +02:00
StandardNotes CI 26fe530deb chore(release): publish
- @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected].1
 - @standardnotes/[email protected].3
 - @standardnotes/[email protected].2
 - @standardnotes/[email protected]
 - @standardnotes/[email protected]
 - @standardnotes/[email protected].5
 - @standardnotes/[email protected]
2022-08-23 12:11:25 +00:00
StandardNotes CI 58f9789142 chore(release): components 2022-08-23 12:11:11 +00:00
Karol Sójko d2cebf930a chore(setup): fix running unit tests in all packages 2022-08-23 13:40:21 +02:00
Karol Sójko 7bff3dee24 fix(services): counting trashed and archived items 2022-08-23 13:20:34 +02:00
129 changed files with 1435 additions and 169 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
+24
View File
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.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
* **api:** add client methods for listing and canceling subscription invites ([#1471](https://github.com/standardnotes/app/issues/1471)) ([91f5694](https://github.com/standardnotes/app/commit/91f5694a025a26e9b7878fc4c78a22c7f2f1dcef))
# [1.5.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
### Features
* **api:** add subscription server and client services and interfaces ([#1470](https://github.com/standardnotes/app/issues/1470)) ([089d3a2](https://github.com/standardnotes/app/commit/089d3a2e669f5a24bb4a38fc7582b423980d2d22))
## [1.4.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/api
## [1.4.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/api
+4 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.4.8",
"version": "1.6.2",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -22,12 +22,14 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest spec --coverage"
"lint:fix": "eslint . --ext .ts --fix",
"test": "jest spec --coverage"
},
"devDependencies": {
"@types/jest": "^28.1.5",
"@types/lodash": "^4.14.182",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"eslint": "^8.23.0",
"eslint-plugin-prettier": "*",
"jest": "^28.1.2",
"ts-jest": "^28.0.5"
@@ -0,0 +1,5 @@
export enum SubscriptionApiOperations {
Inviting,
CancelingInvite,
ListingInvites,
}
@@ -0,0 +1,163 @@
import { Invitation } from '@standardnotes/models'
import { SubscriptionInviteCancelResponse } from '../../Response/Subscription/SubscriptionInviteCancelResponse'
import { SubscriptionInviteListResponse } from '../../Response/Subscription/SubscriptionInviteListResponse'
import { SubscriptionInviteResponse } from '../../Response/Subscription/SubscriptionInviteResponse'
import { SubscriptionServerInterface } from '../../Server/Subscription/SubscriptionServerInterface'
import { SubscriptionApiOperations } from './SubscriptionApiOperations'
import { SubscriptionApiService } from './SubscriptionApiService'
describe('SubscriptionApiService', () => {
let subscriptionServer: SubscriptionServerInterface
const createService = () => new SubscriptionApiService(subscriptionServer)
beforeEach(() => {
subscriptionServer = {} as jest.Mocked<SubscriptionServerInterface>
subscriptionServer.invite = jest.fn().mockReturnValue({
data: { success: true, sharedSubscriptionInvitationUuid: '1-2-3' },
} as jest.Mocked<SubscriptionInviteResponse>)
subscriptionServer.cancelInvite = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<SubscriptionInviteCancelResponse>)
subscriptionServer.listInvites = jest.fn().mockReturnValue({
data: { invitations: [{} as jest.Mocked<Invitation>] },
} as jest.Mocked<SubscriptionInviteListResponse>)
})
it('should invite a user', async () => {
const response = await createService().invite('[email protected]')
expect(response).toEqual({
data: {
success: true,
sharedSubscriptionInvitationUuid: '1-2-3',
},
})
expect(subscriptionServer.invite).toHaveBeenCalledWith({
api: '20200115',
identifier: '[email protected]',
})
})
it('should not invite a user if it is already inviting', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[SubscriptionApiOperations.Inviting, true]]),
})
let error = null
try {
await service.invite('[email protected]')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not invite a user if the server fails', async () => {
subscriptionServer.invite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().invite('[email protected]')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should cancel an invite', async () => {
const response = await createService().cancelInvite('1-2-3')
expect(response).toEqual({
data: {
success: true,
},
})
expect(subscriptionServer.cancelInvite).toHaveBeenCalledWith({
api: '20200115',
inviteUuid: '1-2-3',
})
})
it('should not cancel an invite if it is already canceling', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[SubscriptionApiOperations.CancelingInvite, true]]),
})
let error = null
try {
await service.cancelInvite('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not cancel an invite if the server fails', async () => {
subscriptionServer.cancelInvite = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().cancelInvite('1-2-3')
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should list invites', async () => {
const response = await createService().listInvites()
expect(response).toEqual({
data: {
invitations: [{} as jest.Mocked<Invitation>],
},
})
expect(subscriptionServer.listInvites).toHaveBeenCalledWith({
api: '20200115',
})
})
it('should not list invitations if it is already listing', async () => {
const service = createService()
Object.defineProperty(service, 'operationsInProgress', {
get: () => new Map([[SubscriptionApiOperations.ListingInvites, true]]),
})
let error = null
try {
await service.listInvites()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
it('should not list invites if the server fails', async () => {
subscriptionServer.listInvites = jest.fn().mockImplementation(() => {
throw new Error('Oops')
})
let error = null
try {
await createService().listInvites()
} catch (caughtError) {
error = caughtError
}
expect(error).not.toBeNull()
})
})
@@ -0,0 +1,81 @@
import { ErrorMessage } from '../../Error/ErrorMessage'
import { ApiCallError } from '../../Error/ApiCallError'
import { ApiVersion } from '../../Api/ApiVersion'
import { ApiEndpointParam } from '../../Request/ApiEndpointParam'
import { SubscriptionServerInterface } from '../../Server/Subscription/SubscriptionServerInterface'
import { SubscriptionInviteResponse } from '../../Response/Subscription/SubscriptionInviteResponse'
import { SubscriptionInviteListResponse } from '../../Response/Subscription/SubscriptionInviteListResponse'
import { SubscriptionInviteCancelResponse } from '../../Response/Subscription/SubscriptionInviteCancelResponse'
import { SubscriptionApiServiceInterface } from './SubscriptionApiServiceInterface'
import { SubscriptionApiOperations } from './SubscriptionApiOperations'
export class SubscriptionApiService implements SubscriptionApiServiceInterface {
private operationsInProgress: Map<SubscriptionApiOperations, boolean>
constructor(private subscriptionServer: SubscriptionServerInterface) {
this.operationsInProgress = new Map()
}
async listInvites(): Promise<SubscriptionInviteListResponse> {
if (this.operationsInProgress.get(SubscriptionApiOperations.ListingInvites)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(SubscriptionApiOperations.ListingInvites, true)
try {
const response = await this.subscriptionServer.listInvites({
[ApiEndpointParam.ApiVersion]: ApiVersion.v0,
})
this.operationsInProgress.set(SubscriptionApiOperations.ListingInvites, false)
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
}
}
async cancelInvite(inviteUuid: string): Promise<SubscriptionInviteCancelResponse> {
if (this.operationsInProgress.get(SubscriptionApiOperations.CancelingInvite)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(SubscriptionApiOperations.CancelingInvite, true)
try {
const response = await this.subscriptionServer.cancelInvite({
[ApiEndpointParam.ApiVersion]: ApiVersion.v0,
inviteUuid,
})
this.operationsInProgress.set(SubscriptionApiOperations.CancelingInvite, false)
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
}
}
async invite(inviteeEmail: string): Promise<SubscriptionInviteResponse> {
if (this.operationsInProgress.get(SubscriptionApiOperations.Inviting)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}
this.operationsInProgress.set(SubscriptionApiOperations.Inviting, true)
try {
const response = await this.subscriptionServer.invite({
[ApiEndpointParam.ApiVersion]: ApiVersion.v0,
identifier: inviteeEmail,
})
this.operationsInProgress.set(SubscriptionApiOperations.Inviting, false)
return response
} catch (error) {
throw new ApiCallError(ErrorMessage.GenericFail)
}
}
}
@@ -0,0 +1,11 @@
import { Uuid } from '@standardnotes/common'
import { SubscriptionInviteCancelResponse } from '../../Response/Subscription/SubscriptionInviteCancelResponse'
import { SubscriptionInviteListResponse } from '../../Response/Subscription/SubscriptionInviteListResponse'
import { SubscriptionInviteResponse } from '../../Response/Subscription/SubscriptionInviteResponse'
export interface SubscriptionApiServiceInterface {
invite(inviteeEmail: string): Promise<SubscriptionInviteResponse>
listInvites(): Promise<SubscriptionInviteListResponse>
cancelInvite(inviteUuid: Uuid): Promise<SubscriptionInviteCancelResponse>
}
+3
View File
@@ -1,2 +1,5 @@
export * from './Subscription/SubscriptionApiOperations'
export * from './Subscription/SubscriptionApiService'
export * from './Subscription/SubscriptionApiServiceInterface'
export * from './User/UserApiService'
export * from './User/UserApiServiceInterface'
@@ -4,4 +4,6 @@ export enum ErrorMessage {
RateLimited = 'Too many successive server requests. Please wait a few minutes and try again.',
InsufficientPasswordMessage = 'Your password must be at least %LENGTH% characters in length. For your security, please choose a longer password or, ideally, a passphrase, and try again.',
PasscodeRequired = 'Your passcode is required in order to register for an account.',
GenericInProgress = 'An existing request is already in progress.',
GenericFail = 'A server error occurred. Please try again.',
}
@@ -0,0 +1,10 @@
import { Uuid } from '@standardnotes/common'
import { ApiEndpointParam } from '../ApiEndpointParam'
import { ApiVersion } from '../../Api/ApiVersion'
export type SubscriptionInviteAcceptRequestParams = {
[ApiEndpointParam.ApiVersion]: ApiVersion.v0
inviteUuid: Uuid
[additionalParam: string]: unknown
}
@@ -0,0 +1,10 @@
import { Uuid } from '@standardnotes/common'
import { ApiEndpointParam } from '../ApiEndpointParam'
import { ApiVersion } from '../../Api/ApiVersion'
export type SubscriptionInviteCancelRequestParams = {
[ApiEndpointParam.ApiVersion]: ApiVersion.v0
inviteUuid: Uuid
[additionalParam: string]: unknown
}
@@ -0,0 +1,10 @@
import { Uuid } from '@standardnotes/common'
import { ApiEndpointParam } from '../ApiEndpointParam'
import { ApiVersion } from '../../Api/ApiVersion'
export type SubscriptionInviteDeclineRequestParams = {
[ApiEndpointParam.ApiVersion]: ApiVersion.v0
inviteUuid: Uuid
[additionalParam: string]: unknown
}
@@ -0,0 +1,7 @@
import { ApiEndpointParam } from '../ApiEndpointParam'
import { ApiVersion } from '../../Api/ApiVersion'
export type SubscriptionInviteListRequestParams = {
[ApiEndpointParam.ApiVersion]: ApiVersion.v0
[additionalParam: string]: unknown
}
@@ -0,0 +1,8 @@
import { ApiEndpointParam } from '../ApiEndpointParam'
import { ApiVersion } from '../../Api/ApiVersion'
export type SubscriptionInviteRequestParams = {
[ApiEndpointParam.ApiVersion]: ApiVersion.v0
identifier: string
[additionalParam: string]: unknown
}
+5
View File
@@ -1,2 +1,7 @@
export * from './ApiEndpointParam'
export * from './Subscription/SubscriptionInviteAcceptRequestParams'
export * from './Subscription/SubscriptionInviteCancelRequestParams'
export * from './Subscription/SubscriptionInviteDeclineRequestParams'
export * from './Subscription/SubscriptionInviteListRequestParams'
export * from './Subscription/SubscriptionInviteRequestParams'
export * from './User/UserRegistrationRequestParams'
@@ -0,0 +1,7 @@
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteAcceptResponseBody } from './SubscriptionInviteAcceptResponseBody'
export interface SubscriptionInviteAcceptResponse extends HttpResponse {
data: SubscriptionInviteAcceptResponseBody | HttpErrorResponseBody
}
@@ -0,0 +1,3 @@
export type SubscriptionInviteAcceptResponseBody = {
success: boolean
}
@@ -0,0 +1,7 @@
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteCancelResponseBody } from './SubscriptionInviteCancelResponseBody'
export interface SubscriptionInviteCancelResponse extends HttpResponse {
data: SubscriptionInviteCancelResponseBody | HttpErrorResponseBody
}
@@ -0,0 +1,3 @@
export type SubscriptionInviteCancelResponseBody = {
success: boolean
}
@@ -0,0 +1,7 @@
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteDeclineResponseBody } from './SubscriptionInviteDeclineResponseBody'
export interface SubscriptionInviteDeclineResponse extends HttpResponse {
data: SubscriptionInviteDeclineResponseBody | HttpErrorResponseBody
}
@@ -0,0 +1,3 @@
export type SubscriptionInviteDeclineResponseBody = {
success: boolean
}
@@ -0,0 +1,7 @@
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteListResponseBody } from './SubscriptionInviteListResponseBody'
export interface SubscriptionInviteListResponse extends HttpResponse {
data: SubscriptionInviteListResponseBody | HttpErrorResponseBody
}
@@ -0,0 +1,5 @@
import { Invitation } from '@standardnotes/models'
export type SubscriptionInviteListResponseBody = {
invitations: Array<Invitation>
}
@@ -0,0 +1,7 @@
import { HttpErrorResponseBody } from '../../Http/HttpErrorResponseBody'
import { HttpResponse } from '../../Http/HttpResponse'
import { SubscriptionInviteResponseBody } from './SubscriptionInviteResponseBody'
export interface SubscriptionInviteResponse extends HttpResponse {
data: SubscriptionInviteResponseBody | HttpErrorResponseBody
}
@@ -0,0 +1,10 @@
import { Uuid } from '@standardnotes/common'
export type SubscriptionInviteResponseBody =
| {
success: true
sharedSubscriptionInvitationUuid: Uuid
}
| {
success: false
}
+10
View File
@@ -1,2 +1,12 @@
export * from './Subscription/SubscriptionInviteAcceptResponse'
export * from './Subscription/SubscriptionInviteAcceptResponseBody'
export * from './Subscription/SubscriptionInviteCancelResponse'
export * from './Subscription/SubscriptionInviteCancelResponseBody'
export * from './Subscription/SubscriptionInviteDeclineResponse'
export * from './Subscription/SubscriptionInviteDeclineResponseBody'
export * from './Subscription/SubscriptionInviteListResponse'
export * from './Subscription/SubscriptionInviteListResponseBody'
export * from './Subscription/SubscriptionInviteResponse'
export * from './Subscription/SubscriptionInviteResponseBody'
export * from './User/UserRegistrationResponse'
export * from './User/UserRegistrationResponseBody'
@@ -0,0 +1,15 @@
import { Uuid } from '@standardnotes/common'
const SharingPaths = {
invite: '/v1/subscription-invites',
acceptInvite: (inviteUuid: Uuid) => `/v1/subscription-invites/${inviteUuid}/accept`,
declineInvite: (inviteUuid: Uuid) => `/v1/subscription-invites/${inviteUuid}/decline`,
cancelInvite: (inviteUuid: Uuid) => `/v1/subscription-invites/${inviteUuid}`,
listInvites: '/v1/subscription-invites',
}
export const Paths = {
v1: {
...SharingPaths,
},
}
@@ -0,0 +1,106 @@
import { Invitation } from '@standardnotes/models'
import { ApiVersion } from '../../Api'
import { HttpServiceInterface } from '../../Http'
import { SubscriptionInviteResponse } from '../../Response'
import { SubscriptionInviteAcceptResponse } from '../../Response/Subscription/SubscriptionInviteAcceptResponse'
import { SubscriptionInviteCancelResponse } from '../../Response/Subscription/SubscriptionInviteCancelResponse'
import { SubscriptionInviteDeclineResponse } from '../../Response/Subscription/SubscriptionInviteDeclineResponse'
import { SubscriptionInviteListResponse } from '../../Response/Subscription/SubscriptionInviteListResponse'
import { SubscriptionServer } from './SubscriptionServer'
describe('SubscriptionServer', () => {
let httpService: HttpServiceInterface
const createServer = () => new SubscriptionServer(httpService)
beforeEach(() => {
httpService = {} as jest.Mocked<HttpServiceInterface>
})
it('should invite a user to a shared subscription', async () => {
httpService.post = jest.fn().mockReturnValue({
data: { success: true, sharedSubscriptionInvitationUuid: '1-2-3' },
} as jest.Mocked<SubscriptionInviteResponse>)
const response = await createServer().invite({
api: ApiVersion.v0,
identifier: '[email protected]',
})
expect(response).toEqual({
data: {
success: true,
sharedSubscriptionInvitationUuid: '1-2-3',
},
})
})
it('should accept an invite to a shared subscription', async () => {
httpService.get = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<SubscriptionInviteAcceptResponse>)
const response = await createServer().acceptInvite({
api: ApiVersion.v0,
inviteUuid: '1-2-3',
})
expect(response).toEqual({
data: {
success: true,
},
})
})
it('should decline an invite to a shared subscription', async () => {
httpService.get = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<SubscriptionInviteDeclineResponse>)
const response = await createServer().declineInvite({
api: ApiVersion.v0,
inviteUuid: '1-2-3',
})
expect(response).toEqual({
data: {
success: true,
},
})
})
it('should cancel an invite to a shared subscription', async () => {
httpService.delete = jest.fn().mockReturnValue({
data: { success: true },
} as jest.Mocked<SubscriptionInviteCancelResponse>)
const response = await createServer().cancelInvite({
api: ApiVersion.v0,
inviteUuid: '1-2-3',
})
expect(response).toEqual({
data: {
success: true,
},
})
})
it('should list invitations to a shared subscription', async () => {
httpService.get = jest.fn().mockReturnValue({
data: { invitations: [{} as jest.Mocked<Invitation>] },
} as jest.Mocked<SubscriptionInviteListResponse>)
const response = await createServer().listInvites({
api: ApiVersion.v0,
})
expect(response).toEqual({
data: {
invitations: [{} as jest.Mocked<Invitation>],
},
})
})
})
@@ -0,0 +1,48 @@
import { HttpServiceInterface } from '../../Http/HttpServiceInterface'
import { SubscriptionInviteAcceptRequestParams } from '../../Request/Subscription/SubscriptionInviteAcceptRequestParams'
import { SubscriptionInviteCancelRequestParams } from '../../Request/Subscription/SubscriptionInviteCancelRequestParams'
import { SubscriptionInviteDeclineRequestParams } from '../../Request/Subscription/SubscriptionInviteDeclineRequestParams'
import { SubscriptionInviteListRequestParams } from '../../Request/Subscription/SubscriptionInviteListRequestParams'
import { SubscriptionInviteRequestParams } from '../../Request/Subscription/SubscriptionInviteRequestParams'
import { SubscriptionInviteAcceptResponse } from '../../Response/Subscription/SubscriptionInviteAcceptResponse'
import { SubscriptionInviteCancelResponse } from '../../Response/Subscription/SubscriptionInviteCancelResponse'
import { SubscriptionInviteDeclineResponse } from '../../Response/Subscription/SubscriptionInviteDeclineResponse'
import { SubscriptionInviteListResponse } from '../../Response/Subscription/SubscriptionInviteListResponse'
import { SubscriptionInviteResponse } from '../../Response/Subscription/SubscriptionInviteResponse'
import { Paths } from './Paths'
import { SubscriptionServerInterface } from './SubscriptionServerInterface'
export class SubscriptionServer implements SubscriptionServerInterface {
constructor(private httpService: HttpServiceInterface) {}
async acceptInvite(params: SubscriptionInviteAcceptRequestParams): Promise<SubscriptionInviteAcceptResponse> {
const response = await this.httpService.get(Paths.v1.acceptInvite(params.inviteUuid), params)
return response as SubscriptionInviteAcceptResponse
}
async declineInvite(params: SubscriptionInviteDeclineRequestParams): Promise<SubscriptionInviteDeclineResponse> {
const response = await this.httpService.get(Paths.v1.declineInvite(params.inviteUuid), params)
return response as SubscriptionInviteDeclineResponse
}
async cancelInvite(params: SubscriptionInviteCancelRequestParams): Promise<SubscriptionInviteCancelResponse> {
const response = await this.httpService.delete(Paths.v1.cancelInvite(params.inviteUuid), params)
return response as SubscriptionInviteCancelResponse
}
async listInvites(params: SubscriptionInviteListRequestParams): Promise<SubscriptionInviteListResponse> {
const response = await this.httpService.get(Paths.v1.listInvites, params)
return response as SubscriptionInviteListResponse
}
async invite(params: SubscriptionInviteRequestParams): Promise<SubscriptionInviteResponse> {
const response = await this.httpService.post(Paths.v1.invite, params)
return response as SubscriptionInviteResponse
}
}
@@ -0,0 +1,18 @@
import { SubscriptionInviteAcceptRequestParams } from '../../Request/Subscription/SubscriptionInviteAcceptRequestParams'
import { SubscriptionInviteCancelRequestParams } from '../../Request/Subscription/SubscriptionInviteCancelRequestParams'
import { SubscriptionInviteDeclineRequestParams } from '../../Request/Subscription/SubscriptionInviteDeclineRequestParams'
import { SubscriptionInviteListRequestParams } from '../../Request/Subscription/SubscriptionInviteListRequestParams'
import { SubscriptionInviteRequestParams } from '../../Request/Subscription/SubscriptionInviteRequestParams'
import { SubscriptionInviteAcceptResponse } from '../../Response/Subscription/SubscriptionInviteAcceptResponse'
import { SubscriptionInviteCancelResponse } from '../../Response/Subscription/SubscriptionInviteCancelResponse'
import { SubscriptionInviteDeclineResponse } from '../../Response/Subscription/SubscriptionInviteDeclineResponse'
import { SubscriptionInviteListResponse } from '../../Response/Subscription/SubscriptionInviteListResponse'
import { SubscriptionInviteResponse } from '../../Response/Subscription/SubscriptionInviteResponse'
export interface SubscriptionServerInterface {
invite(params: SubscriptionInviteRequestParams): Promise<SubscriptionInviteResponse>
acceptInvite(params: SubscriptionInviteAcceptRequestParams): Promise<SubscriptionInviteAcceptResponse>
declineInvite(params: SubscriptionInviteDeclineRequestParams): Promise<SubscriptionInviteDeclineResponse>
cancelInvite(params: SubscriptionInviteCancelRequestParams): Promise<SubscriptionInviteCancelResponse>
listInvites(params: SubscriptionInviteListRequestParams): Promise<SubscriptionInviteListResponse>
}
+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.
## [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
## [2.7.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-22)
### Bug Fixes
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.3",
"base64": "2a2ce988902c9fdb7fe507c826bff13592adfe4fbe1c36e8468155730f507573",
"binary": "ae614e38946c480256157554d9af542deb0c9741630ad3242becce391991b994"
"version": "0.2.4",
"base64": "eaa8225677b18448cf6e8191cbf8a23c012590054d60434730cad20fd5b056f0",
"binary": "22db0aba7937234f8e0617a508a46de6a517c3e34be7deee87bc80533065f36c"
},
"org.standardnotes.file-safe": {
"version": "2.0.16",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/components-meta",
"version": "2.7.8",
"version": "2.7.10",
"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.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
## [0.2.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-13)
### Bug Fixes
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/advanced-checklist",
"version": "0.2.3",
"version": "0.2.4",
"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",
+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.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
## [3.23.105](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.104](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-29)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.103](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-25)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.102](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-24)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.101](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/desktop
## [3.23.100](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**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.100",
"version": "3.23.113",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,
+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.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
## [1.14.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/encryption
## [1.14.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/encryption
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.14.1",
"version": "1.14.4",
"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",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.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
## [1.50.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-13)
**Note:** Version bump only for package @standardnotes/features
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/features",
"version": "1.50.4",
"version": "1.50.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -22,7 +22,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest"
"test": "jest"
},
"dependencies": {
"@standardnotes/auth": "^3.19.4",
+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.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
## [1.22.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.22.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/filepicker
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.22.1",
"version": "1.22.4",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -20,7 +20,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest"
"test": "jest"
},
"devDependencies": {
"@types/jest": "^28.1.5",
+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.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
## [1.9.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/files
## [1.9.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/files
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.9.1",
"version": "1.9.4",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -20,7 +20,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest"
"test": "jest"
},
"devDependencies": {
"@types/jest": "^28.1.5",
+60
View File
@@ -3,6 +3,66 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [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
## [3.31.21](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.20](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-29)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.19](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-25)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.18](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-24)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.17](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/mobile
## [3.31.16](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**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.16",
"version": "3.32.0",
"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.17.0](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
### Features
* **api:** add subscription server and client services and interfaces ([#1470](https://github.com/standardnotes/app/issues/1470)) ([089d3a2](https://github.com/standardnotes/app/commit/089d3a2e669f5a24bb4a38fc7582b423980d2d22))
## [1.16.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/models
## [1.16.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
### Bug Fixes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.16.1",
"version": "1.17.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -20,7 +20,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest"
"test": "jest"
},
"devDependencies": {
"@types/jest": "^28.1.5",
@@ -0,0 +1,15 @@
import { InvitationStatus } from './InvitationStatus'
import { InviteeIdentifierType } from './InviteeIdentifierType'
import { InviterIdentifierType } from './InviterIdentifierType'
export type Invitation = {
uuid: string
inviterIdentifier: string
inviterIdentifierType: InviterIdentifierType
inviteeIdentifier: string
inviteeIdentifierType: InviteeIdentifierType
status: InvitationStatus
subscriptionId: number
createdAt: number
updatedAt: number
}
@@ -0,0 +1,6 @@
export enum InvitationStatus {
Sent = 'sent',
Canceled = 'canceled',
Accepted = 'accepted',
Declined = 'declined',
}
@@ -0,0 +1,5 @@
export enum InviteeIdentifierType {
Email = 'email',
Hash = 'hash',
Uuid = 'uuid',
}
@@ -0,0 +1,4 @@
export enum InviterIdentifierType {
Email = 'email',
Uuid = 'uuid',
}
+4
View File
@@ -24,6 +24,10 @@ export * from './Abstract/Contextual/SessionHistory'
export * from './Abstract/Item'
export * from './Abstract/Payload'
export * from './Abstract/TransferPayload'
export * from './Api/Subscription/Invitation'
export * from './Api/Subscription/InvitationStatus'
export * from './Api/Subscription/InviteeIdentifierType'
export * from './Api/Subscription/InviterIdentifierType'
export * from './Local/KeyParams/RootKeyParamsInterface'
export * from './Local/RootKey/KeychainTypes'
export * from './Local/RootKey/RootKeyContent'
+56
View File
@@ -3,6 +3,62 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [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.3.27](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.26](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-29)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.25](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-25)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.24](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-24)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.23](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/releases
## [1.3.22](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/releases
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.3.22",
"version": "1.3.36",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.9.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/responses
## [1.9.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-13)
### Bug Fixes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/responses",
"version": "1.9.3",
"version": "1.9.4",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -21,7 +21,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest spec --coverage --passWithNoTests"
"test": "jest spec --coverage --passWithNoTests"
},
"devDependencies": {
"@types/jest": "^28.1.5",
+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.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
## [1.17.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
### Bug Fixes
* **services:** counting trashed and archived items ([7bff3de](https://github.com/standardnotes/app/commit/7bff3dee24d058be91cb278b09692b4ff4396106))
## [1.17.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
### Bug Fixes
+8
View File
@@ -7,5 +7,13 @@ module.exports = {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
coverageThreshold: {
global: {
branches: 9,
functions: 9,
lines: 16,
statements: 16
}
}
};
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/services",
"version": "1.17.1",
"version": "1.18.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -20,7 +20,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest spec --coverage"
"test": "jest spec --coverage"
},
"dependencies": {
"@standardnotes/auth": "^3.19.4",
@@ -2,6 +2,7 @@ export enum Environment {
Web = 1,
Desktop = 2,
Mobile = 3,
NativeMobileWeb = 4,
}
export enum Platform {
@@ -1,16 +1,16 @@
import {
InternalEventBusInterface,
SyncServiceInterface,
ItemManagerInterface,
AlertService,
ApiServiceInterface,
ChallengeServiceInterface,
} from '@standardnotes/services'
import { FileService } from './FileService'
import { PureCryptoInterface, StreamEncryptor } from '@standardnotes/sncrypto-common'
import { FileItem } from '@standardnotes/models'
import { EncryptionProvider } from '@standardnotes/encryption'
import { ItemManagerInterface } from '../Item/ItemManagerInterface'
import { ChallengeServiceInterface } from '../Challenge'
import { InternalEventBusInterface } from '..'
import { AlertService } from '../Alert/AlertService'
import { ApiServiceInterface } from '../Api/ApiServiceInterface'
import { SyncServiceInterface } from '../Sync/SyncServiceInterface'
import { FileService } from './FileService'
describe('fileService', () => {
let apiService: ApiServiceInterface
let itemManager: ItemManagerInterface
@@ -13,6 +13,10 @@ describe('ItemCounter', () => {
{
trashed: true,
} as jest.Mocked<SNNote>,
{
archived: true,
trashed: true,
} as jest.Mocked<SNNote>,
{
content_type: ContentType.Note,
} as jest.Mocked<SNNote>,
@@ -23,7 +27,7 @@ describe('ItemCounter', () => {
expect(createCounter().countNotesAndTags(items)).toEqual({
archived: 1,
deleted: 1,
deleted: 2,
notes: 1,
tags: 1,
})
@@ -13,13 +13,13 @@ export class ItemCounter implements ItemCounterInterface {
}
for (const item of items) {
if (item.archived) {
counts.archived++
if (item.trashed) {
counts.deleted++
continue
}
if (item.trashed) {
counts.deleted++
if (item.archived) {
counts.archived++
continue
}
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.11.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/sncrypto-common
# 1.11.0 (2022-07-06)
### Features
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/sncrypto-common",
"version": "1.11.0",
"version": "1.11.1",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -21,7 +21,7 @@
"build": "tsc -p tsconfig.json",
"watch": "tsc -p tsconfig.json --watch",
"lint": "eslint . --ext .ts",
"test:unit": "yarn lint"
"test": "yarn lint"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.30.0",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.12.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/sncrypto-web
## [1.12.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-06)
**Note:** Version bump only for package @standardnotes/sncrypto-web
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/sncrypto-web",
"version": "1.12.2",
"version": "1.12.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
+28
View File
@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [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
## [2.125.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/snjs
## [2.125.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-24)
### Bug Fixes
* **snjs:** showing archived notes on trashed smart view ([#1426](https://github.com/standardnotes/app/issues/1426)) ([2c69a51](https://github.com/standardnotes/app/commit/2c69a514a8a2c3cfe713e118bb6997f21e41ebe8))
## [2.125.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/snjs
## [2.125.1](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/snjs
+1 -1
View File
@@ -58,5 +58,5 @@ yarn start:server:e2e
From the root of the repository, run:
```
yarn run test:unit
yarn run test
```
+1 -1
View File
@@ -31,7 +31,7 @@ module.exports = {
branches: 13,
functions: 22,
lines: 27,
statements: 28,
statements: 27,
},
},
}
@@ -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]
}
@@ -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}`
}
@@ -11,6 +11,8 @@ import {
FillItemContent,
PayloadTimestampDefaults,
NoteContent,
SmartView,
SystemViewId,
} from '@standardnotes/models'
const setupRandomUuid = () => {
@@ -179,6 +181,39 @@ describe('itemManager', () => {
const notes = itemManager.getDisplayableNotes()
expect(notes).toHaveLength(1)
})
it('viewing trashed notes smart view should include archived notes', async () => {
itemManager = createService()
const archivedNote = createNote('archived')
const trashedNote = createNote('trashed')
const archivedAndTrashedNote = createNote('archived&trashed')
await itemManager.insertItems([archivedNote, trashedNote, archivedAndTrashedNote])
await itemManager.changeItem<Models.NoteMutator>(archivedNote, (m) => {
m.archived = true
})
await itemManager.changeItem<Models.NoteMutator>(trashedNote, (m) => {
m.trashed = true
})
await itemManager.changeItem<Models.NoteMutator>(archivedAndTrashedNote, (m) => {
m.trashed = true
m.archived = true
})
itemManager.setPrimaryItemDisplayOptions({
sortBy: 'title',
sortDirection: 'asc',
includeArchived: false,
includeTrashed: false,
views: [{ uuid: SystemViewId.TrashedNotes } as jest.Mocked<SmartView>],
})
const notes = itemManager.getDisplayableNotes()
expect(notes).toHaveLength(2)
})
})
describe('tag relationships', () => {
@@ -127,20 +127,20 @@ export class ItemManager
const override: Models.FilterDisplayOptions = {}
if (options.views && options.views.find((view) => view.uuid === Models.SystemViewId.AllNotes)) {
if (options.includeArchived == undefined) {
if (options.includeArchived === undefined) {
override.includeArchived = false
}
if (options.includeTrashed == undefined) {
if (options.includeTrashed === undefined) {
override.includeTrashed = false
}
}
if (options.views && options.views.find((view) => view.uuid === Models.SystemViewId.ArchivedNotes)) {
if (options.includeTrashed == undefined) {
if (options.includeTrashed === undefined) {
override.includeTrashed = false
}
}
if (options.views && options.views.find((view) => view.uuid === Models.SystemViewId.TrashedNotes)) {
if (options.includeArchived == undefined) {
if (!options.includeArchived) {
override.includeArchived = true
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/snjs",
"version": "2.125.1",
"version": "2.126.0",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -25,7 +25,7 @@
"lint": "yarn lint:tsc && yarn lint:eslint",
"lint:eslint": "eslint --ext .ts lib/",
"lint:tsc": "tsc --noEmit --emitDeclarationOnly false --project lib/tsconfig.json",
"test:unit": "jest spec --coverage",
"test": "jest spec --coverage",
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand"
},
"devDependencies": {
+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.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
## [1.1.3](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/ui-services
## [1.1.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/ui-services
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/ui-services",
"version": "1.1.2",
"version": "1.1.6",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -20,7 +20,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest spec --coverage"
"test": "jest spec --coverage --passWithNoTests"
},
"dependencies": {
"@standardnotes/common": "^1.30.0",
+4
View File
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.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
## [1.8.2](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-07-13)
### Bug Fixes
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/utils",
"version": "1.8.2",
"version": "1.8.3",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -22,7 +22,7 @@
"prebuild": "yarn clean",
"build": "tsc -p tsconfig.json",
"lint": "eslint . --ext .ts",
"test:unit": "jest spec"
"test": "jest spec"
},
"dependencies": {
"@standardnotes/common": "^1.23.1",
+65
View File
@@ -3,6 +3,71 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [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
## [3.45.9](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-31)
**Note:** Version bump only for package @standardnotes/web
## [3.45.8](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-29)
### Bug Fixes
* tag autocomplete result not clickable on iOS ([#1455](https://github.com/standardnotes/app/issues/1455)) ([876c0e8](https://github.com/standardnotes/app/commit/876c0e83ca52d918854601b4929259711cc9a5eb))
## [3.45.7](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-25)
### Bug Fixes
* editor content being hidden under keyboard on mobile ([#1410](https://github.com/standardnotes/app/issues/1410)) ([520b3ad](https://github.com/standardnotes/app/commit/520b3add0f8597c79706812c4819fb23a551becc))
## [3.45.6](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-24)
**Note:** Version bump only for package @standardnotes/web
## [3.45.5](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
**Note:** Version bump only for package @standardnotes/web
## [3.45.4](https://github.com/standardnotes/app/compare/@standardnotes/[email protected]...@standardnotes/[email protected]) (2022-08-23)
### Bug Fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@standardnotes/web",
"version": "3.45.4",
"version": "3.45.17",
"license": "AGPL-3.0-or-later",
"main": "dist/app.js",
"author": "Standard Notes.",
+3 -14
View File
@@ -34,18 +34,13 @@ import { ApplicationGroup } from './Application/ApplicationGroup'
import { WebOrDesktopDevice } from './Application/Device/WebOrDesktopDevice'
import { WebApplication } from './Application/Application'
import { createRoot, Root } from 'react-dom/client'
import { ElementIds } from './Constants/ElementIDs'
let keyCount = 0
const getKey = () => {
return keyCount++
}
const RootId = 'app-group-root'
const setViewportHeight = () => {
document.documentElement.style.setProperty('--viewport-height', `${window.innerHeight}px`)
}
const startApplication: StartApplication = async function startApplication(
defaultSyncServerHost: string,
device: WebOrDesktopDevice,
@@ -58,24 +53,18 @@ const startApplication: StartApplication = async function startApplication(
let root: Root
const onDestroy = () => {
const rootElement = document.getElementById(RootId) as HTMLElement
const rootElement = document.getElementById(ElementIds.RootId) as HTMLElement
root.unmount()
rootElement.remove()
window.removeEventListener('resize', setViewportHeight)
window.removeEventListener('orientationchange', setViewportHeight)
renderApp()
}
const renderApp = () => {
const rootElement = document.createElement('div')
rootElement.id = RootId
rootElement.id = ElementIds.RootId
const appendedRootNode = document.body.appendChild(rootElement)
root = createRoot(appendedRootNode)
setViewportHeight()
window.addEventListener('resize', setViewportHeight)
window.addEventListener('orientationchange', setViewportHeight)
disableIosTextFieldZoom()
root.render(
@@ -33,7 +33,7 @@ const VisibilityChangeKey = 'visibilitychange'
const MSToWaitAfterIframeLoadToAvoidFlicker = 35
const ComponentView: FunctionComponent<IProps> = ({ application, onLoad, componentViewer, requestReload }) => {
const iframeRef = useRef<HTMLIFrameElement>(null)
const iframeRef = useRef<HTMLIFrameElement | null>(null)
const [loadTimeout, setLoadTimeout] = useState<ReturnType<typeof setTimeout> | undefined>(undefined)
const [hasIssueLoading, setHasIssueLoading] = useState(false)
@@ -200,6 +200,7 @@ const ComponentView: FunctionComponent<IProps> = ({ application, onLoad, compone
{error === ComponentViewerError.MissingUrl && <UrlMissing componentName={component.displayName} />}
{component.uuid && isComponentValid && (
<iframe
className="min-h-[40rem]"
ref={iframeRef}
onLoad={onIframeLoad}
data-component-viewer-id={componentViewer.identifier}

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