From facb4b182903effb94da4626d74f923ddcdc6194 Mon Sep 17 00:00:00 2001
From: licui
Date: Wed, 31 Oct 2018 15:48:43 -0400
Subject: [PATCH] Update external process shapes from v1 to v2
---
.../_v2/api/system/external-process.d.ts | 20 ++++-
types/openfin/_v2/api/system/system.d.ts | 6 +-
types/openfin/index.d.ts | 77 +------------------
3 files changed, 22 insertions(+), 81 deletions(-)
diff --git a/types/openfin/_v2/api/system/external-process.d.ts b/types/openfin/_v2/api/system/external-process.d.ts
index 8a68f1eae3..624c93ea18 100644
--- a/types/openfin/_v2/api/system/external-process.d.ts
+++ b/types/openfin/_v2/api/system/external-process.d.ts
@@ -1,7 +1,17 @@
export interface ExternalProcessRequestType {
- path: string;
- arguments: string;
- listener: LaunchExternalProcessListener;
+ path?: string;
+ alias?: string;
+ arguments?: string;
+ listener?: LaunchExternalProcessListener;
+ lifetime?: string;
+ certificate?: CertificationInfo;
+}
+export interface CertificationInfo {
+ serial?: string;
+ subject?: string;
+ publickey?: string;
+ thumbprint?: string;
+ trusted?: boolean;
}
export interface ExitCode {
topic: string;
@@ -20,3 +30,7 @@ export interface ExternalConnection {
token: string;
uuid: string;
}
+export interface ExternalProcessInfo {
+ pid: number;
+ listener?: LaunchExternalProcessListener;
+}
diff --git a/types/openfin/_v2/api/system/system.d.ts b/types/openfin/_v2/api/system/system.d.ts
index 88a37d0b26..76f244cabf 100644
--- a/types/openfin/_v2/api/system/system.d.ts
+++ b/types/openfin/_v2/api/system/system.d.ts
@@ -12,7 +12,7 @@ import { RVMInfo } from './rvm';
import { RuntimeInfo } from './runtime-info';
import { Entity, EntityInfo } from './entity';
import { HostSpecs } from './host-specs';
-import { ExternalProcessRequestType, TerminateExternalRequestType, ExternalConnection } from './external-process';
+import { ExternalProcessRequestType, TerminateExternalRequestType, ExternalConnection, ExternalProcessInfo } from './external-process';
import Transport from '../../transport/transport';
import { CookieInfo, CookieOption } from './cookie';
import { RegistryInfo } from './registry-info';
@@ -454,11 +454,11 @@ export default class System extends EmitterBase {
launchExternalProcess(options: ExternalProcessRequestType): Promise;
/**
* Monitors a running process.
- * @param { number } pid See tutorial for more details
+ * @param { ExternalProcessInfo } options See tutorial for more details
* @return {Promise.}
* @tutorial System.monitorExternalProcess
*/
- monitorExternalProcess(pid: number): Promise;
+ monitorExternalProcess(options: ExternalProcessInfo): Promise;
/**
* Writes the passed message into both the log file and the console.
* @param { string } level The log level for the entry. Can be either "info", "warning" or "error"
diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts
index b77b91eba5..41e35c0c45 100644
--- a/types/openfin/index.d.ts
+++ b/types/openfin/index.d.ts
@@ -34,6 +34,7 @@ import { CookieInfo, CookieOption } from './_v2/api/system/cookie';
import { AppAssetInfo, AppAssetRequest, RuntimeDownloadOptions, RuntimeDownloadProgress } from './_v2/api/system/download-asset';
import { DownloadPreloadInfo, DownloadPreloadOption } from './_v2/api/system/download-preload';
import { EntityInfo } from './_v2/api/system/entity';
+import { ExternalProcessRequestType, ExternalProcessInfo } from './_v2/api/system/external-process';
import { HostSpecs } from './_v2/api/system/host-specs';
import { LogInfo } from './_v2/api/system/log';
import { MonitorInfo } from './_v2/api/system/monitor';
@@ -584,7 +585,7 @@ declare namespace fin {
/**
* Runs an executable or batch file.
*/
- launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void;
+ launchExternalProcess(options: ExternalProcessRequestType, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void;
/**
* Writes the passed message into both the log file and the console.
*/
@@ -657,80 +658,6 @@ declare namespace fin {
updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void;
}
- interface ExternalProcessLaunchInfo {
- path?: string;
- /**
- * Additionally note that the executable found in the zip file specified in appAssets
- * will default to the one mentioned by appAssets.target
- * If the the path below refers to a specific path it will override this default
- */
- alias?: string;
- /**
- * When using alias; if no arguments are passed then the arguments (if any)
- * are taken from the 'app.json' file, from the 'args' parameter
- * of the 'appAssets' Object with the relevant 'alias'.
- * If 'arguments' is passed as a parameter it takes precedence
- * over any 'args' set in the 'app.json'.
- */
- arguments?: string;
- listener?(result: {
- /**
- * "Exited" Or "released" on a call to releaseExternalProcess
- */
- topic?: string;
- /**
- * The mapped UUID which identifies the launched process
- */
- uuid?: string;
- /*
- * Process exit code
- */
- exitCode?: number;
- }): void;
- certificate?: CertificationInfo;
- }
-
- interface CertificationInfo {
- /**
- * A hex string with or without spaces
- */
- serial?: string;
- /**
- * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields
- */
- subject?: string;
- /**
- * A hex string with or without spaces
- */
- publickey?: string;
- /**
- * A hex string with or without spaces
- */
- thumbprint?: string;
- /**
- * A boolean indicating that the certificate is trusted and not revoked
- */
- trusted?: boolean;
- }
-
- interface ExternalProcessInfo {
- pid?: number;
- listener?(result: {
- /**
- * "Exited" Or "released" on a call to releaseExternalProcess
- */
- topic?: string;
- /**
- * The mapped UUID which identifies the launched process
- */
- uuid?: string;
- /*
- * Process exit code
- */
- exitCode?: number;
- }): void;
- }
-
interface OpenFinWindowStatic {
/**
* Class: Window