@in.pulse-crm/sdk 1.3.2 → 1.3.3

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/dist/file.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { AxiosInstance } from "axios";
4
2
  interface UploadFileOptions {
5
3
  /**
package/dist/index.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -64,6 +64,69 @@ export type SectorId = number;
64
64
  * Nome de uma instância.
65
65
  */
66
66
  export type InstanceName = string;
67
+ /**
68
+ * Represents a function type for emitting events to specific rooms in a socket server.
69
+ * This function type supports multiple overloads, each corresponding to a specific
70
+ * combination of room type, event type, and value type.
71
+ *
72
+ * @typedef EmitFunction
73
+ *
74
+ * @overload
75
+ * Emits a `NEW_CHAT` event to a chat or monitor room.
76
+ * @param instanceName - The name of the instance emitting the event.
77
+ * @param room - The target room, either a `SocketChatRoom` or `SocketMonitorRoom`.
78
+ * @param event - The event type, `SocketEventType.NEW_CHAT`.
79
+ * @param value - The value associated with the event (type not yet implemented).
80
+ *
81
+ * @overload
82
+ * Emits a `CHAT_FINISHED` event to a chat or monitor room.
83
+ * @param instanceName - The name of the instance emitting the event.
84
+ * @param room - The target room, either a `SocketChatRoom` or `SocketMonitorRoom`.
85
+ * @param event - The event type, `SocketEventType.CHAT_FINISHED`.
86
+ * @param value - The ID of the finished chat.
87
+ *
88
+ * @overload
89
+ * Emits a `QR_CODE` event to an admin room.
90
+ * @param instanceName - The name of the instance emitting the event.
91
+ * @param room - The target room, a `SocketAdminRoom`.
92
+ * @param event - The event type, `SocketEventType.QR_CODE`.
93
+ * @param value - The QR code data.
94
+ *
95
+ * @overload
96
+ * Emits a `MESSAGE` event to a chat room.
97
+ * @param instanceName - The name of the instance emitting the event.
98
+ * @param room - The target room, a `SocketChatRoom`.
99
+ * @param event - The event type, `SocketEventType.MESSAGE`.
100
+ * @param value - The value associated with the event (type not yet implemented).
101
+ *
102
+ * @overload
103
+ * Emits a `NOTIFICATION` event to an admin room.
104
+ * @param instanceName - The name of the instance emitting the event.
105
+ * @param room - The target room, a `SocketAdminRoom`.
106
+ * @param event - The event type, `SocketEventType.NOTIFICATION`.
107
+ * @param value - The value associated with the event (type not yet implemented).
108
+ *
109
+ * @overload
110
+ * Emits a `MESSAGE_EDIT` event to a chat room.
111
+ * @param instanceName - The name of the instance emitting the event.
112
+ * @param room - The target room, a `SocketChatRoom`.
113
+ * @param event - The event type, `SocketEventType.MESSAGE_EDIT`.
114
+ * @param value - The value associated with the event (type not yet implemented).
115
+ *
116
+ * @overload
117
+ * Emits a `MESSAGE_STATUS` event to a chat room.
118
+ * @param instanceName - The name of the instance emitting the event.
119
+ * @param room - The target room, a `SocketChatRoom`.
120
+ * @param event - The event type, `SocketEventType.MESSAGE_STATUS`.
121
+ * @param value - The value associated with the event (type not yet implemented).
122
+ *
123
+ * @overload
124
+ * Emits a `REPORT_STATUS` event to an admin room.
125
+ * @param instanceName - The name of the instance emitting the event.
126
+ * @param room - The target room, a `SocketAdminRoom`.
127
+ * @param event - The event type, `SocketEventType.REPORT_STATUS`.
128
+ * @param value - The report status data.
129
+ */
67
130
  export type EmitFunction = {
68
131
  (instanceName: string, room: SocketChatRoom | SocketMonitorRoom, event: SocketEventType.NEW_CHAT, value: NotImplemented): void;
69
132
  (instanceName: string, room: SocketChatRoom | SocketMonitorRoom, event: SocketEventType.CHAT_FINISHED, value: ChatId): void;
@@ -72,7 +135,7 @@ export type EmitFunction = {
72
135
  (instanceName: string, room: SocketAdminRoom, event: SocketEventType.NOTIFICATION, value: NotImplemented): void;
73
136
  (instanceName: string, room: SocketChatRoom, event: SocketEventType.MESSAGE_EDIT, value: NotImplemented): void;
74
137
  (instanceName: string, room: SocketChatRoom, event: SocketEventType.MESSAGE_STATUS, value: NotImplemented): void;
75
- (instanceName: string, room: SocketAdminRoom, event: SocketEventType.REPORT_STATUS, value: ReportStatusData): void;
138
+ (instanceName: string, room: SocketReportsRoom, event: SocketEventType.REPORT_STATUS, value: ReportStatusData): void;
76
139
  };
77
140
  /**
78
141
  * Classe para manipulação de eventos de socket.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@in.pulse-crm/sdk",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "SDKs for abstraction of api consumption of in.pulse-crm application",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -77,6 +77,69 @@ export type SectorId = number;
77
77
  */
78
78
  export type InstanceName = string;
79
79
 
80
+ /**
81
+ * Represents a function type for emitting events to specific rooms in a socket server.
82
+ * This function type supports multiple overloads, each corresponding to a specific
83
+ * combination of room type, event type, and value type.
84
+ *
85
+ * @typedef EmitFunction
86
+ *
87
+ * @overload
88
+ * Emits a `NEW_CHAT` event to a chat or monitor room.
89
+ * @param instanceName - The name of the instance emitting the event.
90
+ * @param room - The target room, either a `SocketChatRoom` or `SocketMonitorRoom`.
91
+ * @param event - The event type, `SocketEventType.NEW_CHAT`.
92
+ * @param value - The value associated with the event (type not yet implemented).
93
+ *
94
+ * @overload
95
+ * Emits a `CHAT_FINISHED` event to a chat or monitor room.
96
+ * @param instanceName - The name of the instance emitting the event.
97
+ * @param room - The target room, either a `SocketChatRoom` or `SocketMonitorRoom`.
98
+ * @param event - The event type, `SocketEventType.CHAT_FINISHED`.
99
+ * @param value - The ID of the finished chat.
100
+ *
101
+ * @overload
102
+ * Emits a `QR_CODE` event to an admin room.
103
+ * @param instanceName - The name of the instance emitting the event.
104
+ * @param room - The target room, a `SocketAdminRoom`.
105
+ * @param event - The event type, `SocketEventType.QR_CODE`.
106
+ * @param value - The QR code data.
107
+ *
108
+ * @overload
109
+ * Emits a `MESSAGE` event to a chat room.
110
+ * @param instanceName - The name of the instance emitting the event.
111
+ * @param room - The target room, a `SocketChatRoom`.
112
+ * @param event - The event type, `SocketEventType.MESSAGE`.
113
+ * @param value - The value associated with the event (type not yet implemented).
114
+ *
115
+ * @overload
116
+ * Emits a `NOTIFICATION` event to an admin room.
117
+ * @param instanceName - The name of the instance emitting the event.
118
+ * @param room - The target room, a `SocketAdminRoom`.
119
+ * @param event - The event type, `SocketEventType.NOTIFICATION`.
120
+ * @param value - The value associated with the event (type not yet implemented).
121
+ *
122
+ * @overload
123
+ * Emits a `MESSAGE_EDIT` event to a chat room.
124
+ * @param instanceName - The name of the instance emitting the event.
125
+ * @param room - The target room, a `SocketChatRoom`.
126
+ * @param event - The event type, `SocketEventType.MESSAGE_EDIT`.
127
+ * @param value - The value associated with the event (type not yet implemented).
128
+ *
129
+ * @overload
130
+ * Emits a `MESSAGE_STATUS` event to a chat room.
131
+ * @param instanceName - The name of the instance emitting the event.
132
+ * @param room - The target room, a `SocketChatRoom`.
133
+ * @param event - The event type, `SocketEventType.MESSAGE_STATUS`.
134
+ * @param value - The value associated with the event (type not yet implemented).
135
+ *
136
+ * @overload
137
+ * Emits a `REPORT_STATUS` event to an admin room.
138
+ * @param instanceName - The name of the instance emitting the event.
139
+ * @param room - The target room, a `SocketAdminRoom`.
140
+ * @param event - The event type, `SocketEventType.REPORT_STATUS`.
141
+ * @param value - The report status data.
142
+ */
80
143
  export type EmitFunction = {
81
144
  (
82
145
  instanceName: string,
@@ -122,7 +185,7 @@ export type EmitFunction = {
122
185
  ): void;
123
186
  (
124
187
  instanceName: string,
125
- room: SocketAdminRoom,
188
+ room: SocketReportsRoom,
126
189
  event: SocketEventType.REPORT_STATUS,
127
190
  value: ReportStatusData
128
191
  ): void;