@todesktop/shared 7.192.0 → 7.193.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/lib/cjs/index.d.ts +2 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/introspection/status.d.ts +18 -0
- package/lib/cjs/introspection/status.js +82 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/introspection/status.d.ts +18 -0
- package/lib/esm/introspection/status.js +77 -0
- package/package.json +1 -1
- package/src/index.cjs.ts +2 -0
- package/src/index.ts +1 -0
- package/src/introspection/status.ts +101 -0
- package/vitest.config.ts +9 -0
package/lib/cjs/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export * from './desktopify';
|
|
|
3
3
|
export * from './desktopify2';
|
|
4
4
|
export * from './getSiteInfo';
|
|
5
5
|
export * from './hsm';
|
|
6
|
+
export * from './introspection/breakpoints';
|
|
7
|
+
export * from './introspection/status';
|
|
6
8
|
export * from './invitePermissionLabels';
|
|
7
9
|
export * from './personalAccessTokens';
|
|
8
10
|
export * from './plans';
|
package/lib/cjs/index.js
CHANGED
|
@@ -24,6 +24,8 @@ __exportStar(require("./desktopify"), exports);
|
|
|
24
24
|
__exportStar(require("./desktopify2"), exports);
|
|
25
25
|
__exportStar(require("./getSiteInfo"), exports);
|
|
26
26
|
__exportStar(require("./hsm"), exports);
|
|
27
|
+
__exportStar(require("./introspection/breakpoints"), exports);
|
|
28
|
+
__exportStar(require("./introspection/status"), exports);
|
|
27
29
|
__exportStar(require("./invitePermissionLabels"), exports);
|
|
28
30
|
__exportStar(require("./personalAccessTokens"), exports);
|
|
29
31
|
__exportStar(require("./plans"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Build } from '../desktopify';
|
|
2
|
+
import type { IntrospectBreakpointStatus, IntrospectShellStatus } from '../desktopify';
|
|
3
|
+
export type IntrospectPlatformName = 'mac' | 'windows' | 'linux';
|
|
4
|
+
/**
|
|
5
|
+
* Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
|
|
6
|
+
* Builds that were introspected cannot be released.
|
|
7
|
+
*/
|
|
8
|
+
export declare function wasIntrospected(build: Build): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get list of platform names that were introspected (have connectedAt or disconnectedAt).
|
|
11
|
+
* Returns capitalized platform names (e.g., ['Mac', 'Windows']).
|
|
12
|
+
*/
|
|
13
|
+
export declare function getIntrospectedPlatformNames(build: Build): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Format introspection status as a human-readable string.
|
|
16
|
+
* Combines breakpoint status and shell status into a single label.
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatIntrospectionStatus(breakpointStatus?: IntrospectBreakpointStatus, shellStatus?: IntrospectShellStatus): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wasIntrospected = wasIntrospected;
|
|
4
|
+
exports.getIntrospectedPlatformNames = getIntrospectedPlatformNames;
|
|
5
|
+
exports.formatIntrospectionStatus = formatIntrospectionStatus;
|
|
6
|
+
const PLATFORM_LABELS = {
|
|
7
|
+
mac: 'Mac',
|
|
8
|
+
windows: 'Windows',
|
|
9
|
+
linux: 'Linux',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
|
|
13
|
+
* Builds that were introspected cannot be released.
|
|
14
|
+
*/
|
|
15
|
+
function wasIntrospected(build) {
|
|
16
|
+
const introspect = build.introspect;
|
|
17
|
+
if (!introspect)
|
|
18
|
+
return false;
|
|
19
|
+
const platforms = ['mac', 'windows', 'linux'];
|
|
20
|
+
for (const platform of platforms) {
|
|
21
|
+
const data = introspect[platform];
|
|
22
|
+
if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get list of platform names that were introspected (have connectedAt or disconnectedAt).
|
|
30
|
+
* Returns capitalized platform names (e.g., ['Mac', 'Windows']).
|
|
31
|
+
*/
|
|
32
|
+
function getIntrospectedPlatformNames(build) {
|
|
33
|
+
const introspect = build.introspect;
|
|
34
|
+
if (!introspect)
|
|
35
|
+
return [];
|
|
36
|
+
const platforms = ['mac', 'windows', 'linux'];
|
|
37
|
+
const result = [];
|
|
38
|
+
for (const platform of platforms) {
|
|
39
|
+
const data = introspect[platform];
|
|
40
|
+
if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
|
|
41
|
+
result.push(PLATFORM_LABELS[platform]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Format introspection status as a human-readable string.
|
|
48
|
+
* Combines breakpoint status and shell status into a single label.
|
|
49
|
+
*/
|
|
50
|
+
function formatIntrospectionStatus(breakpointStatus, shellStatus) {
|
|
51
|
+
if (breakpointStatus === 'paused') {
|
|
52
|
+
if (shellStatus === 'connected') {
|
|
53
|
+
return 'paused (shell connected)';
|
|
54
|
+
}
|
|
55
|
+
if (shellStatus === 'disconnected') {
|
|
56
|
+
return 'paused (shell disconnected)';
|
|
57
|
+
}
|
|
58
|
+
return 'paused';
|
|
59
|
+
}
|
|
60
|
+
if (breakpointStatus === 'ready') {
|
|
61
|
+
if (shellStatus === 'connected') {
|
|
62
|
+
return 'ready (shell connected)';
|
|
63
|
+
}
|
|
64
|
+
if (shellStatus === 'disconnected') {
|
|
65
|
+
return 'ready (shell disconnected)';
|
|
66
|
+
}
|
|
67
|
+
return 'ready';
|
|
68
|
+
}
|
|
69
|
+
if (breakpointStatus === 'resuming') {
|
|
70
|
+
return 'resuming';
|
|
71
|
+
}
|
|
72
|
+
if (breakpointStatus === 'initializing') {
|
|
73
|
+
return 'initializing';
|
|
74
|
+
}
|
|
75
|
+
if (breakpointStatus === 'finished') {
|
|
76
|
+
return 'finished';
|
|
77
|
+
}
|
|
78
|
+
if (breakpointStatus === 'error' || shellStatus === 'error') {
|
|
79
|
+
return 'error';
|
|
80
|
+
}
|
|
81
|
+
return 'status unknown';
|
|
82
|
+
}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './desktopify2.js';
|
|
|
4
4
|
export * from './getSiteInfo.js';
|
|
5
5
|
export * from './hsm.js';
|
|
6
6
|
export * from './introspection/breakpoints.js';
|
|
7
|
+
export * from './introspection/status.js';
|
|
7
8
|
export * from './invitePermissionLabels.js';
|
|
8
9
|
export * from './personalAccessTokens.js';
|
|
9
10
|
export * from './plans.js';
|
package/lib/esm/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from './desktopify2.js';
|
|
|
6
6
|
export * from './getSiteInfo.js';
|
|
7
7
|
export * from './hsm.js';
|
|
8
8
|
export * from './introspection/breakpoints.js';
|
|
9
|
+
export * from './introspection/status.js';
|
|
9
10
|
export * from './invitePermissionLabels.js';
|
|
10
11
|
export * from './personalAccessTokens.js';
|
|
11
12
|
export * from './plans.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Build } from '../desktopify';
|
|
2
|
+
import type { IntrospectBreakpointStatus, IntrospectShellStatus } from '../desktopify';
|
|
3
|
+
export type IntrospectPlatformName = 'mac' | 'windows' | 'linux';
|
|
4
|
+
/**
|
|
5
|
+
* Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
|
|
6
|
+
* Builds that were introspected cannot be released.
|
|
7
|
+
*/
|
|
8
|
+
export declare function wasIntrospected(build: Build): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get list of platform names that were introspected (have connectedAt or disconnectedAt).
|
|
11
|
+
* Returns capitalized platform names (e.g., ['Mac', 'Windows']).
|
|
12
|
+
*/
|
|
13
|
+
export declare function getIntrospectedPlatformNames(build: Build): string[];
|
|
14
|
+
/**
|
|
15
|
+
* Format introspection status as a human-readable string.
|
|
16
|
+
* Combines breakpoint status and shell status into a single label.
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatIntrospectionStatus(breakpointStatus?: IntrospectBreakpointStatus, shellStatus?: IntrospectShellStatus): string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const PLATFORM_LABELS = {
|
|
2
|
+
mac: 'Mac',
|
|
3
|
+
windows: 'Windows',
|
|
4
|
+
linux: 'Linux',
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
|
|
8
|
+
* Builds that were introspected cannot be released.
|
|
9
|
+
*/
|
|
10
|
+
export function wasIntrospected(build) {
|
|
11
|
+
const introspect = build.introspect;
|
|
12
|
+
if (!introspect)
|
|
13
|
+
return false;
|
|
14
|
+
const platforms = ['mac', 'windows', 'linux'];
|
|
15
|
+
for (const platform of platforms) {
|
|
16
|
+
const data = introspect[platform];
|
|
17
|
+
if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get list of platform names that were introspected (have connectedAt or disconnectedAt).
|
|
25
|
+
* Returns capitalized platform names (e.g., ['Mac', 'Windows']).
|
|
26
|
+
*/
|
|
27
|
+
export function getIntrospectedPlatformNames(build) {
|
|
28
|
+
const introspect = build.introspect;
|
|
29
|
+
if (!introspect)
|
|
30
|
+
return [];
|
|
31
|
+
const platforms = ['mac', 'windows', 'linux'];
|
|
32
|
+
const result = [];
|
|
33
|
+
for (const platform of platforms) {
|
|
34
|
+
const data = introspect[platform];
|
|
35
|
+
if ((data === null || data === void 0 ? void 0 : data.connectedAt) || (data === null || data === void 0 ? void 0 : data.disconnectedAt)) {
|
|
36
|
+
result.push(PLATFORM_LABELS[platform]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Format introspection status as a human-readable string.
|
|
43
|
+
* Combines breakpoint status and shell status into a single label.
|
|
44
|
+
*/
|
|
45
|
+
export function formatIntrospectionStatus(breakpointStatus, shellStatus) {
|
|
46
|
+
if (breakpointStatus === 'paused') {
|
|
47
|
+
if (shellStatus === 'connected') {
|
|
48
|
+
return 'paused (shell connected)';
|
|
49
|
+
}
|
|
50
|
+
if (shellStatus === 'disconnected') {
|
|
51
|
+
return 'paused (shell disconnected)';
|
|
52
|
+
}
|
|
53
|
+
return 'paused';
|
|
54
|
+
}
|
|
55
|
+
if (breakpointStatus === 'ready') {
|
|
56
|
+
if (shellStatus === 'connected') {
|
|
57
|
+
return 'ready (shell connected)';
|
|
58
|
+
}
|
|
59
|
+
if (shellStatus === 'disconnected') {
|
|
60
|
+
return 'ready (shell disconnected)';
|
|
61
|
+
}
|
|
62
|
+
return 'ready';
|
|
63
|
+
}
|
|
64
|
+
if (breakpointStatus === 'resuming') {
|
|
65
|
+
return 'resuming';
|
|
66
|
+
}
|
|
67
|
+
if (breakpointStatus === 'initializing') {
|
|
68
|
+
return 'initializing';
|
|
69
|
+
}
|
|
70
|
+
if (breakpointStatus === 'finished') {
|
|
71
|
+
return 'finished';
|
|
72
|
+
}
|
|
73
|
+
if (breakpointStatus === 'error' || shellStatus === 'error') {
|
|
74
|
+
return 'error';
|
|
75
|
+
}
|
|
76
|
+
return 'status unknown';
|
|
77
|
+
}
|
package/package.json
CHANGED
package/src/index.cjs.ts
CHANGED
|
@@ -8,6 +8,8 @@ export * from './desktopify';
|
|
|
8
8
|
export * from './desktopify2';
|
|
9
9
|
export * from './getSiteInfo';
|
|
10
10
|
export * from './hsm';
|
|
11
|
+
export * from './introspection/breakpoints';
|
|
12
|
+
export * from './introspection/status';
|
|
11
13
|
export * from './invitePermissionLabels';
|
|
12
14
|
export * from './personalAccessTokens';
|
|
13
15
|
export * from './plans';
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './desktopify2.js';
|
|
|
7
7
|
export * from './getSiteInfo.js';
|
|
8
8
|
export * from './hsm.js';
|
|
9
9
|
export * from './introspection/breakpoints.js';
|
|
10
|
+
export * from './introspection/status.js';
|
|
10
11
|
export * from './invitePermissionLabels.js';
|
|
11
12
|
export * from './personalAccessTokens.js';
|
|
12
13
|
export * from './plans.js';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Build } from '../desktopify';
|
|
2
|
+
import type {
|
|
3
|
+
IntrospectBreakpointStatus,
|
|
4
|
+
IntrospectShellStatus,
|
|
5
|
+
} from '../desktopify';
|
|
6
|
+
|
|
7
|
+
export type IntrospectPlatformName = 'mac' | 'windows' | 'linux';
|
|
8
|
+
|
|
9
|
+
const PLATFORM_LABELS: Record<IntrospectPlatformName, string> = {
|
|
10
|
+
mac: 'Mac',
|
|
11
|
+
windows: 'Windows',
|
|
12
|
+
linux: 'Linux',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Check if a build was introspected (has connectedAt or disconnectedAt on any platform).
|
|
17
|
+
* Builds that were introspected cannot be released.
|
|
18
|
+
*/
|
|
19
|
+
export function wasIntrospected(build: Build): boolean {
|
|
20
|
+
const introspect = build.introspect;
|
|
21
|
+
if (!introspect) return false;
|
|
22
|
+
|
|
23
|
+
const platforms: IntrospectPlatformName[] = ['mac', 'windows', 'linux'];
|
|
24
|
+
|
|
25
|
+
for (const platform of platforms) {
|
|
26
|
+
const data = introspect[platform];
|
|
27
|
+
if (data?.connectedAt || data?.disconnectedAt) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get list of platform names that were introspected (have connectedAt or disconnectedAt).
|
|
37
|
+
* Returns capitalized platform names (e.g., ['Mac', 'Windows']).
|
|
38
|
+
*/
|
|
39
|
+
export function getIntrospectedPlatformNames(build: Build): string[] {
|
|
40
|
+
const introspect = build.introspect;
|
|
41
|
+
if (!introspect) return [];
|
|
42
|
+
|
|
43
|
+
const platforms: IntrospectPlatformName[] = ['mac', 'windows', 'linux'];
|
|
44
|
+
const result: string[] = [];
|
|
45
|
+
|
|
46
|
+
for (const platform of platforms) {
|
|
47
|
+
const data = introspect[platform];
|
|
48
|
+
if (data?.connectedAt || data?.disconnectedAt) {
|
|
49
|
+
result.push(PLATFORM_LABELS[platform]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Format introspection status as a human-readable string.
|
|
58
|
+
* Combines breakpoint status and shell status into a single label.
|
|
59
|
+
*/
|
|
60
|
+
export function formatIntrospectionStatus(
|
|
61
|
+
breakpointStatus?: IntrospectBreakpointStatus,
|
|
62
|
+
shellStatus?: IntrospectShellStatus,
|
|
63
|
+
): string {
|
|
64
|
+
if (breakpointStatus === 'paused') {
|
|
65
|
+
if (shellStatus === 'connected') {
|
|
66
|
+
return 'paused (shell connected)';
|
|
67
|
+
}
|
|
68
|
+
if (shellStatus === 'disconnected') {
|
|
69
|
+
return 'paused (shell disconnected)';
|
|
70
|
+
}
|
|
71
|
+
return 'paused';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (breakpointStatus === 'ready') {
|
|
75
|
+
if (shellStatus === 'connected') {
|
|
76
|
+
return 'ready (shell connected)';
|
|
77
|
+
}
|
|
78
|
+
if (shellStatus === 'disconnected') {
|
|
79
|
+
return 'ready (shell disconnected)';
|
|
80
|
+
}
|
|
81
|
+
return 'ready';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (breakpointStatus === 'resuming') {
|
|
85
|
+
return 'resuming';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (breakpointStatus === 'initializing') {
|
|
89
|
+
return 'initializing';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (breakpointStatus === 'finished') {
|
|
93
|
+
return 'finished';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (breakpointStatus === 'error' || shellStatus === 'error') {
|
|
97
|
+
return 'error';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return 'status unknown';
|
|
101
|
+
}
|
package/vitest.config.ts
ADDED