@todesktop/shared 7.190.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/.prettierignore +0 -2
- package/CHANGELOG.md +19 -0
- package/README.md +42 -15
- package/eslint.config.mjs +8 -55
- package/lib/{base.d.ts → cjs/base.d.ts} +82 -75
- package/lib/{desktopify.d.ts → cjs/desktopify.d.ts} +74 -74
- package/lib/{desktopify.js → cjs/desktopify.js} +12 -11
- package/lib/{desktopify2.d.ts → cjs/desktopify2.d.ts} +223 -223
- package/lib/{getSiteInfo.d.ts → cjs/getSiteInfo.d.ts} +6 -6
- package/lib/{hsm.d.ts → cjs/hsm.d.ts} +1 -1
- package/lib/{hsm.js → cjs/hsm.js} +1 -1
- package/lib/{index.d.ts → cjs/index.d.ts} +7 -8
- package/lib/{index.js → cjs/index.js} +11 -9
- package/lib/{invitePermissionLabels.d.ts → cjs/invitePermissionLabels.d.ts} +4 -2
- package/lib/{invitePermissionLabels.js → cjs/invitePermissionLabels.js} +11 -3
- package/lib/{personalAccessTokens.d.ts → cjs/personalAccessTokens.d.ts} +12 -12
- package/lib/{plans.d.ts → cjs/plans.d.ts} +27 -27
- package/lib/{plans.js → cjs/plans.js} +165 -163
- package/lib/{plugin.d.ts → cjs/plugin.d.ts} +18 -18
- package/lib/{toDesktop.d.ts → cjs/toDesktop.d.ts} +66 -66
- package/lib/cjs/translation.d.ts +2 -0
- package/lib/{validations.d.ts → cjs/validations.d.ts} +66 -66
- package/lib/cjs/validations.js +178 -0
- package/lib/esm/base.d.ts +326 -0
- package/lib/esm/base.js +19 -0
- package/lib/esm/desktopify.d.ts +339 -0
- package/lib/esm/desktopify.js +71 -0
- package/lib/esm/desktopify2.d.ts +506 -0
- package/lib/esm/desktopify2.js +77 -0
- package/lib/esm/getSiteInfo.d.ts +24 -0
- package/lib/esm/getSiteInfo.js +1 -0
- package/lib/esm/hsm.d.ts +30 -0
- package/lib/esm/hsm.js +35 -0
- package/lib/esm/index.d.ts +12 -0
- package/lib/esm/index.js +14 -0
- package/lib/esm/invitePermissionLabels.d.ts +13 -0
- package/lib/esm/invitePermissionLabels.js +24 -0
- package/lib/esm/personalAccessTokens.d.ts +24 -0
- package/lib/esm/personalAccessTokens.js +1 -0
- package/lib/esm/plans.d.ts +130 -0
- package/lib/esm/plans.js +626 -0
- package/lib/esm/plugin.d.ts +55 -0
- package/lib/esm/plugin.js +1 -0
- package/lib/esm/toDesktop.d.ts +191 -0
- package/lib/esm/toDesktop.js +1 -0
- package/lib/esm/translation.d.ts +2 -0
- package/lib/esm/translation.js +13 -0
- package/lib/esm/validations.d.ts +102 -0
- package/lib/{validations.js → esm/validations.js} +54 -56
- package/package.json +29 -20
- package/src/base.ts +90 -82
- package/src/desktopify.ts +82 -80
- package/src/desktopify2.ts +240 -240
- package/src/getSiteInfo.ts +6 -6
- package/src/hsm.ts +7 -7
- package/src/index.cjs.ts +19 -0
- package/src/index.ts +14 -14
- package/src/invitePermissionLabels.ts +20 -6
- package/src/personalAccessTokens.ts +12 -12
- package/src/plans.ts +191 -191
- package/src/plugin.ts +19 -19
- package/src/toDesktop.ts +70 -70
- package/src/translation.ts +2 -2
- package/src/validations.ts +51 -49
- package/tsconfig.esm.json +15 -0
- package/tsconfig.json +6 -4
- package/.prettierrc +0 -5
- package/lib/translation.d.ts +0 -2
- package/lib/{base.js → cjs/base.js} +3 -3
- /package/lib/{desktopify2.js → cjs/desktopify2.js} +0 -0
- /package/lib/{getSiteInfo.js → cjs/getSiteInfo.js} +0 -0
- /package/lib/{personalAccessTokens.js → cjs/personalAccessTokens.js} +0 -0
- /package/lib/{plugin.js → cjs/plugin.js} +0 -0
- /package/lib/{toDesktop.js → cjs/toDesktop.js} +0 -0
- /package/lib/{translation.js → cjs/translation.js} +0 -0
package/src/getSiteInfo.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export interface IAppFromServerProps {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
2
|
appModelId: string;
|
|
5
|
-
|
|
6
|
-
meta: IAppFromServerPropsMeta;
|
|
3
|
+
appType: 'app' | 'electron' | 'menubar' | 'tabbed';
|
|
7
4
|
html?: string;
|
|
8
5
|
iconUrl?: string;
|
|
6
|
+
id: string;
|
|
7
|
+
meta: IAppFromServerPropsMeta;
|
|
8
|
+
name: string;
|
|
9
9
|
secret: string;
|
|
10
|
-
|
|
10
|
+
url: string;
|
|
11
11
|
// dimension: IAppFromServerPropsDimension;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -16,9 +16,9 @@ interface IAppFromServerPropsMeta {
|
|
|
16
16
|
isHttps?: boolean;
|
|
17
17
|
}
|
|
18
18
|
export interface IAppFromServerPropsDimension {
|
|
19
|
-
width: number;
|
|
20
19
|
height: number;
|
|
21
20
|
type: string;
|
|
21
|
+
width: number;
|
|
22
22
|
}
|
|
23
23
|
export interface IAppFromServerPropsS3PutsEntity {
|
|
24
24
|
ETag: string;
|
package/src/hsm.ts
CHANGED
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
* - mas-dev = Apple Development
|
|
7
7
|
*/
|
|
8
8
|
export type MacTarget =
|
|
9
|
-
| 'mac'
|
|
10
9
|
| 'mac-installer'
|
|
11
|
-
| '
|
|
10
|
+
| 'mac'
|
|
11
|
+
| 'mas-dev'
|
|
12
12
|
| 'mas-installer'
|
|
13
|
-
| 'mas
|
|
13
|
+
| 'mas';
|
|
14
14
|
|
|
15
15
|
export type WindowsTarget = 'windows';
|
|
16
16
|
|
|
17
17
|
export function isMacTarget(type: string): type is MacTarget {
|
|
18
|
-
return ['mac', 'mac-installer', 'mas', 'mas-
|
|
19
|
-
type
|
|
18
|
+
return ['mac', 'mac-installer', 'mas', 'mas-dev', 'mas-installer'].includes(
|
|
19
|
+
type,
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -34,11 +34,11 @@ export function isWindowsTarget(type: string): type is MacTarget {
|
|
|
34
34
|
*/
|
|
35
35
|
export const getCertificateNameFromHSM = (
|
|
36
36
|
appId: string,
|
|
37
|
-
target: MacTarget | WindowsTarget
|
|
37
|
+
target: MacTarget | WindowsTarget,
|
|
38
38
|
) => {
|
|
39
39
|
if (!isMacTarget(target) && !isWindowsTarget(target)) {
|
|
40
40
|
throw new Error(
|
|
41
|
-
`Invalid target '${target}'. Only windows or mac certs are supported
|
|
41
|
+
`Invalid target '${target}'. Only windows or mac certs are supported`,
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
|
package/src/index.cjs.ts
ADDED
|
@@ -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,17 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
// Path is relative to lib/esm/ output directory
|
|
2
|
+
import packageJson from '../../package.json' with { type: 'json' };
|
|
2
3
|
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './desktopify';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './getSiteInfo';
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
4
|
+
export * from './base.js';
|
|
5
|
+
export * from './desktopify.js';
|
|
6
|
+
export * from './desktopify2.js';
|
|
7
|
+
export * from './getSiteInfo.js';
|
|
8
|
+
export * from './hsm.js';
|
|
9
|
+
export * from './invitePermissionLabels.js';
|
|
10
|
+
export * from './personalAccessTokens.js';
|
|
11
|
+
export * from './plans.js';
|
|
12
|
+
export * from './plugin.js';
|
|
13
|
+
export * from './toDesktop.js';
|
|
13
14
|
|
|
14
|
-
export * from './
|
|
15
|
+
export * from './validations.js';
|
|
15
16
|
|
|
16
|
-
const schemaVersion = version;
|
|
17
|
-
export { schemaVersion };
|
|
17
|
+
export const schemaVersion = packageJson.version;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { UserIHaveSentInviteTo } from './toDesktop';
|
|
2
2
|
|
|
3
|
-
export type InvitePermissionKey =
|
|
3
|
+
export type InvitePermissionKey =
|
|
4
|
+
| 'canBuild'
|
|
5
|
+
| 'canManageBilling'
|
|
6
|
+
| 'canManageUsers'
|
|
7
|
+
| 'canRelease';
|
|
4
8
|
|
|
5
9
|
export type InvitePermissionFlags = Record<InvitePermissionKey, boolean>;
|
|
6
10
|
|
|
7
11
|
export const INVITE_PERMISSION_LABELS: Record<InvitePermissionKey, string> = {
|
|
8
12
|
canBuild: 'Can build',
|
|
9
|
-
|
|
13
|
+
canManageBilling: 'Can manage billing',
|
|
10
14
|
canManageUsers: 'Can manage users',
|
|
15
|
+
canRelease: 'Can release',
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
export const formatInvitePermissionSummary = (
|
|
14
|
-
permissions: Partial<InvitePermissionFlags
|
|
19
|
+
permissions: Partial<InvitePermissionFlags>,
|
|
15
20
|
): string => {
|
|
16
21
|
const enabled = (
|
|
17
22
|
Object.entries(permissions) as Array<
|
|
@@ -26,14 +31,23 @@ export const formatInvitePermissionSummary = (
|
|
|
26
31
|
|
|
27
32
|
export type NormalizedInvitePermissions = {
|
|
28
33
|
canBuild: boolean;
|
|
29
|
-
|
|
34
|
+
canManageBilling: boolean;
|
|
30
35
|
canManageUsers: boolean;
|
|
36
|
+
canRelease: boolean;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const FULL_OWNER_PERMISSIONS: NormalizedInvitePermissions = {
|
|
40
|
+
canBuild: true,
|
|
41
|
+
canManageBilling: true,
|
|
42
|
+
canManageUsers: true,
|
|
43
|
+
canRelease: true,
|
|
31
44
|
};
|
|
32
45
|
|
|
33
46
|
export const normalizeInvitePermissions = (
|
|
34
|
-
permissions?: UserIHaveSentInviteTo['permissions']
|
|
47
|
+
permissions?: UserIHaveSentInviteTo['permissions'],
|
|
35
48
|
): NormalizedInvitePermissions => ({
|
|
36
49
|
canBuild: permissions?.canBuild === true,
|
|
37
|
-
|
|
50
|
+
canManageBilling: permissions?.canManageBilling === true,
|
|
38
51
|
canManageUsers: permissions?.canManageUsers === true,
|
|
52
|
+
canRelease: permissions?.canRelease === true,
|
|
39
53
|
});
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export type PatStatus = 'active' | '
|
|
1
|
+
export type PatStatus = 'active' | 'expired' | 'revoked';
|
|
2
2
|
|
|
3
|
-
export type PatPermissionSource = '
|
|
3
|
+
export type PatPermissionSource = 'delegate' | 'owner';
|
|
4
4
|
|
|
5
5
|
export interface PatAppScope {
|
|
6
|
-
ownerUserId: string;
|
|
7
6
|
applicationId: string;
|
|
7
|
+
ownerUserId: string;
|
|
8
8
|
permissionSource: PatPermissionSource;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export interface PatUsageApp {
|
|
12
|
-
ownerUserId: string;
|
|
13
12
|
applicationId: string;
|
|
13
|
+
ownerUserId: string;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface PatSummary {
|
|
17
|
-
tokenId: string;
|
|
18
|
-
tokenPrefix: string;
|
|
19
|
-
description: string;
|
|
20
|
-
createdAt: string | null;
|
|
21
|
-
expiresAt: string | null;
|
|
22
|
-
revokedAt: string | null;
|
|
23
|
-
lastUsedAt: string | null;
|
|
24
|
-
lastUsedByApp: PatUsageApp | null;
|
|
25
17
|
appScopes: PatAppScope[];
|
|
18
|
+
createdAt: null | string;
|
|
19
|
+
description: string;
|
|
20
|
+
expiresAt: null | string;
|
|
21
|
+
lastUsedAt: null | string;
|
|
22
|
+
lastUsedByApp: null | PatUsageApp;
|
|
23
|
+
revokedAt: null | string;
|
|
26
24
|
status: PatStatus;
|
|
25
|
+
tokenId: string;
|
|
26
|
+
tokenPrefix: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export type PatListItem = PatSummary;
|