@todesktop/shared 7.189.24 → 7.190.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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "legacyRepo": "todesktop-shared-types",
3
+ "legacyBranch": "master",
4
+ "lastImportedSha": "4277cf7b551ea276b69e1e196bc1b3a0d8c0c4d2",
5
+ "lastImportedAt": "2025-10-29T21:11:57+00:00"
6
+ }
@@ -1,7 +1,7 @@
1
1
  import { ISwitchableValue } from './toDesktop';
2
2
  import { MenuItemConstructorOptions, BrowserWindowConstructorOptions, WebPreferences, NotificationConstructorOptions, MessageBoxOptions } from '@todesktop/client-electron-types';
3
3
  import { BaseApp } from './base';
4
- import { DesktopAppPlugin } from './plugin';
4
+ import { CustomPlugin, DesktopAppPlugin } from './plugin';
5
5
  import { ValidTranslationKeys, ValidTranslationLanguages } from './translation';
6
6
  interface BaseAssetDetails {
7
7
  /**
@@ -429,6 +429,10 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
429
429
  * An array of plugin modules. Can work with semver specificity
430
430
  */
431
431
  plugins?: (Plugin | string)[];
432
+ /**
433
+ * Metadata about plugins that were manually linked into the app
434
+ */
435
+ customPlugins?: CustomPlugin[];
432
436
  /**
433
437
  * The app's windows
434
438
  */
@@ -1,4 +1,11 @@
1
+ import { UserIHaveSentInviteTo } from './toDesktop';
1
2
  export type InvitePermissionKey = 'canBuild' | 'canRelease' | 'canManageUsers';
2
3
  export type InvitePermissionFlags = Record<InvitePermissionKey, boolean>;
3
4
  export declare const INVITE_PERMISSION_LABELS: Record<InvitePermissionKey, string>;
4
5
  export declare const formatInvitePermissionSummary: (permissions: Partial<InvitePermissionFlags>) => string;
6
+ export type NormalizedInvitePermissions = {
7
+ canBuild: boolean;
8
+ canRelease: boolean;
9
+ canManageUsers: boolean;
10
+ };
11
+ export declare const normalizeInvitePermissions: (permissions?: UserIHaveSentInviteTo["permissions"]) => NormalizedInvitePermissions;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatInvitePermissionSummary = exports.INVITE_PERMISSION_LABELS = void 0;
3
+ exports.normalizeInvitePermissions = exports.formatInvitePermissionSummary = exports.INVITE_PERMISSION_LABELS = void 0;
4
4
  exports.INVITE_PERMISSION_LABELS = {
5
5
  canBuild: 'Can build',
6
6
  canRelease: 'Can release',
@@ -13,3 +13,9 @@ const formatInvitePermissionSummary = (permissions) => {
13
13
  return enabled.join(', ');
14
14
  };
15
15
  exports.formatInvitePermissionSummary = formatInvitePermissionSummary;
16
+ const normalizeInvitePermissions = (permissions) => ({
17
+ canBuild: (permissions === null || permissions === void 0 ? void 0 : permissions.canBuild) === true,
18
+ canRelease: (permissions === null || permissions === void 0 ? void 0 : permissions.canRelease) === true,
19
+ canManageUsers: (permissions === null || permissions === void 0 ? void 0 : permissions.canManageUsers) === true,
20
+ });
21
+ exports.normalizeInvitePermissions = normalizeInvitePermissions;
package/lib/plugin.d.ts CHANGED
@@ -11,6 +11,15 @@ export interface DesktopAppPlugin {
11
11
  */
12
12
  package: string;
13
13
  }
14
+ export interface CustomPlugin {
15
+ packageName: string;
16
+ displayName?: string;
17
+ sourcePath: string;
18
+ todesktop: ToDesktopPlugin;
19
+ addedAt: string;
20
+ lastLinkedAt?: string;
21
+ description?: string;
22
+ }
14
23
  export type ToDesktopPlugin = {
15
24
  namespace: string;
16
25
  version: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@todesktop/shared",
3
- "version": "7.189.24",
3
+ "version": "7.190.0",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -7,7 +7,7 @@ import {
7
7
  MessageBoxOptions,
8
8
  } from '@todesktop/client-electron-types';
9
9
  import { BaseApp } from './base';
10
- import { DesktopAppPlugin } from './plugin';
10
+ import { CustomPlugin, DesktopAppPlugin } from './plugin';
11
11
  import { ValidTranslationKeys, ValidTranslationLanguages } from './translation';
12
12
 
13
13
  interface BaseAssetDetails {
@@ -564,6 +564,10 @@ export interface DesktopifyApp2<Plugin = DesktopAppPlugin> {
564
564
  * An array of plugin modules. Can work with semver specificity
565
565
  */
566
566
  plugins?: (Plugin | string)[];
567
+ /**
568
+ * Metadata about plugins that were manually linked into the app
569
+ */
570
+ customPlugins?: CustomPlugin[];
567
571
  /**
568
572
  * The app's windows
569
573
  */
@@ -1,3 +1,5 @@
1
+ import { UserIHaveSentInviteTo } from './toDesktop';
2
+
1
3
  export type InvitePermissionKey = 'canBuild' | 'canRelease' | 'canManageUsers';
2
4
 
3
5
  export type InvitePermissionFlags = Record<InvitePermissionKey, boolean>;
@@ -21,3 +23,17 @@ export const formatInvitePermissionSummary = (
21
23
 
22
24
  return enabled.join(', ');
23
25
  };
26
+
27
+ export type NormalizedInvitePermissions = {
28
+ canBuild: boolean;
29
+ canRelease: boolean;
30
+ canManageUsers: boolean;
31
+ };
32
+
33
+ export const normalizeInvitePermissions = (
34
+ permissions?: UserIHaveSentInviteTo['permissions']
35
+ ): NormalizedInvitePermissions => ({
36
+ canBuild: permissions?.canBuild === true,
37
+ canRelease: permissions?.canRelease === true,
38
+ canManageUsers: permissions?.canManageUsers === true,
39
+ });
package/src/plugin.ts CHANGED
@@ -13,6 +13,16 @@ export interface DesktopAppPlugin {
13
13
  package: string;
14
14
  }
15
15
 
16
+ export interface CustomPlugin {
17
+ packageName: string;
18
+ displayName?: string;
19
+ sourcePath: string;
20
+ todesktop: ToDesktopPlugin;
21
+ addedAt: string;
22
+ lastLinkedAt?: string;
23
+ description?: string;
24
+ }
25
+
16
26
  export type ToDesktopPlugin = {
17
27
  namespace: string;
18
28
  version: number;