Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new type PlatfromInteropBrokerHelpers which extends ModuleHelpers #724

Merged
merged 43 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5d3a5ed
Add additional action for a workspace lifecycle event.
johnman Apr 10, 2024
2b0b4f1
Improving FDC3 docs to make it easier to learn about fdc3 (#704)
johnman Apr 11, 2024
1a52503
Merge branch 'main' into workspace/vnext
johnman Apr 12, 2024
194d60c
Update versioning in docs
johnman Apr 12, 2024
11f4a28
Window state improvements and dependency pinning.
johnman Apr 12, 2024
fc8bbdb
Update the launch script for workspace v18
johnman Apr 12, 2024
bbbb95e
Include window state on page save
johnman Apr 12, 2024
bbc2630
Remove rspack
johnman Apr 12, 2024
94a2ffe
Gave greater control over what is built.
johnman Apr 12, 2024
6592b97
Added Cloud Interop support with documentation.
johnman Apr 12, 2024
a92d043
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman Apr 12, 2024
bf7ffcf
Added option of creating analytics for your modules (except analytics…
johnman Apr 16, 2024
fd4c413
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman Apr 16, 2024
c9e78ce
Bump versions for v18 Beta Release
johnman Apr 18, 2024
d00722d
Improved how appIds associated with views/windows are validated (#708)
johnman Apr 19, 2024
d8d00ec
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman Apr 19, 2024
ec1bc66
Updated Snap to 0.3.0 (#710)
johnman Apr 23, 2024
c998fc8
Merge branch 'main' into workspace/vnext
johnman Apr 23, 2024
7cc29db
Update snap version to 0.3.0
johnman Apr 23, 2024
aeea0f3
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman Apr 23, 2024
8f8aa83
Bumping runtime version to take in patched runtime.
johnman Apr 24, 2024
6f155e8
Added a classic app example and the ability to easily test snap with …
johnman Apr 25, 2024
ea4a5ea
Added restrictive model for launch external process and updated docs …
johnman Apr 26, 2024
bfa42cf
Merge branch 'main' into workspace/vnext
johnman Apr 26, 2024
cf75f82
Update version paths in snap example
johnman Apr 26, 2024
ecca673
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman Apr 26, 2024
ca95520
Update workspace to 18.0.9
johnman Apr 27, 2024
0bd7992
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman Apr 27, 2024
440480f
Update cloud interop to 0.36.11
johnman Apr 30, 2024
20e1478
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman Apr 30, 2024
44ddca2
Remove native ui automation until a review is performed.
johnman Apr 30, 2024
e1391ee
Remove automation native until after a review of dependencies. (#718)
johnman Apr 30, 2024
8d66bb6
Created 10 and 20 windows snapshot that can be loaded from Home. (#719)
ameetj85 May 7, 2024
4c391f9
Update cloud interop version
johnman May 7, 2024
2dabbae
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman May 7, 2024
9faf9d1
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman May 8, 2024
81b2a0a
Updated the common call and manager portal apps so they support runni…
johnman May 8, 2024
2ec2873
Update apps.json (#722)
ameetj85 May 9, 2024
d60cc79
Added security realm back
johnman May 10, 2024
82ae074
Merge branch 'main' into workspace/vnext
johnman May 10, 2024
269927a
Updated snapshots to reflect v18
johnman May 10, 2024
3853751
Merge remote-tracking branch 'origin/workspace/v18.0.0' into workspac…
johnman May 13, 2024
f02a5af
Added PlatformInteropBrokerHelpers type which has has access to all a…
johnman May 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions how-to/workspace-platform-starter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## v18.0.0

- Update the interop broker override module pattern so that it is now passed a PlatformInteropBrokerHelpers object instead of the standard ModuleHelpers object. There are no additional functions at the moment but getApps returns all apps (even private ones) for the interop broker as it needs access to everything in order to perform intent resolution.
- Added example of supporting workspace and desktop browser (through openfin/core-web as part of OpenFin anywhere) to our contact and manager portal examples in public/common by importing the fin/fdc3 api if it is not available (will require being rendered in an OpenFin Web Layout: <https://github.com/built-on-openfin/web-starter/tree/web/v18.0.0>).
- More efficient validation of appIds associated with views/windows for faster interop based actions. The appId validation in our wps module (modules directory) has extracted into its own file and tests to ensure it continues to behave as expected across future updates have been added to the test directory.
- Module Helpers now provide a getAnalyticsClient (it is marked as optional and the result could be undefined so it leaves the option for it to be denied to a module or removed). This client supports a ModuleAnalytic event which will have a source of Module assigned to it (you can still specify type and use the data property to provide additional module specific information). This data will be passed to the analyticProviders that receive the Workspace Analytic events. See [How to Configure Analytics](./docs/how-to-configure-analytics.md).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import type OpenFin from "@openfin/core";
import { getApps } from "../apps";
import { createLogger } from "../logger-provider";
import { initializeModules, loadModules } from "../modules";
import type { WindowPositioningOptions } from "../shapes/browser-shapes";
import type { PlatformInteropOverride, PlatformInteropOverrideOptions } from "../shapes/interopbroker-shapes";
import type {
PlatformInteropBrokerHelpers,
PlatformInteropOverride,
PlatformInteropOverrideOptions
} from "../shapes/interopbroker-shapes";
import type { ModuleDefinition, ModuleEntry, ModuleHelpers } from "../shapes/module-shapes";
import type { PlatformProviderOptions } from "../shapes/platform-shapes";

const logger = createLogger("InteropProvider");
const allOverrides: OpenFin.ConstructorOverride<OpenFin.InteropBroker>[] = [];
let modules: ModuleEntry<PlatformInteropOverride, unknown, unknown, ModuleDefinition>[] = [];
Expand Down Expand Up @@ -43,9 +47,17 @@ export async function init(
...interopOverrideSettings?.openOptions
};

// interop broker will need access to all apps where as general modules
// have access to public apps and will need the specific appId or intent
// if they want to read/launch them.
const platformInteropBrokeHelpers: PlatformInteropBrokerHelpers = {
...helpers,
getApps
};

if (Array.isArray(moduleOptions)) {
modules = await loadModules<PlatformInteropOverride>(options.interop, "interopOverride");
await initializeModules<PlatformInteropOverride>(modules, helpers);
await initializeModules<PlatformInteropOverride>(modules, platformInteropBrokeHelpers);
}

logger.info("Getting interop overrides...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,8 @@ export interface OpenOptions {
*/
connectionTimeout?: number;
}

/**
* Interop Broker helpers provides environment methods and data.
*/
export type PlatformInteropBrokerHelpers = ModuleHelpers;
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { cloudInteropOverride } from "@openfin/cloud-interop";
import type OpenFin from "@openfin/core";
import type {
PlatformInteropOverride,
PlatformInteropOverrideOptions
PlatformInteropOverrideOptions,
PlatformInteropBrokerHelpers
} from "workspace-platform-starter/shapes/interopbroker-shapes";
import type { Logger, LoggerCreator } from "workspace-platform-starter/shapes/logger-shapes";
import type { ModuleDefinition, ModuleHelpers } from "workspace-platform-starter/shapes/module-shapes";
import type { ModuleDefinition } from "workspace-platform-starter/shapes/module-shapes";
import { isStringValue } from "workspace-platform-starter/utils";
import type { OpenFinCloudInteropOptions } from "./shapes";

Expand All @@ -30,7 +31,7 @@ export class OpenFinCloudInterop implements PlatformInteropOverride<OpenFinCloud
* Helper methods for the module.
* @internal
*/
private _helpers: ModuleHelpers | undefined;
private _helpers: PlatformInteropBrokerHelpers | undefined;

/**
* Initialize the module.
Expand All @@ -42,7 +43,7 @@ export class OpenFinCloudInterop implements PlatformInteropOverride<OpenFinCloud
public async initialize(
definition: ModuleDefinition<OpenFinCloudInteropOptions>,
loggerCreator: LoggerCreator,
helpers: ModuleHelpers
helpers: PlatformInteropBrokerHelpers
): Promise<void> {
this._definition = definition;
const loggerName = definition.data?.loggerName ?? "OpenfinCloudInterop";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import type {
IntentRegistrationPayload,
IntentTargetMetaData,
ProcessedContext,
PlatformInteropOverrideOptions
PlatformInteropOverrideOptions,
PlatformInteropBrokerHelpers
} from "workspace-platform-starter/shapes/interopbroker-shapes";
import type { Logger } from "workspace-platform-starter/shapes/logger-shapes";
import type { ModuleHelpers } from "workspace-platform-starter/shapes/module-shapes";
import {
formatError,
isEmpty,
Expand All @@ -58,7 +58,7 @@ import { IntentResolverHelper } from "./intent-resolver-helper";
export async function getConstructorOverride(
options: PlatformInteropOverrideOptions,
logger: Logger,
helpers: ModuleHelpers
helpers: PlatformInteropBrokerHelpers
): Promise<OpenFin.ConstructorOverride<OpenFin.InteropBroker>> {
if (!helpers?.getApp || !helpers?.getApps || !helpers.launchApp) {
throw new Error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import type OpenFin from "@openfin/core";
import type {
PlatformInteropOverride,
PlatformInteropOverrideOptions
PlatformInteropOverrideOptions,
PlatformInteropBrokerHelpers
} from "workspace-platform-starter/shapes/interopbroker-shapes";
import type { Logger, LoggerCreator } from "workspace-platform-starter/shapes/logger-shapes";
import type { ModuleDefinition, ModuleHelpers } from "workspace-platform-starter/shapes/module-shapes";
import type { ModuleDefinition } from "workspace-platform-starter/shapes/module-shapes";
import { getConstructorOverride as wpsConstructorOverride } from "./broker/wps-interop-override";
import type { WpsInteropOverrideOptions } from "./shapes";
/**
Expand All @@ -28,7 +29,7 @@ export class WpsInteropOverride implements PlatformInteropOverride<WpsInteropOve
* Helper methods for the module.
* @internal
*/
private _helpers: ModuleHelpers | undefined;
private _helpers: PlatformInteropBrokerHelpers | undefined;

/**
* Initialize the module.
Expand All @@ -40,7 +41,7 @@ export class WpsInteropOverride implements PlatformInteropOverride<WpsInteropOve
public async initialize(
definition: ModuleDefinition<WpsInteropOverrideOptions>,
loggerCreator: LoggerCreator,
helpers: ModuleHelpers
helpers: PlatformInteropBrokerHelpers
): Promise<void> {
this._definition = definition;
const loggerName = definition.data?.loggerName ?? "WpsInteropOverride";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,7 @@ export interface OpenOptions {
*/
connectionTimeout?: number;
}
/**
* Interop Broker helpers provides environment methods and data.
*/
export type PlatformInteropBrokerHelpers = ModuleHelpers;
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import type OpenFin from "@openfin/core";
import type {
PlatformInteropOverride,
PlatformInteropOverrideOptions
PlatformInteropOverrideOptions,
PlatformInteropBrokerHelpers
} from "workspace-platform-starter/shapes/interopbroker-shapes";
import type { Logger, LoggerCreator } from "workspace-platform-starter/shapes/logger-shapes";
import type { ModuleDefinition, ModuleHelpers } from "workspace-platform-starter/shapes/module-shapes";
import type { ModuleDefinition } from "workspace-platform-starter/shapes/module-shapes";
import type { ExampleInteropOverrideOptions } from "./shapes";

/**
Expand All @@ -28,7 +29,7 @@ export class ExampleInteropOverride implements PlatformInteropOverride<ExampleIn
* Helper methods for the module.
* @internal
*/
private _helpers: ModuleHelpers | undefined;
private _helpers: PlatformInteropBrokerHelpers | undefined;

/**
* Initialize the module.
Expand All @@ -40,7 +41,7 @@ export class ExampleInteropOverride implements PlatformInteropOverride<ExampleIn
public async initialize(
definition: ModuleDefinition<ExampleInteropOverrideOptions>,
loggerCreator: LoggerCreator,
helpers: ModuleHelpers
helpers: PlatformInteropBrokerHelpers
): Promise<void> {
this._definition = definition;
this._logger = loggerCreator("ExampleInteropOverride");
Expand Down
Loading