@todesktop/shared 7.191.0 → 7.191.1

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/{base.d.ts → cjs/base.d.ts} +1 -0
  3. package/lib/cjs/base.js +22 -0
  4. package/lib/cjs/desktopify.js +79 -0
  5. package/lib/cjs/desktopify2.js +80 -0
  6. package/lib/cjs/getSiteInfo.js +2 -0
  7. package/lib/cjs/hsm.js +42 -0
  8. package/lib/cjs/index.d.ts +12 -0
  9. package/lib/cjs/index.js +33 -0
  10. package/lib/cjs/invitePermissionLabels.js +29 -0
  11. package/lib/cjs/personalAccessTokens.js +2 -0
  12. package/lib/cjs/plans.js +632 -0
  13. package/lib/cjs/plugin.js +2 -0
  14. package/lib/cjs/toDesktop.js +2 -0
  15. package/lib/cjs/translation.js +14 -0
  16. package/lib/cjs/validations.js +178 -0
  17. package/lib/esm/base.d.ts +326 -0
  18. package/lib/esm/desktopify.d.ts +339 -0
  19. package/lib/esm/desktopify2.d.ts +506 -0
  20. package/lib/esm/getSiteInfo.d.ts +24 -0
  21. package/lib/esm/hsm.d.ts +30 -0
  22. package/lib/{index.d.ts → esm/index.d.ts} +1 -1
  23. package/lib/{index.js → esm/index.js} +2 -1
  24. package/lib/esm/invitePermissionLabels.d.ts +13 -0
  25. package/lib/esm/personalAccessTokens.d.ts +24 -0
  26. package/lib/esm/plans.d.ts +130 -0
  27. package/lib/esm/plugin.d.ts +55 -0
  28. package/lib/esm/toDesktop.d.ts +191 -0
  29. package/lib/esm/translation.d.ts +2 -0
  30. package/lib/esm/validations.d.ts +102 -0
  31. package/package.json +20 -5
  32. package/src/base.ts +1 -0
  33. package/src/index.cjs.ts +19 -0
  34. package/src/index.ts +2 -1
  35. package/tsconfig.esm.json +15 -0
  36. package/tsconfig.json +3 -4
  37. /package/lib/{desktopify.d.ts → cjs/desktopify.d.ts} +0 -0
  38. /package/lib/{desktopify2.d.ts → cjs/desktopify2.d.ts} +0 -0
  39. /package/lib/{getSiteInfo.d.ts → cjs/getSiteInfo.d.ts} +0 -0
  40. /package/lib/{hsm.d.ts → cjs/hsm.d.ts} +0 -0
  41. /package/lib/{invitePermissionLabels.d.ts → cjs/invitePermissionLabels.d.ts} +0 -0
  42. /package/lib/{personalAccessTokens.d.ts → cjs/personalAccessTokens.d.ts} +0 -0
  43. /package/lib/{plans.d.ts → cjs/plans.d.ts} +0 -0
  44. /package/lib/{plugin.d.ts → cjs/plugin.d.ts} +0 -0
  45. /package/lib/{toDesktop.d.ts → cjs/toDesktop.d.ts} +0 -0
  46. /package/lib/{translation.d.ts → cjs/translation.d.ts} +0 -0
  47. /package/lib/{validations.d.ts → cjs/validations.d.ts} +0 -0
  48. /package/lib/{base.js → esm/base.js} +0 -0
  49. /package/lib/{desktopify.js → esm/desktopify.js} +0 -0
  50. /package/lib/{desktopify2.js → esm/desktopify2.js} +0 -0
  51. /package/lib/{getSiteInfo.js → esm/getSiteInfo.js} +0 -0
  52. /package/lib/{hsm.js → esm/hsm.js} +0 -0
  53. /package/lib/{invitePermissionLabels.js → esm/invitePermissionLabels.js} +0 -0
  54. /package/lib/{personalAccessTokens.js → esm/personalAccessTokens.js} +0 -0
  55. /package/lib/{plans.js → esm/plans.js} +0 -0
  56. /package/lib/{plugin.js → esm/plugin.js} +0 -0
  57. /package/lib/{toDesktop.js → esm/toDesktop.js} +0 -0
  58. /package/lib/{translation.js → esm/translation.js} +0 -0
  59. /package/lib/{validations.js → esm/validations.js} +0 -0
