@openfin/cloud-interop-core-api 0.0.1-alpha.e6793f0 → 0.0.1-alpha.e6a1a71

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.
package/bundle.d.ts ADDED
@@ -0,0 +1,883 @@
1
+ import mqtt from 'mqtt';
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * Raised when an interop client receives an aggregate of intents from other connected sessions
6
+ * @public
7
+ */
8
+ export declare type AggregateIntentDetailsEvent = {
9
+ responses: IntentDetailsEvent[];
10
+ };
11
+
12
+ /**
13
+ * Represents an app intent
14
+ * @public
15
+ */
16
+ export declare type AppIdentifier = z.infer<typeof appIdentifierSchema>;
17
+
18
+ /**
19
+ * Schema for an AppIdentifier
20
+ * @public
21
+ */
22
+ declare const appIdentifierSchema: z.ZodObject<{
23
+ appId: z.ZodString;
24
+ instanceId: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ appId: string;
27
+ instanceId?: string | undefined;
28
+ }, {
29
+ appId: string;
30
+ instanceId?: string | undefined;
31
+ }>;
32
+
33
+ /**
34
+ * Represents an app intent
35
+ * @public
36
+ */
37
+ export declare type AppIntent = z.infer<typeof appIntentSchema>;
38
+
39
+ /**
40
+ * Schema for an app intent
41
+ * @public
42
+ */
43
+ declare const appIntentSchema: z.ZodObject<{
44
+ intent: z.ZodObject<{
45
+ displayName: z.ZodString;
46
+ name: z.ZodString;
47
+ }, "strip", z.ZodTypeAny, {
48
+ name: string;
49
+ displayName: string;
50
+ }, {
51
+ name: string;
52
+ displayName: string;
53
+ }>;
54
+ apps: z.ZodArray<z.ZodObject<{
55
+ description: z.ZodOptional<z.ZodString>;
56
+ icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
+ size: z.ZodOptional<z.ZodString>;
58
+ src: z.ZodString;
59
+ type: z.ZodOptional<z.ZodString>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ src: string;
62
+ type?: string | undefined;
63
+ size?: string | undefined;
64
+ }, {
65
+ src: string;
66
+ type?: string | undefined;
67
+ size?: string | undefined;
68
+ }>, "many">>;
69
+ instanceMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
70
+ name: z.ZodOptional<z.ZodString>;
71
+ resultType: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
72
+ screenshots: z.ZodOptional<z.ZodArray<z.ZodObject<{
73
+ label: z.ZodOptional<z.ZodString>;
74
+ size: z.ZodOptional<z.ZodString>;
75
+ src: z.ZodString;
76
+ type: z.ZodOptional<z.ZodString>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ src: string;
79
+ type?: string | undefined;
80
+ size?: string | undefined;
81
+ label?: string | undefined;
82
+ }, {
83
+ src: string;
84
+ type?: string | undefined;
85
+ size?: string | undefined;
86
+ label?: string | undefined;
87
+ }>, "many">>;
88
+ title: z.ZodOptional<z.ZodString>;
89
+ tooltip: z.ZodOptional<z.ZodString>;
90
+ version: z.ZodOptional<z.ZodString>;
91
+ } & {
92
+ appId: z.ZodString;
93
+ instanceId: z.ZodOptional<z.ZodString>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ appId: string;
96
+ instanceId?: string | undefined;
97
+ description?: string | undefined;
98
+ icons?: {
99
+ src: string;
100
+ type?: string | undefined;
101
+ size?: string | undefined;
102
+ }[] | undefined;
103
+ instanceMetadata?: Record<string, unknown> | undefined;
104
+ name?: string | undefined;
105
+ resultType?: string | null | undefined;
106
+ screenshots?: {
107
+ src: string;
108
+ type?: string | undefined;
109
+ size?: string | undefined;
110
+ label?: string | undefined;
111
+ }[] | undefined;
112
+ title?: string | undefined;
113
+ tooltip?: string | undefined;
114
+ version?: string | undefined;
115
+ }, {
116
+ appId: string;
117
+ instanceId?: string | undefined;
118
+ description?: string | undefined;
119
+ icons?: {
120
+ src: string;
121
+ type?: string | undefined;
122
+ size?: string | undefined;
123
+ }[] | undefined;
124
+ instanceMetadata?: Record<string, unknown> | undefined;
125
+ name?: string | undefined;
126
+ resultType?: string | null | undefined;
127
+ screenshots?: {
128
+ src: string;
129
+ type?: string | undefined;
130
+ size?: string | undefined;
131
+ label?: string | undefined;
132
+ }[] | undefined;
133
+ title?: string | undefined;
134
+ tooltip?: string | undefined;
135
+ version?: string | undefined;
136
+ }>, "many">;
137
+ }, "strip", z.ZodTypeAny, {
138
+ intent: {
139
+ name: string;
140
+ displayName: string;
141
+ };
142
+ apps: {
143
+ appId: string;
144
+ instanceId?: string | undefined;
145
+ description?: string | undefined;
146
+ icons?: {
147
+ src: string;
148
+ type?: string | undefined;
149
+ size?: string | undefined;
150
+ }[] | undefined;
151
+ instanceMetadata?: Record<string, unknown> | undefined;
152
+ name?: string | undefined;
153
+ resultType?: string | null | undefined;
154
+ screenshots?: {
155
+ src: string;
156
+ type?: string | undefined;
157
+ size?: string | undefined;
158
+ label?: string | undefined;
159
+ }[] | undefined;
160
+ title?: string | undefined;
161
+ tooltip?: string | undefined;
162
+ version?: string | undefined;
163
+ }[];
164
+ }, {
165
+ intent: {
166
+ name: string;
167
+ displayName: string;
168
+ };
169
+ apps: {
170
+ appId: string;
171
+ instanceId?: string | undefined;
172
+ description?: string | undefined;
173
+ icons?: {
174
+ src: string;
175
+ type?: string | undefined;
176
+ size?: string | undefined;
177
+ }[] | undefined;
178
+ instanceMetadata?: Record<string, unknown> | undefined;
179
+ name?: string | undefined;
180
+ resultType?: string | null | undefined;
181
+ screenshots?: {
182
+ src: string;
183
+ type?: string | undefined;
184
+ size?: string | undefined;
185
+ label?: string | undefined;
186
+ }[] | undefined;
187
+ title?: string | undefined;
188
+ tooltip?: string | undefined;
189
+ version?: string | undefined;
190
+ }[];
191
+ }>;
192
+
193
+ export declare class AuthorizationError extends CloudInteropAPIError {
194
+ constructor(message?: string, code?: string);
195
+ }
196
+
197
+ /**
198
+ * Represents a base event for the cloud interop api
199
+ * @public
200
+ * @property {Source} source - The source of the event
201
+ * @property {HistoryRecord} history - A trail of timestamps of when the context hit various points in the system
202
+ */
203
+ export declare type BaseCloudInteropAPIEvent = {
204
+ /**
205
+ * The source of the event
206
+ */
207
+ source: Source;
208
+ /**
209
+ * A trail of timestamps of when the event hit various points in the system
210
+ * @internal
211
+ */
212
+ history?: HistoryRecord;
213
+ };
214
+
215
+ /**
216
+ * Represents an Intent Discovery Event
217
+ * @public
218
+ */
219
+ export declare type BaseIntentDiscoveryEvent = BaseIntentEvent & {
220
+ discoveryId: string;
221
+ };
222
+
223
+ /**
224
+ * Represents a base intent event
225
+ * @public
226
+ */
227
+ export declare type BaseIntentEvent = BaseCloudInteropAPIEvent & {
228
+ /**
229
+ * The session id of the interop client that initiated an intent action
230
+ */
231
+ initiatingSessionId: string;
232
+ };
233
+
234
+ /**
235
+ * Represents a single connection to a Cloud Interop service
236
+ *
237
+ * @public
238
+ * @class
239
+ */
240
+ export declare class CloudInteropAPI {
241
+ #private;
242
+ constructor(cloudInteropSettings: CloudInteropSettings);
243
+ get sessionDetails(): CreateSessionResponse | undefined;
244
+ get mqttClient(): mqtt.MqttClient | undefined;
245
+ /**
246
+ * Connects and creates a session on the Cloud Interop service
247
+ *
248
+ * @param parameters - The parameters to use to connect
249
+ * @returns Promise that resolves when connection is established
250
+ * @memberof CloudInteropAPI
251
+ * @throws CloudInteropAPIError - If an error occurs during connection
252
+ * @throws AuthorizationError - If the connection is unauthorized
253
+ */
254
+ connect(parameters: ConnectParameters): Promise<void>;
255
+ /**
256
+ * Disconnects from the Cloud Interop service
257
+ *
258
+ * @returns Promise that resolves when disconnected
259
+ * @memberof CloudInteropAPI
260
+ * @throws CloudInteropAPIError - If an error occurs during disconnection
261
+ */
262
+ disconnect(): Promise<void>;
263
+ /**
264
+ * Publishes a new context for the given context group to the other connected sessions
265
+ *
266
+ * @param contextGroup - The context group to publish to
267
+ * @param context - The context to publish
268
+ * @returns Promise that resolves when context is published
269
+ * @memberof CloudInteropAPI
270
+ */
271
+ setContext(contextGroup: string, context: InferredContext): Promise<void>;
272
+ /**
273
+ * Starts an intent discovery operation
274
+ *
275
+ * @returns Promise that resolves when intent discovery is started
276
+ * @memberof CloudInteropAPI
277
+ * @throws CloudInteropAPIError - If an error occurs during intent discovery
278
+ */
279
+ startIntentDiscovery(options: StartIntentDiscoveryOptions): Promise<void>;
280
+ raiseIntent(options: RaiseIntentAPIOptions): Promise<void>;
281
+ reportAppIntents(discoveryId: string, intents: AppIntent[]): Promise<boolean>;
282
+ sendIntentResult(initiatingSessionId: string, result: IntentResult): Promise<void>;
283
+ parseSessionId(appId: AppIdentifier | string): string;
284
+ parseAppId(appId: AppIdentifier | string): string;
285
+ addEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
286
+ removeEventListener<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
287
+ once<K extends keyof EventMap>(type: K, callback: EventMap[K]): void;
288
+ }
289
+
290
+ export declare class CloudInteropAPIError extends Error {
291
+ code: string;
292
+ constructor(message?: string, code?: string, cause?: unknown);
293
+ }
294
+
295
+ /**
296
+ * Represents a logging function to be used by the cloud interop client
297
+ */
298
+ export declare type CloudInteropLogger = (level: LogLevel, message: string) => void;
299
+
300
+ export declare type CloudInteropSettings = {
301
+ url: string;
302
+ };
303
+
304
+ /**
305
+ * @internal
306
+ */
307
+ export declare type CommandMessage = ReportIntentsCommand | IntentDetailsCommand | RaiseIntentCommand | IntentResultCommand;
308
+
309
+ /**
310
+ * Represents the parameters to use to connect to an interop server
311
+ */
312
+ export declare type ConnectParameters = {
313
+ /**
314
+ * ID for a group of shared applications.
315
+ * This acts as a namespace for the interop messages that allows separation of messages between different groups of applications for the same user
316
+ */
317
+ platformId: string;
318
+ /**
319
+ * An user-friendly identifier for the source session e.g. Windows Desktop, Android Phone, etc.
320
+ */
321
+ sourceId: string;
322
+ /**
323
+ * The maximum number of times to retry connecting to the cloud interop service when the connection is dropped
324
+ * defaults to 30
325
+ */
326
+ reconnectRetryLimit?: number;
327
+ /**
328
+ * Specifies how often keep alive messages should be sent to the cloud interop service in seconds
329
+ * defaults to 30
330
+ */
331
+ keepAliveIntervalSeconds?: number;
332
+ /**
333
+ * Optional function to call with any logging messages to allow integration with the host application's logging
334
+ *
335
+ * defaults to console.log
336
+ */
337
+ logger?: CloudInteropLogger;
338
+ /**
339
+ * Determines the type of authentication to use with the service gateway
340
+ * defaults to 'none'
341
+ *
342
+ * 'jwt' - Use JWT authentication, in this case jwtAuthenticationParameters must also be provided
343
+ * 'basic' - Use basic authentication, in this case basicAuthenticationParameters must also be provided
344
+ * 'default' - Authentication will be inherited from the current session
345
+ */
346
+ authenticationType?: 'jwt' | 'basic' | 'default';
347
+ /**
348
+ * Optional parameters for basic authentication
349
+ */
350
+ basicAuthenticationParameters?: {
351
+ /**
352
+ * The username to use for basic authentication
353
+ */
354
+ username: string;
355
+ /**
356
+ * The password to use for basic authentication
357
+ */
358
+ password: string;
359
+ };
360
+ /**
361
+ * Optional parameters for JWT authentication
362
+ */
363
+ jwtAuthenticationParameters?: {
364
+ /**
365
+ * When JWT authentication is being used, this will be invoked just whenever a JWT token is required for a request
366
+ */
367
+ jwtRequestCallback: () => string | object;
368
+ /**
369
+ * The id of the service gateway JWT authentication definition to use
370
+ *
371
+ * Note: Contact Here support to to get your organization's authentication id
372
+ */
373
+ authenticationId: string;
374
+ };
375
+ };
376
+
377
+ /**
378
+ * Represents a context received from another cloud interop publisher
379
+ * @public
380
+ * @property {string} contextGroup - The context group
381
+ * @property {object} context - The context
382
+ */
383
+ export declare type ContextEvent = BaseCloudInteropAPIEvent & {
384
+ /**
385
+ * The context group
386
+ */
387
+ contextGroup: string;
388
+ /**
389
+ * The context object
390
+ */
391
+ context?: InferredContext;
392
+ };
393
+
394
+ /**
395
+ * Schema for context object
396
+ * @public
397
+ */
398
+ declare const contextSchema: z.ZodIntersection<z.ZodObject<{
399
+ type: z.ZodString;
400
+ name: z.ZodOptional<z.ZodString>;
401
+ id: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
402
+ }, "strip", z.ZodTypeAny, {
403
+ type: string;
404
+ name?: string | undefined;
405
+ id?: Record<string, any> | undefined;
406
+ }, {
407
+ type: string;
408
+ name?: string | undefined;
409
+ id?: Record<string, any> | undefined;
410
+ }>, z.ZodRecord<z.ZodString, z.ZodAny>>;
411
+
412
+ export declare type CreateSessionResponse = {
413
+ sessionId: string;
414
+ sessionRootTopic: string;
415
+ url: string;
416
+ token: string;
417
+ orgId: string;
418
+ sub: string;
419
+ platformId: string;
420
+ sourceId: string;
421
+ localSessionExpiryHandling?: boolean;
422
+ };
423
+
424
+ declare const errorSchema: z.ZodObject<{
425
+ error: z.ZodString;
426
+ }, "strip", z.ZodTypeAny, {
427
+ error: string;
428
+ }, {
429
+ error: string;
430
+ }>;
431
+
432
+ export declare type EventListenersMap = Map<keyof EventMap, Array<(...args: Parameters<EventMap[keyof EventMap]>) => void>>;
433
+
434
+ export declare type EventMap = {
435
+ reconnected: () => void;
436
+ disconnected: () => void;
437
+ context: (event: ContextEvent) => void;
438
+ reconnecting: (attemptNo: number) => void;
439
+ error: (error: Error) => void;
440
+ 'session-expired': () => void;
441
+ 'report-intents': (event: ReportIntentsEvent) => void;
442
+ 'intent-details': (event: IntentDetailsEvent) => void;
443
+ 'aggregate-intent-details': (event: AggregateIntentDetailsEvent) => void;
444
+ 'raise-intent': (event: RaiseIntentEvent) => void;
445
+ 'intent-result': (event: IntentResultEvent) => void;
446
+ };
447
+
448
+ /**
449
+ * Options for finding intents by intent name or context
450
+ * @public
451
+ */
452
+ export declare type FindIntentOptions = z.infer<typeof findIntentOptionsSchema>;
453
+
454
+ /**
455
+ * Schema for findOptions for the StartDiscovery operation
456
+ * @public
457
+ */
458
+ declare const findIntentOptionsSchema: z.ZodUnion<[z.ZodObject<{
459
+ type: z.ZodLiteral<"find-intent">;
460
+ intent: z.ZodString;
461
+ context: z.ZodOptional<z.ZodIntersection<z.ZodObject<{
462
+ type: z.ZodString;
463
+ name: z.ZodOptional<z.ZodString>;
464
+ id: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
465
+ }, "strip", z.ZodTypeAny, {
466
+ type: string;
467
+ name?: string | undefined;
468
+ id?: Record<string, any> | undefined;
469
+ }, {
470
+ type: string;
471
+ name?: string | undefined;
472
+ id?: Record<string, any> | undefined;
473
+ }>, z.ZodRecord<z.ZodString, z.ZodAny>>>;
474
+ resultType: z.ZodOptional<z.ZodString>;
475
+ }, "strip", z.ZodTypeAny, {
476
+ type: "find-intent";
477
+ intent: string;
478
+ resultType?: string | undefined;
479
+ context?: ({
480
+ type: string;
481
+ name?: string | undefined;
482
+ id?: Record<string, any> | undefined;
483
+ } & Record<string, any>) | undefined;
484
+ }, {
485
+ type: "find-intent";
486
+ intent: string;
487
+ resultType?: string | undefined;
488
+ context?: ({
489
+ type: string;
490
+ name?: string | undefined;
491
+ id?: Record<string, any> | undefined;
492
+ } & Record<string, any>) | undefined;
493
+ }>, z.ZodObject<{
494
+ type: z.ZodLiteral<"find-intents-by-context">;
495
+ context: z.ZodIntersection<z.ZodObject<{
496
+ type: z.ZodString;
497
+ name: z.ZodOptional<z.ZodString>;
498
+ id: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
499
+ }, "strip", z.ZodTypeAny, {
500
+ type: string;
501
+ name?: string | undefined;
502
+ id?: Record<string, any> | undefined;
503
+ }, {
504
+ type: string;
505
+ name?: string | undefined;
506
+ id?: Record<string, any> | undefined;
507
+ }>, z.ZodRecord<z.ZodString, z.ZodAny>>;
508
+ resultType: z.ZodOptional<z.ZodString>;
509
+ }, "strip", z.ZodTypeAny, {
510
+ type: "find-intents-by-context";
511
+ context: {
512
+ type: string;
513
+ name?: string | undefined;
514
+ id?: Record<string, any> | undefined;
515
+ } & Record<string, any>;
516
+ resultType?: string | undefined;
517
+ }, {
518
+ type: "find-intents-by-context";
519
+ context: {
520
+ type: string;
521
+ name?: string | undefined;
522
+ id?: Record<string, any> | undefined;
523
+ } & Record<string, any>;
524
+ resultType?: string | undefined;
525
+ }>]>;
526
+
527
+ /**
528
+ * A trace record for performance monitoring
529
+ * @internal
530
+ */
531
+ declare type HistoryRecord = {
532
+ /**
533
+ * The time the context was sent by the client to the service
534
+ * Note: This is reliant on the time being accurate on the client
535
+ */
536
+ client?: number;
537
+ /**
538
+ * The time the context was received by the service
539
+ */
540
+ received?: number;
541
+ /**
542
+ * The time the context was received and forward to the messaging backbone
543
+ */
544
+ forwarded?: number;
545
+ /**
546
+ * The time the context was received by client api
547
+ */
548
+ clientReceived?: number;
549
+ };
550
+
551
+ /**
552
+ * Represents a context object
553
+ * @public
554
+ */
555
+ export declare type InferredContext = z.infer<typeof contextSchema>;
556
+
557
+ export declare type InferredError = z.infer<typeof errorSchema>;
558
+
559
+ /**
560
+ * @internal
561
+ */
562
+ export declare type IntentDetailsCommand = IntentDetailsEvent & {
563
+ command: 'intent-details';
564
+ };
565
+
566
+ /**
567
+ * Raised when an interop client receives intents from other connected sessions
568
+ * @public
569
+ */
570
+ export declare type IntentDetailsEvent = BaseIntentDiscoveryEvent & {
571
+ intents: AppIntent[];
572
+ };
573
+
574
+ /**
575
+ * Represents an intent resolution
576
+ * @public
577
+ */
578
+ export declare type IntentResolution = z.infer<typeof intentResolutionSchema>;
579
+
580
+ declare const intentResolutionSchema: z.ZodObject<{
581
+ source: z.ZodUnion<[z.ZodString, z.ZodObject<{
582
+ appId: z.ZodString;
583
+ instanceId: z.ZodOptional<z.ZodString>;
584
+ }, "strip", z.ZodTypeAny, {
585
+ appId: string;
586
+ instanceId?: string | undefined;
587
+ }, {
588
+ appId: string;
589
+ instanceId?: string | undefined;
590
+ }>]>;
591
+ version: z.ZodOptional<z.ZodString>;
592
+ intent: z.ZodString;
593
+ getResult: z.ZodOptional<z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
594
+ type: z.ZodString;
595
+ name: z.ZodOptional<z.ZodString>;
596
+ id: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
597
+ }, "strip", z.ZodTypeAny, {
598
+ type: string;
599
+ name?: string | undefined;
600
+ id?: Record<string, any> | undefined;
601
+ }, {
602
+ type: string;
603
+ name?: string | undefined;
604
+ id?: Record<string, any> | undefined;
605
+ }>, z.ZodRecord<z.ZodString, z.ZodAny>>, z.ZodUndefined]>>;
606
+ }, "strip", z.ZodTypeAny, {
607
+ source: string | {
608
+ appId: string;
609
+ instanceId?: string | undefined;
610
+ };
611
+ intent: string;
612
+ version?: string | undefined;
613
+ getResult?: ({
614
+ type: string;
615
+ name?: string | undefined;
616
+ id?: Record<string, any> | undefined;
617
+ } & Record<string, any>) | undefined;
618
+ }, {
619
+ source: string | {
620
+ appId: string;
621
+ instanceId?: string | undefined;
622
+ };
623
+ intent: string;
624
+ version?: string | undefined;
625
+ getResult?: ({
626
+ type: string;
627
+ name?: string | undefined;
628
+ id?: Record<string, any> | undefined;
629
+ } & Record<string, any>) | undefined;
630
+ }>;
631
+
632
+ /**
633
+ * Represents an intent result
634
+ * @public
635
+ */
636
+ export declare type IntentResult = z.infer<typeof intentResultSchema>;
637
+
638
+ /**
639
+ * @internal
640
+ */
641
+ export declare type IntentResultCommand = IntentResultEvent & {
642
+ command: 'intent-result';
643
+ };
644
+
645
+ /**
646
+ * Raised when an interop client receives an intent result after raising an intent on a target session
647
+ * @public
648
+ */
649
+ export declare type IntentResultEvent = BaseIntentEvent & {
650
+ result: IntentResult;
651
+ };
652
+
653
+ /**
654
+ * Schema for the result of an intent
655
+ * @public
656
+ */
657
+ declare const intentResultSchema: z.ZodUnion<[z.ZodObject<{
658
+ error: z.ZodString;
659
+ }, "strip", z.ZodTypeAny, {
660
+ error: string;
661
+ }, {
662
+ error: string;
663
+ }>, z.ZodObject<{
664
+ source: z.ZodUnion<[z.ZodString, z.ZodObject<{
665
+ appId: z.ZodString;
666
+ instanceId: z.ZodOptional<z.ZodString>;
667
+ }, "strip", z.ZodTypeAny, {
668
+ appId: string;
669
+ instanceId?: string | undefined;
670
+ }, {
671
+ appId: string;
672
+ instanceId?: string | undefined;
673
+ }>]>;
674
+ version: z.ZodOptional<z.ZodString>;
675
+ intent: z.ZodString;
676
+ getResult: z.ZodOptional<z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
677
+ type: z.ZodString;
678
+ name: z.ZodOptional<z.ZodString>;
679
+ id: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
680
+ }, "strip", z.ZodTypeAny, {
681
+ type: string;
682
+ name?: string | undefined;
683
+ id?: Record<string, any> | undefined;
684
+ }, {
685
+ type: string;
686
+ name?: string | undefined;
687
+ id?: Record<string, any> | undefined;
688
+ }>, z.ZodRecord<z.ZodString, z.ZodAny>>, z.ZodUndefined]>>;
689
+ }, "strip", z.ZodTypeAny, {
690
+ source: string | {
691
+ appId: string;
692
+ instanceId?: string | undefined;
693
+ };
694
+ intent: string;
695
+ version?: string | undefined;
696
+ getResult?: ({
697
+ type: string;
698
+ name?: string | undefined;
699
+ id?: Record<string, any> | undefined;
700
+ } & Record<string, any>) | undefined;
701
+ }, {
702
+ source: string | {
703
+ appId: string;
704
+ instanceId?: string | undefined;
705
+ };
706
+ intent: string;
707
+ version?: string | undefined;
708
+ getResult?: ({
709
+ type: string;
710
+ name?: string | undefined;
711
+ id?: Record<string, any> | undefined;
712
+ } & Record<string, any>) | undefined;
713
+ }>]>;
714
+
715
+ export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
716
+
717
+ /**
718
+ * Options used to raise an Intent
719
+ * @public
720
+ */
721
+ export declare type RaiseIntentAPIOptions = {
722
+ raiseOptions: RaiseIntentOptions;
723
+ appId: AppIdentifier | string;
724
+ };
725
+
726
+ /**
727
+ * @internal
728
+ */
729
+ export declare type RaiseIntentCommand = RaiseIntentEvent & {
730
+ command: 'raise-intent';
731
+ };
732
+
733
+ /**
734
+ * Raised when an interop client invokes an intent
735
+ * @public
736
+ */
737
+ export declare type RaiseIntentEvent = BaseIntentEvent & {
738
+ targetSessionId: string;
739
+ raiseOptions: RaiseIntentOptions;
740
+ };
741
+
742
+ /**
743
+ * Options for raising an intent by intent name or context
744
+ * @public
745
+ */
746
+ export declare type RaiseIntentOptions = z.infer<typeof raiseIntentOptionsSchema>;
747
+
748
+ /**
749
+ * Schema for raiseOptions for the RaiseIntent operation
750
+ * @public
751
+ */
752
+ declare const raiseIntentOptionsSchema: z.ZodUnion<[z.ZodObject<{
753
+ type: z.ZodLiteral<"raise-intent">;
754
+ intent: z.ZodString;
755
+ context: z.ZodIntersection<z.ZodObject<{
756
+ type: z.ZodString;
757
+ name: z.ZodOptional<z.ZodString>;
758
+ id: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
759
+ }, "strip", z.ZodTypeAny, {
760
+ type: string;
761
+ name?: string | undefined;
762
+ id?: Record<string, any> | undefined;
763
+ }, {
764
+ type: string;
765
+ name?: string | undefined;
766
+ id?: Record<string, any> | undefined;
767
+ }>, z.ZodRecord<z.ZodString, z.ZodAny>>;
768
+ }, "strip", z.ZodTypeAny, {
769
+ type: "raise-intent";
770
+ intent: string;
771
+ context: {
772
+ type: string;
773
+ name?: string | undefined;
774
+ id?: Record<string, any> | undefined;
775
+ } & Record<string, any>;
776
+ }, {
777
+ type: "raise-intent";
778
+ intent: string;
779
+ context: {
780
+ type: string;
781
+ name?: string | undefined;
782
+ id?: Record<string, any> | undefined;
783
+ } & Record<string, any>;
784
+ }>, z.ZodObject<{
785
+ type: z.ZodLiteral<"raise-intent-for-context">;
786
+ context: z.ZodIntersection<z.ZodObject<{
787
+ type: z.ZodString;
788
+ name: z.ZodOptional<z.ZodString>;
789
+ id: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
790
+ }, "strip", z.ZodTypeAny, {
791
+ type: string;
792
+ name?: string | undefined;
793
+ id?: Record<string, any> | undefined;
794
+ }, {
795
+ type: string;
796
+ name?: string | undefined;
797
+ id?: Record<string, any> | undefined;
798
+ }>, z.ZodRecord<z.ZodString, z.ZodAny>>;
799
+ }, "strip", z.ZodTypeAny, {
800
+ type: "raise-intent-for-context";
801
+ context: {
802
+ type: string;
803
+ name?: string | undefined;
804
+ id?: Record<string, any> | undefined;
805
+ } & Record<string, any>;
806
+ }, {
807
+ type: "raise-intent-for-context";
808
+ context: {
809
+ type: string;
810
+ name?: string | undefined;
811
+ id?: Record<string, any> | undefined;
812
+ } & Record<string, any>;
813
+ }>]>;
814
+
815
+ /**
816
+ * @internal
817
+ */
818
+ export declare type ReportIntentsCommand = ReportIntentsEvent & {
819
+ command: 'report-intents';
820
+ };
821
+
822
+ /**
823
+ * Raised when an interop client requests intents from other connected sessions.
824
+ * @public
825
+ */
826
+ export declare type ReportIntentsEvent = BaseIntentDiscoveryEvent & {
827
+ /**
828
+ * Options qualifying how the session should respond to the request
829
+ * - intent: when provided, filter the response to only include intents that match the specified intent name
830
+ * - context: when provided, filter the response to only include intents that match the specified context
831
+ * - resultType: when provided, filter the response to only include apps that match the specified result type
832
+ */
833
+ findOptions: FindIntentOptions;
834
+ /**
835
+ * The number of connected sessions including the current session
836
+ */
837
+ sessionCount: number;
838
+ };
839
+
840
+ /**
841
+ * Represents a source session
842
+ * @public
843
+ */
844
+ export declare type Source = {
845
+ /**
846
+ * Source session id
847
+ */
848
+ sessionId: string;
849
+ /**
850
+ * Source environment id
851
+ */
852
+ sourceId: string;
853
+ /**
854
+ * Source user id
855
+ */
856
+ userId: string;
857
+ /**
858
+ * Source org id
859
+ */
860
+ orgId: string;
861
+ /**
862
+ * Source platform id
863
+ */
864
+ platformId: string;
865
+ };
866
+
867
+ /**
868
+ * Options used to start an Intent Discovery Operation, with possible constraints for the responses
869
+ * @public
870
+ */
871
+ export declare type StartIntentDiscoveryOptions = {
872
+ findOptions: FindIntentOptions;
873
+ /**
874
+ * The timeout in ms.
875
+ *
876
+ * Discovery will wait for all connected sessions to respond or until the timeout is reached.
877
+ *
878
+ * Defaults to 3000ms if not provided, minimum value 500ms
879
+ */
880
+ timeout?: number;
881
+ };
882
+
883
+ export { }