Merge branch 'main' of github.com:standardnotes/app

This commit is contained in:
Aman Harwara
2023-01-21 15:55:41 +05:30
170 changed files with 1204 additions and 757 deletions

Binary file not shown.

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.24.6](https://github.com/standardnotes/app/compare/@standardnotes/api@1.24.5...@standardnotes/api@1.24.6) (2023-01-20)
**Note:** Version bump only for package @standardnotes/api
## [1.24.5](https://github.com/standardnotes/app/compare/@standardnotes/api@1.24.4...@standardnotes/api@1.24.5) (2023-01-20)
**Note:** Version bump only for package @standardnotes/api
## [1.24.4](https://github.com/standardnotes/app/compare/@standardnotes/api@1.24.3...@standardnotes/api@1.24.4) (2023-01-20)
**Note:** Version bump only for package @standardnotes/api
## [1.24.3](https://github.com/standardnotes/app/compare/@standardnotes/api@1.24.2...@standardnotes/api@1.24.3) (2023-01-20)
**Note:** Version bump only for package @standardnotes/api
## [1.24.2](https://github.com/standardnotes/app/compare/@standardnotes/api@1.24.1...@standardnotes/api@1.24.2) (2023-01-19)
**Note:** Version bump only for package @standardnotes/api
## [1.24.1](https://github.com/standardnotes/app/compare/@standardnotes/api@1.24.0...@standardnotes/api@1.24.1) (2023-01-19)
**Note:** Version bump only for package @standardnotes/api
# [1.24.0](https://github.com/standardnotes/app/compare/@standardnotes/api@1.23.2...@standardnotes/api@1.24.0) (2023-01-18)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api",
"version": "1.24.0",
"version": "1.24.6",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -36,12 +36,12 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.45.0",
"@standardnotes/domain-core": "^1.11.0",
"@standardnotes/common": "^1.46.4",
"@standardnotes/domain-core": "^1.11.1",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/security": "^1.7.0",
"@standardnotes/security": "^1.7.5",
"@standardnotes/utils": "workspace:*",
"reflect-metadata": "^0.1.13"
}

View File

@@ -10,7 +10,6 @@ import { SubscriptionInviteAcceptResponse } from '../../Response/Subscription/Su
import { SubscriptionApiServiceInterface } from './SubscriptionApiServiceInterface'
import { SubscriptionApiOperations } from './SubscriptionApiOperations'
import { Uuid } from '@standardnotes/common'
import { AppleIAPConfirmResponse } from './../../Response/Subscription/AppleIAPConfirmResponse'
import { AppleIAPConfirmRequestParams } from '../../Request'
@@ -83,7 +82,7 @@ export class SubscriptionApiService implements SubscriptionApiServiceInterface {
}
}
async acceptInvite(inviteUuid: Uuid): Promise<SubscriptionInviteAcceptResponse> {
async acceptInvite(inviteUuid: string): Promise<SubscriptionInviteAcceptResponse> {
if (this.operationsInProgress.get(SubscriptionApiOperations.AcceptingInvite)) {
throw new ApiCallError(ErrorMessage.GenericInProgress)
}

View File

@@ -1,5 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { AppleIAPConfirmResponse } from './../../Response/Subscription/AppleIAPConfirmResponse'
import { AppleIAPConfirmRequestParams } from '../../Request'
import { SubscriptionInviteAcceptResponse } from '../../Response/Subscription/SubscriptionInviteAcceptResponse'
@@ -10,7 +8,7 @@ import { SubscriptionInviteResponse } from '../../Response/Subscription/Subscrip
export interface SubscriptionApiServiceInterface {
invite(inviteeEmail: string): Promise<SubscriptionInviteResponse>
listInvites(): Promise<SubscriptionInviteListResponse>
cancelInvite(inviteUuid: Uuid): Promise<SubscriptionInviteCancelResponse>
acceptInvite(inviteUuid: Uuid): Promise<SubscriptionInviteAcceptResponse>
cancelInvite(inviteUuid: string): Promise<SubscriptionInviteCancelResponse>
acceptInvite(inviteUuid: string): Promise<SubscriptionInviteAcceptResponse>
confirmAppleIAP(params: AppleIAPConfirmRequestParams): Promise<AppleIAPConfirmResponse>
}

View File

@@ -1,4 +1,4 @@
import { UserRequestType, Uuid } from '@standardnotes/common'
import { UserRequestType } from '@standardnotes/common'
import { type RootKeyParamsInterface } from '@standardnotes/models'
import { UserDeletionResponse } from '../../Response/User/UserDeletionResponse'
@@ -12,6 +12,6 @@ export interface UserApiServiceInterface {
keyParams: RootKeyParamsInterface
ephemeral: boolean
}): Promise<UserRegistrationResponse>
submitUserRequest(dto: { userUuid: Uuid; requestType: UserRequestType }): Promise<UserRequestResponse>
submitUserRequest(dto: { userUuid: string; requestType: UserRequestType }): Promise<UserRequestResponse>
deleteAccount(userUuid: string): Promise<UserDeletionResponse>
}

View File