@@ -0,0 +1,130 @@
1
+ import { Subscription } from './base';
2
+ export type PriceKey = `${'monthly' | 'yearly'}_${string}`;
3
+ export type Price = {
4
+ amount: number;
5
+ id: string;
6
+ period: 'monthly' | 'yearly';
7
+ status: 'active' | 'inactive';
8
+ };
9
+ export type Product<T extends PriceKey = any> = {
10
+ id: string;
11
+ prices: Record<T, Price>;
12
+ };
13
+ export type PlanTier = 'basic' | 'legacy_pro' | 'pro' | 'scale';
14
+ export type Plan = {
15
+ eligiblePlanTiers: PlanTier[];
16
+ label: string;
17
+ products: Record<'dev' | 'prod', Product[]>;
18
+ tier: PlanTier;
19
+ };
20
+ export type Configuration = {
21
+ business_profile: {
22
+ headline: string;
23
+ privacy_policy_url: string;
24
+ terms_of_service_url: string;
25
+ };
26
+ default_return_url: string;
27
+ features: {
28
+ payment_method_update: {
29
+ enabled: boolean;
30
+ };
31
+ subscription_update: {
32
+ default_allowed_updates: ('price' | 'promotion_code' | 'quantity')[];
33
+ enabled: boolean;
34
+ products: {
35
+ prices: string[];
36
+ product: string;
37
+ }[];
38
+ };
39
+ };
40
+ metadata: {
41
+ [name: string]: null | number | string;
42
+ };
43
+ };
44
+ export declare enum PortalConfigKey {
45
+ BuilderUpdateDev = "builder_update_dev",
46
+ BuilderUpdateProd = "builder_update_prod",
47
+ BuilderUpgradeDev = "builder_upgrade_dev",
48
+ BuilderUpgradeProd = "builder_upgrade_prod",
49
+ CLIUpdateDev = "cli_update_dev",
50
+ CLIUpdateProd = "cli_update_prod",
51
+ CLIUpgradeDev = "cli_upgrade_dev",
52
+ CLIUpgradeProd = "cli_upgrade_prod"
53
+ }
54
+ export declare const products: {
55
+ readonly dev: {
56
+ readonly builder: {
57
+ readonly essential: Product<"monthly_125" | "monthly_99" | "yearly_1200">;
58
+ readonly professional: Product<"monthly_199" | "monthly_240" | "monthly_300" | "yearly_2880">;
59
+ };
60
+ readonly cli: {
61
+ readonly founder: Product<"monthly_125" | "yearly_1200" | "monthly_100">;
62
+ readonly founder30: Product<"monthly_30">;
63
+ readonly founder50: Product<"monthly_50" | "monthly_90">;
64
+ readonly performance: Product<"monthly_300" | "monthly_375" | "yearly_3600">;
65
+ readonly scale: Product<"monthly_1200" | "monthly_1500" | "yearly_14400">;
66
+ };
67
+ readonly legacy: {
68
+ readonly business: Product<"monthly_199">;
69
+ readonly enterprise: Product<"monthly_700">;
70
+ readonly essential: Product<"monthly_58">;
71
+ readonly essentialNew: Product<"monthly_58" | "yearly_580">;
72
+ readonly growth: Product<"monthly_199">;
73
+ readonly professional: Product<"monthly_199" | "yearly_1990" | "yearly_2388">;
74
+ readonly startup: Product<"monthly_49" | "yearly_200">;
75
+ };
76
+ };
77
+ readonly prod: {
78
+ readonly builder: {
79
+ readonly essential: Product<"monthly_125" | "monthly_99" | "yearly_1200">;
80
+ readonly professional: Product<"monthly_199" | "monthly_240" | "monthly_300" | "yearly_2880">;
81
+ };
82
+ readonly cli: {
83
+ readonly founder: Product<"monthly_125" | "yearly_1200" | "monthly_100">;
84
+ readonly founder30: Product<"monthly_30">;
85
+ readonly founder50: Product<"monthly_50" | "monthly_90">;
86
+ readonly performance: Product<"monthly_300" | "monthly_375" | "yearly_3600">;
87
+ readonly scale: Product<"monthly_1200" | "monthly_1500" | "yearly_14400">;
88
+ };
89
+ readonly legacy: {
90
+ readonly business: Product<"monthly_199">;
91
+ readonly enterprise: Product<"monthly_700">;
92
+ readonly essential: Product<"monthly_58">;
93
+ readonly essentialNew: Product<"monthly_58" | "yearly_580">;
94
+ readonly growth: Product<"monthly_199">;
95
+ readonly professional: Product<"monthly_199" | "yearly_1990" | "yearly_2388">;
96
+ readonly startup: Product<"monthly_49" | "yearly_200">;
97
+ };
98
+ };
99
+ };
100
+ export declare const basicPlan: Plan;
101
+ export declare const legacyProPlan: Plan;
102
+ export declare const proPlan: Plan;
103
+ export declare const scalePlan: Plan;
104
+ export declare const configurations: {
105
+ dev: {
106
+ builder: {
107
+ update: Configuration;
108
+ upgrade: Configuration;
109
+ };
110
+ cli: {
111
+ update: Configuration;
112
+ upgrade: Configuration;
113
+ };
114
+ };
115
+ prod: {
116
+ builder: {
117
+ update: Configuration;
118
+ upgrade: Configuration;
119
+ };
120
+ cli: {
121
+ update: Configuration;
122
+ upgrade: Configuration;
123
+ };
124
+ };
125
+ };
126
+ export declare const hasActiveSub: (sub?: Subscription) => boolean;
127
+ export declare const hasPlan: (plan: Plan, sub?: Subscription) => boolean;
128
+ export declare const getPlan: (sub?: Pick<Subscription, "planId" | "productId">) => null | Plan;
129
+ export type LegacyProductKey = 'builder_essential' | 'builder_professional' | 'business' | 'cli_founder_30' | 'cli_founder_50' | 'cli_founder' | 'cli_performance' | 'cli_scale' | 'enterprise' | 'essential_new' | 'essential' | 'growth' | 'professional_annual_full_price' | 'professional_annual' | 'professional' | 'startup';
130
+ export declare const LegacyProductRecord: Record<LegacyProductKey, Record<'dev' | 'prod', Product>>;
@@ -0,0 +1,55 @@
1
+ type AjvJSONSchemaType = object;
2
+ export interface DesktopAppPlugin {
3
+ /**
4
+ * Package name, including version information.
5
+ * e.g. "@todesktop/plugin-foo", "@todesktop/plugin-baz@1.0.0"
6
+ */
7
+ package: string;
8
+ /**
9
+ * Configuration gathered from the todesktop plugin.
10
+ * Named `todesktop` to clarify that it maps to the `todesktop` key on the package.json
11
+ */
12
+ todesktop?: ToDesktopPlugin;
13
+ }
14
+ export interface CustomPlugin {
15
+ addedAt: string;
16
+ description?: string;
17
+ displayName?: string;
18
+ lastLinkedAt?: string;
19
+ packageName: string;
20
+ sourcePath: string;
21
+ todesktop: ToDesktopPlugin;
22
+ }
23
+ export type ToDesktopPlugin = {
24
+ main?: string;
25
+ namespace: string;
26
+ preferences?: PluginPreferences;
27
+ preload?: string;
28
+ version: number;
29
+ };
30
+ export type PluginPreferences = {
31
+ [id: string]: PluginPreference;
32
+ };
33
+ export type PluginPreference = CheckboxSpec | NumberSpec | TextSpec;
34
+ export type TextSpec = PreferenceSpec<'text', {
35
+ placeholder?: string;
36
+ validator?: AjvJSONSchemaType;
37
+ value?: string;
38
+ }>;
39
+ export type NumberSpec = PreferenceSpec<'number', {
40
+ placeholder?: number;
41
+ validator?: AjvJSONSchemaType;
42
+ value?: number;
43
+ }>;
44
+ export type CheckboxSpec = PreferenceSpec<'checkbox', {
45
+ validator?: AjvJSONSchemaType;
46
+ value?: boolean;
47
+ }>;
48
+ interface PreferenceSpec<T, V> {
49
+ description: string;
50
+ name: string;
51
+ order?: number;
52
+ spec: V;
53
+ type: T;
54
+ }
55
+ export {};
@@ -0,0 +1,191 @@
1
+ import { BaseApp, Schemable } from './base';
2
+ import { IAppBuilderLib } from './desktopify';
3
+ import { PatSummary } from './personalAccessTokens';
4
+ export type IUploadFileStatus = 'done' | 'error' | 'removed' | 'success' | 'uploading';
5
+ export interface IUploadFile {
6
+ error?: any;
7
+ fileName?: string;
8
+ lastModified?: number;
9
+ lastModifiedDate?: Date;
10
+ linkProps?: any;
11
+ name: string;
12
+ originFileObj?: File;
13
+ percent?: number;
14
+ response?: any;
15
+ size: number;
16
+ status?: IUploadFileStatus;
17
+ thumbUrl?: string;
18
+ type: string;
19
+ uid: string;
20
+ url?: string;
21
+ }
22
+ export interface IHueIcon extends IUploadFile {
23
+ hueAdjustment?: number;
24
+ }
25
+ export interface IAppIcon {
26
+ appId: string;
27
+ icon: IHueIcon;
28
+ }
29
+ export type IAppIcons = IAppIcon[];
30
+ export interface IAppWindowOptions {
31
+ alwaysOnTop: boolean;
32
+ autoHideMenuBar: boolean;
33
+ hasMaxHeight: boolean;
34
+ hasMaxWidth: boolean;
35
+ hasMinHeight: boolean;
36
+ hasMinWidth: boolean;
37
+ height: number;
38
+ isMaximizable: boolean;
39
+ isMinimizable: boolean;
40
+ isResizable: boolean;
41
+ maxHeight: number;
42
+ maxWidth: number;
43
+ minHeight: number;
44
+ minWidth: number;
45
+ startInFullscreenMode: boolean;
46
+ transparentInsetTitlebar: boolean;
47
+ transparentTitlebar: boolean;
48
+ width: number;
49
+ }
50
+ export interface IWindowOptions {
51
+ height: number;
52
+ isAlwaysOnTop?: boolean;
53
+ isAutoHideMenuBar?: boolean;
54
+ isFullScreenStartEnabled?: boolean;
55
+ isInsetTitlebarTransparent?: boolean;
56
+ isMaximizable: boolean;
57
+ isMinimizable: boolean;
58
+ isResizable: boolean;
59
+ isTitlebarTransparent?: boolean;
60
+ maxHeight?: ISwitchableValue<number>;
61
+ maxWidth?: ISwitchableValue<number>;
62
+ minHeight?: ISwitchableValue<number>;
63
+ minWidth?: ISwitchableValue<number>;
64
+ width: number;
65
+ }
66
+ export interface IAppPublishedVersions {
67
+ desktopify?: string;
68
+ electron?: string;
69
+ version?: string;
70
+ }
71
+ export interface ISwitchableValue<T> {
72
+ enabled: boolean;
73
+ value: T;
74
+ }
75
+ export interface IIcon {
76
+ height: number;
77
+ type: string;
78
+ url: string;
79
+ width: number;
80
+ }
81
+ export interface IApp extends BaseApp {
82
+ appModelId: string;
83
+ appPkgName?: string;
84
+ appProtocol?: ISwitchableValue<string>;
85
+ appType?: string;
86
+ appxConfig?: Partial<IAppBuilderLib['config']['appx']>;
87
+ cssToInject?: string;
88
+ customDomain?: string;
89
+ customUserAgent?: ISwitchableValue<string>;
90
+ disableContextMenu?: boolean;
91
+ enablePushNotifications?: boolean;
92
+ environmentVariables?: {
93
+ [propertyName: string]: {
94
+ secret: string;
95
+ } | string;
96
+ };
97
+ extraBrowserWindowOptions?: string;
98
+ icon?: string;
99
+ icons?: IIcon[];
100
+ internalUrls?: ISwitchableValue<string>;
101
+ isBackgroundThrottlingPrevented?: boolean;
102
+ isContextMenuDisabled: boolean;
103
+ isDevToolsDisabled: boolean;
104
+ isFindInPageEnabled?: boolean;
105
+ isGoogleOAuthExternal?: boolean;
106
+ isNativeWindowOpenDisabled?: boolean;
107
+ isSingleInstance?: boolean;
108
+ isTitleStatic?: boolean;
109
+ isTransitioningFromSquirrelWindows?: boolean;
110
+ isWebSecurityDisabled?: boolean;
111
+ jsToInject?: string;
112
+ menubarIcon?: string;
113
+ name: string;
114
+ nsisConfig?: Partial<IAppBuilderLib['config']['nsis']>;
115
+ pollForAppUpdatesEveryXMinutes?: number;
116
+ runtimeEnvs?: string;
117
+ secret?: string;
118
+ shouldLaunchAtStartupByDefault?: boolean;
119
+ shouldMakeSameDomainAnExternalLink?: boolean;
120
+ shouldOnlySendAbsolutelyNecessaryRequests?: boolean;
121
+ shouldReuseRendererProcess?: boolean;
122
+ shouldUseRealUserAgent?: boolean;
123
+ themeSource?: 'dark' | 'light' | 'system';
124
+ themeSourceMac?: 'dark' | 'light' | 'system';
125
+ toggleVisibilityKeyboardShortcut?: ISwitchableValue<string>;
126
+ trayIcon?: string;
127
+ url: string;
128
+ useSafeInternalUrlMatcher?: boolean;
129
+ windowOptions: IWindowOptions;
130
+ }
131
+ export interface IUser extends Schemable {
132
+ accessToken?: string;
133
+ allowedIPs?: string[];
134
+ authInfo?: object;
135
+ avatar?: string;
136
+ cliAccessTokens?: PatSummary[];
137
+ currentApplication?: string;
138
+ customerId?: string;
139
+ disableShouldCodeSign?: boolean;
140
+ email?: string;
141
+ featureFlags?: FeatureFlags;
142
+ firstName?: string;
143
+ id: string;
144
+ isAdmin?: boolean;
145
+ isImpersonator?: boolean;
146
+ isOldAccountThatNeedsNewPassword?: boolean;
147
+ lastName?: string;
148
+ seenApplicationGroupsTutorial?: boolean;
149
+ seenReleaseTutorial?: boolean;
150
+ stripeCustomerId?: string;
151
+ }
152
+ export interface FeatureFlags {
153
+ aboutBlankWindowOpenHandler: boolean;
154
+ desktopAppPlugins: boolean;
155
+ macAppStore: boolean;
156
+ }
157
+ export interface InvitePermissions {
158
+ canBuild: boolean;
159
+ canManageBilling?: boolean;
160
+ canManageUsers?: boolean;
161
+ canRelease: boolean;
162
+ }
163
+ export type InviteActorRole = 'delegate' | 'owner';
164
+ export interface InviteActorCapabilities {
165
+ actorEmail: string;
166
+ actorId: string;
167
+ actorPermissions: InvitePermissions;
168
+ actorRole: InviteActorRole;
169
+ }
170
+ export interface UserIHaveSentInviteTo {
171
+ email: string;
172
+ inviterCapabilities?: InviteActorCapabilities;
173
+ name: string;
174
+ permissions?: InvitePermissions;
175
+ sender: UserIHaveAcceptedInviteFrom;
176
+ }
177
+ export interface UserIHaveAcceptedInviteFrom {
178
+ email: string;
179
+ firstName: string;
180
+ id: string;
181
+ lastName: string;
182
+ permissions?: InvitePermissions;
183
+ receiver?: Pick<IUser, 'email' | 'id'>;
184
+ }
185
+ export interface CiInput {
186
+ accessToken: string;
187
+ appData: IApp;
188
+ buildId?: string;
189
+ contextUserId: string;
190
+ userId: string;
191
+ }
@@ -0,0 +1,2 @@
1
+ export type ValidTranslationKeys = 'updateNotification.body' | 'updateNotification.title';
2
+ export type ValidTranslationLanguages = 'default';
@@ -0,0 +1,102 @@
1
+ import * as yup from 'yup';
2
+ import { DesktopifyApp2 } from './desktopify2';
3
+ import { DesktopAppPlugin } from './plugin';
4
+ export declare const appTitleValidation: yup.StringSchema<string, yup.AnyObject, undefined, "">;
5
+ export declare const forceVersionValidation: yup.StringSchema<string, yup.AnyObject, undefined, "">;
6
+ export declare const iconValidation: yup.StringSchema<string, yup.AnyObject, undefined, "">;
7
+ export declare const urlValidation: yup.StringSchema<string, yup.AnyObject, undefined, "">;
8
+ export declare const urlValidationForm: yup.ObjectSchema<{
9
+ url: string;
10
+ }, yup.AnyObject, {
11
+ url: undefined;
12
+ }, "">;
13
+ export declare const heightValidation: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
14
+ export declare const widthValidation: yup.NumberSchema<number, yup.AnyObject, undefined, "">;
15
+ export declare const internalAppRegexValidation: yup.StringSchema<string, yup.AnyObject, undefined, "">;
16
+ export declare const appProtocolValidation: yup.StringSchema<string, yup.AnyObject, undefined, "">;
17
+ export declare const appConfigValidation: yup.ObjectSchema<{
18
+ customUserAgent: string;
19
+ disableDevTools: NonNullable<boolean | undefined>;
20
+ iconUrl: string;
21
+ id: string;
22
+ internalURLs: string;
23
+ isFrameBlocked: NonNullable<boolean | undefined>;
24
+ meta: {
25
+ schemaVersion: number;
26
+ appIterations: number;
27
+ hasAppChanged: NonNullable<boolean | undefined>;
28
+ publishedVersions: {
29
+ electron?: yup.Maybe<string | undefined>;
30
+ version?: yup.Maybe<string | undefined>;
31
+ desktopify?: yup.Maybe<string | undefined>;
32
+ };
33
+ };
34
+ name: string;
35
+ secret: string;
36
+ singleInstance: NonNullable<boolean | undefined>;
37
+ url: string;
38
+ windowOptions: {
39
+ alwaysOnTop: NonNullable<boolean | undefined>;
40
+ autoHideMenuBar: NonNullable<boolean | undefined>;
41
+ height: number;
42
+ maxHeight: number;
43
+ maxWidth: number;
44
+ minHeight: number;
45
+ minWidth: number;
46
+ width: number;
47
+ hasMaxHeight: NonNullable<boolean | undefined>;
48
+ hasMaxWidth: NonNullable<boolean | undefined>;
49
+ hasMinHeight: NonNullable<boolean | undefined>;
50
+ hasMinWidth: NonNullable<boolean | undefined>;
51
+ isFullscreenable: NonNullable<boolean | undefined>;
52
+ isMaximizable: NonNullable<boolean | undefined>;
53
+ isMinimizable: NonNullable<boolean | undefined>;
54
+ isResizable: NonNullable<boolean | undefined>;
55
+ startInFullscreenMode: NonNullable<boolean | undefined>;
56
+ transparentInsetTitlebar: NonNullable<boolean | undefined>;
57
+ transparentTitlebar: NonNullable<boolean | undefined>;
58
+ };
59
+ }, yup.AnyObject, {
60
+ customUserAgent: undefined;
61
+ disableDevTools: undefined;
62
+ iconUrl: undefined;
63
+ id: undefined;
64
+ internalURLs: undefined;
65
+ isFrameBlocked: undefined;
66
+ meta: {
67
+ appIterations: undefined;
68
+ hasAppChanged: undefined;
69
+ publishedVersions: {
70
+ desktopify: undefined;
71
+ electron: undefined;
72
+ version: undefined;
73
+ };
74
+ schemaVersion: undefined;
75
+ };
76
+ name: undefined;
77
+ secret: undefined;
78
+ singleInstance: undefined;
79
+ url: undefined;
80
+ windowOptions: {
81
+ hasMaxHeight: undefined;
82
+ hasMaxWidth: undefined;
83
+ hasMinHeight: undefined;
84
+ hasMinWidth: undefined;
85
+ height: undefined;
86
+ isFullscreenable: undefined;
87
+ isMaximizable: undefined;
88
+ isMinimizable: undefined;
89
+ isResizable: undefined;
90
+ maxHeight: undefined;
91
+ maxWidth: undefined;
92
+ minHeight: undefined;
93
+ minWidth: undefined;
94
+ startInFullscreenMode: undefined;
95
+ width: undefined;
96
+ alwaysOnTop: undefined;
97
+ autoHideMenuBar: undefined;
98
+ transparentInsetTitlebar: undefined;
99
+ transparentTitlebar: undefined;
100
+ };
101
+ }, "">;
102
+ export declare const shouldMinimizeToTrayIsActive: <Plugin = DesktopAppPlugin>(desktopApp: DesktopifyApp2<Plugin>) => boolean;
package/package.json CHANGED
@@ -1,12 +1,27 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.191.0",
3
+ "version": "7.191.1",
4
4
  "description": "",
