@openfin/cloud-interop-core-api 0.0.1-alpha.f5e354c → 0.0.1-alpha.f66501b

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.
@@ -1,85 +0,0 @@
1
- export type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
2
- /**
3
- * Represents a logging function to be used by the cloud interop client
4
- */
5
- export type CloudInteropLogger = (level: LogLevel, message: string) => void;
6
- /**
7
- * Represents the parameters to use to connect to an interop server
8
- */
9
- export type ConnectParameters = {
10
- /**
11
- * ID for a group of shared applications.
12
- * This acts as a namespace for the interop messages that allows separation of messages between different groups of applications for the same user
13
- */
14
- platformId: string;
15
- /**
16
- * An user-friendly identifier for the source session e.g. Windows Desktop, Android Phone, etc.
17
- */
18
- sourceId: string;
19
- /**
20
- * The maximum number of times to retry connecting to the cloud interop service when the connection is dropped
21
- * defaults to 30
22
- */
23
- reconnectRetryLimit?: number;
24
- /**
25
- * Specifies how often keep alive messages should be sent to the cloud interop service in seconds
26
- * defaults to 30
27
- */
28
- keepAliveIntervalSeconds?: number;
29
- /**
30
- * Optional function to call with any logging messages to allow integration with the host application's logging
31
- *
32
- * defaults to console.log
33
- */
34
- logger?: CloudInteropLogger;
35
- /**
36
- * Determines the type of authentication to use with the service gateway
37
- * defaults to 'none'
38
- *
39
- * 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
40
- * 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
41
- * 'default' - Authentication will be inherited from the current session
42
- */
43
- authenticationType?: 'jwt' | 'basic' | 'default';
44
- /**
45
- * Optional parameters for basic authentication
46
- */
47
- basicAuthenticationParameters?: {
48
- /**
49
- * The username to use for basic authentication
50
- */
51
- username: string;
52
- /**
53
- * The password to use for basic authentication
54
- */
55
- password: string;
56
- };
57
- /**
58
- * Optional parameters for JWT authentication
59
- */
60
- jwtAuthenticationParameters?: {
61
- /**
62
- * When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
63
- */
64
- jwtRequestCallback: () => string | object;
65
- /**
66
- * The id of the service gateway JWT authentication definition to use
67
- *
68
- * Note: Contact Here support to to get your organization's authentication id
69
- */
70
- authenticationId: string;
71
- };
72
- };
73
- export type CloudInteropSettings = {
74
- url: string;
75
- };
76
- export type CreateSessionResponse = {
77
- sessionId: string;
78
- sessionRootTopic: string;
79
- url: string;
80
- token: string;
81
- orgId: string;
82
- sub: string;
83
- platformId: string;
84
- sourceId: string;
85
- };
@@ -1,15 +0,0 @@
1
- import { AggregateIntentDetailsEvent, ContextEvent, IntentDetailsEvent, IntentResultEvent, RaiseIntentEvent, ReportIntentsEvent } from '@openfin/shared-utils';
2
- export type EventMap = {
3
- reconnected: () => void;
4
- disconnected: () => void;
5
- context: (event: ContextEvent) => void;
6
- reconnecting: (attemptNo: number) => void;
7
- error: (error: Error) => void;
8
- 'session-expired': () => void;
9
- 'report-intents': (event: ReportIntentsEvent) => void;
10
- 'intent-details': (event: IntentDetailsEvent) => void;
11
- 'aggregate-intent-details': (event: AggregateIntentDetailsEvent) => void;
12
- 'raise-intent': (event: RaiseIntentEvent) => void;
13
- 'intent-result': (event: IntentResultEvent) => void;
14
- };
15
- export type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
@@ -1,3 +0,0 @@
1
- export * from './connect.interface';
2
- export * from './event.interface';
3
- export * from './intents.interface';
@@ -1,22 +0,0 @@
1
- import { AppIdentifier, FindIntentOptions, RaiseIntentOptions } from '@openfin/shared-utils';
2
- /**
3
- * Options used to start an Intent Discovery Operation, with possible constraints for the responses
4
- */
5
- export type StartIntentDiscoveryOptions = {
6
- findOptions: FindIntentOptions;
7
- /**
8
- * The timeout in ms.
9
- *
10
- * Discovery will wait for all connected sessions to respond or until the timeout is reached.
11
- *
12
- * Defaults to 3000ms if not provided, minimum value 500ms
13
- */
14
- timeout?: number;
15
- };
16
- /**
17
- * Options used to raise an Intent
18
- */
19
- export type RaiseIntentAPIOptions = {
20
- raiseOptions: RaiseIntentOptions;
21
- appId: AppIdentifier | string;
22
- };
package/dist/utils.d.ts DELETED
@@ -1,25 +0,0 @@
1
- import { AppIdentifier, AppIntent, Source } from '@openfin/shared-utils';
2
- import { ConnectParameters, CreateSessionResponse } from './interfaces';
3
- export declare const APP_ID_DELIM = "::";
4
- export declare const getRequestHeaders: (connectionParameters: ConnectParameters) => HeadersInit;
5
- /**
6
- * Encodes all app intents in the format: `appId::sourceId::sessionId`,
7
- * where sourceId and sessionId are URI encoded
8
- * @param appIntents
9
- * @param source
10
- * @returns
11
- */
12
- export declare const encodeAppIntents: (appIntents: AppIntent[], { sessionId, sourceId }: Source) => AppIntent[];
13
- /**
14
- * Decodes all app intents by URI decoding the parts previously encoded by `encodeAppIntents`
15
- * @param appIntents
16
- * @returns
17
- */
18
- export declare const decodeAppIntents: (appIntents: AppIntent[]) => AppIntent[];
19
- /**
20
- * Decodes the app id to extract the sessionId, returns '' if not able to parse
21
- * @param app
22
- * @returns
23
- */
24
- export declare const parseSessionId: (appId: AppIdentifier | string) => any;
25
- export declare const getSourceFromSession: (sessionDetails: CreateSessionResponse) => Source;