@@ -1,4 +1,4 @@
import { Uuid, WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import { WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import { ErrorMessage } from '../../Error/ErrorMessage'
import { ApiCallError } from '../../Error/ApiCallError'
@@ -96,7 +96,7 @@ export class WorkspaceApiService implements WorkspaceApiServiceInterface {
async inviteToWorkspace(dto: {
inviteeEmail: string
workspaceUuid: Uuid
workspaceUuid: string
accessLevel: WorkspaceAccessLevel
}): Promise<WorkspaceInvitationResponse> {
this.lockOperation(WorkspaceApiOperations.Inviting)

View File

@@ -1,4 +1,4 @@
import { Uuid, WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import { WorkspaceAccessLevel, WorkspaceType } from '@standardnotes/common'
import { WorkspaceKeyshareInitiatingResponse } from '../../Response/Workspace/WorkspaceKeyshareInitiatingResponse'
import { WorkspaceCreationResponse } from '../../Response/Workspace/WorkspaceCreationResponse'
@@ -17,20 +17,20 @@ export interface WorkspaceApiServiceInterface {
}): Promise<WorkspaceCreationResponse>
inviteToWorkspace(dto: {
inviteeEmail: string
workspaceUuid: Uuid
workspaceUuid: string
accessLevel: WorkspaceAccessLevel
}): Promise<WorkspaceInvitationResponse>
acceptInvite(dto: {
inviteUuid: Uuid
userUuid: Uuid
inviteUuid: string
userUuid: string
publicKey: string
encryptedPrivateKey: string
}): Promise<WorkspaceInvitationAcceptingResponse>
listWorkspaces(): Promise<WorkspaceListResponse>
listWorkspaceUsers(dto: { workspaceUuid: Uuid }): Promise<WorkspaceUserListResponse>
listWorkspaceUsers(dto: { workspaceUuid: string }): Promise<WorkspaceUserListResponse>
initiateKeyshare(dto: {
workspaceUuid: Uuid
userUuid: Uuid
workspaceUuid: string
userUuid: string
encryptedWorkspaceKey: string
}): Promise<WorkspaceKeyshareInitiatingResponse>
}

View File

@@ -1,11 +1,11 @@
import { Uuid, WorkspaceAccessLevel, WorkspaceUserStatus } from '@standardnotes/common'
import { WorkspaceAccessLevel, WorkspaceUserStatus } from '@standardnotes/common'
export type WorkspaceUser = {
uuid: Uuid
uuid: string
accessLevel: WorkspaceAccessLevel
userUuid: Uuid
userUuid: string
userDisplayName: string | null
workspaceUuid: Uuid
workspaceUuid: string
encryptedWorkspaceKey: string | null
publicKey: string | null
encryptedPrivateKey: string | null

View File

@@ -1,9 +1,8 @@
import { Role } from '@standardnotes/security'
import { Uuid } from '@standardnotes/common'
export type HttpResponseMeta = {
auth: {
userUuid?: Uuid
userUuid?: string
roles?: Role[]
}
server: {

View File

@@ -1,6 +1,4 @@
import { Uuid } from '@standardnotes/common'
export type SubscriptionInviteAcceptRequestParams = {
inviteUuid: Uuid
inviteUuid: string
[additionalParam: string]: unknown
}

View File

@@ -1,10 +1,8 @@
import { Uuid } from '@standardnotes/common'
import { ApiEndpointParam } from '../ApiEndpointParam'
import { ApiVersion } from '../../Api/ApiVersion'
export type SubscriptionInviteCancelRequestParams = {
[ApiEndpointParam.ApiVersion]: ApiVersion.v0
inviteUuid: Uuid
inviteUuid: string
[additionalParam: string]: unknown
}

View File

@@ -1,10 +1,8 @@
import { Uuid } from '@standardnotes/common'
import { ApiEndpointParam } from '../ApiEndpointParam'
import { ApiVersion } from '../../Api/ApiVersion'
export type SubscriptionInviteDeclineRequestParams = {
[ApiEndpointParam.ApiVersion]: ApiVersion.v0
inviteUuid: Uuid
inviteUuid: string
[additionalParam: string]: unknown
}

View File

@@ -1,6 +1,4 @@
import { Uuid } from '@standardnotes/common'
export type UserDeletionRequestParams = {
userUuid: Uuid
userUuid: string
[additionalParam: string]: unknown
}

View File

@@ -1,7 +1,7 @@
import { UserRequestType, Uuid } from '@standardnotes/common'
import { UserRequestType } from '@standardnotes/common'
export type UserRequestRequestParams = {
userUuid: Uuid
userUuid: string
requestType: UserRequestType
[additionalParam: string]: unknown
}

View File

@@ -1,8 +1,6 @@
import { Uuid } from '@standardnotes/common'
export type WorkspaceInvitationAcceptingRequestParams = {
inviteUuid: Uuid
userUuid: Uuid
inviteUuid: string
userUuid: string
publicKey: string
encryptedPrivateKey: string
[additionalParam: string]: unknown

View File

@@ -1,7 +1,7 @@
import { Uuid, WorkspaceAccessLevel } from '@standardnotes/common'
import { WorkspaceAccessLevel } from '@standardnotes/common'
export type WorkspaceInvitationRequestParams = {
workspaceUuid: Uuid
workspaceUuid: string
inviteeEmail: string
accessLevel: WorkspaceAccessLevel
[additionalParam: string]: unknown

View File

@@ -1,8 +1,6 @@
import { Uuid } from '@standardnotes/common'
export type WorkspaceKeyshareInitiatingRequestParams = {
userUuid: Uuid
workspaceUuid: Uuid
userUuid: string
workspaceUuid: string
encryptedWorkspaceKey: string
[additionalParam: string]: unknown
}

View File

@@ -1,6 +1,4 @@
import { Uuid } from '@standardnotes/common'
export type WorkspaceUserListRequestParams = {
workspaceUuid: Uuid
workspaceUuid: string
[additionalParam: string]: unknown
}

View File

@@ -1,9 +1,7 @@
import { Uuid } from '@standardnotes/common'
export type SubscriptionInviteResponseBody =
| {
success: true
sharedSubscriptionInvitationUuid: Uuid
sharedSubscriptionInvitationUuid: string
}
| {
success: false

View File

@@ -1,11 +1,10 @@
import { Uuid } from '@standardnotes/common'
import { KeyParamsData, SessionBody } from '@standardnotes/responses'
export type UserRegistrationResponseBody = {
session: SessionBody
key_params: KeyParamsData
user: {
uuid: Uuid
uuid: string
email: string
}
}

View File

@@ -1,10 +1,8 @@
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}`,
acceptInvite: (inviteUuid: string) => `/v1/subscription-invites/${inviteUuid}/accept`,
declineInvite: (inviteUuid: string) => `/v1/subscription-invites/${inviteUuid}/decline`,
cancelInvite: (inviteUuid: string) => `/v1/subscription-invites/${inviteUuid}`,
listInvites: '/v1/subscription-invites',
}

View File

@@ -1,8 +1,6 @@
import { Uuid } from '@standardnotes/common'
const UserPaths = {
register: '/v1/users',
deleteAccount: (userUuid: Uuid) => `/v1/users/${userUuid}`,
deleteAccount: (userUuid: string) => `/v1/users/${userUuid}`,
}
export const Paths = {

View File

@@ -1,7 +1,5 @@
import { Uuid } from '@standardnotes/common'
const UserRequestPaths = {
submitUserRequest: (userUuid: Uuid) => `/v1/users/${userUuid}/requests`,
submitUserRequest: (userUuid: string) => `/v1/users/${userUuid}/requests`,
}
export const Paths = {

View File

@@ -1,13 +1,11 @@
import { Uuid } from '@standardnotes/common'
const WorkspacePaths = {
createWorkspace: '/v1/workspaces',
listWorkspaces: '/v1/workspaces',
listWorkspaceUsers: (uuid: Uuid) => `/v1/workspaces/${uuid}/users`,
initiateKeyshare: (worksapceUuid: Uuid, userUuid: Uuid) =>
listWorkspaceUsers: (uuid: string) => `/v1/workspaces/${uuid}/users`,
initiateKeyshare: (worksapceUuid: string, userUuid: string) =>
`/v1/workspaces/${worksapceUuid}/users/${userUuid}/keyshare`,
inviteToWorkspace: (uuid: Uuid) => `/v1/workspaces/${uuid}/invites`,
acceptInvite: (uuid: Uuid) => `/v1/invites/${uuid}/accept`,
inviteToWorkspace: (uuid: string) => `/v1/workspaces/${uuid}/invites`,
acceptInvite: (uuid: string) => `/v1/invites/${uuid}/accept`,
}
export const Paths = {

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.
## [3.104.100](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.140.6...@standardnotes/desktop@3.104.100) (2023-01-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.99](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.140.5...@standardnotes/desktop@3.104.99) (2023-01-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.98](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.140.4...@standardnotes/desktop@3.104.98) (2023-01-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.97](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.140.3...@standardnotes/desktop@3.104.97) (2023-01-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.96](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.140.2...@standardnotes/desktop@3.104.96) (2023-01-20)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.95](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.140.1...@standardnotes/desktop@3.104.95) (2023-01-19)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.94](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.140.0...@standardnotes/desktop@3.104.94) (2023-01-19)
**Note:** Version bump only for package @standardnotes/desktop
## [3.104.93](https://github.com/standardnotes/app/compare/@standardnotes/desktop@3.139.0...@standardnotes/desktop@3.104.93) (2023-01-18)
**Note:** Version bump only for package @standardnotes/desktop

View File

@@ -1,7 +1,7 @@
{
"name": "@standardnotes/desktop",
"main": "./app/dist/index.js",
"version": "3.104.93",
"version": "3.104.100",
"license": "AGPL-3.0-or-later",
"author": "Standard Notes.",
"private": true,

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.21.6](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.5...@standardnotes/encryption@1.21.6) (2023-01-20)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.5](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.4...@standardnotes/encryption@1.21.5) (2023-01-20)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.4](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.3...@standardnotes/encryption@1.21.4) (2023-01-20)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.3](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.2...@standardnotes/encryption@1.21.3) (2023-01-20)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.2](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.1...@standardnotes/encryption@1.21.2) (2023-01-19)
**Note:** Version bump only for package @standardnotes/encryption
## [1.21.1](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.21.0...@standardnotes/encryption@1.21.1) (2023-01-19)
**Note:** Version bump only for package @standardnotes/encryption
# [1.21.0](https://github.com/standardnotes/app/compare/@standardnotes/encryption@1.20.1...@standardnotes/encryption@1.21.0) (2023-01-18)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/encryption",
"version": "1.21.0",
"version": "1.21.6",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -35,7 +35,7 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.45.0",
"@standardnotes/common": "^1.46.4",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/sncrypto-common": "workspace:*",

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { DecryptedPayloadInterface, EncryptedPayloadInterface, PayloadInterface } from '@standardnotes/models'
import { EncryptionTypeSplit } from './EncryptionTypeSplit'
import { KeyedDecryptionSplit } from './KeyedDecryptionSplit'
@@ -36,7 +35,7 @@ export function CreateDecryptionSplitWithKeyLookup(
return result
}
export function FindPayloadInEncryptionSplit(uuid: Uuid, split: KeyedEncryptionSplit): DecryptedPayloadInterface {
export function FindPayloadInEncryptionSplit(uuid: string, split: KeyedEncryptionSplit): DecryptedPayloadInterface {
const inUsesItemsKey = split.usesItemsKey?.items.find((item: PayloadInterface) => item.uuid === uuid)
if (inUsesItemsKey) {
return inUsesItemsKey
@@ -60,7 +59,7 @@ export function FindPayloadInEncryptionSplit(uuid: Uuid, split: KeyedEncryptionS
throw Error('Cannot find payload in encryption split')
}
export function FindPayloadInDecryptionSplit(uuid: Uuid, split: KeyedDecryptionSplit): EncryptedPayloadInterface {
export function FindPayloadInDecryptionSplit(uuid: string, split: KeyedDecryptionSplit): EncryptedPayloadInterface {
const inUsesItemsKey = split.usesItemsKey?.items.find((item: PayloadInterface) => item.uuid === uuid)
if (inUsesItemsKey) {
return inUsesItemsKey

View File

@@ -1,6 +1,6 @@
import { ProtocolVersion, Uuid } from '@standardnotes/common'
import { ProtocolVersion } from '@standardnotes/common'
export type ItemAuthenticatedData = {
u: Uuid
u: string
v: ProtocolVersion
}

View File

@@ -3,6 +3,28 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.58.5](https://github.com/standardnotes/app/compare/@standardnotes/features@1.58.4...@standardnotes/features@1.58.5) (2023-01-20)
### Bug Fixes
* fixed issue with third party editors not loading ([#2174](https://github.com/standardnotes/app/issues/2174)) ([e7214ea](https://github.com/standardnotes/app/commit/e7214ea73ad5d3026d958c79022d2238a4d1cfdc))
## [1.58.4](https://github.com/standardnotes/app/compare/@standardnotes/features@1.58.3...@standardnotes/features@1.58.4) (2023-01-20)
**Note:** Version bump only for package @standardnotes/features
## [1.58.3](https://github.com/standardnotes/app/compare/@standardnotes/features@1.58.2...@standardnotes/features@1.58.3) (2023-01-20)
**Note:** Version bump only for package @standardnotes/features
## [1.58.2](https://github.com/standardnotes/app/compare/@standardnotes/features@1.58.1...@standardnotes/features@1.58.2) (2023-01-19)
**Note:** Version bump only for package @standardnotes/features
## [1.58.1](https://github.com/standardnotes/app/compare/@standardnotes/features@1.58.0...@standardnotes/features@1.58.1) (2023-01-19)
**Note:** Version bump only for package @standardnotes/features
# [1.58.0](https://github.com/standardnotes/app/compare/@standardnotes/features@1.57.1...@standardnotes/features@1.58.0) (2023-01-06)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/features",
"version": "1.58.0",
"version": "1.58.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -25,9 +25,9 @@
"test": "jest"
},
"dependencies": {
"@standardnotes/auth": "^3.19.4",
"@standardnotes/common": "^1.45.0",
"@standardnotes/security": "^1.7.0",
"@standardnotes/common": "^1.46.4",
"@standardnotes/domain-core": "^1.11.1",
"@standardnotes/security": "^1.7.5",
"reflect-metadata": "^0.1.13"
},
"devDependencies": {

View File

@@ -5,7 +5,6 @@ describe('note type', () => {
it('should return the correct note type for editor identifier', () => {
expect(noteTypeForEditorIdentifier(FeatureIdentifier.PlainEditor)).toEqual(NoteType.Plain)
expect(noteTypeForEditorIdentifier(FeatureIdentifier.SuperEditor)).toEqual(NoteType.Super)
expect(noteTypeForEditorIdentifier(FeatureIdentifier.MarkdownVisualEditor)).toEqual(NoteType.Markdown)
expect(noteTypeForEditorIdentifier(FeatureIdentifier.MarkdownProEditor)).toEqual(NoteType.Markdown)
expect(noteTypeForEditorIdentifier(FeatureIdentifier.PlusEditor)).toEqual(NoteType.RichText)
expect(noteTypeForEditorIdentifier(FeatureIdentifier.CodeEditor)).toEqual(NoteType.Code)

View File

@@ -1,5 +1,5 @@
import { ComponentPermission } from '../Component/ComponentPermission'
import { ContentType, RoleName, SubscriptionName } from '@standardnotes/common'
import { ContentType, SubscriptionName } from '@standardnotes/common'
import { ComponentArea } from '../Component/ComponentArea'
import { PermissionName } from '../Permission/PermissionName'
import { FeatureIdentifier } from './FeatureIdentifier'
@@ -9,11 +9,11 @@ import { ThemeDockIcon } from '../Component/ThemeDockIcon'
type RoleFields = {
/** Server populated */
role_name?: RoleName
role_name?: string
/** Statically populated. Non-influencing; used as a reference by other static consumers (such as email service) */
availableInSubscriptions: SubscriptionName[]
availableInRoles?: RoleName[]
availableInRoles?: string[]
}
export type BaseFeatureDescription = RoleFields & {

View File

@@ -1,5 +1,4 @@
export enum FeatureIdentifier {
AccountSwitcher = 'com.standardnotes.account-switcher',
CloudLink = 'org.standardnotes.cloudlink',
DailyDropboxBackup = 'org.standardnotes.daily-dropbox-backup',
DailyEmailBackup = 'org.standardnotes.daily-email-backup',
@@ -21,7 +20,6 @@ export enum FeatureIdentifier {
AutobiographyTheme = 'org.standardnotes.theme-autobiography',
DynamicTheme = 'org.standardnotes.theme-dynamic',
DarkTheme = 'org.standardnotes.theme-focus',
FocusMode = 'org.standardnotes.focus-mode',
FuturaTheme = 'org.standardnotes.theme-futura',
MidnightTheme = 'org.standardnotes.theme-midnight',
SolarizedDarkTheme = 'org.standardnotes.theme-solarized-dark',
@@ -32,12 +30,12 @@ export enum FeatureIdentifier {
CodeEditor = 'org.standardnotes.code-editor',
MarkdownProEditor = 'org.standardnotes.advanced-markdown-editor',
MarkdownVisualEditor = 'org.standardnotes.markdown-visual-editor',
PlusEditor = 'org.standardnotes.plus-editor',
SheetsEditor = 'org.standardnotes.standard-sheets',
TaskEditor = 'org.standardnotes.simple-task-editor',
TokenVaultEditor = 'org.standardnotes.token-vault',
DeprecatedMarkdownVisualEditor = 'org.standardnotes.markdown-visual-editor',
DeprecatedBoldEditor = 'org.standardnotes.bold-editor',
DeprecatedMarkdownBasicEditor = 'org.standardnotes.simple-markdown-editor',
DeprecatedMarkdownMathEditor = 'org.standardnotes.fancy-markdown-editor',

View File

@@ -1,7 +1,5 @@
import { FeatureDescription } from './FeatureDescription'
import { FeatureIdentifier } from './FeatureIdentifier'
import { editors } from '../Lists/Editors'
import { themes } from '../Lists/Themes'
import { serverFeatures } from '../Lists/ServerFeatures'
import { clientFeatures } from '../Lists/ClientFeatures'
import { GetDeprecatedFeatures } from '../Lists/DeprecatedFeatures'
@@ -9,14 +7,7 @@ import { experimentalFeatures } from '../Lists/ExperimentalFeatures'
import { SubscriptionName } from '@standardnotes/common'
export function GetFeatures(): FeatureDescription[] {
return [
...themes(),
...editors(),
...serverFeatures(),
...clientFeatures(),
...experimentalFeatures(),
...GetDeprecatedFeatures(),
]
return [...serverFeatures(), ...clientFeatures(), ...experimentalFeatures(), ...GetDeprecatedFeatures()]
}
export function GetFeaturesForSubscription(subscription: SubscriptionName): FeatureDescription[] {

View File

@@ -1,13 +1,19 @@
import { ClientFeatureDescription } from '../Feature/FeatureDescription'
import { FeatureDescription } from '../Feature/FeatureDescription'
import { PermissionName } from '../Permission/PermissionName'
import { FeatureIdentifier } from '../Feature/FeatureIdentifier'
import { RoleName, SubscriptionName } from '@standardnotes/common'
import { SubscriptionName } from '@standardnotes/common'
import { RoleName } from '@standardnotes/domain-core'
import { themes } from './Themes'
import { editors } from './Editors'
export function clientFeatures(): ClientFeatureDescription[] {
export function clientFeatures(): FeatureDescription[] {
return [
...themes(),
...editors(),
{
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Tag Nesting',
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
identifier: FeatureIdentifier.TagNesting,
permission_name: PermissionName.TagNesting,
description: 'Organize your tags into folders.',
@@ -16,45 +22,26 @@ export function clientFeatures(): ClientFeatureDescription[] {
name: 'Super Notes',
identifier: FeatureIdentifier.SuperEditor,
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
permission_name: PermissionName.SuperEditor,
description:
'Type / to bring up the block selection menu, or @ to embed images or link other tags and notes. Type - then space to start a list, or [] then space to start a checklist. Drag and drop an image or file to embed it in your note.',
availableInRoles: [RoleName.PlusUser, RoleName.ProUser],
'A new way to edit notes. Type / to bring up the block selection menu, or @ to embed images or link other tags and notes. Type - then space to start a list, or [] then space to start a checklist. Drag and drop an image or file to embed it in your note. Cmd/Ctrl + F to bring up search and replace.',
},
{
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Smart Filters',
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
identifier: FeatureIdentifier.SmartFilters,
permission_name: PermissionName.SmartFilters,
description: 'Create smart filters for viewing notes matching specific criteria.',
},
{
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Encrypted files',
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.ProUser],
identifier: FeatureIdentifier.Files,
permission_name: PermissionName.Files,
description: '',
},
{
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Focus Mode',
identifier: FeatureIdentifier.FocusMode,
permission_name: PermissionName.FocusMode,
description: '',
},
{
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Listed Custom Domain',
identifier: FeatureIdentifier.ListedCustomDomain,
permission_name: PermissionName.ListedCustomDomain,
description: '',
},
{
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Multiple accounts',
identifier: FeatureIdentifier.AccountSwitcher,
permission_name: PermissionName.AccountSwitcher,
description: '',
},
]
}

View File

@@ -10,6 +10,7 @@ import { NoteType } from '../Component/NoteType'
import { FillEditorComponentDefaults } from './Utilities/FillEditorComponentDefaults'
import { ComponentAction } from '../Component/ComponentAction'
import { ComponentArea } from '../Component/ComponentArea'
import { RoleName } from '@standardnotes/domain-core'
export function GetDeprecatedFeatures(): FeatureDescription[] {
const bold: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -37,6 +38,7 @@ export function GetDeprecatedFeatures(): FeatureDescription[] {
permission_name: PermissionName.BoldEditor,
description: 'A simple and peaceful rich editor that helps you write and think clearly.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/bold.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const markdownBasic: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -50,6 +52,22 @@ export function GetDeprecatedFeatures(): FeatureDescription[] {
permission_name: PermissionName.MarkdownBasicEditor,
description: 'A Markdown editor with dynamic split-pane preview.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/simple-markdown.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const markdownAlt: EditorFeatureDescription = FillEditorComponentDefaults({
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Markdown Alternative',
identifier: FeatureIdentifier.DeprecatedMarkdownVisualEditor,
note_type: NoteType.Markdown,
file_type: 'md',
deprecated: true,
permission_name: PermissionName.MarkdownVisualEditor,
spellcheckControl: true,
description:
'A WYSIWYG-style Markdown editor that renders Markdown in preview-mode while you type without displaying any syntax.',
index_path: 'build/index.html',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const markdownMinimist: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -64,6 +82,7 @@ export function GetDeprecatedFeatures(): FeatureDescription[] {
deprecated: true,
description: 'A minimal Markdown editor with live rendering and in-text search via Ctrl/Cmd + F',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/min-markdown.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const markdownMath: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -78,6 +97,7 @@ export function GetDeprecatedFeatures(): FeatureDescription[] {
index_path: 'index.html',
description: 'A beautiful split-pane Markdown editor with synced-scroll, LaTeX support, and colorful syntax.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/fancy-markdown.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const filesafe: IframeComponentFeatureDescription = FillEditorComponentDefaults({
@@ -104,7 +124,8 @@ export function GetDeprecatedFeatures(): FeatureDescription[] {
description:
'Encrypted attachments for your notes using your Dropbox, Google Drive, or WebDAV server. Limited to 50MB per file.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/FileSafe-banner.png',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
return [bold, markdownBasic, markdownMinimist, markdownMath, filesafe]
return [bold, markdownBasic, markdownMinimist, markdownMath, markdownAlt, filesafe]
}

View File

@@ -4,6 +4,7 @@ import { PermissionName } from '../Permission/PermissionName'
import { FeatureIdentifier } from '../Feature/FeatureIdentifier'
import { NoteType } from '../Component/NoteType'
import { FillEditorComponentDefaults } from './Utilities/FillEditorComponentDefaults'
import { RoleName } from '@standardnotes/domain-core'
export function editors(): EditorFeatureDescription[] {
const code: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -20,6 +21,7 @@ export function editors(): EditorFeatureDescription[] {
'Syntax highlighting and convenient keyboard shortcuts for over 120 programming' +
' languages. Ideal for code snippets and procedures.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/code.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const plus: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -33,6 +35,7 @@ export function editors(): EditorFeatureDescription[] {
description:
'From highlighting to custom font sizes and colors, to tables and lists, this editor is perfect for crafting any document.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/plus-editor.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const markdown: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -46,19 +49,7 @@ export function editors(): EditorFeatureDescription[] {
description:
'A fully featured Markdown editor that supports live preview, a styling toolbar, and split pane support.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/adv-markdown.jpg',
})
const markdownAlt: EditorFeatureDescription = FillEditorComponentDefaults({
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Markdown Alternative',
identifier: FeatureIdentifier.MarkdownVisualEditor,
note_type: NoteType.Markdown,
file_type: 'md',
permission_name: PermissionName.MarkdownVisualEditor,
spellcheckControl: true,
description:
'A WYSIWYG-style Markdown editor that renders Markdown in preview-mode while you type without displaying any syntax.',
index_path: 'build/index.html',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const task: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -73,6 +64,7 @@ export function editors(): EditorFeatureDescription[] {
description:
'A great way to manage short-term and long-term to-do"s. You can mark tasks as completed, change their order, and edit the text naturally in place.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/task-editor.jpg',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const tokenvault: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -86,6 +78,7 @@ export function editors(): EditorFeatureDescription[] {
description:
'Encrypt and protect your 2FA secrets for all your internet accounts. Authenticator handles your 2FA secrets so that you never lose them again, or have to start over when you get a new device.',
thumbnail_url: 'https://standard-notes.s3.amazonaws.com/screenshots/models/editors/token-vault.png',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const spreadsheets: EditorFeatureDescription = FillEditorComponentDefaults({
@@ -99,7 +92,8 @@ export function editors(): EditorFeatureDescription[] {
description:
'A powerful spreadsheet editor with formatting and formula support. Not recommended for large data sets, as encryption of such data may decrease editor performance.',
thumbnail_url: 'https://s3.amazonaws.com/standard-notes/screenshots/models/editors/spreadsheets.png',
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
return [code, plus, markdown, markdownAlt, task, tokenvault, spreadsheets]
return [code, plus, markdown, task, tokenvault, spreadsheets]
}

View File

@@ -65,5 +65,11 @@ export function serverFeatures(): ServerFeatureDescription[] {
identifier: FeatureIdentifier.SubscriptionSharing,
permission_name: PermissionName.SubscriptionSharing,
},
{
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
name: 'Listed Custom Domain',
identifier: FeatureIdentifier.ListedCustomDomain,
permission_name: PermissionName.ListedCustomDomain,
},
]
}

View File

@@ -3,6 +3,7 @@ import { PermissionName } from '../Permission/PermissionName'
import { FeatureIdentifier } from '../Feature/FeatureIdentifier'
import { FillThemeComponentDefaults } from './Utilities/FillThemeComponentDefaults'
import { SubscriptionName } from '@standardnotes/common'
import { RoleName } from '@standardnotes/domain-core'
export function themes(): ThemeFeatureDescription[] {
const midnight: ThemeFeatureDescription = FillThemeComponentDefaults({
@@ -17,10 +18,12 @@ export function themes(): ThemeFeatureDescription[] {
foreground_color: '#ffffff',
border_color: '#086DD6',
},
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
})
const futura: ThemeFeatureDescription = FillThemeComponentDefaults({
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
name: 'Futura',
identifier: FeatureIdentifier.FuturaTheme,
permission_name: PermissionName.FuturaTheme,
@@ -35,6 +38,7 @@ export function themes(): ThemeFeatureDescription[] {
const solarizedDark: ThemeFeatureDescription = FillThemeComponentDefaults({
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
name: 'Solarized Dark',
identifier: FeatureIdentifier.SolarizedDarkTheme,
permission_name: PermissionName.SolarizedDarkTheme,
@@ -49,6 +53,7 @@ export function themes(): ThemeFeatureDescription[] {
const autobiography: ThemeFeatureDescription = FillThemeComponentDefaults({
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
name: 'Autobiography',
identifier: FeatureIdentifier.AutobiographyTheme,
permission_name: PermissionName.AutobiographyTheme,
@@ -77,6 +82,7 @@ export function themes(): ThemeFeatureDescription[] {
const titanium: ThemeFeatureDescription = FillThemeComponentDefaults({
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
name: 'Titanium',
identifier: FeatureIdentifier.TitaniumTheme,
permission_name: PermissionName.TitaniumTheme,
@@ -90,6 +96,7 @@ export function themes(): ThemeFeatureDescription[] {
const dynamic: ThemeFeatureDescription = FillThemeComponentDefaults({
availableInSubscriptions: [SubscriptionName.PlusPlan, SubscriptionName.ProPlan],
availableInRoles: [RoleName.NAMES.PlusUser, RoleName.NAMES.ProUser],
name: 'Dynamic Panels',
identifier: FeatureIdentifier.DynamicTheme,
permission_name: PermissionName.ThemeDynamic,

View File

@@ -1,8 +1,6 @@
import { Uuid } from '@standardnotes/common'
import { PermissionName } from './PermissionName'
export type Permission = {
uuid: Uuid
uuid: string
name: PermissionName
}

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.28.11](https://github.com/standardnotes/app/compare/@standardnotes/filepicker@1.28.10...@standardnotes/filepicker@1.28.11) (2023-01-20)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.10](https://github.com/standardnotes/app/compare/@standardnotes/filepicker@1.28.9...@standardnotes/filepicker@1.28.10) (2023-01-20)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.9](https://github.com/standardnotes/app/compare/@standardnotes/filepicker@1.28.8...@standardnotes/filepicker@1.28.9) (2023-01-20)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.8](https://github.com/standardnotes/app/compare/@standardnotes/filepicker@1.28.7...@standardnotes/filepicker@1.28.8) (2023-01-20)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.7](https://github.com/standardnotes/app/compare/@standardnotes/filepicker@1.28.6...@standardnotes/filepicker@1.28.7) (2023-01-19)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.6](https://github.com/standardnotes/app/compare/@standardnotes/filepicker@1.28.5...@standardnotes/filepicker@1.28.6) (2023-01-19)
**Note:** Version bump only for package @standardnotes/filepicker
## [1.28.5](https://github.com/standardnotes/app/compare/@standardnotes/filepicker@1.28.4...@standardnotes/filepicker@1.28.5) (2023-01-18)
**Note:** Version bump only for package @standardnotes/filepicker

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/filepicker",
"version": "1.28.5",
"version": "1.28.11",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -26,7 +26,7 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.45.0",
"@standardnotes/common": "^1.46.4",
"@standardnotes/files": "workspace:*",
"@standardnotes/utils": "workspace:*",
"@types/wicg-file-system-access": "^2020.9.5",

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.14.21](https://github.com/standardnotes/app/compare/@standardnotes/files@1.14.20...@standardnotes/files@1.14.21) (2023-01-20)
**Note:** Version bump only for package @standardnotes/files
## [1.14.20](https://github.com/standardnotes/app/compare/@standardnotes/files@1.14.19...@standardnotes/files@1.14.20) (2023-01-20)
**Note:** Version bump only for package @standardnotes/files
## [1.14.19](https://github.com/standardnotes/app/compare/@standardnotes/files@1.14.18...@standardnotes/files@1.14.19) (2023-01-20)
**Note:** Version bump only for package @standardnotes/files
## [1.14.18](https://github.com/standardnotes/app/compare/@standardnotes/files@1.14.17...@standardnotes/files@1.14.18) (2023-01-20)
**Note:** Version bump only for package @standardnotes/files
## [1.14.17](https://github.com/standardnotes/app/compare/@standardnotes/files@1.14.16...@standardnotes/files@1.14.17) (2023-01-19)
**Note:** Version bump only for package @standardnotes/files
## [1.14.16](https://github.com/standardnotes/app/compare/@standardnotes/files@1.14.15...@standardnotes/files@1.14.16) (2023-01-19)
**Note:** Version bump only for package @standardnotes/files
## [1.14.15](https://github.com/standardnotes/app/compare/@standardnotes/files@1.14.14...@standardnotes/files@1.14.15) (2023-01-18)
**Note:** Version bump only for package @standardnotes/files

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files",
"version": "1.14.15",
"version": "1.14.21",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -28,7 +28,7 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.45.0",
"@standardnotes/common": "^1.46.4",
"@standardnotes/encryption": "workspace:*",
"@standardnotes/models": "workspace:*",
"@standardnotes/responses": "workspace:*",

View File

@@ -1,15 +1,14 @@
import { removeFromArray } from '@standardnotes/utils'
import { Uuid } from '@standardnotes/common'
import { EncryptedBytes } from '../Types/EncryptedBytes'
export class FileMemoryCache {
private cache: Record<Uuid, EncryptedBytes> = {}
private orderedQueue: Uuid[] = []
private cache: Record<string, EncryptedBytes> = {}
private orderedQueue: string[] = []
constructor(public readonly maxSize: number) {}
add(uuid: Uuid, data: EncryptedBytes): boolean {
add(uuid: string, data: EncryptedBytes): boolean {
if (data.encryptedBytes.length > this.maxSize) {
return false
}
@@ -31,11 +30,11 @@ export class FileMemoryCache {
.reduce((total, fileLength) => total + fileLength, 0)
}
get(uuid: Uuid): EncryptedBytes | undefined {
get(uuid: string): EncryptedBytes | undefined {
return this.cache[uuid]
}
remove(uuid: Uuid): void {
remove(uuid: string): void {
delete this.cache[uuid]
removeFromArray(this.orderedQueue, uuid)

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { FileDownloadProgress } from '../Types/FileDownloadProgress'
import { FileBackupRecord, FileBackupsMapping } from './FileBackupsMapping'
@@ -8,7 +7,7 @@ export type FileBackupReadChunkResponse = { chunk: Uint8Array; isLast: boolean;
export interface FileBackupsDevice {
getFilesBackupsMappingFile(): Promise<FileBackupsMapping>
saveFilesBackupsFile(
uuid: Uuid,
uuid: string,
metaFile: string,
downloadRequest: {
chunkSizes: number[]

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { FileBackupsConstantsV1 } from './FileBackupsConstantsV1'
export type FileBackupRecord = {
@@ -12,5 +11,5 @@ export type FileBackupRecord = {
export interface FileBackupsMapping {
version: typeof FileBackupsConstantsV1.Version
files: Record<Uuid, FileBackupRecord>
files: Record<string, FileBackupRecord>
}

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.
## [3.50.36](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.35...@standardnotes/mobile@3.50.36) (2023-01-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.35](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.34...@standardnotes/mobile@3.50.35) (2023-01-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.34](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.33...@standardnotes/mobile@3.50.34) (2023-01-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.33](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.32...@standardnotes/mobile@3.50.33) (2023-01-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.32](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.31...@standardnotes/mobile@3.50.32) (2023-01-20)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.31](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.30...@standardnotes/mobile@3.50.31) (2023-01-19)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.30](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.29...@standardnotes/mobile@3.50.30) (2023-01-19)
**Note:** Version bump only for package @standardnotes/mobile
## [3.50.29](https://github.com/standardnotes/app/compare/@standardnotes/mobile@3.50.28...@standardnotes/mobile@3.50.29) (2023-01-18)
**Note:** Version bump only for package @standardnotes/mobile

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/mobile",
"version": "3.50.29",
"version": "3.50.36",
"author": "Standard Notes.",
"private": true,
"license": "AGPL-3.0-or-later",

View File

@@ -3,6 +3,35 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.42.8](https://github.com/standardnotes/app/compare/@standardnotes/models@1.42.7...@standardnotes/models@1.42.8) (2023-01-20)
### Bug Fixes
* fixed issue with third party editors not loading ([#2174](https://github.com/standardnotes/app/issues/2174)) ([e7214ea](https://github.com/standardnotes/app/commit/e7214ea73ad5d3026d958c79022d2238a4d1cfdc))
## [1.42.7](https://github.com/standardnotes/app/compare/@standardnotes/models@1.42.6...@standardnotes/models@1.42.7) (2023-01-20)
### Bug Fixes
* **models:** dependency declaration ([beccfb1](https://github.com/standardnotes/app/commit/beccfb16b361ba70bd4f7c09d5840d73ed6e85da))
* **models:** dependency on utils declaration ([e9a1012](https://github.com/standardnotes/app/commit/e9a10123fed9e2883e3d2af38939b1608d7b2ffa))
## [1.42.6](https://github.com/standardnotes/app/compare/@standardnotes/models@1.42.5...@standardnotes/models@1.42.6) (2023-01-20)
**Note:** Version bump only for package @standardnotes/models
## [1.42.5](https://github.com/standardnotes/app/compare/@standardnotes/models@1.42.4...@standardnotes/models@1.42.5) (2023-01-20)
**Note:** Version bump only for package @standardnotes/models
## [1.42.4](https://github.com/standardnotes/app/compare/@standardnotes/models@1.42.3...@standardnotes/models@1.42.4) (2023-01-19)
**Note:** Version bump only for package @standardnotes/models
## [1.42.3](https://github.com/standardnotes/app/compare/@standardnotes/models@1.42.2...@standardnotes/models@1.42.3) (2023-01-19)
**Note:** Version bump only for package @standardnotes/models
## [1.42.2](https://github.com/standardnotes/app/compare/@standardnotes/models@1.42.1...@standardnotes/models@1.42.2) (2023-01-18)
**Note:** Version bump only for package @standardnotes/models

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/models",
"version": "1.42.2",
"version": "1.42.8",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -21,11 +21,13 @@
"lint": "eslint src --ext .ts",
"test": "jest"
},
"dependencies": {
"@standardnotes/utils": "workspace:^"
},
"devDependencies": {
"@standardnotes/common": "^1.45.0",
"@standardnotes/common": "^1.46.4",
"@standardnotes/features": "workspace:*",
"@standardnotes/responses": "workspace:*",
"@standardnotes/utils": "workspace:*",
"@types/jest": "^29.2.3",
"@types/lodash": "^4.14.189",
"@typescript-eslint/eslint-plugin": "*",

View File

@@ -1,4 +1,4 @@
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { ComponentPermission } from '@standardnotes/features'
import { IncomingComponentItemPayload } from './IncomingComponentItemPayload'
@@ -14,7 +14,7 @@ export type MessageData = Partial<{
permissions?: ComponentPermission[]
/** Related to the component-registered action */
componentData?: Record<string, unknown>
uuid?: Uuid
uuid?: string
environment?: string
platform?: string
activeThemeUrls?: string[]

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { AppData, DefaultAppDomain } from '../Item/Types/DefaultAppDomain'
import { ContentReference } from '../Reference/ContentReference'
import { AppDataField } from '../Item/Types/AppDataField'
@@ -8,7 +7,7 @@ export interface SpecializedContent {}
export interface ItemContent {
references: ContentReference[]
conflict_of?: Uuid
conflict_of?: string
protected?: boolean
trashed?: boolean
pinned?: boolean

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { ItemContent } from '../Content/ItemContent'
import { ContextPayload } from './ContextPayload'
@@ -6,7 +5,7 @@ export interface BackupFileDecryptedContextualPayload<C extends ItemContent = It
content: C
created_at_timestamp: number
created_at: Date
duplicate_of?: Uuid
duplicate_of?: string
updated_at: Date
updated_at_timestamp: number
}

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { ContextPayload } from './ContextPayload'
export interface BackupFileEncryptedContextualPayload extends ContextPayload {
@@ -6,7 +5,7 @@ export interface BackupFileEncryptedContextualPayload extends ContextPayload {
content: string
created_at_timestamp: number
created_at: Date
duplicate_of?: Uuid
duplicate_of?: string
enc_item_key: string
items_key_id: string | undefined
updated_at: Date

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { ContextPayload } from './ContextPayload'
import { ItemContent } from '../Content/ItemContent'
import { DecryptedPayloadInterface, DeletedPayloadInterface, EncryptedPayloadInterface } from '../Payload'
@@ -19,7 +18,7 @@ export interface LocalStorageEncryptedContextualPayload extends ContextPayload {
created_at_timestamp: number
created_at: Date
dirty: boolean
duplicate_of: Uuid | undefined
duplicate_of: string | undefined
enc_item_key: string
errorDecrypting: boolean
items_key_id: string | undefined
@@ -34,7 +33,7 @@ export interface LocalStorageDecryptedContextualPayload<C extends ItemContent =
created_at: Date
deleted: false
dirty: boolean
duplicate_of?: Uuid
duplicate_of?: string
updated_at_timestamp: number
updated_at: Date
}
@@ -45,7 +44,7 @@ export interface LocalStorageDeletedContextualPayload extends ContextPayload {
created_at: Date
deleted: true
dirty: true
duplicate_of?: Uuid
duplicate_of?: string
updated_at_timestamp: number
updated_at: Date
}

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { ItemContent } from '../Content/ItemContent'
import { DecryptedPayloadInterface, DeletedPayloadInterface, isDecryptedPayload } from '../Payload'
import { ContextPayload } from './ContextPayload'
@@ -7,7 +6,7 @@ export interface OfflineSyncPushContextualPayload extends ContextPayload {
content: ItemContent | undefined
created_at_timestamp: number
created_at: Date
duplicate_of?: Uuid
duplicate_of?: string
updated_at_timestamp: number
updated_at: Date
}

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { DeletedPayloadInterface, EncryptedPayloadInterface } from '../Payload'
import { ContextPayload } from './ContextPayload'
@@ -7,7 +6,7 @@ export interface ServerSyncPushContextualPayload extends ContextPayload {
content: string | undefined
created_at_timestamp: number
created_at: Date
duplicate_of?: Uuid
duplicate_of?: string
enc_item_key?: string
items_key_id?: string
updated_at_timestamp: number

View File

@@ -1,5 +1,4 @@
import { dateToLocalizedString, useBoolean } from '@standardnotes/utils'
import { Uuid } from '@standardnotes/common'
import { DecryptedTransferPayload } from './../../TransferPayload/Interfaces/DecryptedTransferPayload'
import { AppDataField } from '../Types/AppDataField'
import { ComponentDataDomain, DefaultAppDomain } from '../Types/DefaultAppDomain'
@@ -15,7 +14,7 @@ export class DecryptedItem<C extends ItemContent = ItemContent>
extends GenericItem<DecryptedPayloadInterface<C>>
implements DecryptedItemInterface<C>
{
public readonly conflictOf?: Uuid
public readonly conflictOf?: string
public readonly protected: boolean = false
public readonly trashed: boolean = false
public readonly pinned: boolean = false

View File

@@ -1,4 +1,4 @@
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { dateToLocalizedString, deepFreeze } from '@standardnotes/utils'
import { TransferPayload } from './../../TransferPayload/Interfaces/TransferPayload'
import { ItemContentsDiffer } from '../../../Utilities/Item/ItemContentsDiffer'
@@ -13,7 +13,7 @@ import { isDecryptedItem, isDeletedItem, isEncryptedErroredItem } from '../Inter
export abstract class GenericItem<P extends PayloadInterface = PayloadInterface> implements ItemInterface<P> {
payload: P
public readonly duplicateOf?: Uuid
public readonly duplicateOf?: string
public readonly createdAtString?: string
public updatedAtString?: string
public userModifiedDate: Date

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { AppDataField } from '../Types/AppDataField'
import { ComponentDataDomain, DefaultAppDomain } from '../Types/DefaultAppDomain'
import { ContentReference } from '../../Reference/ContentReference'
@@ -15,8 +14,8 @@ export interface DecryptedItemInterface<C extends ItemContent = ItemContent>
SortableItem,
SearchableItem {
readonly content: C
readonly conflictOf?: Uuid
readonly duplicateOf?: Uuid
readonly conflictOf?: string
readonly duplicateOf?: string
readonly protected: boolean
readonly trashed: boolean
readonly pinned: boolean

View File

@@ -1,4 +1,4 @@
import { Uuid, ContentType } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { TransferPayload } from './../../TransferPayload/Interfaces/TransferPayload'
import { PayloadInterface } from '../../Payload/Interfaces/PayloadInterface'
import { PredicateInterface } from '../../../Runtime/Predicate/Interface'
@@ -8,12 +8,12 @@ import { SingletonStrategy } from '../Types/SingletonStrategy'
export interface ItemInterface<P extends PayloadInterface = PayloadInterface> {
payload: P
readonly conflictOf?: Uuid
readonly duplicateOf?: Uuid
readonly conflictOf?: string
readonly duplicateOf?: string
readonly createdAtString?: string
readonly updatedAtString?: string
uuid: Uuid
uuid: string
content_type: ContentType
created_at: Date

View File

@@ -2,7 +2,6 @@ import { DecryptedItemInterface } from './../Interfaces/DecryptedItem'
import { Copy } from '@standardnotes/utils'
import { MutationType } from '../Types/MutationType'
import { PrefKey } from '../../../Syncable/UserPrefs/PrefKey'
import { Uuid } from '@standardnotes/common'
import { ItemContent } from '../../Content/ItemContent'
import { AppDataField } from '../Types/AppDataField'
import { DefaultAppDomain, DomainDataValueType, ItemDomainKey } from '../Types/DefaultAppDomain'
@@ -66,7 +65,7 @@ export class DecryptedItemMutator<C extends ItemContent = ItemContent> extends I
this.setAppDataItem(AppDataField.UserModifiedDate, date)
}
public set conflictOf(conflictOf: Uuid | undefined) {
public set conflictOf(conflictOf: string | undefined) {
this.mutableContent.conflict_of = conflictOf
}

View File

@@ -1,11 +1,9 @@
import { Uuid } from '@standardnotes/common'
import { MutationType } from '../Types/MutationType'
import { ItemMutator } from './ItemMutator'
export type TransactionalMutation = {
itemUuid: Uuid
itemUuid: string
mutate: (mutator: ItemMutator) => void
mutationType?: MutationType
}

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { Copy } from '@standardnotes/utils'
import { SyncResolvedParams, SyncResolvedPayload } from '../../../Runtime/Deltas/Utilities/SyncResolvedPayload'
import { FillItemContent, ItemContent } from '../../Content/ItemContent'
@@ -29,7 +28,7 @@ export class DecryptedPayload<
return this.content.references || []
}
public getReference(uuid: Uuid): ContentReference {
public getReference(uuid: string): ContentReference {
const result = this.references.find((ref) => ref.uuid === uuid)
if (!result) {

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { DecryptedTransferPayload } from './../../TransferPayload/Interfaces/DecryptedTransferPayload'
import { ItemContent } from '../../Content/ItemContent'
import { ContentReference } from '../../Reference/ContentReference'
@@ -11,5 +10,5 @@ export interface DecryptedPayloadInterface<C extends ItemContent = ItemContent>
ejected(): DecryptedTransferPayload<C>
get references(): ContentReference[]
getReference(uuid: Uuid): ContentReference
getReference(uuid: string): ContentReference
}

View File

@@ -1,12 +1,12 @@
import { SyncResolvedParams, SyncResolvedPayload } from './../../../Runtime/Deltas/Utilities/SyncResolvedPayload'
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { ItemContent } from '../../Content/ItemContent'
import { TransferPayload } from '../../TransferPayload/Interfaces/TransferPayload'
import { PayloadSource } from '../Types/PayloadSource'
export interface PayloadInterface<T extends TransferPayload = TransferPayload, C extends ItemContent = ItemContent> {
readonly source: PayloadSource
readonly uuid: Uuid
readonly uuid: string
readonly content_type: ContentType
content: C | string | undefined
deleted: boolean
@@ -26,7 +26,7 @@ export interface PayloadInterface<T extends TransferPayload = TransferPayload, C
readonly lastSyncBegan?: Date
readonly lastSyncEnd?: Date
readonly duplicate_of?: Uuid
readonly duplicate_of?: string
/**
* "Ejected" means a payload for

View File

@@ -1,8 +1,8 @@
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { ItemContent } from '../../Content/ItemContent'
export interface TransferPayload<C extends ItemContent = ItemContent> {
uuid: Uuid
uuid: string
content_type: ContentType
content: C | string | undefined
deleted?: boolean
@@ -19,5 +19,5 @@ export interface TransferPayload<C extends ItemContent = ItemContent> {
lastSyncBegan?: Date
lastSyncEnd?: Date
duplicate_of?: Uuid
duplicate_of?: string
}

View File

@@ -1,11 +1,11 @@
import { extendArray, isObject, isString, UuidMap } from '@standardnotes/utils'
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { remove } from 'lodash'
import { ItemContent } from '../../Abstract/Content/ItemContent'
import { ContentReference } from '../../Abstract/Item'
export interface CollectionElement {
uuid: Uuid
uuid: string
content_type: ContentType
dirty?: boolean
deleted?: boolean
@@ -32,17 +32,17 @@ export abstract class Collection<
Encrypted extends EncryptedCollectionElement,
Deleted extends DeletedCollectionElement,
> {
readonly map: Partial<Record<Uuid, Element>> = {}
readonly map: Partial<Record<string, Element>> = {}
readonly typedMap: Partial<Record<ContentType, Element[]>> = {}
/** An array of uuids of items that are dirty */
dirtyIndex: Set<Uuid> = new Set()
dirtyIndex: Set<string> = new Set()
/** An array of uuids of items that are not marked as deleted */
nondeletedIndex: Set<Uuid> = new Set()
nondeletedIndex: Set<string> = new Set()
/** An array of uuids of items that are errorDecrypting or waitingForKey */
invalidsIndex: Set<Uuid> = new Set()
invalidsIndex: Set<string> = new Set()
readonly referenceMap: UuidMap
@@ -73,7 +73,7 @@ export abstract class Collection<
constructor(
copy = false,
mapCopy?: Partial<Record<Uuid, Element>>,
mapCopy?: Partial<Record<string, Element>>,
typedMapCopy?: Partial<Record<ContentType, Element[]>>,
referenceMapCopy?: UuidMap,
conflictMapCopy?: UuidMap,
@@ -89,7 +89,7 @@ export abstract class Collection<
}
}
public uuids(): Uuid[] {
public uuids(): string[] {
return Object.keys(this.map)
}
@@ -105,7 +105,7 @@ export abstract class Collection<
return this.typedMap[contentType]?.slice() || []
}
} else {
return Object.keys(this.map).map((uuid: Uuid) => {
return Object.keys(this.map).map((uuid: string) => {
return this.map[uuid]
}) as Element[]
}
@@ -129,7 +129,7 @@ export abstract class Collection<
return this.findAll(uuids)
}
public findAll(uuids: Uuid[]): Element[] {
public findAll(uuids: string[]): Element[] {
const results: Element[] = []
for (const id of uuids) {
@@ -142,11 +142,11 @@ export abstract class Collection<
return results
}
public find(uuid: Uuid): Element | undefined {
public find(uuid: string): Element | undefined {
return this.map[uuid]
}
public has(uuid: Uuid): boolean {
public has(uuid: string): boolean {
return this.find(uuid) != undefined
}
@@ -154,7 +154,7 @@ export abstract class Collection<
* If an item is not found, an `undefined` element
* will be inserted into the array.
*/
public findAllIncludingBlanks<E extends Element>(uuids: Uuid[]): (E | Deleted | undefined)[] {
public findAllIncludingBlanks<E extends Element>(uuids: string[]): (E | Deleted | undefined)[] {
const results: (E | Deleted | undefined)[] = []
for (const id of uuids) {
@@ -219,11 +219,11 @@ export abstract class Collection<
}
}
public uuidReferencesForUuid(uuid: Uuid): Uuid[] {
public uuidReferencesForUuid(uuid: string): string[] {
return this.referenceMap.getDirectRelationships(uuid)
}
public uuidsThatReferenceUuid(uuid: Uuid): Uuid[] {
public uuidsThatReferenceUuid(uuid: string): string[] {
return this.referenceMap.getInverseRelationships(uuid)
}
@@ -232,7 +232,7 @@ export abstract class Collection<
return this.findAll(uuids)
}
public conflictsOf(uuid: Uuid): Element[] {
public conflictsOf(uuid: string): Element[] {
const uuids = this.conflictMap.getDirectRelationships(uuid)
return this.findAll(uuids)
}

View File

@@ -1,7 +1,7 @@
import { Uuid, ContentType } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
export interface SortableItem {
uuid: Uuid
uuid: string
content_type: ContentType
created_at: Date
userModifiedDate: Date

View File

@@ -1,6 +1,6 @@
import { ItemContent } from './../../../Abstract/Content/ItemContent'
import { EncryptedItemInterface } from './../../../Abstract/Item/Interfaces/EncryptedItem'
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { SNIndex } from '../../Index/SNIndex'
import { isDecryptedItem } from '../../../Abstract/Item/Interfaces/TypeCheck'
import { DecryptedItemInterface } from '../../../Abstract/Item/Interfaces/DecryptedItem'
@@ -24,7 +24,7 @@ export class ItemCollection
this.discard(delta.discarded)
}
public findDecrypted<T extends DecryptedItemInterface = DecryptedItemInterface>(uuid: Uuid): T | undefined {
public findDecrypted<T extends DecryptedItemInterface = DecryptedItemInterface>(uuid: string): T | undefined {
const result = this.find(uuid)
if (!result) {
@@ -34,12 +34,12 @@ export class ItemCollection
return isDecryptedItem(result) ? (result as T) : undefined
}
public findAllDecrypted<T extends DecryptedItemInterface = DecryptedItemInterface>(uuids: Uuid[]): T[] {
public findAllDecrypted<T extends DecryptedItemInterface = DecryptedItemInterface>(uuids: string[]): T[] {
return this.findAll(uuids).filter(isDecryptedItem) as T[]
}
public findAllDecryptedWithBlanks<C extends ItemContent = ItemContent>(
uuids: Uuid[],
uuids: string[],
): (DecryptedItemInterface<C> | undefined)[] {
const results = this.findAllIncludingBlanks(uuids)
const mapped = results.map((i) => {

View File

@@ -1,5 +1,5 @@
import { removeFromArray } from '@standardnotes/utils'
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { isTag, SNTag } from '../../../Syncable/Tag/Tag'
import { SNIndex } from '../../Index/SNIndex'
import { ItemCollection } from './ItemCollection'
@@ -7,12 +7,12 @@ import { ItemDelta } from '../../Index/ItemDelta'
import { isDecryptedItem, ItemInterface } from '../../../Abstract/Item'
type AllNotesUuidSignifier = undefined
export type TagItemCountChangeObserver = (tagUuid: Uuid | AllNotesUuidSignifier) => void
export type TagItemCountChangeObserver = (tagUuid: string | AllNotesUuidSignifier) => void
export class TagItemsIndex implements SNIndex {
private tagToItemsMap: Partial<Record<Uuid, Set<Uuid>>> = {}
private allCountableItems = new Set<Uuid>()
private countableItemsByType = new Map<ContentType, Set<Uuid>>()
private tagToItemsMap: Partial<Record<string, Set<string>>> = {}
private allCountableItems = new Set<string>()
private countableItemsByType = new Map<ContentType, Set<string>>()
constructor(private collection: ItemCollection, public observers: TagItemCountChangeObserver[] = []) {}
@@ -32,7 +32,7 @@ export class TagItemsIndex implements SNIndex {
}
}
private notifyObservers(tagUuid: Uuid | undefined) {
private notifyObservers(tagUuid: string | undefined) {
for (const observer of this.observers) {
observer(tagUuid)
}
@@ -119,7 +119,7 @@ export class TagItemsIndex implements SNIndex {
}
}
private setForTag(uuid: Uuid): Set<Uuid> {
private setForTag(uuid: string): Set<string> {
let set = this.tagToItemsMap[uuid]
if (!set) {
set = new Set()

View File

@@ -2,7 +2,7 @@ import { ImmutablePayloadCollection } from './../Collection/Payload/ImmutablePay
import { ConflictDelta } from './Conflict'
import { isErrorDecryptingPayload, isDecryptedPayload } from '../../Abstract/Payload/Interfaces/TypeCheck'
import { FullyFormedPayloadInterface, PayloadEmitSource } from '../../Abstract/Payload'
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { HistoryMap } from '../History'
import { ServerSyncPushContextualPayload } from '../../Abstract/Contextual/ServerSyncPush'
import { payloadByFinalizingSyncState } from './Utilities/ApplyDirtyState'
@@ -18,7 +18,7 @@ export class DeltaRemoteRetrieved implements SyncDeltaInterface {
readonly historyMap: HistoryMap,
) {}
private isUuidOfPayloadCurrentlySavingOrSaved(uuid: Uuid): boolean {
private isUuidOfPayloadCurrentlySavingOrSaved(uuid: string): boolean {
return this.itemsSavedOrSaving.find((i) => i.uuid === uuid) != undefined
}

View File

@@ -1,10 +1,9 @@
import { Uuid } from '@standardnotes/common'
import { DecryptedItemInterface } from '../../Abstract/Item'
import { SortableItem } from '../Collection/CollectionSort'
import { ItemCollection } from '../Collection/Item/ItemCollection'
export type DisplayControllerCustomFilter = (element: DisplayItem) => boolean
export type UuidToSortedPositionMap = Record<Uuid, number>
export type UuidToSortedPositionMap = Record<string, number>
export type DisplayItem = SortableItem & DecryptedItemInterface
export interface ReadonlyItemCollection {

View File

@@ -1,7 +1,6 @@
import { Uuid } from '@standardnotes/common'
import { HistoryEntry } from './HistoryEntry'
export type HistoryMap = Record<Uuid, HistoryEntry[]>
export type HistoryMap = Record<string, HistoryEntry[]>
export const historyMapFunctions = {
getNewestRevision: (history: HistoryEntry[]): HistoryEntry | undefined => {

View File

@@ -68,7 +68,7 @@ describe('component model', () => {
expect(component.noteType).toEqual(NoteType.Authentication)
})
it('should return plain as noteType if no note type defined in package_info', () => {
it('should return unknown as noteType if no note type defined in package_info', () => {
const component = new SNComponent(
new DecryptedPayload(
{
@@ -83,6 +83,6 @@ describe('component model', () => {
),
)
expect(component.noteType).toEqual(NoteType.Plain)
expect(component.noteType).toEqual(NoteType.Unknown)
})
})

View File

@@ -1,5 +1,5 @@
import { isValidUrl } from '@standardnotes/utils'
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import {
FeatureIdentifier,
ThirdPartyFeatureDescription,
@@ -159,11 +159,11 @@ export class SNComponent extends DecryptedItem<ComponentContent> implements Comp
return SNComponent.associativeAreas().includes(this.area)
}
public isExplicitlyEnabledForItem(uuid: Uuid): boolean {
public isExplicitlyEnabledForItem(uuid: string): boolean {
return this.associatedItemIds.indexOf(uuid) !== -1
}
public isExplicitlyDisabledForItem(uuid: Uuid): boolean {
public isExplicitlyDisabledForItem(uuid: string): boolean {
return this.disassociatedItemIds.indexOf(uuid) !== -1
}
@@ -180,7 +180,7 @@ export class SNComponent extends DecryptedItem<ComponentContent> implements Comp
}
public get noteType(): NoteType {
return this.package_info.note_type || NoteType.Plain
return this.package_info.note_type || NoteType.Unknown
}
public get isDeprecated(): boolean {

View File

@@ -1,5 +1,4 @@
import { ComponentArea, ComponentPermission } from '@standardnotes/features'
import { Uuid } from '@standardnotes/common'
import { ItemContent } from '../../Abstract/Content/ItemContent'
import { ComponentPackageInfo } from './PackageInfo'
@@ -30,7 +29,7 @@ export interface ComponentInterface {
legacy_url?: string
isMobileDefault: boolean
isDeprecated: boolean
isExplicitlyEnabledForItem(uuid: Uuid): boolean
isExplicitlyEnabledForItem(uuid: string): boolean
}
export type ComponentContent = ComponentInterface & ItemContent

View File

@@ -1,5 +1,4 @@
import { addIfUnique, removeFromArray } from '@standardnotes/utils'
import { Uuid } from '@standardnotes/common'
import { ComponentPermission, FeatureDescription } from '@standardnotes/features'
import { AppDataField } from '../../Abstract/Item/Types/AppDataField'
import { ComponentContent } from './ComponentContent'
@@ -46,23 +45,23 @@ export class ComponentMutator extends DecryptedItemMutator<ComponentContent> {
this.mutableContent.offlineOnly = offlineOnly
}
public associateWithItem(uuid: Uuid): void {
public associateWithItem(uuid: string): void {
const associated = this.mutableContent.associatedItemIds || []
addIfUnique(associated, uuid)
this.mutableContent.associatedItemIds = associated
}
public disassociateWithItem(uuid: Uuid): void {
public disassociateWithItem(uuid: string): void {
const disassociated = this.mutableContent.disassociatedItemIds || []
addIfUnique(disassociated, uuid)
this.mutableContent.disassociatedItemIds = disassociated
}
public removeAssociatedItemId(uuid: Uuid): void {
public removeAssociatedItemId(uuid: string): void {
removeFromArray(this.mutableContent.associatedItemIds || [], uuid)
}
public removeDisassociatedItemId(uuid: Uuid): void {
public removeDisassociatedItemId(uuid: string): void {
removeFromArray(this.mutableContent.disassociatedItemIds || [], uuid)
}

View File

@@ -1,5 +1,5 @@
import { VectorIconNameOrEmoji, IconType } from './../../Utilities/Icon/IconType'
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
import { DecryptedItem } from '../../Abstract/Item/Implementations/DecryptedItem'
import { ItemInterface } from '../../Abstract/Item/Interfaces/ItemInterface'
import { ContentReference } from '../../Abstract/Reference/ContentReference'
@@ -41,7 +41,7 @@ export class SNTag extends DecryptedItem<TagContent> implements TagContentSpecia
return this.noteReferences.length
}
public get parentId(): Uuid | undefined {
public get parentId(): string | undefined {
const reference = this.references.find(isTagToParentTagReference)
return reference?.uuid
}

View File

@@ -1,10 +1,9 @@
import { Uuid } from '@standardnotes/common'
import { ItemInterface } from '../../Abstract/Item/Interfaces/ItemInterface'
export function FindItem<I extends ItemInterface = ItemInterface>(items: I[], uuid: Uuid): I | undefined {
export function FindItem<I extends ItemInterface = ItemInterface>(items: I[], uuid: string): I | undefined {
return items.find((item) => item.uuid === uuid)
}
export function SureFindItem<I extends ItemInterface = ItemInterface>(items: I[], uuid: Uuid): I {
export function SureFindItem<I extends ItemInterface = ItemInterface>(items: I[], uuid: string): I {
return FindItem(items, uuid) as I
}

View File

@@ -1,10 +1,9 @@
import { Uuid } from '@standardnotes/common'
import { PayloadInterface } from '../../Abstract/Payload/Interfaces/PayloadInterface'
export function FindPayload<P extends PayloadInterface = PayloadInterface>(payloads: P[], uuid: Uuid): P | undefined {
export function FindPayload<P extends PayloadInterface = PayloadInterface>(payloads: P[], uuid: string): P | undefined {
return payloads.find((payload) => payload.uuid === uuid)
}
export function SureFindPayload<P extends PayloadInterface = PayloadInterface>(payloads: P[], uuid: Uuid): P {
export function SureFindPayload<P extends PayloadInterface = PayloadInterface>(payloads: P[], uuid: string): P {
return FindPayload(payloads, uuid) as P
}

View File

@@ -1,4 +1,3 @@
import { Uuid } from '@standardnotes/common'
import { remove } from 'lodash'
import { ImmutablePayloadCollection } from '../../Runtime/Collection/Payload/ImmutablePayloadCollection'
import { ContentReference } from '../../Abstract/Reference/ContentReference'
@@ -12,7 +11,7 @@ export function PayloadsByUpdatingReferencingPayloadReferences(
payload: DecryptedPayloadInterface,
baseCollection: ImmutablePayloadCollection<FullyFormedPayloadInterface>,
add: FullyFormedPayloadInterface[] = [],
removeIds: Uuid[] = [],
removeIds: string[] = [],
): SyncResolvedPayload[] {
const referencingPayloads = baseCollection.elementsReferencingElement(payload).filter(isDecryptedPayload)

View File

@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.4.123](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.122...@standardnotes/releases@1.4.123) (2023-01-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.122](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.121...@standardnotes/releases@1.4.122) (2023-01-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.121](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.120...@standardnotes/releases@1.4.121) (2023-01-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.120](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.119...@standardnotes/releases@1.4.120) (2023-01-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.119](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.118...@standardnotes/releases@1.4.119) (2023-01-20)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.118](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.117...@standardnotes/releases@1.4.118) (2023-01-19)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.117](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.116...@standardnotes/releases@1.4.117) (2023-01-19)
**Note:** Version bump only for package @standardnotes/releases
## [1.4.116](https://github.com/standardnotes/app/compare/@standardnotes/releases@1.4.115...@standardnotes/releases@1.4.116) (2023-01-18)
**Note:** Version bump only for package @standardnotes/releases

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/releases",
"version": "1.4.116",
"version": "1.4.123",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"types": "dist/index.d.ts",

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.13.5](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.4...@standardnotes/responses@1.13.5) (2023-01-20)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.4](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.3...@standardnotes/responses@1.13.4) (2023-01-20)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.3](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.2...@standardnotes/responses@1.13.3) (2023-01-20)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.2](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.1...@standardnotes/responses@1.13.2) (2023-01-19)
**Note:** Version bump only for package @standardnotes/responses
## [1.13.1](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.13.0...@standardnotes/responses@1.13.1) (2023-01-19)
**Note:** Version bump only for package @standardnotes/responses
# [1.13.0](https://github.com/standardnotes/app/compare/@standardnotes/responses@1.12.13...@standardnotes/responses@1.13.0) (2023-01-18)
### Features

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/responses",
"version": "1.13.0",
"version": "1.13.5",
"engines": {
"node": ">=16.0.0 <17.0.0"
},
@@ -33,9 +33,9 @@
"typescript": "*"
},
"dependencies": {
"@standardnotes/common": "^1.45.0",
"@standardnotes/common": "^1.46.4",
"@standardnotes/features": "workspace:*",
"@standardnotes/security": "^1.7.0",
"@standardnotes/security": "^1.7.5",
"reflect-metadata": "^0.1.13"
}
}

View File

@@ -1,9 +1,8 @@
import { Role } from '@standardnotes/security'
import { Uuid } from '@standardnotes/common'
export type ResponseMeta = {
auth: {
userUuid?: Uuid
userUuid?: string
roles?: Role[]
}
server: {

View File

@@ -1,6 +1,6 @@
import { MicrosecondsTimestamp, Uuid } from '@standardnotes/common'
import { MicrosecondsTimestamp } from '@standardnotes/common'
export type IntegrityPayload = {
uuid: Uuid
uuid: string
updated_at_timestamp: MicrosecondsTimestamp
}

View File

@@ -1,4 +1,4 @@
import { ContentType, Uuid } from '@standardnotes/common'
import { ContentType } from '@standardnotes/common'
export interface ServerItemResponse {
content_type: ContentType
@@ -6,7 +6,7 @@ export interface ServerItemResponse {
created_at_timestamp: number
created_at: Date
deleted: boolean
duplicate_of?: Uuid
duplicate_of?: string
enc_item_key: string
items_key_id?: string
updated_at_timestamp: number

View File

@@ -4,5 +4,6 @@ import { MinimalHttpResponse } from '../Http/MinimalHttpResponses'
export type GetOfflineFeaturesResponse = MinimalHttpResponse & {
data?: {
features: FeatureDescription[]
roles: string[]
}
}

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