@rocket.chat/desktop-api 1.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +4 -0
- package/.turbo/turbo-build.log +0 -0
- package/CHANGELOG.md +7 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +1 -0
- package/package.json +27 -0
- package/src/index.ts +51 -0
- package/tsconfig.json +13 -0
package/.eslintrc.json
ADDED
|
File without changes
|
package/CHANGELOG.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type ServerInfo = {
|
|
2
|
+
version: string;
|
|
3
|
+
};
|
|
4
|
+
export type Badge = '•' | number;
|
|
5
|
+
export type ThemeAppearance = 'dark' | 'light' | 'auto' | 'high-contrast' | undefined;
|
|
6
|
+
export type VideoChatWindowOptions = {
|
|
7
|
+
providerName?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export type OutlookEventsResponse = {
|
|
10
|
+
status: 'success' | 'canceled';
|
|
11
|
+
};
|
|
12
|
+
export interface IRocketChatDesktop {
|
|
13
|
+
onReady: (cb: (serverInfo: ServerInfo) => void) => void;
|
|
14
|
+
setServerInfo: (serverInfo: ServerInfo) => void;
|
|
15
|
+
setUrlResolver: (getAbsoluteUrl: (relativePath?: string) => string) => void;
|
|
16
|
+
setBadge: (badge: Badge) => void;
|
|
17
|
+
setFavicon: (faviconUrl: string) => void;
|
|
18
|
+
setBackground: (imageUrl: string) => void;
|
|
19
|
+
setSidebarCustomTheme: (customTheme: string) => void;
|
|
20
|
+
setTitle: (title: string) => void;
|
|
21
|
+
setUserLoggedIn: (userLoggedIn: boolean) => void;
|
|
22
|
+
setUserPresenceDetection: (options: {
|
|
23
|
+
isAutoAwayEnabled: boolean;
|
|
24
|
+
idleThreshold: number | null;
|
|
25
|
+
setUserOnline: (online: boolean) => void;
|
|
26
|
+
}) => void;
|
|
27
|
+
setUserThemeAppearance: (themeAppearance: ThemeAppearance) => void;
|
|
28
|
+
createNotification: (options: NotificationOptions & {
|
|
29
|
+
canReply?: boolean;
|
|
30
|
+
title: string;
|
|
31
|
+
onEvent: (eventDescriptor: {
|
|
32
|
+
type: string;
|
|
33
|
+
detail: unknown;
|
|
34
|
+
}) => void;
|
|
35
|
+
}) => Promise<unknown>;
|
|
36
|
+
destroyNotification: (id: unknown) => void;
|
|
37
|
+
getInternalVideoChatWindowEnabled: () => boolean;
|
|
38
|
+
openInternalVideoChatWindow: (url: string, options: VideoChatWindowOptions) => void;
|
|
39
|
+
setGitCommitHash: (gitCommitHash: string) => void;
|
|
40
|
+
writeTextToClipboard: (text: string) => void;
|
|
41
|
+
getOutlookEvents: (date: Date) => Promise<OutlookEventsResponse>;
|
|
42
|
+
setOutlookExchangeUrl: (url: string, userId: string) => void;
|
|
43
|
+
hasOutlookCredentials: () => Promise<boolean>;
|
|
44
|
+
clearOutlookCredentials: () => void;
|
|
45
|
+
setUserToken: (token: string, userId: string) => void;
|
|
46
|
+
openDocumentViewer: (url: string, format: string, options: any) => void;
|
|
47
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://www.schemastore.org/package",
|
|
3
|
+
"name": "@rocket.chat/desktop-api",
|
|
4
|
+
"version": "1.0.0-rc.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"default": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "rimraf dist && tsc -p tsconfig.json",
|
|
15
|
+
"lint": "eslint",
|
|
16
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@rocket.chat/eslint-config": "~0.7.0",
|
|
20
|
+
"eslint": "~8.45.0",
|
|
21
|
+
"rimraf": "~6.0.1",
|
|
22
|
+
"typescript": "~5.9.2"
|
|
23
|
+
},
|
|
24
|
+
"volta": {
|
|
25
|
+
"extends": "../../package.json"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type ServerInfo = {
|
|
2
|
+
version: string;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
export type Badge = '•' | number;
|
|
6
|
+
|
|
7
|
+
export type ThemeAppearance = 'dark' | 'light' | 'auto' | 'high-contrast' | undefined;
|
|
8
|
+
|
|
9
|
+
export type VideoChatWindowOptions = {
|
|
10
|
+
providerName?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type OutlookEventsResponse = {
|
|
14
|
+
status: 'success' | 'canceled';
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export interface IRocketChatDesktop {
|
|
18
|
+
onReady: (cb: (serverInfo: ServerInfo) => void) => void;
|
|
19
|
+
setServerInfo: (serverInfo: ServerInfo) => void;
|
|
20
|
+
setUrlResolver: (getAbsoluteUrl: (relativePath?: string) => string) => void;
|
|
21
|
+
setBadge: (badge: Badge) => void;
|
|
22
|
+
setFavicon: (faviconUrl: string) => void;
|
|
23
|
+
setBackground: (imageUrl: string) => void;
|
|
24
|
+
setSidebarCustomTheme: (customTheme: string) => void;
|
|
25
|
+
setTitle: (title: string) => void;
|
|
26
|
+
setUserLoggedIn: (userLoggedIn: boolean) => void;
|
|
27
|
+
setUserPresenceDetection: (options: {
|
|
28
|
+
isAutoAwayEnabled: boolean;
|
|
29
|
+
idleThreshold: number | null;
|
|
30
|
+
setUserOnline: (online: boolean) => void;
|
|
31
|
+
}) => void;
|
|
32
|
+
setUserThemeAppearance: (themeAppearance: ThemeAppearance) => void;
|
|
33
|
+
createNotification: (
|
|
34
|
+
options: NotificationOptions & {
|
|
35
|
+
canReply?: boolean;
|
|
36
|
+
title: string;
|
|
37
|
+
onEvent: (eventDescriptor: { type: string; detail: unknown }) => void;
|
|
38
|
+
},
|
|
39
|
+
) => Promise<unknown>;
|
|
40
|
+
destroyNotification: (id: unknown) => void;
|
|
41
|
+
getInternalVideoChatWindowEnabled: () => boolean;
|
|
42
|
+
openInternalVideoChatWindow: (url: string, options: VideoChatWindowOptions) => void;
|
|
43
|
+
setGitCommitHash: (gitCommitHash: string) => void;
|
|
44
|
+
writeTextToClipboard: (text: string) => void;
|
|
45
|
+
getOutlookEvents: (date: Date) => Promise<OutlookEventsResponse>;
|
|
46
|
+
setOutlookExchangeUrl: (url: string, userId: string) => void;
|
|
47
|
+
hasOutlookCredentials: () => Promise<boolean>;
|
|
48
|
+
clearOutlookCredentials: () => void;
|
|
49
|
+
setUserToken: (token: string, userId: string) => void;
|
|
50
|
+
openDocumentViewer: (url: string, format: string, options: any) => void;
|
|
51
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@rocket.chat/tsconfig/client.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "es2024",
|
|
5
|
+
"module": "node20",
|
|
6
|
+
"moduleResolution": "node16",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"declarationMap": false,
|
|
10
|
+
"sourceMap": false
|
|
11
|
+
},
|
|
12
|
+
"include": ["src"]
|
|
13
|
+
}
|