-
-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): extract ui-services package
- Loading branch information
Karol Sójko
committed
Aug 4, 2022
1 parent
c72a407
commit 7e25126
Showing
161 changed files
with
1,106 additions
and
825 deletions.
There are no files selected for viewing
Binary file added
BIN
+33.1 KB
.yarn/cache/@standardnotes-common-npm-1.30.0-a603c54867-833b6e7f3e.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/encryption/src/Domain/Service/Encryption/EncryptionProvider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/models/src/Domain/Abstract/Component/ActionObserver.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { ComponentAction } from '@standardnotes/features' | ||
import { MessageData } from './MessageData' | ||
|
||
export type ActionObserver = (action: ComponentAction, messageData: MessageData) => void |
3 changes: 3 additions & 0 deletions
3
packages/models/src/Domain/Abstract/Component/ComponentEventObserver.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { ComponentViewerEvent } from './ComponentViewerEvent' | ||
|
||
export type ComponentEventObserver = (event: ComponentViewerEvent) => void |
9 changes: 9 additions & 0 deletions
9
packages/models/src/Domain/Abstract/Component/ComponentMessage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { ComponentAction } from '@standardnotes/features' | ||
import { MessageData } from './MessageData' | ||
|
||
export type ComponentMessage = { | ||
action: ComponentAction | ||
sessionKey?: string | ||
componentData?: Record<string, unknown> | ||
data: MessageData | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/models/src/Domain/Abstract/Component/ComponentViewerEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export enum ComponentViewerEvent { | ||
FeatureStatusUpdated = 'FeatureStatusUpdated', | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/models/src/Domain/Abstract/Component/IncomingComponentItemPayload.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { DecryptedTransferPayload } from '../TransferPayload/Interfaces/DecryptedTransferPayload' | ||
|
||
export type IncomingComponentItemPayload = DecryptedTransferPayload & { | ||
clientData: Record<string, unknown> | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/models/src/Domain/Abstract/Component/KeyboardModifier.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum KeyboardModifier { | ||
Shift = 'Shift', | ||
Ctrl = 'Control', | ||
Meta = 'Meta', | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/models/src/Domain/Abstract/Component/MessageData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ContentType, Uuid } from '@standardnotes/common' | ||
import { ComponentPermission } from '@standardnotes/features' | ||
|
||
import { IncomingComponentItemPayload } from './IncomingComponentItemPayload' | ||
import { KeyboardModifier } from './KeyboardModifier' | ||
|
||
export type MessageData = Partial<{ | ||
/** Related to the stream-item-context action */ | ||
item?: IncomingComponentItemPayload | ||
/** Related to the stream-items action */ | ||
content_types?: ContentType[] | ||
items?: IncomingComponentItemPayload[] | ||
/** Related to the request-permission action */ | ||
permissions?: ComponentPermission[] | ||
/** Related to the component-registered action */ | ||
componentData?: Record<string, unknown> | ||
uuid?: Uuid | ||
environment?: string | ||
platform?: string | ||
activeThemeUrls?: string[] | ||
/** Related to set-size action */ | ||
width?: string | number | ||
height?: string | number | ||
type?: string | ||
/** Related to themes action */ | ||
themes?: string[] | ||
/** Related to clear-selection action */ | ||
content_type?: ContentType | ||
/** Related to key-pressed action */ | ||
keyboardModifier?: KeyboardModifier | ||
}> |
10 changes: 10 additions & 0 deletions
10
packages/models/src/Domain/Abstract/Component/PermissionDialog.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ComponentPermission } from '@standardnotes/features' | ||
import { SNComponent } from '../../Syncable/Component' | ||
|
||
export type PermissionDialog = { | ||
component: SNComponent | ||
permissions: ComponentPermission[] | ||
permissionsString: string | ||
actionBlock: (approved: boolean) => void | ||
callback: (approved: boolean) => void | ||
} |
68 changes: 9 additions & 59 deletions
68
packages/models/src/Domain/Abstract/Contextual/BackupFile.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,10 @@ | ||
import { Uuid } from '@standardnotes/common' | ||
import { ContextPayload } from './ContextPayload' | ||
import { ItemContent } from '../Content/ItemContent' | ||
import { DecryptedTransferPayload, EncryptedTransferPayload } from '../TransferPayload' | ||
|
||
export interface BackupFileEncryptedContextualPayload extends ContextPayload { | ||
auth_hash?: string | ||
content: string | ||
created_at_timestamp: number | ||
created_at: Date | ||
duplicate_of?: Uuid | ||
enc_item_key: string | ||
items_key_id: string | undefined | ||
updated_at: Date | ||
updated_at_timestamp: number | ||
} | ||
|
||
export interface BackupFileDecryptedContextualPayload<C extends ItemContent = ItemContent> extends ContextPayload { | ||
content: C | ||
created_at_timestamp: number | ||
created_at: Date | ||
duplicate_of?: Uuid | ||
updated_at: Date | ||
updated_at_timestamp: number | ||
} | ||
|
||
export function CreateEncryptedBackupFileContextPayload( | ||
fromPayload: EncryptedTransferPayload, | ||
): BackupFileEncryptedContextualPayload { | ||
return { | ||
auth_hash: fromPayload.auth_hash, | ||
content_type: fromPayload.content_type, | ||
content: fromPayload.content, | ||
created_at_timestamp: fromPayload.created_at_timestamp, | ||
created_at: fromPayload.created_at, | ||
deleted: false, | ||
duplicate_of: fromPayload.duplicate_of, | ||
enc_item_key: fromPayload.enc_item_key, | ||
items_key_id: fromPayload.items_key_id, | ||
updated_at_timestamp: fromPayload.updated_at_timestamp, | ||
updated_at: fromPayload.updated_at, | ||
uuid: fromPayload.uuid, | ||
} | ||
} | ||
|
||
export function CreateDecryptedBackupFileContextPayload( | ||
fromPayload: DecryptedTransferPayload, | ||
): BackupFileDecryptedContextualPayload { | ||
return { | ||
content_type: fromPayload.content_type, | ||
content: fromPayload.content, | ||
created_at_timestamp: fromPayload.created_at_timestamp, | ||
created_at: fromPayload.created_at, | ||
deleted: false, | ||
duplicate_of: fromPayload.duplicate_of, | ||
updated_at_timestamp: fromPayload.updated_at_timestamp, | ||
updated_at: fromPayload.updated_at, | ||
uuid: fromPayload.uuid, | ||
} | ||
import { AnyKeyParamsContent, ProtocolVersion } from '@standardnotes/common' | ||
import { BackupFileDecryptedContextualPayload } from './BackupFileDecryptedContextualPayload' | ||
import { BackupFileEncryptedContextualPayload } from './BackupFileEncryptedContextualPayload' | ||
|
||
export type BackupFile = { | ||
version?: ProtocolVersion | ||
keyParams?: AnyKeyParamsContent | ||
auth_params?: AnyKeyParamsContent | ||
items: (BackupFileDecryptedContextualPayload | BackupFileEncryptedContextualPayload)[] | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/models/src/Domain/Abstract/Contextual/BackupFileDecryptedContextualPayload.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Uuid } from '@standardnotes/common' | ||
import { ItemContent } from '../Content/ItemContent' | ||
import { ContextPayload } from './ContextPayload' | ||
|
||
export interface BackupFileDecryptedContextualPayload<C extends ItemContent = ItemContent> extends ContextPayload { | ||
content: C | ||
created_at_timestamp: number | ||
created_at: Date | ||
duplicate_of?: Uuid | ||
updated_at: Date | ||
updated_at_timestamp: number | ||
} |
14 changes: 14 additions & 0 deletions
14
packages/models/src/Domain/Abstract/Contextual/BackupFileEncryptedContextualPayload.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Uuid } from '@standardnotes/common' | ||
import { ContextPayload } from './ContextPayload' | ||
|
||
export interface BackupFileEncryptedContextualPayload extends ContextPayload { | ||
auth_hash?: string | ||
content: string | ||
created_at_timestamp: number | ||
created_at: Date | ||
duplicate_of?: Uuid | ||
enc_item_key: string | ||
items_key_id: string | undefined | ||
updated_at: Date | ||
updated_at_timestamp: number | ||
} |
39 changes: 39 additions & 0 deletions
39
packages/models/src/Domain/Abstract/Contextual/Functions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { DecryptedTransferPayload, EncryptedTransferPayload } from '../TransferPayload' | ||
|
||
import { BackupFileDecryptedContextualPayload } from './BackupFileDecryptedContextualPayload' | ||
import { BackupFileEncryptedContextualPayload } from './BackupFileEncryptedContextualPayload' | ||
|
||
export function CreateEncryptedBackupFileContextPayload( | ||
fromPayload: EncryptedTransferPayload, | ||
): BackupFileEncryptedContextualPayload { | ||
return { | ||
auth_hash: fromPayload.auth_hash, | ||
content_type: fromPayload.content_type, | ||
content: fromPayload.content, | ||
created_at_timestamp: fromPayload.created_at_timestamp, | ||
created_at: fromPayload.created_at, | ||
deleted: false, | ||
duplicate_of: fromPayload.duplicate_of, | ||
enc_item_key: fromPayload.enc_item_key, | ||
items_key_id: fromPayload.items_key_id, | ||
updated_at_timestamp: fromPayload.updated_at_timestamp, | ||
updated_at: fromPayload.updated_at, | ||
uuid: fromPayload.uuid, | ||
} | ||
} | ||
|
||
export function CreateDecryptedBackupFileContextPayload( | ||
fromPayload: DecryptedTransferPayload, | ||
): BackupFileDecryptedContextualPayload { | ||
return { | ||
content_type: fromPayload.content_type, | ||
content: fromPayload.content, | ||
created_at_timestamp: fromPayload.created_at_timestamp, | ||
created_at: fromPayload.created_at, | ||
deleted: false, | ||
duplicate_of: fromPayload.duplicate_of, | ||
updated_at_timestamp: fromPayload.updated_at_timestamp, | ||
updated_at: fromPayload.updated_at, | ||
uuid: fromPayload.uuid, | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
packages/models/src/Domain/Abstract/Item/Mutator/TransactionalMutation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Uuid } from '@standardnotes/common' | ||
|
||
import { MutationType } from '../Types/MutationType' | ||
|
||
import { ItemMutator } from './ItemMutator' | ||
|
||
export type TransactionalMutation = { | ||
itemUuid: Uuid | ||
mutate: (mutator: ItemMutator) => void | ||
mutationType?: MutationType | ||
} |
11 changes: 11 additions & 0 deletions
11
packages/models/src/Domain/Abstract/Item/Types/ItemStream.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { PayloadEmitSource } from '../../Payload' | ||
import { DecryptedItemInterface } from '../Interfaces/DecryptedItem' | ||
import { DeletedItemInterface } from '../Interfaces/DeletedItem' | ||
import { EncryptedItemInterface } from '../Interfaces/EncryptedItem' | ||
|
||
export type ItemStream<I extends DecryptedItemInterface> = (data: { | ||
changed: I[] | ||
inserted: I[] | ||
removed: (DeletedItemInterface | EncryptedItemInterface)[] | ||
source: PayloadEmitSource | ||
}) => void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/services/src/Domain/Application/AppGroupManagedApplication.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ApplicationInterface } from './ApplicationInterface' | ||
import { DeinitCallback } from './DeinitCallback' | ||
|
||
export interface AppGroupManagedApplication extends ApplicationInterface { | ||
onDeinit: DeinitCallback | ||
setOnDeinit(onDeinit: DeinitCallback): void | ||
} |
Oops, something went wrong.