mirror of
https://github.com/balzack/databag.git
synced 2025-05-04 15:35:16 +00:00
preparing asset upload
This commit is contained in:
parent
7ad9cb55fa
commit
7fe3618a72
@ -134,7 +134,7 @@ export interface Attribute {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Focus {
|
export interface Focus {
|
||||||
addTopic(sealed: boolean, type: string, subject: (assetId: {assetId: string, transform: string}[]) => any, files: AssetSource[]): Promise<string>;
|
addTopic(sealed: boolean, type: string, subject: (asset: {assetId: string, context: any}[]) => any, files: AssetSource[], progress: (percent: number)=>boolean): Promise<string>;
|
||||||
setTopicSubject(topicId: string, type: string, subject: (assets: {assetId: string, transform: string}[]) => any, files: AssetSource[]): Promise<void>;
|
setTopicSubject(topicId: string, type: string, subject: (assets: {assetId: string, transform: string}[]) => any, files: AssetSource[]): Promise<void>;
|
||||||
removeTopic(topicId: string): Promise<void>;
|
removeTopic(topicId: string): Promise<void>;
|
||||||
|
|
||||||
|
@ -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<string> {
|
||||||
return '';
|
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[]) {}
|
public async setTopicSubject(topicId: string, type: string, subject: (assets: {assetId: string, transform: string}[]) => any, files: AssetSource[]) {}
|
||||||
|
@ -153,7 +153,6 @@ export class SessionModule implements Session {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public setFocus(cardId: string | null, channelId: string): Focus {
|
public setFocus(cardId: string | null, channelId: string): Focus {
|
||||||
console.log("SESSION SET FOCUS");
|
|
||||||
if (cardId) {
|
if (cardId) {
|
||||||
return this.contact.setFocus(cardId, channelId);
|
return this.contact.setFocus(cardId, channelId);
|
||||||
} else {
|
} else {
|
||||||
|
@ -110,19 +110,28 @@ export type Tag = {
|
|||||||
sortOrder: number;
|
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 = {
|
export type AssetSource = {
|
||||||
type: string;
|
name: string;
|
||||||
|
mimeType: string;
|
||||||
extension: string;
|
extension: string;
|
||||||
path: string;
|
hosting: {mode: HostingMode, context: any, data?: string, position?: number, size?: number}[],
|
||||||
transforms: string[],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Asset = {
|
export type Asset = {
|
||||||
assetId: string;
|
assetId: string;
|
||||||
type: string;
|
mimeType: string;
|
||||||
encrypted: boolean;
|
|
||||||
transform: string;
|
|
||||||
extension: string;
|
extension: string;
|
||||||
|
hosting: HostingMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Group = {
|
export type Group = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user