@smartspace/api-client 0.1.0-pr.739.7b7edd5 → 0.1.0-pr.740.7ec6aa3

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,6 +1,6 @@
1
1
  import type { MessageThreadSummary } from '../SmartSpace.App.Business.Models.MessageThread';
2
2
  import type { CommentSummary } from '../SmartSpace.App.Business.Models.Comment';
3
- export type IClientHubInvoker = {
3
+ export type IChatHubInvoker = {
4
4
  /**
5
5
  * @param groupName Transpiled from string
6
6
  * @returns Transpiled from System.Threading.Tasks.Task
@@ -12,7 +12,19 @@ export type IClientHubInvoker = {
12
12
  */
13
13
  leaveGroup(groupName: string): Promise<void>;
14
14
  };
15
- export type INotificationReceiver = {
15
+ export type IConfigHubInvoker = {
16
+ /**
17
+ * @param groupName Transpiled from string
18
+ * @returns Transpiled from System.Threading.Tasks.Task
19
+ */
20
+ joinGroup(groupName: string): Promise<void>;
21
+ /**
22
+ * @param groupName Transpiled from string
23
+ * @returns Transpiled from System.Threading.Tasks.Task
24
+ */
25
+ leaveGroup(groupName: string): Promise<void>;
26
+ };
27
+ export type IChatReceiver = {
16
28
  /**
17
29
  * @param name Transpiled from string
18
30
  * @param message Transpiled from string
@@ -34,6 +46,14 @@ export type INotificationReceiver = {
34
46
  * @returns Transpiled from System.Threading.Tasks.Task
35
47
  */
36
48
  receiveCommentsUpdate(comment: CommentSummary): Promise<void>;
49
+ };
50
+ export type IConfigReceiver = {
51
+ /**
52
+ * @param name Transpiled from string
53
+ * @param message Transpiled from string
54
+ * @returns Transpiled from System.Threading.Tasks.Task
55
+ */
56
+ receiveMessage(name: string, message: string): Promise<void>;
37
57
  /**
38
58
  * @returns Transpiled from System.Threading.Tasks.Task
39
59
  */
@@ -1,5 +1,5 @@
1
1
  import type { HubConnection } from '@microsoft/signalr';
2
- import type { IClientHubInvoker, INotificationReceiver } from './SmartSpace.App.Business.Hubs.Contracts';
2
+ import type { IChatHubInvoker, IConfigHubInvoker, IChatReceiver, IConfigReceiver } from './SmartSpace.App.Business.Hubs.Contracts';
3
3
  export type Disposable = {
4
4
  dispose(): void;
5
5
  };
@@ -10,10 +10,12 @@ export type ReceiverRegister<T> = {
10
10
  register(connection: HubConnection, receiver: T): Disposable;
11
11
  };
12
12
  export type HubProxyFactoryProvider = {
13
- (hubType: "IClientHubInvoker"): HubProxyFactory<IClientHubInvoker>;
13
+ (hubType: "IChatHubInvoker"): HubProxyFactory<IChatHubInvoker>;
14
+ (hubType: "IConfigHubInvoker"): HubProxyFactory<IConfigHubInvoker>;
14
15
  };
15
16
  export declare const getHubProxyFactory: HubProxyFactoryProvider;
16
17
  export type ReceiverRegisterProvider = {
17
- (receiverType: "INotificationReceiver"): ReceiverRegister<INotificationReceiver>;
18
+ (receiverType: "IChatReceiver"): ReceiverRegister<IChatReceiver>;
19
+ (receiverType: "IConfigReceiver"): ReceiverRegister<IConfigReceiver>;
18
20
  };
19
21
  export declare const getReceiverRegister: ReceiverRegisterProvider;
@@ -13,25 +13,50 @@ class ReceiverMethodSubscription {
13
13
  }
14
14
  }
15
15
  exports.getHubProxyFactory = ((hubType) => {
16
- if (hubType === "IClientHubInvoker") {
17
- return IClientHubInvoker_HubProxyFactory.Instance;
16
+ if (hubType === "IChatHubInvoker") {
17
+ return IChatHubInvoker_HubProxyFactory.Instance;
18
+ }
19
+ if (hubType === "IConfigHubInvoker") {
20
+ return IConfigHubInvoker_HubProxyFactory.Instance;
18
21
  }
19
22
  });
20
23
  exports.getReceiverRegister = ((receiverType) => {
21
- if (receiverType === "INotificationReceiver") {
22
- return INotificationReceiver_Binder.Instance;
24
+ if (receiverType === "IChatReceiver") {
25
+ return IChatReceiver_Binder.Instance;
26
+ }
27
+ if (receiverType === "IConfigReceiver") {
28
+ return IConfigReceiver_Binder.Instance;
23
29
  }
24
30
  });
25
31
  // HubProxy
26
- class IClientHubInvoker_HubProxyFactory {
32
+ class IChatHubInvoker_HubProxyFactory {
33
+ constructor() {
34
+ this.createHubProxy = (connection) => {
35
+ return new IChatHubInvoker_HubProxy(connection);
36
+ };
37
+ }
38
+ }
39
+ IChatHubInvoker_HubProxyFactory.Instance = new IChatHubInvoker_HubProxyFactory();
40
+ class IChatHubInvoker_HubProxy {
41
+ constructor(connection) {
42
+ this.connection = connection;
43
+ this.joinGroup = async (groupName) => {
44
+ return await this.connection.invoke("JoinGroup", groupName);
45
+ };
46
+ this.leaveGroup = async (groupName) => {
47
+ return await this.connection.invoke("LeaveGroup", groupName);
48
+ };
49
+ }
50
+ }
51
+ class IConfigHubInvoker_HubProxyFactory {
27
52
  constructor() {
28
53
  this.createHubProxy = (connection) => {
29
- return new IClientHubInvoker_HubProxy(connection);
54
+ return new IConfigHubInvoker_HubProxy(connection);
30
55
  };
31
56
  }
32
57
  }
33
- IClientHubInvoker_HubProxyFactory.Instance = new IClientHubInvoker_HubProxyFactory();
34
- class IClientHubInvoker_HubProxy {
58
+ IConfigHubInvoker_HubProxyFactory.Instance = new IConfigHubInvoker_HubProxyFactory();
59
+ class IConfigHubInvoker_HubProxy {
35
60
  constructor(connection) {
36
61
  this.connection = connection;
37
62
  this.joinGroup = async (groupName) => {
@@ -43,28 +68,41 @@ class IClientHubInvoker_HubProxy {
43
68
  }
44
69
  }
45
70
  // Receiver
46
- class INotificationReceiver_Binder {
71
+ class IChatReceiver_Binder {
47
72
  constructor() {
48
73
  this.register = (connection, receiver) => {
49
74
  const __receiveMessage = (...args) => receiver.receiveMessage(...args);
50
75
  const __receiveThreadUpdate = (...args) => receiver.receiveThreadUpdate(...args);
51
76
  const __receiveThreadDeleted = (...args) => receiver.receiveThreadDeleted(...args);
52
77
  const __receiveCommentsUpdate = (...args) => receiver.receiveCommentsUpdate(...args);
53
- const __blocksUpdate = () => receiver.blocksUpdate();
54
78
  connection.on("ReceiveMessage", __receiveMessage);
55
79
  connection.on("ReceiveThreadUpdate", __receiveThreadUpdate);
56
80
  connection.on("ReceiveThreadDeleted", __receiveThreadDeleted);
57
81
  connection.on("ReceiveCommentsUpdate", __receiveCommentsUpdate);
58
- connection.on("BlocksUpdate", __blocksUpdate);
59
82
  const methodList = [
60
83
  { methodName: "ReceiveMessage", method: __receiveMessage },
61
84
  { methodName: "ReceiveThreadUpdate", method: __receiveThreadUpdate },
62
85
  { methodName: "ReceiveThreadDeleted", method: __receiveThreadDeleted },
63
- { methodName: "ReceiveCommentsUpdate", method: __receiveCommentsUpdate },
86
+ { methodName: "ReceiveCommentsUpdate", method: __receiveCommentsUpdate }
87
+ ];
88
+ return new ReceiverMethodSubscription(connection, methodList);
89
+ };
90
+ }
91
+ }
92
+ IChatReceiver_Binder.Instance = new IChatReceiver_Binder();
93
+ class IConfigReceiver_Binder {
94
+ constructor() {
95
+ this.register = (connection, receiver) => {
96
+ const __receiveMessage = (...args) => receiver.receiveMessage(...args);
97
+ const __blocksUpdate = () => receiver.blocksUpdate();
98
+ connection.on("ReceiveMessage", __receiveMessage);
99
+ connection.on("BlocksUpdate", __blocksUpdate);
100
+ const methodList = [
101
+ { methodName: "ReceiveMessage", method: __receiveMessage },
64
102
  { methodName: "BlocksUpdate", method: __blocksUpdate }
65
103
  ];
66
104
  return new ReceiverMethodSubscription(connection, methodList);
67
105
  };
68
106
  }
69
107
  }
70
- INotificationReceiver_Binder.Instance = new INotificationReceiver_Binder();
108
+ IConfigReceiver_Binder.Instance = new IConfigReceiver_Binder();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartspace/api-client",
3
- "version": "0.1.0-pr.739.7b7edd5",
3
+ "version": "0.1.0-pr.740.7ec6aa3",
4
4
  "description": "Generated TypeScript client for SmartSpace APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",