@todesktop/shared 7.184.17 → 7.184.19

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/lib/plans.d.ts CHANGED
@@ -34,7 +34,7 @@ export declare const prodPlanIds: {
34
34
  enterprise: string;
35
35
  };
36
36
  export declare type PlanIds = typeof prodPlanIds;
37
- export declare const getPlanEnvironment: (stage: "dev" | "prod") => {
37
+ export declare const getPlanEnvironment: (stage: 'dev' | 'prod') => {
38
38
  startup: string;
39
39
  business: string;
40
40
  essential: string;
@@ -51,7 +51,7 @@ export declare const getPlanEnvironment: (stage: "dev" | "prod") => {
51
51
  builder_professional: string;
52
52
  enterprise: string;
53
53
  };
54
- export declare const getCLIPlanIds: (stage: "dev" | "prod") => Pick<{
54
+ export declare const getCLIPlanIds: (stage: 'dev' | 'prod') => Pick<{
55
55
  startup: string;
56
56
  business: string;
57
57
  essential: string;
@@ -68,7 +68,7 @@ export declare const getCLIPlanIds: (stage: "dev" | "prod") => Pick<{
68
68
  builder_professional: string;
69
69
  enterprise: string;
70
70
  }, "cli_founder" | "cli_founder_30" | "cli_founder_50" | "cli_performance" | "cli_scale">;
71
- export declare const getCLIFounderPlanIds: (stage: "dev" | "prod") => Pick<{
71
+ export declare const getCLIFounderPlanIds: (stage: 'dev' | 'prod') => Pick<{
72
72
  startup: string;
73
73
  business: string;
74
74
  essential: string;
@@ -85,7 +85,7 @@ export declare const getCLIFounderPlanIds: (stage: "dev" | "prod") => Pick<{
85
85
  builder_professional: string;
86
86
  enterprise: string;
87
87
  }, "cli_founder" | "cli_founder_30" | "cli_founder_50">;
88
- export declare const getCLIPerformancePlanIds: (stage: "dev" | "prod") => Pick<{
88
+ export declare const getCLIPerformancePlanIds: (stage: 'dev' | 'prod') => Pick<{
89
89
  startup: string;
90
90
  business: string;
91
91
  essential: string;
@@ -102,7 +102,7 @@ export declare const getCLIPerformancePlanIds: (stage: "dev" | "prod") => Pick<{
102
102
  builder_professional: string;
103
103
  enterprise: string;
104
104
  }, "cli_performance">;
105
- export declare const getCLIScalePlanIds: (stage: "dev" | "prod") => Pick<{
105
+ export declare const getCLIScalePlanIds: (stage: 'dev' | 'prod') => Pick<{
106
106
  startup: string;
107
107
  business: string;
108
108
  essential: string;
@@ -119,7 +119,7 @@ export declare const getCLIScalePlanIds: (stage: "dev" | "prod") => Pick<{
119
119
  builder_professional: string;
120
120
  enterprise: string;
121
121
  }, "cli_scale">;
122
- export declare const getBuilderPlanIds: (stage: "dev" | "prod") => Pick<{
122
+ export declare const getBuilderPlanIds: (stage: 'dev' | 'prod') => Pick<{
123
123
  startup: string;
124
124
  business: string;
125
125
  essential: string;
@@ -136,7 +136,7 @@ export declare const getBuilderPlanIds: (stage: "dev" | "prod") => Pick<{
136
136
  builder_professional: string;
137
137
  enterprise: string;
138
138
  }, "builder_essential" | "builder_professional">;
139
- export declare const getBuilderEssentialPlanIds: (stage: "dev" | "prod") => Pick<{
139
+ export declare const getBuilderEssentialPlanIds: (stage: 'dev' | 'prod') => Pick<{
140
140
  startup: string;
141
141
  business: string;
142
142
  essential: string;
@@ -153,7 +153,7 @@ export declare const getBuilderEssentialPlanIds: (stage: "dev" | "prod") => Pick
153
153
  builder_professional: string;
154
154
  enterprise: string;
155
155
  }, "builder_essential">;
156
- export declare const getBuilderProfessionalPlanIds: (stage: "dev" | "prod") => Pick<{
156
+ export declare const getBuilderProfessionalPlanIds: (stage: 'dev' | 'prod') => Pick<{
157
157
  startup: string;
158
158
  business: string;
159
159
  essential: string;
@@ -170,7 +170,7 @@ export declare const getBuilderProfessionalPlanIds: (stage: "dev" | "prod") => P
170
170
  builder_professional: string;
171
171
  enterprise: string;
172
172
  }, "builder_professional">;
173
- export declare const getEssentialPlanIds: (stage: "dev" | "prod") => Pick<{
173
+ export declare const getEssentialPlanIds: (stage: 'dev' | 'prod') => Pick<{
174
174
  startup: string;
175
175
  business: string;
176
176
  essential: string;
@@ -187,7 +187,7 @@ export declare const getEssentialPlanIds: (stage: "dev" | "prod") => Pick<{
187
187
  builder_professional: string;
188
188
  enterprise: string;
189
189
  }, "startup" | "essential" | "essential_new">;
190
- export declare const getProfessionalPlanIds: (stage: "dev" | "prod") => Pick<{
190
+ export declare const getProfessionalPlanIds: (stage: 'dev' | 'prod') => Pick<{
191
191
  startup: string;
192
192
  business: string;
193
193
  essential: string;
@@ -204,7 +204,7 @@ export declare const getProfessionalPlanIds: (stage: "dev" | "prod") => Pick<{
204
204
  builder_professional: string;
205
205
  enterprise: string;
206
206
  }, "business" | "growth" | "professional" | "professional_annual">;
207
- export declare const getEnterprisePlanIds: (stage: "dev" | "prod") => Pick<{
207
+ export declare const getEnterprisePlanIds: (stage: 'dev' | 'prod') => Pick<{
208
208
  startup: string;
209
209
  business: string;
210
210
  essential: string;
package/lib/plans.js CHANGED
@@ -9,81 +9,81 @@ function pick(objectInput, ...keys) {
9
9
  return objectOutput;
10
10
  }
11
11
  exports.devPlanIds = {
12
- startup: "plan_Fe8BzLp7k71eGD",
13
- business: "plan_Fe8CUkZfXasFtB",
14
- essential: "plan_FpljxNuZtNFFbm",
15
- growth: "plan_FplOshrr1w3Mvu",
16
- essential_new: "plan_GYXmTA3EdfCv4q",
17
- professional: "plan_GYXoIkvwVKyfF2",
18
- professional_annual: "price_1KHU70IewCKA2h0IR87yXOQ2",
19
- cli_founder: "plan_Gq0FzdmoTJshQL",
20
- cli_founder_30: "plan_GsL7NZskOY0TC9",
21
- cli_founder_50: "plan_GsL6VYAshfh7c4",
22
- cli_performance: "price_1L821UIewCKA2h0IUwRhicyo",
23
- cli_scale: "price_1L821wIewCKA2h0IMLUmjulL",
24
- builder_essential: "price_1M4o9XIewCKA2h0IVfGrid8E",
25
- builder_professional: "price_1M4o9vIewCKA2h0IHREokdD8",
26
- enterprise: "price_1H2v6JIewCKA2h0IgUwsuctb",
12
+ startup: 'plan_Fe8BzLp7k71eGD',
13
+ business: 'plan_Fe8CUkZfXasFtB',
14
+ essential: 'plan_FpljxNuZtNFFbm',
15
+ growth: 'plan_FplOshrr1w3Mvu',
16
+ essential_new: 'plan_GYXmTA3EdfCv4q',
17
+ professional: 'plan_GYXoIkvwVKyfF2',
18
+ professional_annual: 'price_1KHU70IewCKA2h0IR87yXOQ2',
19
+ cli_founder: 'plan_Gq0FzdmoTJshQL',
20
+ cli_founder_30: 'plan_GsL7NZskOY0TC9',
21
+ cli_founder_50: 'plan_GsL6VYAshfh7c4',
22
+ cli_performance: 'price_1L821UIewCKA2h0IUwRhicyo',
23
+ cli_scale: 'price_1L821wIewCKA2h0IMLUmjulL',
24
+ builder_essential: 'price_1M4o9XIewCKA2h0IVfGrid8E',
25
+ builder_professional: 'price_1M4o9vIewCKA2h0IHREokdD8',
26
+ enterprise: 'price_1H2v6JIewCKA2h0IgUwsuctb',
27
27
  };
28
28
  exports.prodPlanIds = {
29
- startup: "plan_FdmDAUN7JGD8pR",
30
- business: "plan_FdmE8akq9ukxiY",
31
- essential: "plan_FohJzCujA6vvt4",
32
- growth: "plan_FohKGuWis5ocsi",
33
- essential_new: "plan_GYXn2cnPl5dy7j",
34
- professional: "plan_GYXoKsa2j0yURg",
35
- professional_annual: "price_1KHTgaIewCKA2h0I81TVg85r",
36
- professional_annual_full_price: "price_1KLT32IewCKA2h0IFeJOAgG5",
37
- cli_founder: "plan_GpzWZLfsOzjrvI",
38
- cli_founder_30: "plan_GsL1IRUwpj5CIF",
39
- cli_founder_50: "plan_GsL1IRUwpj5CIF",
40
- cli_performance: "price_1L822LIewCKA2h0I5JYyOG1p",
41
- cli_scale: "price_1L822RIewCKA2h0IPt9f2nZM",
42
- builder_essential: "price_1M4oA4IewCKA2h0IWgfbSJBe",
43
- builder_professional: "price_1MIDxtIewCKA2h0IvWi5weJL",
44
- enterprise: "plan_GuGICX6nRtDthN",
29
+ startup: 'plan_FdmDAUN7JGD8pR',
30
+ business: 'plan_FdmE8akq9ukxiY',
31
+ essential: 'plan_FohJzCujA6vvt4',
32
+ growth: 'plan_FohKGuWis5ocsi',
33
+ essential_new: 'plan_GYXn2cnPl5dy7j',
34
+ professional: 'plan_GYXoKsa2j0yURg',
35
+ professional_annual: 'price_1KHTgaIewCKA2h0I81TVg85r',
36
+ professional_annual_full_price: 'price_1KLT32IewCKA2h0IFeJOAgG5',
37
+ cli_founder: 'plan_GpzWZLfsOzjrvI',
38
+ cli_founder_30: 'plan_GsL1IRUwpj5CIF',
39
+ cli_founder_50: 'plan_GsL1IRUwpj5CIF',
40
+ cli_performance: 'price_1L822LIewCKA2h0I5JYyOG1p',
41
+ cli_scale: 'price_1L822RIewCKA2h0IPt9f2nZM',
42
+ builder_essential: 'price_1M4oA4IewCKA2h0IWgfbSJBe',
43
+ builder_professional: 'price_1MIDxtIewCKA2h0IvWi5weJL',
44
+ enterprise: 'plan_GuGICX6nRtDthN',
45
45
  };
46
- exports.getPlanEnvironment = (stage) => stage === "prod" ? exports.prodPlanIds : exports.devPlanIds;
46
+ exports.getPlanEnvironment = (stage) => stage === 'prod' ? exports.prodPlanIds : exports.devPlanIds;
47
47
  /* ToDesktop CLI Plans */
48
48
  exports.getCLIPlanIds = (stage) => {
49
49
  const planIds = exports.getPlanEnvironment(stage);
50
- return pick(planIds, "cli_founder", "cli_founder_30", "cli_founder_50", "cli_performance", "cli_scale");
50
+ return pick(planIds, 'cli_founder', 'cli_founder_30', 'cli_founder_50', 'cli_performance', 'cli_scale');
51
51
  };
52
52
  exports.getCLIFounderPlanIds = (stage) => {
53
53
  const planIds = exports.getPlanEnvironment(stage);
54
- return pick(planIds, "cli_founder", "cli_founder_30", "cli_founder_50");
54
+ return pick(planIds, 'cli_founder', 'cli_founder_30', 'cli_founder_50');
55
55
  };
56
56
  exports.getCLIPerformancePlanIds = (stage) => {
57
57
  const planIds = exports.getPlanEnvironment(stage);
58
- return pick(planIds, "cli_performance");
58
+ return pick(planIds, 'cli_performance');
59
59
  };
60
60
  exports.getCLIScalePlanIds = (stage) => {
61
61
  const planIds = exports.getPlanEnvironment(stage);
62
- return pick(planIds, "cli_scale");
62
+ return pick(planIds, 'cli_scale');
63
63
  };
64
64
  /* ToDesktop Builder Plans */
65
65
  exports.getBuilderPlanIds = (stage) => {
66
66
  const planIds = exports.getPlanEnvironment(stage);
67
- return pick(planIds, "builder_essential", "builder_professional");
67
+ return pick(planIds, 'builder_essential', 'builder_professional');
68
68
  };
69
69
  exports.getBuilderEssentialPlanIds = (stage) => {
70
70
  const planIds = exports.getPlanEnvironment(stage);
71
- return pick(planIds, "builder_essential");
71
+ return pick(planIds, 'builder_essential');
72
72
  };
73
73
  exports.getBuilderProfessionalPlanIds = (stage) => {
74
74
  const planIds = exports.getPlanEnvironment(stage);
75
- return pick(planIds, "builder_professional");
75
+ return pick(planIds, 'builder_professional');
76
76
  };
77
77
  /* ToDesktop Web Plans */
78
78
  exports.getEssentialPlanIds = (stage) => {
79
79
  const planIds = exports.getPlanEnvironment(stage);
80
- return pick(planIds, "startup", "essential", "essential_new");
80
+ return pick(planIds, 'startup', 'essential', 'essential_new');
81
81
  };
82
82
  exports.getProfessionalPlanIds = (stage) => {
83
83
  const planIds = exports.getPlanEnvironment(stage);
84
- return pick(planIds, "business", "growth", "professional", "professional_annual");
84
+ return pick(planIds, 'business', 'growth', 'professional', 'professional_annual');
85
85
  };
86
86
  exports.getEnterprisePlanIds = (stage) => {
87
87
  const planIds = exports.getPlanEnvironment(stage);
88
- return pick(planIds, "enterprise");
88
+ return pick(planIds, 'enterprise');
89
89
  };
package/lib/plugin.d.ts CHANGED
@@ -22,17 +22,17 @@ export declare type PluginPreferences = {
22
22
  [id: string]: PluginPreference;
23
23
  };
24
24
  export declare type PluginPreference = NumberSpec | TextSpec | CheckboxSpec;
25
- export declare type TextSpec = PreferenceSpec<"text", {
25
+ export declare type TextSpec = PreferenceSpec<'text', {
26
26
  validator?: AjvJSONSchemaType;
27
27
  value?: string;
28
28
  placeholder?: string;
29
29
  }>;
30
- export declare type NumberSpec = PreferenceSpec<"number", {
30
+ export declare type NumberSpec = PreferenceSpec<'number', {
31
31
  validator?: AjvJSONSchemaType;
32
32
  value?: number;
33
33
  placeholder?: number;
34
34
  }>;
35
- export declare type CheckboxSpec = PreferenceSpec<"checkbox", {
35
+ export declare type CheckboxSpec = PreferenceSpec<'checkbox', {
36
36
  validator?: AjvJSONSchemaType;
37
37
  value?: boolean;
38
38
  }>;
@@ -1,6 +1,6 @@
1
- import { BaseApp, Schemable } from "./base";
2
- import { IAppBuilderLib } from "./desktopify";
3
- export declare type IUploadFileStatus = "error" | "success" | "done" | "uploading" | "removed";
1
+ import { BaseApp, Schemable } from './base';
2
+ import { IAppBuilderLib } from './desktopify';
3
+ export declare type IUploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed';
4
4
  export interface IUploadFile {
5
5
  uid: string;
6
6
  size: number;
@@ -88,7 +88,7 @@ export interface IApp extends BaseApp {
88
88
  appPkgName?: string;
89
89
  appProtocol?: ISwitchableValue<string>;
90
90
  appType?: string;
91
- appxConfig?: Partial<IAppBuilderLib["config"]["appx"]>;
91
+ appxConfig?: Partial<IAppBuilderLib['config']['appx']>;
92
92
  cssToInject?: string;
93
93
  customDomain?: string;
94
94
  customUserAgent?: ISwitchableValue<string>;
@@ -116,14 +116,14 @@ export interface IApp extends BaseApp {
116
116
  jsToInject?: string;
117
117
  menubarIcon?: string;
118
118
  name: string;
119
- nsisConfig?: Partial<IAppBuilderLib["config"]["nsis"]>;
119
+ nsisConfig?: Partial<IAppBuilderLib['config']['nsis']>;
120
120
  runtimeEnvs?: string;
121
121
  secret?: string;
122
122
  shouldLaunchAtStartupByDefault?: boolean;
123
123
  shouldOnlySendAbsolutelyNecessaryRequests?: boolean;
124
124
  shouldReuseRendererProcess?: boolean;
125
- themeSource?: "system" | "light" | "dark";
126
- themeSourceMac?: "system" | "light" | "dark";
125
+ themeSource?: 'system' | 'light' | 'dark';
126
+ themeSourceMac?: 'system' | 'light' | 'dark';
127
127
  toggleVisibilityKeyboardShortcut?: ISwitchableValue<string>;
128
128
  trayIcon?: string;
129
129
  url: string;
@@ -133,7 +133,7 @@ export interface IApp extends BaseApp {
133
133
  }
134
134
  export interface IUser extends Schemable {
135
135
  id: string;
136
- authInfo?: {};
136
+ authInfo?: object;
137
137
  avatar?: string;
138
138
  currentApplication?: string;
139
139
  customerId?: string;
@@ -1,2 +1,2 @@
1
- export declare type ValidTranslationKeys = "updateNotification.title" | "updateNotification.body";
2
- export declare type ValidTranslationLanguages = "default";
1
+ export declare type ValidTranslationKeys = 'updateNotification.title' | 'updateNotification.body';
2
+ export declare type ValidTranslationLanguages = 'default';
@@ -1,5 +1,5 @@
1
- import * as yup from "yup";
2
- import { DesktopifyApp2 } from ".";
1
+ import * as yup from 'yup';
2
+ import { DesktopifyApp2 } from '.';
3
3
  export declare const appTitleValidation: yup.StringSchema;
4
4
  export declare const forceVersionValidation: yup.StringSchema;
5
5
  export declare const iconValidation: yup.StringSchema;
@@ -6,85 +6,85 @@ const semver = require("semver");
6
6
  const isRegex = require("is-regex");
7
7
  exports.appTitleValidation = yup
8
8
  .string()
9
- .label("App title")
9
+ .label('App title')
10
10
  .max(26)
11
- .matches(/^[\w\-\s]+$/, "App title may contain letters, numbers, spaces and dashes only")
12
- .matches(/^[^\s]+(\s+[^\s]+)*$/, "App title may not begin or end with space")
11
+ .matches(/^[\w\-\s]+$/, 'App title may contain letters, numbers, spaces and dashes only')
12
+ .matches(/^[^\s]+(\s+[^\s]+)*$/, 'App title may not begin or end with space')
13
13
  .required();
14
14
  function isNumeric(str) {
15
- if (typeof str != "string")
15
+ if (typeof str != 'string')
16
16
  return false;
17
- return !isNaN(str) && !isNaN(parseFloat(str));
17
+ return !isNaN(Number(str)) && !isNaN(parseFloat(str));
18
18
  }
19
19
  function isNumericSemver(value) {
20
20
  // check if valid semver
21
21
  if (!semver.valid(value))
22
22
  return false;
23
23
  // ensure that all values are numbers
24
- if (!value.split(".").every((num) => isNumeric(num)))
24
+ if (!value.split('.').every((num) => isNumeric(num)))
25
25
  return false;
26
26
  return true;
27
27
  }
28
28
  exports.forceVersionValidation = yup
29
29
  .string()
30
- .label("App version")
30
+ .label('App version')
31
31
  .required()
32
- .when("$currentVersion", (currentVersion, schema) => schema.test("semantic-version", "App version must follow a numeric SemVer versioning scheme (e.g. 1.0.0) and be greater than prior version.", (forceVersion) => {
32
+ .when('$currentVersion', (currentVersion, schema) => schema.test('semantic-version', 'App version must follow a numeric SemVer versioning scheme (e.g. 1.0.0) and be greater than prior version.', (forceVersion) => {
33
33
  return (isNumericSemver(forceVersion) &&
34
34
  semver.gt(forceVersion, currentVersion));
35
35
  }));
36
36
  exports.iconValidation = yup
37
37
  .string()
38
- .label("Icon")
38
+ .label('Icon')
39
39
  .url()
40
- .required("You must upload an icon for your app");
40
+ .required('You must upload an icon for your app');
41
41
  exports.urlValidation = yup
42
42
  .string()
43
43
  .matches(/^(?:([a-z0-9+.-]+):\/\/)(?:\S+(?::\S*)?@)?(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/, {
44
44
  message: "Invalid URL. Don't forget to include the protocol (e.g.. https://).",
45
45
  excludeEmptyString: true,
46
46
  })
47
- .label("Website URL")
47
+ .label('Website URL')
48
48
  .required();
49
49
  exports.urlValidationForm = yup.object().shape({
50
50
  url: exports.urlValidation,
51
51
  });
52
52
  exports.heightValidation = yup
53
53
  .number()
54
- .label("Height")
54
+ .label('Height')
55
55
  .moreThan(1)
56
56
  .lessThan(2000)
57
57
  .required();
58
58
  exports.widthValidation = yup
59
59
  .number()
60
- .label("Width")
60
+ .label('Width')
61
61
  .moreThan(1)
62
62
  .lessThan(3000)
63
63
  .required();
64
64
  exports.internalAppRegexValidation = yup
65
65
  .string()
66
66
  .required()
67
- .label("Internal URLs")
68
- .test("escape-forward-slash", "a forward-slash ('/') must be escaped with a back-slash ('\\')", (value) => {
69
- if (value.includes("/")) {
70
- let forwardSlashCount = value
71
- .split("")
72
- .map((char) => char === "/")
67
+ .label('Internal URLs')
68
+ .test('escape-forward-slash', "a forward-slash ('/') must be escaped with a back-slash ('\\')", (value) => {
69
+ if (value.includes('/')) {
70
+ const forwardSlashCount = value
71
+ .split('')
72
+ .map((char) => char === '/')
73
73
  .filter((isTrue) => isTrue).length;
74
- let backSlashEscapeCount = ((value || "").match(/(?=\\\/)/g) || [])
74
+ const backSlashEscapeCount = ((value || '').match(/(?=\\\/)/g) || [])
75
75
  .length;
76
76
  return forwardSlashCount === backSlashEscapeCount;
77
77
  }
78
78
  return true;
79
79
  })
80
- .test("is-regex", "${path} must be valid regular expression", (value) => isRegex(RegExp(value)));
80
+ .test('is-regex', '${path} must be valid regular expression', (value) => isRegex(RegExp(value)));
81
81
  exports.appProtocolValidation = yup
82
82
  .string()
83
83
  .required()
84
- .label("App Protocol")
85
- .test("ends-with-protocol", "Protocols must end with `://`", (value) => value.endsWith("://"))
86
- .test("is-lowercase", "Protocols must be lowercase", (value) => value === value.toLowerCase())
87
- .matches(/^[a-zA-Z\-]+\:\/\/$/, "Protocols contain letters and dashes (-) only")
84
+ .label('App Protocol')
85
+ .test('ends-with-protocol', 'Protocols must end with `://`', (value) => value.endsWith('://'))
86
+ .test('is-lowercase', 'Protocols must be lowercase', (value) => value === value.toLowerCase())
87
+ .matches(/^[a-zA-Z-]+:\/\/$/, 'Protocols contain letters and dashes (-) only')
88
88
  .min(5);
89
89
  exports.appConfigValidation = yup.object({
90
90
  id: yup.string().required(),
@@ -134,5 +134,5 @@ exports.appConfigValidation = yup.object({
134
134
  .required(),
135
135
  });
136
136
  exports.shouldMinimizeToTrayIsActive = (desktopApp) => {
137
- return desktopApp.trays.some((t) => t.leftClick.role === "toggleMenu" || t.rightClick.role === "toggleMenu");
137
+ return desktopApp.trays.some((t) => t.leftClick.role === 'toggleMenu' || t.rightClick.role === 'toggleMenu');
138
138
  };
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.184.17",
3
+ "version": "7.184.19",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
9
  "build": "rm -f ./lib/* && tsc",
10
+ "lint": "npm run lint:types && npm run lint:styles",
11
+ "lint:types": "tsc --noEmit",
12
+ "lint:styles": "prettier --check . && eslint src",
10
13
  "prepublishOnly": "npm run build",
11
14
  "bump": "npm version minor && git push && npm publish",
12
15
  "dev": "tsc"
@@ -24,12 +27,13 @@
24
27
  },
25
28
  "devDependencies": {
26
29
  "@types/semver": "^7.3.9",
30
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
31
+ "@typescript-eslint/parser": "^5.60.1",
27
32
  "app-builder-lib": "^22.10.4",
28
- "tslint": "^5.12.1",
29
- "tslint-config-prettier": "1.18.0",
30
- "tslint-eslint-rules": "5.4.0",
31
- "tslint-react": "^3.6.0",
32
- "tslint-react-hooks": "1.1.0",
33
+ "eslint": "^8.43.0",
34
+ "eslint-config-prettier": "^8.8.0",
35
+ "eslint-plugin-prettier": "^4.2.1",
36
+ "prettier": "^2.8.8",
33
37
  "typescript": "^3.9.10"
34
38
  }
35
39
  }
package/src/base.ts CHANGED
@@ -3,45 +3,45 @@ import {
3
3
  FilePath,
4
4
  IAppBuilderLib,
5
5
  Release,
6
- } from "./desktopify";
6
+ } from './desktopify';
7
7
  export interface Schemable {
8
8
  schemaVersion?: number;
9
9
  }
10
10
 
11
- export type ProgressTypes = "progress" | "done" | "error";
11
+ export type ProgressTypes = 'progress' | 'done' | 'error';
12
12
 
13
13
  export interface IChecklistItem {
14
14
  [id: string]: boolean;
15
15
  }
16
16
 
17
17
  export interface IDownloadButtonOptions {
18
- buttonSize: "small" | "medium" | "large";
19
- fontFamily: "serif" | "sans-serif";
18
+ buttonSize: 'small' | 'medium' | 'large';
19
+ fontFamily: 'serif' | 'sans-serif';
20
20
  bgColor: string;
21
21
  fgColor: string;
22
22
  borderRadius: number;
23
23
  showAppIcon: {
24
24
  enabled: boolean;
25
- alignment: "right" | "left";
25
+ alignment: 'right' | 'left';
26
26
  };
27
27
  showDownloadIcon: {
28
28
  enabled: boolean;
29
- alignment: "right" | "left";
29
+ alignment: 'right' | 'left';
30
30
  };
31
31
  btnText: string;
32
32
  }
33
33
 
34
34
  export enum WindowsEVOnboardingSteps {
35
- "hasChosenProvider" = "hasChosenProvider",
36
- "hasOrderedCert" = "hasOrderedCert",
37
- "hasBeenVerified" = "hasBeenVerified",
38
- "hasGeneratedCert" = "hasGeneratedCert",
39
- "hasUploadedCert" = "hasUploadedCert",
35
+ 'hasChosenProvider' = 'hasChosenProvider',
36
+ 'hasOrderedCert' = 'hasOrderedCert',
37
+ 'hasBeenVerified' = 'hasBeenVerified',
38
+ 'hasGeneratedCert' = 'hasGeneratedCert',
39
+ 'hasUploadedCert' = 'hasUploadedCert',
40
40
  }
41
41
 
42
42
  export enum WindowsEVOnboardingProvider {
43
- "globalsign" = "globalsign",
44
- "other" = "other",
43
+ 'globalsign' = 'globalsign',
44
+ 'other' = 'other',
45
45
  }
46
46
 
47
47
  export interface IAppBuildProgress {
@@ -58,7 +58,7 @@ export interface IAppMeta {
58
58
  currentBuildProgress?: {
59
59
  channel?: string;
60
60
  id?: string;
61
- releaseId?: Release["id"];
61
+ releaseId?: Release['id'];
62
62
  linux?: IAppBuildProgress;
63
63
  mac?: IAppBuildProgress;
64
64
  projectConfig?: {
@@ -77,14 +77,14 @@ export interface IAppMeta {
77
77
  iconSize?: number;
78
78
  iconTextSize?: number;
79
79
  title?: string;
80
- contents?: IAppBuilderLib["config"]["dmg"]["contents"];
81
- window?: IAppBuilderLib["config"]["dmg"]["window"];
80
+ contents?: IAppBuilderLib['config']['dmg']['contents'];
81
+ window?: IAppBuilderLib['config']['dmg']['window'];
82
82
  };
83
83
  extraContentFiles?: ExtraFileReference[];
84
84
  electronMirror?: string;
85
85
  electronVersion?: string;
86
86
  extraResources?: ExtraFileReference[];
87
- fileAssociations?: IAppBuilderLib["config"]["fileAssociations"];
87
+ fileAssociations?: IAppBuilderLib['config']['fileAssociations'];
88
88
  filesForDistribution?: string[];
89
89
  icon: FilePath;
90
90
  id: string;
@@ -98,14 +98,14 @@ export interface IAppMeta {
98
98
  category?: string;
99
99
  dmgBackground?: FilePath;
100
100
  entitlements?: FilePath;
101
- extendInfo?: IAppBuilderLib["config"]["mac"]["extendInfo"];
101
+ extendInfo?: IAppBuilderLib['config']['mac']['extendInfo'];
102
102
  icon?: FilePath;
103
103
  };
104
104
  nodeVersion?: string;
105
- packageManager?: "npm" | "yarn" | "pnpm";
105
+ packageManager?: 'npm' | 'yarn' | 'pnpm';
106
106
  productName?: string;
107
107
  schemaVersion: number;
108
- snap?: IAppBuilderLib["config"]["snap"];
108
+ snap?: IAppBuilderLib['config']['snap'];
109
109
  windows?: {
110
110
  icon?: FilePath;
111
111
  nsisCustomBinary?: {
@@ -155,8 +155,8 @@ export interface IAppMeta {
155
155
  }
156
156
 
157
157
  export enum WindowsHSMCertType {
158
- ev = "ev",
159
- file = "file",
158
+ ev = 'ev',
159
+ file = 'file',
160
160
  }
161
161
 
162
162
  export interface CustomWindowsCodeSignFile {
@@ -169,7 +169,7 @@ export interface CustomWindowsCodeSignFile {
169
169
  }
170
170
 
171
171
  export interface CustomWindowsCodeSignEV {
172
- certType: "hsm";
172
+ certType: 'hsm';
173
173
  hsmCertType: WindowsHSMCertType.ev;
174
174
  hsmCertName: string;
175
175
  }
@@ -218,7 +218,7 @@ export interface BaseApp extends Schemable {
218
218
  shouldCreateMacUniversalInstaller?: boolean;
219
219
 
220
220
  // artifact configs
221
- appxConfig?: Partial<IAppBuilderLib["config"]["appx"]>;
222
- nsisConfig?: Partial<IAppBuilderLib["config"]["nsis"]>;
221
+ appxConfig?: Partial<IAppBuilderLib['config']['appx']>;
222
+ nsisConfig?: Partial<IAppBuilderLib['config']['nsis']>;
223
223
  snapStore?: { login?: string; description?: string };
224
224
  }