@openfin/core 40.82.2 → 40.82.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,6 +45,15 @@ declare type Accelerator = {
45
45
  zoom: boolean;
46
46
  };
47
47
 
48
+ /**
49
+ * Generated when a View is added to a layout.
50
+ * @interface
51
+ */
52
+ declare type AddedToLayoutEvent = BaseEvent_4 & {
53
+ type: 'added-to-layout';
54
+ layoutIdentity: OpenFin_2.LayoutIdentity;
55
+ };
56
+
48
57
  /**
49
58
  * Options to use when adding a view to a {@link TabStack}.
50
59
  *
@@ -3702,6 +3711,7 @@ declare type ContainerCreatedEvent = LayoutDOMEvent & {
3702
3711
 
3703
3712
  /**
3704
3713
  * Generated when content navigation or redirection is blocked by {@link OpenFin.DomainSettings}.
3714
+ * @interface
3705
3715
  */
3706
3716
  declare type ContentBlockedEvent = NamedEvent & {
3707
3717
  type: 'content-blocked';
@@ -4709,6 +4719,7 @@ declare type ErrorPlainObject = {
4709
4719
  stack?: string;
4710
4720
  message: string;
4711
4721
  name?: string;
4722
+ cause?: Error | ErrorPlainObject;
4712
4723
  toString(): string;
4713
4724
  };
4714
4725
 
@@ -4757,7 +4768,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
4757
4768
  */
4758
4769
  declare type Event_4 = (WebContentsEvents.Event<'view'> & {
4759
4770
  target: OpenFin_2.Identity;
4760
- }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent;
4771
+ }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
4761
4772
 
4762
4773
  /**
4763
4774
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
@@ -8220,6 +8231,23 @@ declare type LogLevel = OpenFin_2.LogLevel;
8220
8231
  */
8221
8232
  declare type LogLevel_2 = 'verbose' | 'info' | 'warning' | 'error' | 'fatal';
8222
8233
 
8234
+ declare type LogUploaderUIOptions = {
8235
+ title?: string;
8236
+ icon?: string;
8237
+ header?: string;
8238
+ description?: string;
8239
+ email?: string;
8240
+ website?: string;
8241
+ websiteDescription?: string;
8242
+ };
8243
+
8244
+ declare type LogUploadOptions = {
8245
+ endpoint: string;
8246
+ manifests?: string[];
8247
+ logs?: string[];
8248
+ ui?: LogUploaderUIOptions;
8249
+ };
8250
+
8223
8251
  /**
8224
8252
  * @interface
8225
8253
  */
@@ -8278,6 +8306,7 @@ declare type Manifest = {
8278
8306
  enableErrorReporting?: boolean;
8279
8307
  };
8280
8308
  interopBrokerConfiguration: InteropBrokerOptions;
8309
+ logUpload?: LogUploadOptions;
8281
8310
  };
8282
8311
 
8283
8312
  /**
@@ -8909,6 +8938,34 @@ declare type NavigationRules = {
8909
8938
 
8910
8939
  declare type NewConnectConfig = ConfigWithUuid & ConfigWithRuntime;
8911
8940
 
8941
+ declare interface NodeNetworkInterfaceBase {
8942
+ address: string;
8943
+ netmask: string;
8944
+ mac: string;
8945
+ internal: boolean;
8946
+ cidr: string | null;
8947
+ }
8948
+
8949
+ declare type NodeNetworkInterfaceInfo = NodeNetworkInterfaceInfoIPv4 | NodeNetworkInterfaceInfoIPv6;
8950
+
8951
+ declare interface NodeNetworkInterfaceInfoIPv4 extends NodeNetworkInterfaceBase {
8952
+ family: 'IPv4';
8953
+ scopeid?: undefined;
8954
+ }
8955
+
8956
+ declare interface NodeNetworkInterfaceInfoIPv6 extends NodeNetworkInterfaceBase {
8957
+ family: 'IPv6';
8958
+ scopeid: number;
8959
+ }
8960
+
8961
+ declare interface NodeUserInfo {
8962
+ username: string;
8963
+ uid: number;
8964
+ gid: number;
8965
+ shell: string | null;
8966
+ homedir: string;
8967
+ }
8968
+
8912
8969
  /**
8913
8970
  * @interface
8914
8971
  */
