@morgan-stanley/composeui-fdc3 0.1.0-alpha.10

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.
Files changed (78) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +57 -0
  3. package/dist/fdc3-iife-bundle.js +2028 -0
  4. package/package.json +45 -0
  5. package/rollup.config.js +16 -0
  6. package/src/ComposeUIChannel.spec.ts +251 -0
  7. package/src/ComposeUIContextListener.spec.ts +116 -0
  8. package/src/ComposeUIDesktopAgent.spec.ts +189 -0
  9. package/src/ComposeUIDesktopAgent.ts +259 -0
  10. package/src/ComposeUIIntentHandling.spec.ts +218 -0
  11. package/src/ComposeUIMessagingChannelFactory.spec.ts +114 -0
  12. package/src/ComposeUIMessagingMetadataClient.spec.ts +132 -0
  13. package/src/ComposeUIMessagingOpenClient.spec.ts +146 -0
  14. package/src/index.ts +70 -0
  15. package/src/infrastructure/ChannelFactory.ts +25 -0
  16. package/src/infrastructure/ChannelItem.ts +20 -0
  17. package/src/infrastructure/ChannelType.ts +14 -0
  18. package/src/infrastructure/ComposeUIChannel.ts +86 -0
  19. package/src/infrastructure/ComposeUIContextListener.ts +148 -0
  20. package/src/infrastructure/ComposeUIErrors.ts +21 -0
  21. package/src/infrastructure/ComposeUIIntentListener.ts +100 -0
  22. package/src/infrastructure/ComposeUIIntentResolution.ts +61 -0
  23. package/src/infrastructure/ComposeUIPrivateChannel.ts +204 -0
  24. package/src/infrastructure/ComposeUITopic.ts +160 -0
  25. package/src/infrastructure/IntentsClient.ts +22 -0
  26. package/src/infrastructure/MessagingChannelFactory.ts +196 -0
  27. package/src/infrastructure/MessagingIntentsClient.ts +119 -0
  28. package/src/infrastructure/MessagingMetadataClient.ts +72 -0
  29. package/src/infrastructure/MessagingOpenClient.ts +103 -0
  30. package/src/infrastructure/MetadataClient.ts +19 -0
  31. package/src/infrastructure/OpenAppIdentifier.ts +18 -0
  32. package/src/infrastructure/OpenClient.ts +18 -0
  33. package/src/infrastructure/PrivateChannelContextListenerEventListener.ts +45 -0
  34. package/src/infrastructure/PrivateChannelDisconnectEventListener.ts +45 -0
  35. package/src/infrastructure/messages/Fdc3AddContextListenerRequest.ts +22 -0
  36. package/src/infrastructure/messages/Fdc3AddContextListenerResponse.ts +17 -0
  37. package/src/infrastructure/messages/Fdc3CreateAppChannelRequest.ts +17 -0
  38. package/src/infrastructure/messages/Fdc3CreateAppChannelResponse.ts +17 -0
  39. package/src/infrastructure/messages/Fdc3CreatePrivateChannelRequest.ts +16 -0
  40. package/src/infrastructure/messages/Fdc3CreatePrivateChannelResponse.ts +17 -0
  41. package/src/infrastructure/messages/Fdc3FindChannelRequest.ts +24 -0
  42. package/src/infrastructure/messages/Fdc3FindChannelResponse.ts +17 -0
  43. package/src/infrastructure/messages/Fdc3FindInstancesRequest.ts +17 -0
  44. package/src/infrastructure/messages/Fdc3FindInstancesResponse.ts +18 -0
  45. package/src/infrastructure/messages/Fdc3FindIntentRequest.ts +24 -0
  46. package/src/infrastructure/messages/Fdc3FindIntentResponse.ts +19 -0
  47. package/src/infrastructure/messages/Fdc3FindIntentsByContextRequest.ts +23 -0
  48. package/src/infrastructure/messages/Fdc3FindIntentsByContextResponse.ts +19 -0
  49. package/src/infrastructure/messages/Fdc3GetAppMetadataRequest.ts +17 -0
  50. package/src/infrastructure/messages/Fdc3GetAppMetadataResponse.ts +18 -0
  51. package/src/infrastructure/messages/Fdc3GetCurrentContextRequest.ts +18 -0
  52. package/src/infrastructure/messages/Fdc3GetInfoRequest.ts +17 -0
  53. package/src/infrastructure/messages/Fdc3GetInfoResponse.ts +18 -0
  54. package/src/infrastructure/messages/Fdc3GetIntentResultRequest.ts +23 -0
  55. package/src/infrastructure/messages/Fdc3GetIntentResultResponse.ts +23 -0
  56. package/src/infrastructure/messages/Fdc3GetOpenedAppContextRequest.ts +15 -0
  57. package/src/infrastructure/messages/Fdc3GetOpenedAppContextResponse.ts +18 -0
  58. package/src/infrastructure/messages/Fdc3GetUserChannelsRequest.ts +15 -0
  59. package/src/infrastructure/messages/Fdc3GetUserChannelsResponse.ts +18 -0
  60. package/src/infrastructure/messages/Fdc3IntentListenerRequest.ts +22 -0
  61. package/src/infrastructure/messages/Fdc3IntentListenerResponse.ts +17 -0
  62. package/src/infrastructure/messages/Fdc3JoinPrivateChannelRequest.ts +17 -0
  63. package/src/infrastructure/messages/Fdc3JoinPrivateChannelResponse.ts +16 -0
  64. package/src/infrastructure/messages/Fdc3JoinUserChannelRequest.ts +15 -0
  65. package/src/infrastructure/messages/Fdc3JoinUserChannelResponse.ts +20 -0
  66. package/src/infrastructure/messages/Fdc3OpenRequest.ts +21 -0
  67. package/src/infrastructure/messages/Fdc3OpenResponse.ts +18 -0
  68. package/src/infrastructure/messages/Fdc3PrivateChannelInternalEvent.ts +20 -0
  69. package/src/infrastructure/messages/Fdc3RaiseIntentForContextRequest.ts +20 -0
  70. package/src/infrastructure/messages/Fdc3RaiseIntentRequest.ts +24 -0
  71. package/src/infrastructure/messages/Fdc3RaiseIntentResolutionRequest.ts +20 -0
  72. package/src/infrastructure/messages/Fdc3RaiseIntentResponse.ts +21 -0
  73. package/src/infrastructure/messages/Fdc3RemoveContextListenerRequest.ts +19 -0
  74. package/src/infrastructure/messages/Fdc3RemoveContextListenerResponse.ts +17 -0
  75. package/src/infrastructure/messages/Fdc3StoreIntentResultRequest.ts +29 -0
  76. package/src/infrastructure/messages/Fdc3StoreIntentResultResponse.ts +17 -0
  77. package/tsconfig.json +15 -0
  78. package/vite.config.ts +7 -0
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ *
12
+ */
13
+ export type Fdc3PrivateChannelInternalEventType = "contextListenerAdded" | "unsubscribed" | "disconnected";
14
+ export class Fdc3PrivateChannelInternalEvent {
15
+
16
+ /**
17
+ * Message representing events on the remote side of a PrivateChannel
18
+ */
19
+ constructor(public event: Fdc3PrivateChannelInternalEventType, public instanceId: string, public contextType?: string | undefined) { }
20
+ }
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ */
12
+ import { AppIdentifier, Context } from "@finos/fdc3";
13
+
14
+ export class Fdc3RaiseIntentForContextRequest {
15
+ constructor(
16
+ public readonly messageId: number,
17
+ public readonly fdc3InstanceId: string,
18
+ public readonly context: Context,
19
+ public readonly targetAppIdentifier?: AppIdentifier) {}
20
+ }
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ *
12
+ */
13
+
14
+ import { AppIdentifier, Context } from "@finos/fdc3";
15
+
16
+ export class Fdc3RaiseIntentRequest {
17
+ constructor(
18
+ public readonly messageId: number,
19
+ public readonly fdc3InstanceId: string,
20
+ public readonly intent: string,
21
+ public readonly context: Context,
22
+ public readonly targetAppIdentifier?: AppIdentifier) {
23
+ }
24
+ }
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ *
12
+ */
13
+
14
+ import { Context, ContextMetadata } from "@finos/fdc3";
15
+
16
+ export interface Fdc3RaiseIntentResolutionRequest {
17
+ messageId: string;
18
+ context: Context;
19
+ contextMetadata: ContextMetadata;
20
+ }
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ *
12
+ */
13
+
14
+ import { AppMetadata } from "@finos/fdc3";
15
+
16
+ export interface Fdc3RaiseIntentResponse {
17
+ messageId: string;
18
+ intent?: string;
19
+ appMetadata?: AppMetadata;
20
+ error?: string;
21
+ }
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ */
12
+
13
+ export class Fdc3RemoveContextListenerRequest {
14
+ constructor(
15
+ public readonly fdc3InstanceId: string,
16
+ public readonly listenerId: string,
17
+ public readonly contextType?: string,
18
+ ) {}
19
+ }
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ */
12
+
13
+
14
+ export interface Fdc3RemoveContextListenerResponse {
15
+ error?: string;
16
+ success: boolean;
17
+ }
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ *
12
+ */
13
+
14
+ import { Context } from "@finos/fdc3";
15
+ import { ChannelType } from "../ChannelType";
16
+
17
+ export class Fdc3StoreIntentResultRequest {
18
+ constructor(
19
+ public messageId: string,
20
+ public intent: string,
21
+ public originFdc3InstanceId: string,
22
+ public targetFdc3InstanceId: string,
23
+ public channelId?: string,
24
+ public channelType?: ChannelType,
25
+ public context?: Context,
26
+ public voidResult: boolean = false,
27
+ public error?: string
28
+ ) {}
29
+ }
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Morgan Stanley makes this available to you under the Apache License,
3
+ * Version 2.0 (the "License"). You may obtain a copy of the License at
4
+ * http://www.apache.org/licenses/LICENSE-2.0.
5
+ * See the NOTICE file distributed with this work for additional information
6
+ * regarding copyright ownership. Unless required by applicable law or agreed
7
+ * to in writing, software distributed under the License is distributed on an
8
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
9
+ * or implied. See the License for the specific language governing permissions
10
+ * and limitations under the License.
11
+ *
12
+ */
13
+
14
+ export class Fdc3StoreIntentResultResponse {
15
+ public stored?: boolean;
16
+ public error?: string;
17
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "moduleResolution": "node",
4
+ "types": [ "node" ],
5
+ "experimentalDecorators": true,
6
+ "module": "es2022",
7
+ "esModuleInterop": true,
8
+ "target": "es2022",
9
+ "declaration": true,
10
+ "outDir": "output",
11
+ "lib": [ "es2022", "DOM" ],
12
+ "strict": true
13
+ },
14
+ "files": [ "src/index.ts" ]
15
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ environment: 'jsdom',
6
+ },
7
+ });