diff --git a/app/sdk/src/api.ts b/app/sdk/src/api.ts index 06f5d13e..0a28fcc8 100644 --- a/app/sdk/src/api.ts +++ b/app/sdk/src/api.ts @@ -134,7 +134,7 @@ export interface Attribute { } export interface Focus { - addTopic(sealed: boolean, type: string, subject: (assetId: {assetId: string, transform: string}[]) => any, files: AssetSource[]): Promise; + addTopic(sealed: boolean, type: string, subject: (asset: {assetId: string, context: any}[]) => any, files: AssetSource[], progress: (percent: number)=>boolean): Promise; setTopicSubject(topicId: string, type: string, subject: (assets: {assetId: string, transform: string}[]) => any, files: AssetSource[]): Promise; removeTopic(topicId: string): Promise; diff --git a/app/sdk/src/focus.ts b/app/sdk/src/focus.ts index 8a673451..9af56f94 100644 --- a/app/sdk/src/focus.ts +++ b/app/sdk/src/focus.ts @@ -215,8 +215,30 @@ export class FocusModule implements Focus { } } - public async addTopic(sealed: boolean, type: string, subject: (assetId: {assetId: string, transform: string}[]) => any, files: AssetSource[]) { + public async addTopic(sealed: boolean, type: string, subject: (asset: {assetId: string, context: any}[]) => any, files: AssetSource[], progress: (percent: nunber)=>boolean): Promise { return ''; + + // if not assets + // subject callback + // format + // if sealed + // encrypt + // add confirmed topic + + // else + // add unconfirmed topic + // for each asset + // if split + // for each block + // encrypt + // upload reporting progress + // else + // upload reporting progress + // subject callback + // format + // if sealed + // encrypt + // set subject and confirm } public async setTopicSubject(topicId: string, type: string, subject: (assets: {assetId: string, transform: string}[]) => any, files: AssetSource[]) {} diff --git a/app/sdk/src/session.ts b/app/sdk/src/session.ts index be2c3c41..5b2c4b7b 100644 --- a/app/sdk/src/session.ts +++ b/app/sdk/src/session.ts @@ -153,7 +153,6 @@ export class SessionModule implements Session { } public setFocus(cardId: string | null, channelId: string): Focus { -console.log("SESSION SET FOCUS"); if (cardId) { return this.contact.setFocus(cardId, channelId); } else { diff --git a/app/sdk/src/types.ts b/app/sdk/src/types.ts index c0b67ac1..21b6280f 100644 --- a/app/sdk/src/types.ts +++ b/app/sdk/src/types.ts @@ -110,19 +110,28 @@ export type Tag = { sortOrder: number; }; +enum HostingMode { + Inline, // sealed or unsealed, include data in message body + Split, // sealed only, split file into blocks + Thumb, // unsealed only, server side generate thumbnail from source + Copy, // unsealed only, server side preserve data while stripping metadata + HighQuality, // unsealed only, server side transcode to high quality + MediumQuality, // unsealed only, server side transcode to medium quality + LowQuality, // unsealed only, server side transcode to low quality +} + export type AssetSource = { - type: string; + name: string; + mimeType: string; extension: string; - path: string; - transforms: string[], + hosting: {mode: HostingMode, context: any, data?: string, position?: number, size?: number}[], } export type Asset = { assetId: string; - type: string; - encrypted: boolean; - transform: string; + mimeType: string; extension: string; + hosting: HostingMode; }; export type Group = {