@@ -9111,6 +9168,8 @@ declare namespace OpenFin_2 {
9111
9168
  PlatformViewCreationOptions,
9112
9169
  ProcessAffinityStrategy,
9113
9170
  PlatformOptions,
9171
+ LogUploaderUIOptions,
9172
+ LogUploadOptions,
9114
9173
  Manifest,
9115
9174
  LayoutContent,
9116
9175
  LayoutItemConfig,
@@ -9138,6 +9197,7 @@ declare namespace OpenFin_2 {
9138
9197
  Time,
9139
9198
  CpuInfo,
9140
9199
  GpuInfo,
9200
+ OSInfo,
9141
9201
  HostSpecs,
9142
9202
  PrinterInfo_2 as PrinterInfo,
9143
9203
  Dpi,
@@ -9347,6 +9407,25 @@ declare type OptionsChangedEvent = BaseEvent_5 & {
9347
9407
  diff: OpenFin_2.WindowOptionDiff;
9348
9408
  };
9349
9409
 
9410
+ /**
9411
+ * @interface
9412
+ * The keys represent the output from calling individual Node `os` APIs.
9413
+ * For example, `userInfo` will have the output of calling `os.userInfo()`. For more information
9414
+ * see [Node `os` API docs](https://nodejs.org/docs/latest-v20.x/api/os.html)
9415
+ */
9416
+ declare type OSInfo = {
9417
+ platform: string;
9418
+ release: string;
9419
+ version: string;
9420
+ /**
9421
+ * Throws if a user has no username or homedir.
9422
+ * See [Node os.userInfo docs for more info](https://nodejs.org/docs/latest-v20.x/api/os.html#osuserinfooptions)
9423
+ */
9424
+ userInfo: NodeUserInfo;
9425
+ hostname: string;
9426
+ networkInterfaces: Record<string, NodeNetworkInterfaceInfo[] | undefined>;
9427
+ };
9428
+
9350
9429
  declare type OverrideCallback<T extends any = PlatformProvider, U extends T = T> = (arg: Constructor<T>) => U | Promise<U>;
9351
9430
 
9352
9431
  /**
@@ -11608,6 +11687,8 @@ declare interface ProtocolMap extends ProtocolMapBase {
11608
11687
  };
11609
11688
  response: void;
11610
11689
  };
11690
+ 'get-host-specs': GetterCall<OpenFin_2.HostSpecs>;
11691
+ 'get-os-info': GetterCall<OpenFin_2.OSInfo>;
11611
11692
  'system-get-printers': GetterCall<OpenFin_2.PrinterInfo[]>;
11612
11693
  'system-register-shutdown-handler': VoidCall;
11613
11694
  'get-domain-settings': ApiCall<OpenFin_2.ApplicationIdentity, OpenFin_2.DefaultDomainSettings>;
@@ -11835,6 +11916,15 @@ declare interface RemoteConfig extends ExistingConnectConfig {
11835
11916
  token: string;
11836
11917
  }
11837
11918
 
11919
+ /**
11920
+ * Generated when a View is removed from a layout.
11921
+ * @interface
11922
+ */
11923
+ declare type RemovedFromLayoutEvent = BaseEvent_4 & {
11924
+ type: 'removed-from-layout';
11925
+ layoutIdentity: OpenFin_2.LayoutIdentity;
11926
+ };
11927
+
11838
11928
  /**
11839
11929
  * @interface
11840
11930
  */
@@ -12948,7 +13038,8 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12948
13038
  */
12949
13039
  getRvmInfo(): Promise<OpenFin_2.RVMInfo>;
12950
13040
  /**
12951
- * Retrieves system information.
13041
+ * Retrieves general system information. If you need more detailed information about the
13042
+ * OS and the currently logged in user, use `fin.System.getOSInfo()` instead.
12952
13043
  *
12953
13044
  * @example
12954
13045
  * ```js
@@ -12956,6 +13047,15 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12956
13047
  * ```
12957
13048
  */
12958
13049
  getHostSpecs(): Promise<OpenFin_2.HostSpecs>;
13050
+ /**
13051
+ * Retrieves information about the OS and the currently logged in user.
13052
+ *
13053
+ * @example
13054
+ * ```js
13055
+ * fin.System.getOSInfo().then(specs => console.log(specs)).catch(err => console.log(err));
13056
+ * ```
13057
+ */
13058
+ getOSInfo(): Promise<OpenFin_2.OSInfo>;
12959
13059
  /**
12960
13060
  * Runs an executable or batch file. A path to the file must be included in options.
12961
13061
  * <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
@@ -14083,6 +14183,7 @@ declare type SystemEventType = EventType_8;
14083
14183
  * @interface
14084
14184
  */
14085
14185
  declare type SystemPermissions = {
14186
+ getOSInfo: boolean;
14086
14187
  getAllExternalWindows: boolean;
14087
14188
  launchExternalProcess: boolean | {
14088
14189
  enabled: boolean;
@@ -15074,6 +15175,8 @@ declare namespace ViewEvents {
15074
15175
  BaseEvent_4 as BaseEvent,
15075
15176
  BaseViewEvent,
15076
15177
  TargetChangedEvent,
15178
+ AddedToLayoutEvent,
15179
+ RemovedFromLayoutEvent,
15077
15180
  NonPropagatedViewEvent,
15078
15181
  CreatedEvent,
15079
15182
  DestroyedEvent,
@@ -45,6 +45,15 @@ declare type Accelerator = {
45
45
  zoom: boolean;
46
46
  };
47
47
 
48
+ /**
49
+ * Generated when a View is added to a layout.
50
+ * @interface
51
+ */
52
+ declare type AddedToLayoutEvent = BaseEvent_4 & {
53
+ type: 'added-to-layout';
54
+ layoutIdentity: OpenFin_2.LayoutIdentity;
55
+ };
56
+
48
57
  /**
49
58
  * Options to use when adding a view to a {@link TabStack}.
50
59
  *
@@ -3702,6 +3711,7 @@ declare type ContainerCreatedEvent = LayoutDOMEvent & {
3702
3711
 
3703
3712
  /**
3704
3713
  * Generated when content navigation or redirection is blocked by {@link OpenFin.DomainSettings}.
3714
+ * @interface
3705
3715
  */
3706
3716
  declare type ContentBlockedEvent = NamedEvent & {
3707
3717
  type: 'content-blocked';
@@ -4709,6 +4719,7 @@ declare type ErrorPlainObject = {
4709
4719
  stack?: string;
4710
4720
  message: string;
4711
4721
  name?: string;
4722
+ cause?: Error | ErrorPlainObject;
4712
4723
  toString(): string;
4713
4724
  };
4714
4725
 
@@ -4757,7 +4768,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
4757
4768
  */
4758
4769
  declare type Event_4 = (WebContentsEvents.Event<'view'> & {
4759
4770
  target: OpenFin_2.Identity;
4760
- }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent;
4771
+ }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
4761
4772
 
4762
4773
  /**
4763
4774
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
@@ -8220,6 +8231,23 @@ declare type LogLevel = OpenFin_2.LogLevel;
8220
8231
  */
8221
8232
  declare type LogLevel_2 = 'verbose' | 'info' | 'warning' | 'error' | 'fatal';
8222
8233
 
8234
+ declare type LogUploaderUIOptions = {
8235
+ title?: string;
8236
+ icon?: string;
8237
+ header?: string;
8238
+ description?: string;
8239
+ email?: string;
8240
+ website?: string;
8241
+ websiteDescription?: string;
8242
+ };
8243
+
8244
+ declare type LogUploadOptions = {
8245
+ endpoint: string;
8246
+ manifests?: string[];
8247
+ logs?: string[];
8248
+ ui?: LogUploaderUIOptions;
8249
+ };
8250
+
8223
8251
  /**
8224
8252
  * @interface
8225
8253
  */
@@ -8278,6 +8306,7 @@ declare type Manifest = {
8278
8306
  enableErrorReporting?: boolean;
8279
8307
  };
8280
8308
  interopBrokerConfiguration: InteropBrokerOptions;
8309
+ logUpload?: LogUploadOptions;
8281
8310
  };
8282
8311
 
8283
8312
  /**
@@ -8909,6 +8938,34 @@ declare type NavigationRules = {
8909
8938
 
8910
8939
  declare type NewConnectConfig = ConfigWithUuid & ConfigWithRuntime;
8911
8940
 
8941
+ declare interface NodeNetworkInterfaceBase {
8942
+ address: string;
8943
+ netmask: string;
8944
+ mac: string;
8945
+ internal: boolean;
8946
+ cidr: string | null;
8947
+ }
8948
+
8949
+ declare type NodeNetworkInterfaceInfo = NodeNetworkInterfaceInfoIPv4 | NodeNetworkInterfaceInfoIPv6;
8950
+
8951
+ declare interface NodeNetworkInterfaceInfoIPv4 extends NodeNetworkInterfaceBase {
8952
+ family: 'IPv4';
8953
+ scopeid?: undefined;
8954
+ }
8955
+
8956
+ declare interface NodeNetworkInterfaceInfoIPv6 extends NodeNetworkInterfaceBase {
8957
+ family: 'IPv6';
8958
+ scopeid: number;
8959
+ }
8960
+
8961
+ declare interface NodeUserInfo {
8962
+ username: string;
8963
+ uid: number;
8964
+ gid: number;
8965
+ shell: string | null;
8966
+ homedir: string;
8967
+ }
8968
+
8912
8969
  /**
8913
8970
  * @interface
8914
8971
  */
@@ -9111,6 +9168,8 @@ declare namespace OpenFin_2 {
9111
9168
  PlatformViewCreationOptions,
9112
9169
  ProcessAffinityStrategy,
9113
9170
  PlatformOptions,
9171
+ LogUploaderUIOptions,
9172
+ LogUploadOptions,
9114
9173
  Manifest,
9115
9174
  LayoutContent,
9116
9175
  LayoutItemConfig,
@@ -9138,6 +9197,7 @@ declare namespace OpenFin_2 {
9138
9197
  Time,
9139
9198
  CpuInfo,
9140
9199
  GpuInfo,
9200
+ OSInfo,
9141
9201
  HostSpecs,
9142
9202
  PrinterInfo_2 as PrinterInfo,
9143
9203
  Dpi,
@@ -9347,6 +9407,25 @@ declare type OptionsChangedEvent = BaseEvent_5 & {
9347
9407
  diff: OpenFin_2.WindowOptionDiff;
9348
9408
  };
9349
9409
 
9410
+ /**
9411
+ * @interface
9412
+ * The keys represent the output from calling individual Node `os` APIs.
9413
+ * For example, `userInfo` will have the output of calling `os.userInfo()`. For more information
9414
+ * see [Node `os` API docs](https://nodejs.org/docs/latest-v20.x/api/os.html)
9415
+ */
9416
+ declare type OSInfo = {
9417
+ platform: string;
9418
+ release: string;
9419
+ version: string;
9420
+ /**
9421
+ * Throws if a user has no username or homedir.
9422
+ * See [Node os.userInfo docs for more info](https://nodejs.org/docs/latest-v20.x/api/os.html#osuserinfooptions)
9423
+ */
9424
+ userInfo: NodeUserInfo;
9425
+ hostname: string;
9426
+ networkInterfaces: Record<string, NodeNetworkInterfaceInfo[] | undefined>;
9427
+ };
9428
+
9350
9429
  declare type OverrideCallback<T extends any = PlatformProvider, U extends T = T> = (arg: Constructor<T>) => U | Promise<U>;
9351
9430
 
9352
9431
  /**
@@ -11608,6 +11687,8 @@ declare interface ProtocolMap extends ProtocolMapBase {
11608
11687
  };
11609
11688
  response: void;
11610
11689
  };
11690
+ 'get-host-specs': GetterCall<OpenFin_2.HostSpecs>;
11691
+ 'get-os-info': GetterCall<OpenFin_2.OSInfo>;
11611
11692
  'system-get-printers': GetterCall<OpenFin_2.PrinterInfo[]>;
11612
11693
  'system-register-shutdown-handler': VoidCall;
11613
11694
  'get-domain-settings': ApiCall<OpenFin_2.ApplicationIdentity, OpenFin_2.DefaultDomainSettings>;
@@ -11835,6 +11916,15 @@ declare interface RemoteConfig extends ExistingConnectConfig {
11835
11916
  token: string;
11836
11917
  }
11837
11918
 
11919
+ /**
11920
+ * Generated when a View is removed from a layout.
11921
+ * @interface
11922
+ */
11923
+ declare type RemovedFromLayoutEvent = BaseEvent_4 & {
11924
+ type: 'removed-from-layout';
11925
+ layoutIdentity: OpenFin_2.LayoutIdentity;
11926
+ };
11927
+
11838
11928
  /**
11839
11929
  * @interface
11840
11930
  */
@@ -12948,7 +13038,8 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12948
13038
  */
12949
13039
  getRvmInfo(): Promise<OpenFin_2.RVMInfo>;
12950
13040
  /**
12951
- * Retrieves system information.
13041
+ * Retrieves general system information. If you need more detailed information about the
13042
+ * OS and the currently logged in user, use `fin.System.getOSInfo()` instead.
12952
13043
  *
12953
13044
  * @example
12954
13045
  * ```js
@@ -12956,6 +13047,15 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12956
13047
  * ```
12957
13048
  */
12958
13049
  getHostSpecs(): Promise<OpenFin_2.HostSpecs>;
13050
+ /**
13051
+ * Retrieves information about the OS and the currently logged in user.
13052
+ *
13053
+ * @example
13054
+ * ```js
13055
+ * fin.System.getOSInfo().then(specs => console.log(specs)).catch(err => console.log(err));
13056
+ * ```
13057
+ */
13058
+ getOSInfo(): Promise<OpenFin_2.OSInfo>;
12959
13059
  /**
12960
13060
  * Runs an executable or batch file. A path to the file must be included in options.
12961
13061
  * <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
@@ -14083,6 +14183,7 @@ declare type SystemEventType = EventType_8;
14083
14183
  * @interface
14084
14184
  */
14085
14185
  declare type SystemPermissions = {
14186
+ getOSInfo: boolean;
14086
14187
  getAllExternalWindows: boolean;
14087
14188
  launchExternalProcess: boolean | {
14088
14189
  enabled: boolean;
@@ -15074,6 +15175,8 @@ declare namespace ViewEvents {
15074
15175
  BaseEvent_4 as BaseEvent,
15075
15176
  BaseViewEvent,
15076
15177
  TargetChangedEvent,
15178
+ AddedToLayoutEvent,
15179
+ RemovedFromLayoutEvent,
15077
15180
  NonPropagatedViewEvent,
15078
15181
  CreatedEvent,
15079
15182
  DestroyedEvent,
@@ -45,6 +45,15 @@ declare type Accelerator = {
45
45
  zoom: boolean;
46
46
  };
47
47
 
48
+ /**
49
+ * Generated when a View is added to a layout.
50
+ * @interface
51
+ */
52
+ declare type AddedToLayoutEvent = BaseEvent_4 & {
53
+ type: 'added-to-layout';
54
+ layoutIdentity: OpenFin_2.LayoutIdentity;
55
+ };
56
+
48
57
  /**
49
58
  * Options to use when adding a view to a {@link TabStack}.
50
59
  *
@@ -3702,6 +3711,7 @@ declare type ContainerCreatedEvent = LayoutDOMEvent & {
3702
3711
 
3703
3712
  /**
3704
3713
  * Generated when content navigation or redirection is blocked by {@link OpenFin.DomainSettings}.
3714
+ * @interface
3705
3715
  */
3706
3716
  declare type ContentBlockedEvent = NamedEvent & {
3707
3717
  type: 'content-blocked';
@@ -4709,6 +4719,7 @@ declare type ErrorPlainObject = {
4709
4719
  stack?: string;
4710
4720
  message: string;
4711
4721
  name?: string;
4722
+ cause?: Error | ErrorPlainObject;
4712
4723
  toString(): string;
4713
4724
  };
4714
4725
 
@@ -4757,7 +4768,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
4757
4768
  */
4758
4769
  declare type Event_4 = (WebContentsEvents.Event<'view'> & {
4759
4770
  target: OpenFin_2.Identity;
4760
- }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent;
4771
+ }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
4761
4772
 
4762
4773
  /**
4763
4774
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
@@ -8220,6 +8231,23 @@ declare type LogLevel = OpenFin_2.LogLevel;
8220
8231
  */
8221
8232
  declare type LogLevel_2 = 'verbose' | 'info' | 'warning' | 'error' | 'fatal';
8222
8233
 
8234
+ declare type LogUploaderUIOptions = {
8235
+ title?: string;
8236
+ icon?: string;
8237
+ header?: string;
8238
+ description?: string;
8239
+ email?: string;
8240
+ website?: string;
8241
+ websiteDescription?: string;
8242
+ };
8243
+
8244
+ declare type LogUploadOptions = {
8245
+ endpoint: string;
8246
+ manifests?: string[];
8247
+ logs?: string[];
8248
+ ui?: LogUploaderUIOptions;
8249
+ };
8250
+
8223
8251
  /**
8224
8252
  * @interface
8225
8253
  */
@@ -8278,6 +8306,7 @@ declare type Manifest = {
8278
8306
  enableErrorReporting?: boolean;
8279
8307
  };
8280
8308
  interopBrokerConfiguration: InteropBrokerOptions;
8309
+ logUpload?: LogUploadOptions;
8281
8310
  };
8282
8311
 
8283
8312
  /**
@@ -8909,6 +8938,34 @@ declare type NavigationRules = {
8909
8938
 
8910
8939
  declare type NewConnectConfig = ConfigWithUuid & ConfigWithRuntime;
8911
8940
 
8941
+ declare interface NodeNetworkInterfaceBase {
8942
+ address: string;
8943
+ netmask: string;
8944
+ mac: string;
8945
+ internal: boolean;
8946
+ cidr: string | null;
8947
+ }
8948
+
8949
+ declare type NodeNetworkInterfaceInfo = NodeNetworkInterfaceInfoIPv4 | NodeNetworkInterfaceInfoIPv6;
8950
+
8951
+ declare interface NodeNetworkInterfaceInfoIPv4 extends NodeNetworkInterfaceBase {
8952
+ family: 'IPv4';
8953
+ scopeid?: undefined;
8954
+ }
8955
+
8956
+ declare interface NodeNetworkInterfaceInfoIPv6 extends NodeNetworkInterfaceBase {
8957
+ family: 'IPv6';
8958
+ scopeid: number;
8959
+ }
8960
+
8961
+ declare interface NodeUserInfo {
8962
+ username: string;
8963
+ uid: number;
8964
+ gid: number;
8965
+ shell: string | null;
8966
+ homedir: string;
8967
+ }
8968
+
8912
8969
  /**
8913
8970
  * @interface
8914
8971
  */
@@ -9111,6 +9168,8 @@ declare namespace OpenFin_2 {
9111
9168
  PlatformViewCreationOptions,
9112
9169
  ProcessAffinityStrategy,
9113
9170
  PlatformOptions,
9171
+ LogUploaderUIOptions,
9172
+ LogUploadOptions,
9114
9173
  Manifest,
9115
9174
  LayoutContent,
9116
9175
  LayoutItemConfig,
@@ -9138,6 +9197,7 @@ declare namespace OpenFin_2 {
9138
9197
  Time,
9139
9198
  CpuInfo,
9140
9199
  GpuInfo,
9200
+ OSInfo,
9141
9201
  HostSpecs,
9142
9202
  PrinterInfo_2 as PrinterInfo,
9143
9203
  Dpi,
@@ -9347,6 +9407,25 @@ declare type OptionsChangedEvent = BaseEvent_5 & {
9347
9407
  diff: OpenFin_2.WindowOptionDiff;
9348
9408
  };
9349
9409
 
9410
+ /**
9411
+ * @interface
9412
+ * The keys represent the output from calling individual Node `os` APIs.
9413
+ * For example, `userInfo` will have the output of calling `os.userInfo()`. For more information
9414
+ * see [Node `os` API docs](https://nodejs.org/docs/latest-v20.x/api/os.html)
9415
+ */
9416
+ declare type OSInfo = {
9417
+ platform: string;
9418
+ release: string;
9419
+ version: string;
9420
+ /**
9421
+ * Throws if a user has no username or homedir.
9422
+ * See [Node os.userInfo docs for more info](https://nodejs.org/docs/latest-v20.x/api/os.html#osuserinfooptions)
9423
+ */
9424
+ userInfo: NodeUserInfo;
9425
+ hostname: string;
9426
+ networkInterfaces: Record<string, NodeNetworkInterfaceInfo[] | undefined>;
9427
+ };
9428
+
9350
9429
  declare type OverrideCallback<T extends any = PlatformProvider, U extends T = T> = (arg: Constructor<T>) => U | Promise<U>;
9351
9430
 
9352
9431
  /**
@@ -11608,6 +11687,8 @@ declare interface ProtocolMap extends ProtocolMapBase {
11608
11687
  };
11609
11688
  response: void;
11610
11689
  };
11690
+ 'get-host-specs': GetterCall<OpenFin_2.HostSpecs>;
11691
+ 'get-os-info': GetterCall<OpenFin_2.OSInfo>;
11611
11692
  'system-get-printers': GetterCall<OpenFin_2.PrinterInfo[]>;
11612
11693
  'system-register-shutdown-handler': VoidCall;
11613
11694
  'get-domain-settings': ApiCall<OpenFin_2.ApplicationIdentity, OpenFin_2.DefaultDomainSettings>;
@@ -11835,6 +11916,15 @@ declare interface RemoteConfig extends ExistingConnectConfig {
11835
11916
  token: string;
11836
11917
  }
11837
11918
 
11919
+ /**
11920
+ * Generated when a View is removed from a layout.
11921
+ * @interface
11922
+ */
11923
+ declare type RemovedFromLayoutEvent = BaseEvent_4 & {
11924
+ type: 'removed-from-layout';
11925
+ layoutIdentity: OpenFin_2.LayoutIdentity;
11926
+ };
11927
+
11838
11928
  /**
11839
11929
  * @interface
11840
11930
  */
@@ -12948,7 +13038,8 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12948
13038
  */
12949
13039
  getRvmInfo(): Promise<OpenFin_2.RVMInfo>;
12950
13040
  /**
12951
- * Retrieves system information.
13041
+ * Retrieves general system information. If you need more detailed information about the
13042
+ * OS and the currently logged in user, use `fin.System.getOSInfo()` instead.
12952
13043
  *
12953
13044
  * @example
12954
13045
  * ```js
@@ -12956,6 +13047,15 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12956
13047
  * ```
12957
13048
  */
12958
13049
  getHostSpecs(): Promise<OpenFin_2.HostSpecs>;
13050
+ /**
13051
+ * Retrieves information about the OS and the currently logged in user.
13052
+ *
13053
+ * @example
13054
+ * ```js
13055
+ * fin.System.getOSInfo().then(specs => console.log(specs)).catch(err => console.log(err));
13056
+ * ```
13057
+ */
13058
+ getOSInfo(): Promise<OpenFin_2.OSInfo>;
12959
13059
  /**
12960
13060
  * Runs an executable or batch file. A path to the file must be included in options.
12961
13061
  * <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
@@ -14083,6 +14183,7 @@ declare type SystemEventType = EventType_8;
14083
14183
  * @interface
14084
14184
  */
14085
14185
  declare type SystemPermissions = {
14186
+ getOSInfo: boolean;
14086
14187
  getAllExternalWindows: boolean;
14087
14188
  launchExternalProcess: boolean | {
14088
14189
  enabled: boolean;
@@ -15074,6 +15175,8 @@ declare namespace ViewEvents {
15074
15175
  BaseEvent_4 as BaseEvent,
15075
15176
  BaseViewEvent,
15076
15177
  TargetChangedEvent,
15178
+ AddedToLayoutEvent,
15179
+ RemovedFromLayoutEvent,
15077
15180
  NonPropagatedViewEvent,
15078
15181
  CreatedEvent,
15079
15182
  DestroyedEvent,
package/out/mock.d.ts CHANGED
@@ -45,6 +45,15 @@ declare type Accelerator = {
45
45
  zoom: boolean;
46
46
  };
47
47
 
48
+ /**
49
+ * Generated when a View is added to a layout.
50
+ * @interface
51
+ */
52
+ declare type AddedToLayoutEvent = BaseEvent_4 & {
53
+ type: 'added-to-layout';
54
+ layoutIdentity: OpenFin_2.LayoutIdentity;
55
+ };
56
+
48
57
  /**
49
58
  * Options to use when adding a view to a {@link TabStack}.
50
59
  *
@@ -3761,6 +3770,7 @@ declare type ContainerCreatedEvent = LayoutDOMEvent & {
3761
3770
 
3762
3771
  /**
3763
3772
  * Generated when content navigation or redirection is blocked by {@link OpenFin.DomainSettings}.
3773
+ * @interface
3764
3774
  */
3765
3775
  declare type ContentBlockedEvent = NamedEvent & {
3766
3776
  type: 'content-blocked';
@@ -4773,6 +4783,7 @@ declare type ErrorPlainObject = {
4773
4783
  stack?: string;
4774
4784
  message: string;
4775
4785
  name?: string;
4786
+ cause?: Error | ErrorPlainObject;
4776
4787
  toString(): string;
4777
4788
  };
4778
4789
 
@@ -4821,7 +4832,7 @@ declare type Event_3 = ViewEvents.PropagatedEvent<'application'> | WindowEvents.
4821
4832
  */
4822
4833
  declare type Event_4 = (WebContentsEvents.Event<'view'> & {
4823
4834
  target: OpenFin_2.Identity;
4824
- }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent;
4835
+ }) | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent | HostContextChangedEvent | AddedToLayoutEvent | RemovedFromLayoutEvent;
4825
4836
 
4826
4837
  /**
4827
4838
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing events shared by all WebContents elements
@@ -8513,6 +8524,23 @@ declare type LogLevel = OpenFin_2.LogLevel;
8513
8524
  */
8514
8525
  declare type LogLevel_2 = 'verbose' | 'info' | 'warning' | 'error' | 'fatal';
8515
8526
 
8527
+ declare type LogUploaderUIOptions = {
8528
+ title?: string;
8529
+ icon?: string;
8530
+ header?: string;
8531
+ description?: string;
8532
+ email?: string;
8533
+ website?: string;
8534
+ websiteDescription?: string;
8535
+ };
8536
+
8537
+ declare type LogUploadOptions = {
8538
+ endpoint: string;
8539
+ manifests?: string[];
8540
+ logs?: string[];
8541
+ ui?: LogUploaderUIOptions;
8542
+ };
8543
+
8516
8544
  /**
8517
8545
  * @interface
8518
8546
  */
@@ -8571,6 +8599,7 @@ declare type Manifest = {
8571
8599
  enableErrorReporting?: boolean;
8572
8600
  };
8573
8601
  interopBrokerConfiguration: InteropBrokerOptions;
8602
+ logUpload?: LogUploadOptions;
8574
8603
  };
8575
8604
 
8576
8605
  /**
@@ -9214,6 +9243,34 @@ declare type NavigationRules = {
9214
9243
 
9215
9244
  declare type NewConnectConfig = ConfigWithUuid & ConfigWithRuntime;
9216
9245
 
9246
+ declare interface NodeNetworkInterfaceBase {
9247
+ address: string;
9248
+ netmask: string;
9249
+ mac: string;
9250
+ internal: boolean;
9251
+ cidr: string | null;
9252
+ }
9253
+
9254
+ declare type NodeNetworkInterfaceInfo = NodeNetworkInterfaceInfoIPv4 | NodeNetworkInterfaceInfoIPv6;
9255
+
9256
+ declare interface NodeNetworkInterfaceInfoIPv4 extends NodeNetworkInterfaceBase {
9257
+ family: 'IPv4';
9258
+ scopeid?: undefined;
9259
+ }
9260
+
9261
+ declare interface NodeNetworkInterfaceInfoIPv6 extends NodeNetworkInterfaceBase {
9262
+ family: 'IPv6';
9263
+ scopeid: number;
9264
+ }
9265
+
9266
+ declare interface NodeUserInfo {
9267
+ username: string;
9268
+ uid: number;
9269
+ gid: number;
9270
+ shell: string | null;
9271
+ homedir: string;
9272
+ }
9273
+
9217
9274
  /**
9218
9275
  * @interface
9219
9276
  */
@@ -9426,6 +9483,8 @@ declare namespace OpenFin_2 {
9426
9483
  PlatformViewCreationOptions,
9427
9484
  ProcessAffinityStrategy,
9428
9485
  PlatformOptions,
9486
+ LogUploaderUIOptions,
9487
+ LogUploadOptions,
9429
9488
  Manifest,
9430
9489
  LayoutContent,
9431
9490
  LayoutItemConfig,
@@ -9453,6 +9512,7 @@ declare namespace OpenFin_2 {
9453
9512
  Time,
9454
9513
  CpuInfo,
9455
9514
  GpuInfo,
9515
+ OSInfo,
9456
9516
  HostSpecs,
9457
9517
  PrinterInfo_2 as PrinterInfo,
9458
9518
  Dpi,
@@ -9662,6 +9722,25 @@ declare type OptionsChangedEvent = BaseEvent_5 & {
9662
9722
  diff: OpenFin_2.WindowOptionDiff;
9663
9723
  };
9664
9724
 
9725
+ /**
9726
+ * @interface
9727
+ * The keys represent the output from calling individual Node `os` APIs.
9728
+ * For example, `userInfo` will have the output of calling `os.userInfo()`. For more information
9729
+ * see [Node `os` API docs](https://nodejs.org/docs/latest-v20.x/api/os.html)
9730
+ */
9731
+ declare type OSInfo = {
9732
+ platform: string;
9733
+ release: string;
9734
+ version: string;
9735
+ /**
9736
+ * Throws if a user has no username or homedir.
9737
+ * See [Node os.userInfo docs for more info](https://nodejs.org/docs/latest-v20.x/api/os.html#osuserinfooptions)
9738
+ */
9739
+ userInfo: NodeUserInfo;
9740
+ hostname: string;
9741
+ networkInterfaces: Record<string, NodeNetworkInterfaceInfo[] | undefined>;
9742
+ };
9743
+
9665
9744
  declare type OverrideCallback<T extends any = PlatformProvider, U extends T = T> = (arg: Constructor<T>) => U | Promise<U>;
9666
9745
 
9667
9746
  /**
@@ -12001,6 +12080,8 @@ declare interface ProtocolMap extends ProtocolMapBase {
12001
12080
  };
12002
12081
  response: void;
12003
12082
  };
12083
+ 'get-host-specs': GetterCall<OpenFin_2.HostSpecs>;
12084
+ 'get-os-info': GetterCall<OpenFin_2.OSInfo>;
12004
12085
  'system-get-printers': GetterCall<OpenFin_2.PrinterInfo[]>;
12005
12086
  'system-register-shutdown-handler': VoidCall;
12006
12087
  'get-domain-settings': ApiCall<OpenFin_2.ApplicationIdentity, OpenFin_2.DefaultDomainSettings>;
@@ -12228,6 +12309,15 @@ declare interface RemoteConfig extends ExistingConnectConfig {
12228
12309
  token: string;
12229
12310
  }
12230
12311
 
12312
+ /**
12313
+ * Generated when a View is removed from a layout.
12314
+ * @interface
12315
+ */
12316
+ declare type RemovedFromLayoutEvent = BaseEvent_4 & {
12317
+ type: 'removed-from-layout';
12318
+ layoutIdentity: OpenFin_2.LayoutIdentity;
12319
+ };
12320
+
12231
12321
  /**
12232
12322
  * @interface
12233
12323
  */
@@ -13347,7 +13437,8 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
13347
13437
  */
13348
13438
  getRvmInfo(): Promise<OpenFin_2.RVMInfo>;
13349
13439
  /**
13350
- * Retrieves system information.
13440
+ * Retrieves general system information. If you need more detailed information about the
13441
+ * OS and the currently logged in user, use `fin.System.getOSInfo()` instead.
13351
13442
  *
13352
13443
  * @example
13353
13444
  * ```js
@@ -13355,6 +13446,15 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
13355
13446
  * ```
13356
13447
  */
13357
13448
  getHostSpecs(): Promise<OpenFin_2.HostSpecs>;
13449
+ /**
13450
+ * Retrieves information about the OS and the currently logged in user.
13451
+ *
13452
+ * @example
13453
+ * ```js
13454
+ * fin.System.getOSInfo().then(specs => console.log(specs)).catch(err => console.log(err));
13455
+ * ```
13456
+ */
13457
+ getOSInfo(): Promise<OpenFin_2.OSInfo>;
13358
13458
  /**
13359
13459
  * Runs an executable or batch file. A path to the file must be included in options.
13360
13460
  * <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
@@ -14482,6 +14582,7 @@ declare type SystemEventType = EventType_8;
14482
14582
  * @interface
14483
14583
  */
14484
14584
  declare type SystemPermissions = {
14585
+ getOSInfo: boolean;
14485
14586
  getAllExternalWindows: boolean;
14486
14587
  launchExternalProcess: boolean | {
14487
14588
  enabled: boolean;
@@ -15517,6 +15618,8 @@ declare namespace ViewEvents {
15517
15618
  BaseEvent_4 as BaseEvent,
15518
15619
  BaseViewEvent,
15519
15620
  TargetChangedEvent,
15621
+ AddedToLayoutEvent,
15622
+ RemovedFromLayoutEvent,
15520
15623
  NonPropagatedViewEvent,
15521
15624
  CreatedEvent,
15522
15625
  DestroyedEvent,
package/out/mock.js CHANGED
@@ -620,19 +620,57 @@ transportErrors.NotImplementedError = NotImplementedError;
620
620
  class NotSupportedError extends Error {
621
621
  }
622
622
  transportErrors.NotSupportedError = NotSupportedError;
623
- class InternalError extends Error {
623
+ class DeserializedError extends Error {
624
624
  constructor(err) {
625
625
  const { message, name, stack, ...rest } = err;
626
626
  super(message);
627
+ if ('cause' in err && err.cause) {
628
+ this.cause = new DeserializedError(err.cause);
629
+ }
627
630
  this.name = name || 'Error';
628
631
  this.stack = stack ?? this.toString();
629
- Object.keys(rest).forEach(key => {
632
+ Object.keys(rest)
633
+ .filter((k) => k !== 'cause')
634
+ .forEach((key) => {
630
635
  this[key] = rest[key];
631
636
  });
632
637
  }
633
638
  }
634
639
  // For documentation of the error methods being used see here: https://v8.dev/docs/stack-trace-api
635
640
  class RuntimeError extends Error {
641
+ static trimEndCallSites(err, takeUntilRegex) {
642
+ // save original props
643
+ const length = Error.stackTraceLimit;
644
+ // eslint-disable-next-line no-underscore-dangle
645
+ const _prepareStackTrace = Error.prepareStackTrace;
646
+ // This will be called when we access the `stack` property
647
+ Error.prepareStackTrace = (_, stack) => stack;
648
+ // in channel errors, the error was already serialized so we need to handle both string and CallSite[]
649
+ const isString = typeof err.stack === 'string';
650
+ const stack = (isString ? err.stack?.split('\n') : err.stack) ?? [];
651
+ // restore original props
652
+ Error.prepareStackTrace = _prepareStackTrace;
653
+ Error.stackTraceLimit = length;
654
+ // stack is optional in non chromium contexts
655
+ if (stack.length) {
656
+ const newStack = [];
657
+ // remove this call ONLY if it's not a string
658
+ for (const line of isString ? stack : stack.slice(1)) {
659
+ // inclusive take until
660
+ newStack.push(line);
661
+ if (takeUntilRegex.test(line.toString())) {
662
+ break;
663
+ }
664
+ }
665
+ if (isString) {
666
+ // maintain it as a string
667
+ err.stack = newStack.join('\n');
668
+ }
669
+ else {
670
+ err.stack = RuntimeError.prepareStackTrace(err, newStack);
671
+ }
672
+ }
673
+ }
636
674
  static getCallSite(callsToRemove = 0) {
637
675
  const length = Error.stackTraceLimit;
638
676
  const realCallsToRemove = callsToRemove + 1; // remove this call;
@@ -651,21 +689,82 @@ class RuntimeError extends Error {
651
689
  if (typeof Error.prepareStackTrace === 'function') {
652
690
  return Error.prepareStackTrace(err, callSites);
653
691
  }
654
- let string = "";
655
- string += err.name || "Error";
656
- string += `: ${err.message || ""}`;
657
- for (const callSite of callSites) {
658
- string += `\n at ${callSite.toString()}`;
659
- }
660
- return string;
661
- }
662
- ;
692
+ // TODO: this is just a first iteration, we can make this "nicer" at some point
693
+ // const EXCLUSIONS = ['IpcRenderer', 'Object.onMessage', 'Transport.onmessage', 'MessageReceiver.onmessage'];
694
+ let stackTrace = `${err.name || 'Error'}: ${err.message || ''}\n`;
695
+ stackTrace += callSites
696
+ .map((line) => ` at ${line}`)
697
+ // .filter((line) => !EXCLUSIONS.some((l) => line.includes(l)))
698
+ .join('\n');
699
+ return stackTrace;
700
+ }
701
+ /*
702
+
703
+ NON filtered stack trace example from MTP page channel-errors.tsx:
704
+
705
+ Caused by: ChannelError: Error from ch0
706
+ at ChannelClient.dispatch (<anonymous>:3:119560)
707
+ at eval (test-channel-errors.tsx:73:26)
708
+ at ChannelProvider.processAction (<anonymous>:3:116748)
709
+ at ChannelProvider.processAction (<anonymous>:3:149121)
710
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
711
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
712
+ at Transport.onmessage (<anonymous>:3:282049)
713
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
714
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
715
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
716
+ Caused by: ChannelError: Error from ch0
717
+ at ChannelClient.dispatch (<anonymous>:3:119560)
718
+ at eval (test-channel-errors.tsx:73:26)
719
+ at ChannelProvider.processAction (<anonymous>:3:116748)
720
+ at ChannelProvider.processAction (<anonymous>:3:149121)
721
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
722
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
723
+ at Transport.onmessage (<anonymous>:3:282049)
724
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
725
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
726
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
727
+ Caused by: ChannelError: Error from ch0
728
+ at ChannelClient.dispatch (<anonymous>:3:119560)
729
+ at eval (test-channel-errors.tsx:73:26)
730
+ at ChannelProvider.processAction (<anonymous>:3:116748)
731
+ at ChannelProvider.processAction (<anonymous>:3:149121)
732
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
733
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
734
+ at Transport.onmessage (<anonymous>:3:282049)
735
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
736
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
737
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
738
+ Caused by: ChannelError: Error from ch0
739
+ at ChannelClient.dispatch (<anonymous>:3:119560)
740
+ at eval (test-channel-errors.tsx:50:23)
741
+ at ChannelProvider.processAction (<anonymous>:3:116748)
742
+ at ChannelProvider.processAction (<anonymous>:3:149121)
743
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
744
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
745
+ at Transport.onmessage (<anonymous>:3:282049)
746
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
747
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
748
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
749
+ Caused by: Error: Error from ch0
750
+ at eval (test-channel-errors.tsx:54:19)
751
+ at ChannelProvider.processAction (<anonymous>:3:116748)
752
+ at ChannelProvider.processAction (<anonymous>:3:149121)
753
+ at MessageReceiver.processChannelMessage (<anonymous>:3:131909)
754
+ at MessageReceiver.onmessage (<anonymous>:3:131232)
755
+ at Transport.onmessage (<anonymous>:3:282049)
756
+ at IpcRenderer.<anonymous> (<anonymous>:3:275150)
757
+ at IpcRenderer.emit (node:electron/js2c/sandbox_bundle:2:34834)
758
+ at Object.onMessage (node:electron/js2c/sandbox_bundle:2:51566)
759
+
760
+
761
+ */
663
762
  constructor(payload, callSites) {
664
763
  const { reason, error } = payload;
665
764
  super(reason);
666
- this.name = 'RuntimeError';
765
+ this.name = this.constructor.name;
667
766
  if (error?.stack) {
668
- this.cause = new InternalError(error);
767
+ this.cause = new DeserializedError(error);
669
768
  }
670
769
  if (callSites) {
671
770
  this.stack = RuntimeError.prepareStackTrace(this, callSites);
@@ -3016,9 +3115,14 @@ function requireInstance$2 () {
3016
3115
  // don't expose
3017
3116
  });
3018
3117
  const layoutWindow = await this.getCurrentWindow();
3118
+ let layoutWindowIdentity = layoutWindow.identity;
3119
+ // TODO: CORE-1857 - when we tearout active layout or drag a view out of a window, the above identity includes the whole window info.
3120
+ if (layoutWindowIdentity.identity) {
3121
+ layoutWindowIdentity = layoutWindowIdentity.identity;
3122
+ }
3019
3123
  try {
3020
3124
  const providerChannelClient = await __classPrivateFieldGet(this, _View_providerChannelClient, "f").getValue();
3021
- const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindow.identity);
3125
+ const client = await layout_entities_1.LayoutNode.newLayoutEntitiesClient(providerChannelClient, layout_constants_1.LAYOUT_CONTROLLER_ID, layoutWindowIdentity);
3022
3126
  const layoutIdentity = await client.getLayoutIdentityForViewOrThrow(this.identity);
3023
3127
  return this.fin.Platform.Layout.wrap(layoutIdentity);
3024
3128
  }
@@ -3031,7 +3135,7 @@ function requireInstance$2 () {
3031
3135
  throw e;
3032
3136
  }
3033
3137
  // fallback logic for missing endpoint
3034
- return this.fin.Platform.Layout.wrap(layoutWindow.identity);
3138
+ return this.fin.Platform.Layout.wrap(layoutWindowIdentity);
3035
3139
  }
3036
3140
  };
3037
3141
  /**
@@ -5907,7 +6011,7 @@ function requireWindow () {
5907
6011
  Object.defineProperty(system, "__esModule", { value: true });
5908
6012
  system.System = void 0;
5909
6013
  const base_1$i = base;
5910
- const transport_errors_1$1 = transportErrors;
6014
+ const transport_errors_1$5 = transportErrors;
5911
6015
  const window_1 = requireWindow();
5912
6016
  const events_1$6 = require$$0;
5913
6017
  /**
@@ -6393,7 +6497,8 @@ class System extends base_1$i.EmitterBase {
6393
6497
  return this.wire.sendAction('get-rvm-info').then(({ payload }) => payload.data);
6394
6498
  }
6395
6499
  /**
6396
- * Retrieves system information.
6500
+ * Retrieves general system information. If you need more detailed information about the
6501
+ * OS and the currently logged in user, use `fin.System.getOSInfo()` instead.
6397
6502
  *
6398
6503
  * @example
6399
6504
  * ```js
@@ -6403,6 +6508,17 @@ class System extends base_1$i.EmitterBase {
6403
6508
  getHostSpecs() {
6404
6509
  return this.wire.sendAction('get-host-specs').then(({ payload }) => payload.data);
6405
6510
  }
6511
+ /**
6512
+ * Retrieves information about the OS and the currently logged in user.
6513
+ *
6514
+ * @example
6515
+ * ```js
6516
+ * fin.System.getOSInfo().then(specs => console.log(specs)).catch(err => console.log(err));
6517
+ * ```
6518
+ */
6519
+ getOSInfo() {
6520
+ return this.wire.sendAction('get-os-info').then(({ payload }) => payload.data);
6521
+ }
6406
6522
  /**
6407
6523
  * Runs an executable or batch file. A path to the file must be included in options.
6408
6524
  * <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
@@ -6985,9 +7101,9 @@ class System extends base_1$i.EmitterBase {
6985
7101
  });
6986
7102
  // node.js environment not supported
6987
7103
  if (this.wire.environment.type !== 'openfin') {
6988
- throw new transport_errors_1$1.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
7104
+ throw new transport_errors_1$5.NotSupportedError('downloadAsset only supported in an OpenFin Render process');
6989
7105
  }
6990
- const callSite = transport_errors_1$1.RuntimeError.getCallSite();
7106
+ const callSite = transport_errors_1$5.RuntimeError.getCallSite();
6991
7107
  const downloadId = this.wire.environment.getNextMessageId().toString();
6992
7108
  const dlProgressKey = `asset-download-progress-${downloadId}`;
6993
7109
  const dlErrorKey = `asset-download-error-${downloadId}`;
@@ -7007,7 +7123,7 @@ class System extends base_1$i.EmitterBase {
7007
7123
  const dlError = (payload) => {
7008
7124
  cleanListeners();
7009
7125
  const { reason, err: error } = payload;
7010
- reject(new transport_errors_1$1.RuntimeError({ reason, error }, callSite));
7126
+ reject(new transport_errors_1$5.RuntimeError({ reason, error }, callSite));
7011
7127
  };
7012
7128
  const dlComplete = () => {
7013
7129
  cleanListeners();
@@ -7058,11 +7174,11 @@ class System extends base_1$i.EmitterBase {
7058
7174
  * ```
7059
7175
  */
7060
7176
  downloadRuntime(options, progressListener) {
7061
- const callsites = transport_errors_1$1.RuntimeError.getCallSite();
7177
+ const callsites = transport_errors_1$5.RuntimeError.getCallSite();
7062
7178
  return new Promise((resolve, reject) => {
7063
7179
  // node.js environment not supported
7064
7180
  if (this.wire.environment.type !== 'openfin') {
7065
- reject(new transport_errors_1$1.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
7181
+ reject(new transport_errors_1$5.NotSupportedError('downloadRuntime only supported in an OpenFin Render process'));
7066
7182
  return;
7067
7183
  }
7068
7184
  const downloadId = this.wire.environment.getNextMessageId().toString();
@@ -7084,7 +7200,7 @@ class System extends base_1$i.EmitterBase {
7084
7200
  const dlError = (payload) => {
7085
7201
  cleanListeners();
7086
7202
  const { reason, err: error } = payload;
7087
- reject(new transport_errors_1$1.RuntimeError({ reason, error }, callsites));
7203
+ reject(new transport_errors_1$5.RuntimeError({ reason, error }, callsites));
7088
7204
  };
7089
7205
  const dlComplete = () => {
7090
7206
  cleanListeners();
@@ -7819,6 +7935,7 @@ var channel = {};
7819
7935
 
7820
7936
  Object.defineProperty(channel, "__esModule", { value: true });
7821
7937
  channel.ChannelBase = channel.ProtectedItems = void 0;
7938
+ const transport_errors_1$4 = transportErrors;
7822
7939
  const resultOrPayload = (func) => async (topic, payload, senderIdentity) => {
7823
7940
  const res = await func(topic, payload, senderIdentity);
7824
7941
  return res === undefined ? payload : res;
@@ -7851,6 +7968,7 @@ class ChannelBase {
7851
7968
  return this.postAction ? await this.postAction(topic, actionProcessed, senderIdentity) : actionProcessed;
7852
7969
  }
7853
7970
  catch (e) {
7971
+ transport_errors_1$4.RuntimeError.trimEndCallSites(e, /Channel.*processAction/);
7854
7972
  if (this.errorMiddleware) {
7855
7973
  return this.errorMiddleware(topic, e, senderIdentity);
7856
7974
  }
@@ -8152,6 +8270,25 @@ class ChannelBase {
8152
8270
  }
8153
8271
  channel.ChannelBase = ChannelBase;
8154
8272
 
8273
+ var channelError = {};
8274
+
8275
+ Object.defineProperty(channelError, "__esModule", { value: true });
8276
+ channelError.ChannelError = void 0;
8277
+ const transport_errors_1$3 = transportErrors;
8278
+ class ChannelError extends Error {
8279
+ constructor(originalError, action, dispatchPayload, callsites) {
8280
+ super(originalError.message);
8281
+ this.action = action;
8282
+ this.dispatchPayload = dispatchPayload;
8283
+ this.name = this.constructor.name;
8284
+ if ('cause' in originalError && originalError.cause instanceof Error) {
8285
+ this.cause = originalError.cause;
8286
+ }
8287
+ this.stack = transport_errors_1$3.RuntimeError.prepareStackTrace(this, callsites);
8288
+ }
8289
+ }
8290
+ channelError.ChannelError = ChannelError;
8291
+
8155
8292
  var __classPrivateFieldGet$c = (commonjsGlobal && commonjsGlobal.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8156
8293
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
8157
8294
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
@@ -8166,7 +8303,9 @@ var __classPrivateFieldSet$a = (commonjsGlobal && commonjsGlobal.__classPrivateF
8166
8303
  var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
8167
8304
  Object.defineProperty(client, "__esModule", { value: true });
8168
8305
  client.ChannelClient = void 0;
8306
+ const transport_errors_1$2 = transportErrors;
8169
8307
  const channel_1$1 = channel;
8308
+ const channel_error_1$1 = channelError;
8170
8309
  const channelClientsByEndpointId = new Map();
8171
8310
  /**
8172
8311
  * Instance created to enable use of a channel as a client. Allows for communication with the
@@ -8268,7 +8407,10 @@ class ChannelClient extends channel_1$1.ChannelBase {
8268
8407
  */
8269
8408
  async dispatch(action, payload) {
8270
8409
  if (__classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").isEndpointConnected(this.providerIdentity.channelId)) {
8271
- return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload);
8410
+ const callSites = transport_errors_1$2.RuntimeError.getCallSite();
8411
+ return __classPrivateFieldGet$c(this, _ChannelClient_strategy, "f").send(this.providerIdentity.channelId, action, payload).catch((e) => {
8412
+ throw new channel_error_1$1.ChannelError(e, action, payload, callSites);
8413
+ });
8272
8414
  }
8273
8415
  throw new Error('The client you are trying to dispatch from is disconnected from the target provider.');
8274
8416
  }
@@ -8383,7 +8525,7 @@ class ClassicStrategy {
8383
8525
  _ClassicStrategy_endpointIdentityMap.set(this, new Map());
8384
8526
  // Store a set of cancellable promises to be able to reject them when client
8385
8527
  // connection problems occur
8386
- _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map);
8528
+ _ClassicStrategy_pendingMessagesByEndpointId.set(this, new Map());
8387
8529
  this.send = async (endpointId, action, payload) => {
8388
8530
  const to = __classPrivateFieldGet$b(this, _ClassicStrategy_endpointIdentityMap, "f").get(endpointId);
8389
8531
  if (!to) {
@@ -8397,17 +8539,21 @@ class ClassicStrategy {
8397
8539
  }
8398
8540
  delete cleanId.isLocalEndpointId;
8399
8541
  // grab the promise before awaiting it to save in our pending messages map
8400
- const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f")
8401
- .sendAction('send-channel-message', {
8542
+ const p = __classPrivateFieldGet$b(this, _ClassicStrategy_wire, "f").sendAction('send-channel-message', {
8402
8543
  ...cleanId,
8403
8544
  providerIdentity: this.providerIdentity,
8404
8545
  action,
8405
8546
  payload
8406
8547
  });
8407
8548
  __classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.add(p);
8408
- const raw = await p.catch((error) => {
8549
+ const raw = await p
8550
+ .catch((error) => {
8551
+ if ('cause' in error) {
8552
+ throw error;
8553
+ }
8409
8554
  throw new Error(error.message);
8410
- }).finally(() => {
8555
+ })
8556
+ .finally(() => {
8411
8557
  // clean up the pending promise
8412
8558
  __classPrivateFieldGet$b(this, _ClassicStrategy_pendingMessagesByEndpointId, "f").get(endpointId)?.delete(p);
8413
8559
  });
@@ -8461,13 +8607,17 @@ var errors = {};
8461
8607
  Object.defineProperty(errors, "__esModule", { value: true });
8462
8608
  errors.errorToPOJO = void 0;
8463
8609
  function errorToPOJO(error) {
8464
- return {
8610
+ const errorObj = {
8465
8611
  stack: error.stack,
8466
8612
  name: error.name,
8467
8613
  message: error.message,
8468
8614
  // support the case where stack is empty or missing
8469
8615
  toString: () => error.stack || error.toString()
8470
8616
  };
8617
+ if ('cause' in error) {
8618
+ errorObj.cause = errorToPOJO(error.cause);
8619
+ }
8620
+ return errorObj;
8471
8621
  }
8472
8622
  errors.errorToPOJO = errorToPOJO;
8473
8623
 
@@ -8486,7 +8636,7 @@ var _RTCEndpoint_processAction, _RTCEndpoint_disconnectListener;
8486
8636
  Object.defineProperty(endpoint, "__esModule", { value: true });
8487
8637
  endpoint.RTCEndpoint = void 0;
8488
8638
  /* eslint-disable @typescript-eslint/no-unused-vars */
8489
- const errors_1$1 = errors;
8639
+ const errors_1$2 = errors;
8490
8640
  /*
8491
8641
  This handles sending RTC messages between RTC connections over the request and response data channels.
8492
8642
  */
@@ -8575,7 +8725,7 @@ class RTCEndpoint {
8575
8725
  if (this.rtc.channels.response.readyState === 'open') {
8576
8726
  this.rtc.channels.response.send(JSON.stringify({
8577
8727
  messageId,
8578
- error: (0, errors_1$1.errorToPOJO)(error),
8728
+ error: (0, errors_1$2.errorToPOJO)(error),
8579
8729
  success: false
8580
8730
  }));
8581
8731
  }
@@ -8891,8 +9041,10 @@ var __classPrivateFieldSet$6 = (commonjsGlobal && commonjsGlobal.__classPrivateF
8891
9041
  var _ChannelProvider_connections, _ChannelProvider_protectedObj, _ChannelProvider_strategy, _ChannelProvider_removeEndpoint, _ChannelProvider_close;
8892
9042
  Object.defineProperty(provider, "__esModule", { value: true });
8893
9043
  provider.ChannelProvider = void 0;
8894
- const channel_1 = channel;
9044
+ const transport_errors_1$1 = transportErrors;
8895
9045
  const runtimeVersioning_1 = runtimeVersioning;
9046
+ const channel_1 = channel;
9047
+ const channel_error_1 = channelError;
8896
9048
  /**
8897
9049
  * Instance created to enable use of a channel as a provider. Allows for communication with the {@link ChannelClient ChannelClients} by invoking an action on
8898
9050
  * a single client via {@link ChannelProvider#dispatch dispatch} or all clients via {@link ChannelProvider#publish publish}
@@ -9009,7 +9161,10 @@ class ChannelProvider extends channel_1.ChannelBase {
9009
9161
  dispatch(to, action, payload) {
9010
9162
  const endpointId = to.endpointId ?? this.getEndpointIdForOpenFinId(to, action);
9011
9163
  if (endpointId && __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").isEndpointConnected(endpointId)) {
9012
- return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload);
9164
+ const callSites = transport_errors_1$1.RuntimeError.getCallSite();
9165
+ return __classPrivateFieldGet$8(this, _ChannelProvider_strategy, "f").send(endpointId, action, payload).catch((e) => {
9166
+ throw new channel_error_1.ChannelError(e, action, payload, callSites);
9167
+ });
9013
9168
  }
9014
9169
  return Promise.reject(new Error(`Client connection with identity uuid: ${to.uuid} / name: ${to.name} / endpointId: ${endpointId} no longer connected.`));
9015
9170
  }
@@ -9222,6 +9377,7 @@ Object.defineProperty(messageReceiver, "__esModule", { value: true });
9222
9377
  messageReceiver.MessageReceiver = void 0;
9223
9378
  const client_1$1 = client;
9224
9379
  const base_1$g = base;
9380
+ const errors_1$1 = errors;
9225
9381
  /*
9226
9382
  This is a singleton (per fin object) tasked with routing messages coming off the ipc to the correct endpoint.
9227
9383
  It needs to be a singleton because there can only be one per wire. It tracks both clients and providers' processAction passed in via the strategy.
@@ -9250,6 +9406,7 @@ class MessageReceiver extends base_1$g.Base {
9250
9406
  if (!handler) {
9251
9407
  ackToSender.payload.success = false;
9252
9408
  ackToSender.payload.reason = `Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${key} no longer connected.`;
9409
+ ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(new Error(ackToSender.payload.reason));
9253
9410
  return this.wire.sendRaw(ackToSender);
9254
9411
  }
9255
9412
  try {
@@ -9261,6 +9418,7 @@ class MessageReceiver extends base_1$g.Base {
9261
9418
  catch (e) {
9262
9419
  ackToSender.payload.success = false;
9263
9420
  ackToSender.payload.reason = e.message;
9421
+ ackToSender.payload.error = (0, errors_1$1.errorToPOJO)(e);
9264
9422
  return this.wire.sendRaw(ackToSender);
9265
9423
  }
9266
9424
  }
@@ -17269,7 +17427,10 @@ class Transport extends events_1$1.EventEmitter {
17269
17427
  }
17270
17428
  else {
17271
17429
  console.warn('Received invalid response from core', data);
17272
- handleNack({ reason: 'invalid response shape' });
17430
+ handleNack({
17431
+ reason: 'invalid response shape',
17432
+ error: (0, errors_1.errorToPOJO)(new Error('Invalid response shape'))
17433
+ });
17273
17434
  }
17274
17435
  }
17275
17436
  else if (!data.payload.success) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "40.82.2",
3
+ "version": "40.82.4",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/mock.js",