@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.
- package/CHANGELOG.md +6 -0
- package/lib/{base.d.ts → cjs/base.d.ts} +1 -0
- package/lib/cjs/base.js +22 -0
- package/lib/cjs/desktopify.js +79 -0
- package/lib/cjs/desktopify2.js +80 -0
- package/lib/cjs/getSiteInfo.js +2 -0
- package/lib/cjs/hsm.js +42 -0
- package/lib/cjs/index.d.ts +12 -0
- package/lib/cjs/index.js +33 -0
- package/lib/cjs/invitePermissionLabels.js +29 -0
- package/lib/cjs/personalAccessTokens.js +2 -0
- package/lib/cjs/plans.js +632 -0
- package/lib/cjs/plugin.js +2 -0
- package/lib/cjs/toDesktop.js +2 -0
- package/lib/cjs/translation.js +14 -0
- package/lib/cjs/validations.js +178 -0
- package/lib/esm/base.d.ts +326 -0
- package/lib/esm/desktopify.d.ts +339 -0
- package/lib/esm/desktopify2.d.ts +506 -0
- package/lib/esm/getSiteInfo.d.ts +24 -0
- package/lib/esm/hsm.d.ts +30 -0
- package/lib/{index.d.ts → esm/index.d.ts} +1 -1
- package/lib/{index.js → esm/index.js} +2 -1
- package/lib/esm/invitePermissionLabels.d.ts +13 -0
- package/lib/esm/personalAccessTokens.d.ts +24 -0
- package/lib/esm/plans.d.ts +130 -0
- package/lib/esm/plugin.d.ts +55 -0
- package/lib/esm/toDesktop.d.ts +191 -0
- package/lib/esm/translation.d.ts +2 -0
- package/lib/esm/validations.d.ts +102 -0
- package/package.json +20 -5
- package/src/base.ts +1 -0
- package/src/index.cjs.ts +19 -0
- package/src/index.ts +2 -1
- package/tsconfig.esm.json +15 -0
- package/tsconfig.json +3 -4
- /package/lib/{desktopify.d.ts → cjs/desktopify.d.ts} +0 -0
- /package/lib/{desktopify2.d.ts → cjs/desktopify2.d.ts} +0 -0
- /package/lib/{getSiteInfo.d.ts → cjs/getSiteInfo.d.ts} +0 -0
- /package/lib/{hsm.d.ts → cjs/hsm.d.ts} +0 -0
- /package/lib/{invitePermissionLabels.d.ts → cjs/invitePermissionLabels.d.ts} +0 -0
- /package/lib/{personalAccessTokens.d.ts → cjs/personalAccessTokens.d.ts} +0 -0
- /package/lib/{plans.d.ts → cjs/plans.d.ts} +0 -0
- /package/lib/{plugin.d.ts → cjs/plugin.d.ts} +0 -0
- /package/lib/{toDesktop.d.ts → cjs/toDesktop.d.ts} +0 -0
- /package/lib/{translation.d.ts → cjs/translation.d.ts} +0 -0
- /package/lib/{validations.d.ts → cjs/validations.d.ts} +0 -0
- /package/lib/{base.js → esm/base.js} +0 -0
- /package/lib/{desktopify.js → esm/desktopify.js} +0 -0
- /package/lib/{desktopify2.js → esm/desktopify2.js} +0 -0
- /package/lib/{getSiteInfo.js → esm/getSiteInfo.js} +0 -0
- /package/lib/{hsm.js → esm/hsm.js} +0 -0
- /package/lib/{invitePermissionLabels.js → esm/invitePermissionLabels.js} +0 -0
- /package/lib/{personalAccessTokens.js → esm/personalAccessTokens.js} +0 -0
- /package/lib/{plans.js → esm/plans.js} +0 -0
- /package/lib/{plugin.js → esm/plugin.js} +0 -0
- /package/lib/{toDesktop.js → esm/toDesktop.js} +0 -0
- /package/lib/{translation.js → esm/translation.js} +0 -0
- /package/lib/{validations.js → esm/validations.js} +0 -0
package/CHANGELOG.md
CHANGED
package/lib/cjs/base.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WindowsHSMCertType = exports.WindowsEVOnboardingProvider = exports.WindowsEVOnboardingSteps = void 0;
|
|
4
|
+
var WindowsEVOnboardingSteps;
|
|
5
|
+
(function (WindowsEVOnboardingSteps) {
|
|
6
|
+
WindowsEVOnboardingSteps["hasBeenVerified"] = "hasBeenVerified";
|
|
7
|
+
WindowsEVOnboardingSteps["hasChosenProvider"] = "hasChosenProvider";
|
|
8
|
+
WindowsEVOnboardingSteps["hasGeneratedCert"] = "hasGeneratedCert";
|
|
9
|
+
WindowsEVOnboardingSteps["hasOrderedCert"] = "hasOrderedCert";
|
|
10
|
+
WindowsEVOnboardingSteps["hasUploadedCert"] = "hasUploadedCert";
|
|
11
|
+
})(WindowsEVOnboardingSteps || (exports.WindowsEVOnboardingSteps = WindowsEVOnboardingSteps = {}));
|
|
12
|
+
var WindowsEVOnboardingProvider;
|
|
13
|
+
(function (WindowsEVOnboardingProvider) {
|
|
14
|
+
WindowsEVOnboardingProvider["globalsign"] = "globalsign";
|
|
15
|
+
WindowsEVOnboardingProvider["other"] = "other";
|
|
16
|
+
})(WindowsEVOnboardingProvider || (exports.WindowsEVOnboardingProvider = WindowsEVOnboardingProvider = {}));
|
|
17
|
+
var WindowsHSMCertType;
|
|
18
|
+
(function (WindowsHSMCertType) {
|
|
19
|
+
WindowsHSMCertType["azureTrustedSigning"] = "azureTrustedSigning";
|
|
20
|
+
WindowsHSMCertType["ev"] = "ev";
|
|
21
|
+
WindowsHSMCertType["file"] = "file";
|
|
22
|
+
})(WindowsHSMCertType || (exports.WindowsHSMCertType = WindowsHSMCertType = {}));
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBuildCancellable = exports.isBuildRunning = exports.isCiBuildRunning = exports.isPlatformBuildRunning = exports.hasBuildKickedOff = exports.ManifestCategory = exports.AnalysisStatus = exports.BuildStatus = exports.PackageManager = exports.PlatformName = void 0;
|
|
4
|
+
var PlatformName;
|
|
5
|
+
(function (PlatformName) {
|
|
6
|
+
PlatformName["linux"] = "linux";
|
|
7
|
+
PlatformName["mac"] = "mac";
|
|
8
|
+
PlatformName["windows"] = "windows";
|
|
9
|
+
})(PlatformName || (exports.PlatformName = PlatformName = {}));
|
|
10
|
+
var PackageManager;
|
|
11
|
+
(function (PackageManager) {
|
|
12
|
+
PackageManager["npm"] = "npm";
|
|
13
|
+
PackageManager["pnpm"] = "pnpm";
|
|
14
|
+
PackageManager["yarn"] = "yarn";
|
|
15
|
+
})(PackageManager || (exports.PackageManager = PackageManager = {}));
|
|
16
|
+
var BuildStatus;
|
|
17
|
+
(function (BuildStatus) {
|
|
18
|
+
BuildStatus["building"] = "building";
|
|
19
|
+
BuildStatus["cancelled"] = "cancelled";
|
|
20
|
+
BuildStatus["failed"] = "failed";
|
|
21
|
+
BuildStatus["preparation"] = "preparation";
|
|
22
|
+
BuildStatus["queued"] = "queued";
|
|
23
|
+
BuildStatus["succeeded"] = "succeeded";
|
|
24
|
+
})(BuildStatus || (exports.BuildStatus = BuildStatus = {}));
|
|
25
|
+
var AnalysisStatus;
|
|
26
|
+
(function (AnalysisStatus) {
|
|
27
|
+
AnalysisStatus["analyzing"] = "analyzing";
|
|
28
|
+
AnalysisStatus["done"] = "done";
|
|
29
|
+
AnalysisStatus["downloading"] = "downloading";
|
|
30
|
+
AnalysisStatus["error"] = "error";
|
|
31
|
+
AnalysisStatus["extracting"] = "extracting";
|
|
32
|
+
AnalysisStatus["initializing"] = "initializing";
|
|
33
|
+
AnalysisStatus["notStarted"] = "notStarted";
|
|
34
|
+
})(AnalysisStatus || (exports.AnalysisStatus = AnalysisStatus = {}));
|
|
35
|
+
var ManifestCategory;
|
|
36
|
+
(function (ManifestCategory) {
|
|
37
|
+
ManifestCategory["buildStamped"] = "build-stamped";
|
|
38
|
+
ManifestCategory["primary"] = "primary";
|
|
39
|
+
ManifestCategory["versioned"] = "versioned";
|
|
40
|
+
})(ManifestCategory || (exports.ManifestCategory = ManifestCategory = {}));
|
|
41
|
+
const hasBuildKickedOff = (build) => {
|
|
42
|
+
if (!build) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return build.status && build.status !== BuildStatus.preparation;
|
|
46
|
+
};
|
|
47
|
+
exports.hasBuildKickedOff = hasBuildKickedOff;
|
|
48
|
+
const isPlatformBuildRunning = (platformBuild) => {
|
|
49
|
+
if (!platformBuild) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return (!platformBuild.shouldSkip && // <-- Noteworthy
|
|
53
|
+
!['cancelled', 'succeeded'].includes(platformBuild.status) &&
|
|
54
|
+
(platformBuild.status !== 'failed' ||
|
|
55
|
+
platformBuild.numberOfAttemptedBuilds < 2));
|
|
56
|
+
};
|
|
57
|
+
exports.isPlatformBuildRunning = isPlatformBuildRunning;
|
|
58
|
+
// NOTE: this relies on Firestore solely
|
|
59
|
+
const isCiBuildRunning = (build) => {
|
|
60
|
+
if (!build) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return (build.status === 'building' ||
|
|
64
|
+
(build.status === 'failed' &&
|
|
65
|
+
['linux', 'mac', 'windows'].some((platform) => build.status === 'building' ||
|
|
66
|
+
(build.status === 'failed' &&
|
|
67
|
+
(0, exports.isPlatformBuildRunning)(build[platform])))));
|
|
68
|
+
};
|
|
69
|
+
exports.isCiBuildRunning = isCiBuildRunning;
|
|
70
|
+
const isBuildRunning = (build) => {
|
|
71
|
+
if (!build) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return (!['cancelled', 'succeeded'].includes(build.status) &&
|
|
75
|
+
['linux', 'mac', 'windows'].some((platform) => (0, exports.isPlatformBuildRunning)(build[platform])));
|
|
76
|
+
};
|
|
77
|
+
exports.isBuildRunning = isBuildRunning;
|
|
78
|
+
const isBuildCancellable = (build) => (0, exports.hasBuildKickedOff)(build) && (0, exports.isBuildRunning)(build);
|
|
79
|
+
exports.isBuildCancellable = isBuildCancellable;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allowedWebPreferencesOptions = exports.allowedBrowserWindowConstructorOptions = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Whitelist of allowed DesktopifyWindow Options.
|
|
6
|
+
* These attrs (if set) are passed to the `BrowserWindow` constructor
|
|
7
|
+
* when the window is created
|
|
8
|
+
*/
|
|
9
|
+
exports.allowedBrowserWindowConstructorOptions = [
|
|
10
|
+
'width',
|
|
11
|
+
'height',
|
|
12
|
+
// "x",
|
|
13
|
+
// "y",
|
|
14
|
+
'useContentSize',
|
|
15
|
+
'center',
|
|
16
|
+
'minWidth',
|
|
17
|
+
'minHeight',
|
|
18
|
+
'maxWidth',
|
|
19
|
+
'maxHeight',
|
|
20
|
+
'resizable',
|
|
21
|
+
'movable',
|
|
22
|
+
'minimizable',
|
|
23
|
+
'maximizable',
|
|
24
|
+
'closable',
|
|
25
|
+
'focusable',
|
|
26
|
+
'alwaysOnTop',
|
|
27
|
+
'fullscreen',
|
|
28
|
+
'fullscreenable',
|
|
29
|
+
'simpleFullscreen',
|
|
30
|
+
'skipTaskbar',
|
|
31
|
+
'kiosk',
|
|
32
|
+
'icon',
|
|
33
|
+
'paintWhenInitiallyHidden',
|
|
34
|
+
'frame',
|
|
35
|
+
'acceptFirstMouse',
|
|
36
|
+
'disableAutoHideCursor',
|
|
37
|
+
'autoHideMenuBar',
|
|
38
|
+
'enableLargerThanScreen',
|
|
39
|
+
'backgroundColor',
|
|
40
|
+
'hasShadow',
|
|
41
|
+
'opacity',
|
|
42
|
+
'darkTheme',
|
|
43
|
+
'transparent',
|
|
44
|
+
'visualEffectState',
|
|
45
|
+
'titleBarStyle',
|
|
46
|
+
'trafficLightPosition',
|
|
47
|
+
// "roundedCorners",
|
|
48
|
+
'thickFrame',
|
|
49
|
+
'type',
|
|
50
|
+
'vibrancy',
|
|
51
|
+
'zoomToPageWidth',
|
|
52
|
+
'tabbingIdentifier',
|
|
53
|
+
'webPreferences',
|
|
54
|
+
'titleBarOverlay',
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* Whitelist of allowed DesktopifyWindow Web Preferences Options.
|
|
58
|
+
* These attrs (if set) are passed to the webPreferences object in the `BrowserWindow` constructor
|
|
59
|
+
* when the window is created
|
|
60
|
+
*/
|
|
61
|
+
exports.allowedWebPreferencesOptions = [
|
|
62
|
+
'devTools',
|
|
63
|
+
'zoomFactor',
|
|
64
|
+
'textAreasAreResizable',
|
|
65
|
+
'scrollBounce',
|
|
66
|
+
'defaultFontFamily',
|
|
67
|
+
'defaultFontSize',
|
|
68
|
+
'defaultMonospaceFontSize',
|
|
69
|
+
'minimumFontSize',
|
|
70
|
+
'defaultEncoding',
|
|
71
|
+
'backgroundThrottling',
|
|
72
|
+
'offscreen',
|
|
73
|
+
'safeDialogs',
|
|
74
|
+
'safeDialogsMessage',
|
|
75
|
+
'navigateOnDragDrop',
|
|
76
|
+
'autoplayPolicy',
|
|
77
|
+
'disableHtmlFullscreenWindowResize',
|
|
78
|
+
'accessibleTitle',
|
|
79
|
+
'spellcheck',
|
|
80
|
+
];
|
package/lib/cjs/hsm.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAPIKeyNameFromHSM = exports.getCertificateNameFromHSM = void 0;
|
|
4
|
+
exports.isMacTarget = isMacTarget;
|
|
5
|
+
exports.isWindowsTarget = isWindowsTarget;
|
|
6
|
+
function isMacTarget(type) {
|
|
7
|
+
return ['mac', 'mac-installer', 'mas', 'mas-dev', 'mas-installer'].includes(type);
|
|
8
|
+
}
|
|
9
|
+
function isWindowsTarget(type) {
|
|
10
|
+
return ['windows'].includes(type);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Files that are uploaded to HSM have a unique secretName that depends on the appId and target.
|
|
14
|
+
* This function returns the key name that is used for certificate files that have a `.p12` postfix.
|
|
15
|
+
*
|
|
16
|
+
* @param appId the application id
|
|
17
|
+
* @param target the target type
|
|
18
|
+
* @returns the name of the secret that is required for downloading the cert from HSM.
|
|
19
|
+
*/
|
|
20
|
+
const getCertificateNameFromHSM = (appId, target) => {
|
|
21
|
+
if (!isMacTarget(target) && !isWindowsTarget(target)) {
|
|
22
|
+
throw new Error(`Invalid target '${target}'. Only windows or mac certs are supported`);
|
|
23
|
+
}
|
|
24
|
+
return `todesktop-${appId}-${target}-cert`;
|
|
25
|
+
};
|
|
26
|
+
exports.getCertificateNameFromHSM = getCertificateNameFromHSM;
|
|
27
|
+
/**
|
|
28
|
+
* Files that are uploaded to HSM have a unique secretName that depends on the appId and target.
|
|
29
|
+
* This function returns the key name that is used for key files that have a `.p8` postfix.
|
|
30
|
+
* Currently only used for mac notarization.
|
|
31
|
+
*
|
|
32
|
+
* @param appId the application id
|
|
33
|
+
* @param target the target type
|
|
34
|
+
* @returns the name of the secret that is required for downloading the cert from HSM.
|
|
35
|
+
*/
|
|
36
|
+
const getAPIKeyNameFromHSM = (appId, target) => {
|
|
37
|
+
if (!isMacTarget(target)) {
|
|
38
|
+
throw new Error(`Invalid target '${target}'. Only mac certs are supported`);
|
|
39
|
+
}
|
|
40
|
+
return `todesktop-${appId}-${target}-api-key`;
|
|
41
|
+
};
|
|
42
|
+
exports.getAPIKeyNameFromHSM = getAPIKeyNameFromHSM;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './base';
|
|
2
|
+
export * from './desktopify';
|
|
3
|
+
export * from './desktopify2';
|
|
4
|
+
export * from './getSiteInfo';
|
|
5
|
+
export * from './hsm';
|
|
6
|
+
export * from './invitePermissionLabels';
|
|
7
|
+
export * from './personalAccessTokens';
|
|
8
|
+
export * from './plans';
|
|
9
|
+
export * from './plugin';
|
|
10
|
+
export * from './toDesktop';
|
|
11
|
+
export * from './validations';
|
|
12
|
+
export declare const schemaVersion: any;
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.schemaVersion = void 0;
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */
|
|
19
|
+
// CJS-specific entry point
|
|
20
|
+
// Path is relative to lib/cjs/ output directory
|
|
21
|
+
const packageJson = require('../../package.json');
|
|
22
|
+
__exportStar(require("./base"), exports);
|
|
23
|
+
__exportStar(require("./desktopify"), exports);
|
|
24
|
+
__exportStar(require("./desktopify2"), exports);
|
|
25
|
+
__exportStar(require("./getSiteInfo"), exports);
|
|
26
|
+
__exportStar(require("./hsm"), exports);
|
|
27
|
+
__exportStar(require("./invitePermissionLabels"), exports);
|
|
28
|
+
__exportStar(require("./personalAccessTokens"), exports);
|
|
29
|
+
__exportStar(require("./plans"), exports);
|
|
30
|
+
__exportStar(require("./plugin"), exports);
|
|
31
|
+
__exportStar(require("./toDesktop"), exports);
|
|
32
|
+
__exportStar(require("./validations"), exports);
|
|
33
|
+
exports.schemaVersion = packageJson.version;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeInvitePermissions = exports.FULL_OWNER_PERMISSIONS = exports.formatInvitePermissionSummary = exports.INVITE_PERMISSION_LABELS = void 0;
|
|
4
|
+
exports.INVITE_PERMISSION_LABELS = {
|
|
5
|
+
canBuild: 'Can build',
|
|
6
|
+
canManageBilling: 'Can manage billing',
|
|
7
|
+
canManageUsers: 'Can manage users',
|
|
8
|
+
canRelease: 'Can release',
|
|
9
|
+
};
|
|
10
|
+
const formatInvitePermissionSummary = (permissions) => {
|
|
11
|
+
const enabled = Object.entries(permissions)
|
|
12
|
+
.filter(([, value]) => value === true)
|
|
13
|
+
.map(([key]) => exports.INVITE_PERMISSION_LABELS[key]);
|
|
14
|
+
return enabled.join(', ');
|
|
15
|
+
};
|
|
16
|
+
exports.formatInvitePermissionSummary = formatInvitePermissionSummary;
|
|
17
|
+
exports.FULL_OWNER_PERMISSIONS = {
|
|
18
|
+
canBuild: true,
|
|
19
|
+
canManageBilling: true,
|
|
20
|
+
canManageUsers: true,
|
|
21
|
+
canRelease: true,
|
|
22
|
+
};
|
|
23
|
+
const normalizeInvitePermissions = (permissions) => ({
|
|
24
|
+
canBuild: (permissions === null || permissions === void 0 ? void 0 : permissions.canBuild) === true,
|
|
25
|
+
canManageBilling: (permissions === null || permissions === void 0 ? void 0 : permissions.canManageBilling) === true,
|
|
26
|
+
canManageUsers: (permissions === null || permissions === void 0 ? void 0 : permissions.canManageUsers) === true,
|
|
27
|
+
canRelease: (permissions === null || permissions === void 0 ? void 0 : permissions.canRelease) === true,
|
|
28
|
+
});
|
|
29
|
+
exports.normalizeInvitePermissions = normalizeInvitePermissions;
|