5
- "type": "module",
6
- "main": "./lib/index.js",
7
- "types": "./lib/index.d.ts",
5
+ "main": "./lib/cjs/index.js",
6
+ "module": "./lib/esm/index.js",
7
+ "types": "./lib/esm/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": {
11
+ "types": "./lib/esm/index.d.ts",
12
+ "default": "./lib/esm/index.js"
13
+ },
14
+ "require": {
15
+ "types": "./lib/cjs/index.d.ts",
16
+ "default": "./lib/cjs/index.js"
17
+ }
18
+ }
19
+ },
8
20
  "scripts": {
9
- "build": "rm -f ./lib/* && tsc",
21
+ "build": "rm -rf ./lib && pnpm run build:cjs && pnpm run build:esm && pnpm run build:rename-cjs-index",
22
+ "build:cjs": "tsc -p tsconfig.json",
23
+ "build:esm": "tsc -p tsconfig.esm.json",
24
+ "build:rename-cjs-index": "mv ./lib/cjs/index.cjs.js ./lib/cjs/index.js && mv ./lib/cjs/index.cjs.d.ts ./lib/cjs/index.d.ts",
10
25
  "bump": "npm version minor && git push && npm publish",
11
26
  "dev": "tsc",
12
27
  "format": "prettier . --write && eslint --fix",
package/src/base.ts CHANGED
@@ -171,6 +171,7 @@ export interface ToDesktopJson {
171
171
  mas?: {
172
172
  entitlements?: FilePath;
173
173
  entitlementsInherit?: FilePath;
174
+ minimumSystemVersion?: string;
174
175
  provisioningProfile?: FilePath;
175
176
  type?: 'development' | 'distribution'; // defaults to development
176
177
  x64ArchFiles?: string;
@@ -0,0 +1,19 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */
2
+ // CJS-specific entry point
3
+ // Path is relative to lib/cjs/ output directory
4
+ const packageJson = require('../../package.json');
5
+
6
+ export * from './base';
7
+ export * from './desktopify';
8
+ export * from './desktopify2';
9
+ export * from './getSiteInfo';
10
+ export * from './hsm';
11
+ export * from './invitePermissionLabels';
12
+ export * from './personalAccessTokens';
13
+ export * from './plans';
14
+ export * from './plugin';
15
+ export * from './toDesktop';
16
+
17
+ export * from './validations';
18
+
19
+ export const schemaVersion = packageJson.version;
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
- import packageJson from '../package.json' with { type: 'json' };
1
+ // Path is relative to lib/esm/ output directory
2
+ import packageJson from '../../package.json' with { type: 'json' };
2
3
 
3
4
  export * from './base.js';
4
5
  export * from './desktopify.js';
@@ -0,0 +1,15 @@
1
+ {
2
+ "extends": "@todesktop/dev-config/tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "target": "es2016",
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "declaration": true,
8
+ "outDir": "./lib/esm",
9
+ "rootDir": "./src",
10
+ "resolveJsonModule": true,
11
+ "strict": true
12
+ },
13
+ "include": ["src/**/*"],
14
+ "exclude": ["node_modules", "lib", "src/index.cjs.ts"]
15
+ }
package/tsconfig.json CHANGED
@@ -2,14 +2,13 @@
2
2
  "extends": "@todesktop/dev-config/tsconfig.base.json",
3
3
  "compilerOptions": {
4
4
  "target": "es2016",
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
5
+ "module": "commonjs",
7
6
  "declaration": true,
8
- "outDir": "./lib",
7
+ "outDir": "./lib/cjs",
9
8
  "rootDir": "./src",
10
9
  "resolveJsonModule": true,
11
10
  "strict": true
12
11
  },
13
12
  "include": ["src/**/*"],
14
- "exclude": ["node_modules", "lib"]
13
+ "exclude": ["node_modules", "lib", "src/index.ts"]
15
14
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes