@todesktop/shared 7.188.65 → 7.188.67
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/README.md +75 -0
- package/eslint.config.mjs +57 -0
- package/lib/base.d.ts +15 -12
- package/lib/base.js +3 -3
- package/lib/desktopify.d.ts +23 -23
- package/lib/desktopify.js +17 -12
- package/lib/desktopify2.d.ts +12 -13
- package/lib/hsm.d.ts +2 -2
- package/lib/hsm.js +7 -5
- package/lib/index.js +6 -2
- package/lib/plans.d.ts +117 -220
- package/lib/plans.js +618 -88
- package/lib/plugin.d.ts +7 -7
- package/lib/toDesktop.d.ts +2 -2
- package/lib/translation.d.ts +2 -2
- package/lib/validations.d.ts +3 -3
- package/lib/validations.js +2 -1
- package/package.json +8 -5
- package/src/base.ts +12 -6
- package/src/plans.ts +698 -102
- package/.eslintrc.js +0 -33
package/lib/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type AjvJSONSchemaType = object;
|
|
2
2
|
export interface DesktopAppPlugin {
|
|
3
3
|
/**
|
|
4
4
|
* Configuration gathered from the todesktop plugin.
|
|
@@ -11,28 +11,28 @@ export interface DesktopAppPlugin {
|
|
|
11
11
|
*/
|
|
12
12
|
package: string;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type ToDesktopPlugin = {
|
|
15
15
|
namespace: string;
|
|
16
16
|
version: number;
|
|
17
17
|
main?: string;
|
|
18
18
|
preload?: string;
|
|
19
19
|
preferences?: PluginPreferences;
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export type PluginPreferences = {
|
|
22
22
|
[id: string]: PluginPreference;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
24
|
+
export type PluginPreference = NumberSpec | TextSpec | CheckboxSpec;
|
|
25
|
+
export type TextSpec = PreferenceSpec<'text', {
|
|
26
26
|
validator?: AjvJSONSchemaType;
|
|
27
27
|
value?: string;
|
|
28
28
|
placeholder?: string;
|
|
29
29
|
}>;
|
|
30
|
-
export
|
|
30
|
+
export type NumberSpec = PreferenceSpec<'number', {
|
|
31
31
|
validator?: AjvJSONSchemaType;
|
|
32
32
|
value?: number;
|
|
33
33
|
placeholder?: number;
|
|
34
34
|
}>;
|
|
35
|
-
export
|
|
35
|
+
export type CheckboxSpec = PreferenceSpec<'checkbox', {
|
|
36
36
|
validator?: AjvJSONSchemaType;
|
|
37
37
|
value?: boolean;
|
|
38
38
|
}>;
|
package/lib/toDesktop.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseApp, Schemable } from './base';
|
|
2
2
|
import { IAppBuilderLib } from './desktopify';
|
|
3
|
-
export
|
|
3
|
+
export type IUploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed';
|
|
4
4
|
export interface IUploadFile {
|
|
5
5
|
uid: string;
|
|
6
6
|
size: number;
|
|
@@ -25,7 +25,7 @@ export interface IAppIcon {
|
|
|
25
25
|
appId: string;
|
|
26
26
|
icon: IHueIcon;
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export type IAppIcons = IAppIcon[];
|
|
29
29
|
export interface IAppWindowOptions {
|
|
30
30
|
startInFullscreenMode: boolean;
|
|
31
31
|
isResizable: boolean;
|
package/lib/translation.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type ValidTranslationKeys = 'updateNotification.title' | 'updateNotification.body';
|
|
2
|
+
export type ValidTranslationLanguages = 'default';
|
package/lib/validations.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export declare const appTitleValidation: yup.StringSchema;
|
|
|
5
5
|
export declare const forceVersionValidation: yup.StringSchema;
|
|
6
6
|
export declare const iconValidation: yup.StringSchema;
|
|
7
7
|
export declare const urlValidation: yup.StringSchema;
|
|
8
|
-
export declare const urlValidationForm: yup.ObjectSchema<
|
|
8
|
+
export declare const urlValidationForm: yup.ObjectSchema<{
|
|
9
9
|
url: string;
|
|
10
|
-
}
|
|
10
|
+
}>;
|
|
11
11
|
export declare const heightValidation: yup.NumberSchema;
|
|
12
12
|
export declare const widthValidation: yup.NumberSchema;
|
|
13
13
|
export declare const internalAppRegexValidation: yup.StringSchema;
|
|
@@ -51,4 +51,4 @@ export declare const appConfigValidation: yup.ObjectSchema<{
|
|
|
51
51
|
publishedVersions: any;
|
|
52
52
|
};
|
|
53
53
|
}>;
|
|
54
|
-
export declare const shouldMinimizeToTrayIsActive: <
|
|
54
|
+
export declare const shouldMinimizeToTrayIsActive: <Plugin = DesktopAppPlugin>(desktopApp: DesktopifyApp2<Plugin>) => boolean;
|
package/lib/validations.js
CHANGED
|
@@ -133,6 +133,7 @@ exports.appConfigValidation = yup.object({
|
|
|
133
133
|
})
|
|
134
134
|
.required(),
|
|
135
135
|
});
|
|
136
|
-
|
|
136
|
+
const shouldMinimizeToTrayIsActive = (desktopApp) => {
|
|
137
137
|
return desktopApp.trays.some((t) => t.leftClick.role === 'toggleMenu' || t.rightClick.role === 'toggleMenu');
|
|
138
138
|
};
|
|
139
|
+
exports.shouldMinimizeToTrayIsActive = shouldMinimizeToTrayIsActive;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todesktop/shared",
|
|
3
|
-
"version": "7.188.
|
|
3
|
+
"version": "7.188.67",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -26,14 +26,17 @@
|
|
|
26
26
|
"yup": "^0.26.10"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@eslint/eslintrc": "^3.1.0",
|
|
30
|
+
"@eslint/js": "^9.9.1",
|
|
29
31
|
"@types/semver": "^7.3.9",
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
31
|
-
"@typescript-eslint/parser": "^
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^8.4.0",
|
|
33
|
+
"@typescript-eslint/parser": "^8.4.0",
|
|
32
34
|
"app-builder-lib": "^22.10.4",
|
|
33
|
-
"eslint": "^
|
|
35
|
+
"eslint": "^9.9.1",
|
|
34
36
|
"eslint-config-prettier": "^8.8.0",
|
|
35
37
|
"eslint-plugin-prettier": "^4.2.1",
|
|
38
|
+
"globals": "^15.9.0",
|
|
36
39
|
"prettier": "^2.8.8",
|
|
37
|
-
"typescript": "^
|
|
40
|
+
"typescript": "^5.5.4"
|
|
38
41
|
}
|
|
39
42
|
}
|
package/src/base.ts
CHANGED
|
@@ -268,12 +268,7 @@ export interface BaseApp extends Schemable {
|
|
|
268
268
|
// this property is dynamically resolved at queueBuild in cloud functions
|
|
269
269
|
parentApp?: BaseApp;
|
|
270
270
|
parent?: { id: string; relationshipToParent: string } | null;
|
|
271
|
-
subscription?:
|
|
272
|
-
status: string;
|
|
273
|
-
subscriptionId: string;
|
|
274
|
-
itemId: string;
|
|
275
|
-
planId: string;
|
|
276
|
-
};
|
|
271
|
+
subscription?: Subscription;
|
|
277
272
|
|
|
278
273
|
// artifacts
|
|
279
274
|
shouldCreate32BitWindowsArtifacts?: boolean;
|
|
@@ -304,3 +299,14 @@ export interface BaseApp extends Schemable {
|
|
|
304
299
|
shouldPinToVersion?: boolean;
|
|
305
300
|
};
|
|
306
301
|
}
|
|
302
|
+
|
|
303
|
+
export type Subscription = {
|
|
304
|
+
status: string;
|
|
305
|
+
subscriptionId: string;
|
|
306
|
+
itemId: string;
|
|
307
|
+
planId: string;
|
|
308
|
+
|
|
309
|
+
// todo: remove optional qualifier once we complete migration
|
|
310
|
+
productId?: string;
|
|
311
|
+
priceId?: string;
|
|
312
|
+
};
|