@periskope/types 0.6.234 → 0.6.235

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './object.types';
1
2
  export * from './rules.types';
2
3
  export * from './supabase.types';
3
4
  export * from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./object.types"), exports);
17
18
  __exportStar(require("./rules.types"), exports);
18
19
  __exportStar(require("./supabase.types"), exports);
19
20
  __exportStar(require("./types"), exports);
@@ -0,0 +1,347 @@
1
+ export type ObjChatType = {
2
+ org_id: string;
3
+ chat_id: string;
4
+ is_muted: boolean;
5
+ chat_name: string;
6
+ chat_type: string;
7
+ closed_at: string | null;
8
+ is_exited: boolean;
9
+ org_phone: string;
10
+ chat_image: string;
11
+ created_at: string;
12
+ updated_at: string;
13
+ assigned_to: string;
14
+ invite_link: string;
15
+ member_count: number;
16
+ flag_count_map: any;
17
+ info_admins_only: boolean | null;
18
+ message_unread_count: number | null;
19
+ messages_admins_only: boolean | null;
20
+ add_members_admins_only: boolean | null;
21
+ group_description: string | null;
22
+ labels: string[];
23
+ label_ids: Record<string, boolean>;
24
+ chat_access: Record<string, boolean>;
25
+ custom_properties: Record<string, string>;
26
+ members: Record<string, {
27
+ org_id: string;
28
+ chat_id: string;
29
+ is_admin: boolean;
30
+ org_phone: string;
31
+ contact_id: string;
32
+ is_internal: boolean;
33
+ contact_name: string;
34
+ contact_color: string;
35
+ contact_image: string;
36
+ is_super_admin: boolean;
37
+ }>;
38
+ latest_message: {
39
+ id: {
40
+ id: string;
41
+ remote: string;
42
+ from_me: boolean;
43
+ serialized: string;
44
+ };
45
+ to: string | null;
46
+ ack: string;
47
+ fts: string;
48
+ body: string;
49
+ from: string | null;
50
+ links: any;
51
+ media: any;
52
+ token: string | null;
53
+ author: string | null;
54
+ is_gif: boolean | null;
55
+ org_id: string;
56
+ vcards: any;
57
+ chat_id: string;
58
+ from_me: boolean;
59
+ duration: number | null;
60
+ location: any;
61
+ order_id: string | null;
62
+ raw_data: any;
63
+ broadcast: boolean | null;
64
+ has_media: boolean | null;
65
+ invite_v4: any;
66
+ is_status: boolean | null;
67
+ media_key: string | null;
68
+ org_phone: string;
69
+ poll_info: any;
70
+ prev_body: string | null;
71
+ timestamp: string;
72
+ unique_id: string;
73
+ is_deleted: boolean | null;
74
+ is_starred: boolean | null;
75
+ message_id: string;
76
+ updated_at: string;
77
+ device_type: string | null;
78
+ flag_status: string | null;
79
+ broadcast_id: string | null;
80
+ has_reaction: boolean | null;
81
+ is_ephemeral: boolean | null;
82
+ is_forwarded: boolean | null;
83
+ message_type: string;
84
+ performed_by: string | null;
85
+ poll_results: any;
86
+ sender_phone: string;
87
+ delivery_info: {
88
+ read: Record<string, number>;
89
+ pending: any[];
90
+ delivered: Record<string, number>;
91
+ read_count: number;
92
+ delivered_count: number;
93
+ };
94
+ flag_metadata: any;
95
+ mentioned_ids: string[];
96
+ has_quoted_msg: boolean | null;
97
+ sent_message_id: string;
98
+ forwarding_score: number | null;
99
+ message_ticket_id: string | null;
100
+ quoted_message_id: string | null;
101
+ flag_response_time: number | null;
102
+ };
103
+ };
104
+ export type ObjChatNotificationType = {
105
+ org_id: string;
106
+ notification_id: string;
107
+ chat_id: string;
108
+ author: string;
109
+ body: string | null;
110
+ id: {
111
+ id: string;
112
+ fromMe: boolean;
113
+ remote: string;
114
+ serialized: string;
115
+ };
116
+ recipientids: string[];
117
+ type: 'remove' | string;
118
+ timestamp: string;
119
+ org_phone: string;
120
+ unique_id: string;
121
+ };
122
+ export type ObjMessageType = {
123
+ message_id: string;
124
+ org_id: string;
125
+ ack: string;
126
+ author: string;
127
+ body: string | null;
128
+ broadcast: string | null;
129
+ device_type: 'android' | 'ios' | string | null;
130
+ flag_status: boolean | null;
131
+ duration: number | null;
132
+ forwarding_score: string;
133
+ from: string;
134
+ from_me: boolean;
135
+ has_media: boolean;
136
+ has_quoted_msg: boolean;
137
+ has_reaction: boolean;
138
+ id: {
139
+ id: string;
140
+ fromMe: boolean;
141
+ remote: string;
142
+ _serialized: string;
143
+ };
144
+ invite_v4: any | null;
145
+ is_ephemeral: boolean | null;
146
+ is_forwarded: boolean;
147
+ is_gif: boolean;
148
+ is_starred: boolean;
149
+ is_status: boolean;
150
+ links: string | null;
151
+ location: any | null;
152
+ media_key: string | null;
153
+ mentioned_ids: string[];
154
+ order_id: string | null;
155
+ raw_data: any | null;
156
+ to: string;
157
+ token: string | null;
158
+ message_type: string;
159
+ vcards: any[];
160
+ chat_id: string;
161
+ timestamp: string;
162
+ org_phone: string;
163
+ broadcast_id: string | null;
164
+ is_deleted: boolean | null;
165
+ media: {
166
+ path: string;
167
+ size: number;
168
+ filename: string;
169
+ mimetype: string;
170
+ dimensions: {
171
+ ar: number;
172
+ width: number;
173
+ height: number;
174
+ };
175
+ } | null;
176
+ performed_by: string;
177
+ prev_body: string | null;
178
+ quoted_message_id: string | null;
179
+ sender_phone: string;
180
+ sent_message_id: string;
181
+ delivery_info: {
182
+ read: Record<string, number>;
183
+ pending: string[];
184
+ delivered: Record<string, number>;
185
+ read_count: number;
186
+ delivered_count: number;
187
+ };
188
+ flag_metadata: {
189
+ status: boolean;
190
+ response_id: string;
191
+ response_type: string;
192
+ response_email: string;
193
+ response_timestamp: string;
194
+ } | null;
195
+ poll_info: {
196
+ options: {
197
+ allowMultipleAnswers: boolean;
198
+ };
199
+ pollName: string;
200
+ pollOptions: string[];
201
+ } | null;
202
+ poll_results: Record<string, Record<string, string>>;
203
+ updated_at: string;
204
+ message_ticket_id: string | null;
205
+ unique_id: string;
206
+ };
207
+ export type ObjReactionType = {
208
+ org_id: string;
209
+ message_id: string;
210
+ ack: string;
211
+ id: {
212
+ id: string;
213
+ fromMe: boolean;
214
+ remote: string;
215
+ _serialized: string;
216
+ };
217
+ orphan: string;
218
+ reaction: string;
219
+ read: boolean;
220
+ reaction_id: string;
221
+ timestamp: string;
222
+ msg_id: {
223
+ id: string;
224
+ fromMe: boolean;
225
+ remote: string;
226
+ _serialized: string;
227
+ };
228
+ orphan_reason: string | null;
229
+ sender_id: string;
230
+ org_phone: string;
231
+ chat_id: string;
232
+ unique_id: string;
233
+ };
234
+ export type ObjTicketType = {
235
+ chat: {
236
+ org_id: string;
237
+ org_phone: string;
238
+ chat_id: string;
239
+ members: Record<string, {
240
+ org_id: string;
241
+ chat_id: string;
242
+ is_admin: boolean;
243
+ org_phone: string;
244
+ contact_id: string;
245
+ is_internal: boolean;
246
+ contact_name: string;
247
+ contact_color: string;
248
+ contact_image: string;
249
+ is_super_admin: boolean;
250
+ }>;
251
+ is_muted: boolean;
252
+ chat_name: string;
253
+ chat_type: string;
254
+ chat_image: string;
255
+ created_at: string;
256
+ chat_labels: string;
257
+ invite_link: string;
258
+ custom_properties: Record<string, string>;
259
+ group_description: string | null;
260
+ };
261
+ message: {
262
+ body: string;
263
+ chat_id: string;
264
+ org_phone: string;
265
+ timestamp: string;
266
+ media_path: string;
267
+ message_id: string;
268
+ sender_name: string;
269
+ performed_by: string;
270
+ sender_phone: string;
271
+ };
272
+ ticket: {
273
+ org_id: string;
274
+ status: string;
275
+ subject: string;
276
+ assignee: string;
277
+ due_date: string;
278
+ priority: number;
279
+ closed_at: string;
280
+ closed_by: string;
281
+ raised_by: string;
282
+ ticket_id: string;
283
+ created_at: string;
284
+ is_deleted: boolean;
285
+ assigned_by: string;
286
+ ticket_labels: string;
287
+ quoted_message_id: string;
288
+ ticket_custom_properties: Record<string, string>;
289
+ };
290
+ attached_messages: Array<{
291
+ body: string;
292
+ chat_id: string;
293
+ org_phone: string;
294
+ timestamp: string;
295
+ media_path: string;
296
+ message_id: string;
297
+ sender_name: string;
298
+ performed_by: string;
299
+ sender_phone: string;
300
+ }>;
301
+ };
302
+ export type ObjContactType = {
303
+ chat_ids: string[];
304
+ contact_color: string;
305
+ contact_id: string;
306
+ contact_image: string;
307
+ contact_name: string;
308
+ contact_type: string;
309
+ is_imported: boolean | null;
310
+ is_internal: boolean;
311
+ is_my_contact: boolean | null;
312
+ is_wa_contact: boolean;
313
+ labels: string[];
314
+ org_id: string;
315
+ updated_at: string;
316
+ };
317
+ export type ObjPhoneType = {
318
+ org_id: string;
319
+ org_phone: string;
320
+ created_at: string;
321
+ updated_at: string;
322
+ wa_state: string;
323
+ phone_id: string;
324
+ qr_code: string | null;
325
+ phone_image: string;
326
+ phone_name: string;
327
+ first_connected_at: string;
328
+ is_ready: boolean;
329
+ label_ids: Record<string, boolean>;
330
+ labels: string[];
331
+ };
332
+ export type ObjMessageJobType = {
333
+ addedTimestamp: number;
334
+ attemptsMade: number;
335
+ attemptsStarted: number;
336
+ data: {
337
+ body: string;
338
+ chat_id: string;
339
+ };
340
+ finishedTimestamp: number;
341
+ id: string;
342
+ message_id: string;
343
+ processedTimestamp: number;
344
+ stacktrace: string[];
345
+ status: string;
346
+ };
347
+ //# sourceMappingURL=object.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.types.d.ts","sourceRoot":"","sources":["../src/object.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM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IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/mod_json_type.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
- {
2
- "name": "@periskope/types",
3
- "version": "0.6.234",
4
- "private": false,
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "dependencies": {
8
- "@types/pg": "8.11.2",
9
- "pg": "^8.11.3",
10
- "stripe": "^14.19.0",
11
- "ts-node": "^10.9.2",
12
- "type-fest": "^4.8.3"
13
- },
14
- "scripts": {
15
- "dev": "tsc --watch",
16
- "build": "tsc",
17
- "update-package": "tsc \u0026\u0026 npm publish --access public"
18
- }
19
- }
1
+ {
2
+ "name": "@periskope/types",
3
+ "version": "0.6.235",
4
+ "private": false,
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "dependencies": {
8
+ "@types/pg": "8.11.2",
9
+ "pg": "^8.11.3",
10
+ "stripe": "^14.19.0",
11
+ "ts-node": "^10.9.2",
12
+ "type-fest": "^4.8.3"
13
+ },
14
+ "scripts": {
15
+ "dev": "tsc --watch",
16
+ "build": "tsc",
17
+ "update-package": "tsc \u0026\u0026 npm publish --access public"
18
+ }
19
+ }
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './object.types';
1
2
  export * from './rules.types';
2
3
  export * from './supabase.types';
3
4
  export * from './types';
@@ -0,0 +1,362 @@
1
+ export type ObjChatType = {
2
+ org_id: string;
3
+ chat_id: string;
4
+ is_muted: boolean;
5
+ chat_name: string;
6
+ chat_type: string;
7
+ closed_at: string | null;
8
+ is_exited: boolean;
9
+ org_phone: string;
10
+ chat_image: string;
11
+ created_at: string;
12
+ updated_at: string;
13
+ assigned_to: string;
14
+ invite_link: string;
15
+ member_count: number;
16
+ flag_count_map: any; // change to appropriate type if known
17
+ info_admins_only: boolean | null;
18
+ message_unread_count: number | null;
19
+ messages_admins_only: boolean | null;
20
+ add_members_admins_only: boolean | null;
21
+ group_description: string | null;
22
+
23
+ labels: string[];
24
+ label_ids: Record<string, boolean>;
25
+ chat_access: Record<string, boolean>;
26
+ custom_properties: Record<string, string>;
27
+
28
+ members: Record<
29
+ string,
30
+ {
31
+ org_id: string;
32
+ chat_id: string;
33
+ is_admin: boolean;
34
+ org_phone: string;
35
+ contact_id: string;
36
+ is_internal: boolean;
37
+ contact_name: string;
38
+ contact_color: string;
39
+ contact_image: string;
40
+ is_super_admin: boolean;
41
+ }
42
+ >;
43
+
44
+ latest_message: {
45
+ id: {
46
+ id: string;
47
+ remote: string;
48
+ from_me: boolean;
49
+ serialized: string;
50
+ };
51
+ to: string | null;
52
+ ack: string;
53
+ fts: string;
54
+ body: string;
55
+ from: string | null;
56
+ links: any; // change to appropriate type if known
57
+ media: any; // change to appropriate type if known
58
+ token: string | null;
59
+ author: string | null;
60
+ is_gif: boolean | null;
61
+ org_id: string;
62
+ vcards: any; // change to appropriate type if known
63
+ chat_id: string;
64
+ from_me: boolean;
65
+ duration: number | null;
66
+ location: any; // change to appropriate type if known
67
+ order_id: string | null;
68
+ raw_data: any; // change to appropriate type if known
69
+ broadcast: boolean | null;
70
+ has_media: boolean | null;
71
+ invite_v4: any; // change to appropriate type if known
72
+ is_status: boolean | null;
73
+ media_key: string | null;
74
+ org_phone: string;
75
+ poll_info: any; // change to appropriate type if known
76
+ prev_body: string | null;
77
+ timestamp: string;
78
+ unique_id: string;
79
+ is_deleted: boolean | null;
80
+ is_starred: boolean | null;
81
+ message_id: string;
82
+ updated_at: string;
83
+ device_type: string | null;
84
+ flag_status: string | null;
85
+ broadcast_id: string | null;
86
+ has_reaction: boolean | null;
87
+ is_ephemeral: boolean | null;
88
+ is_forwarded: boolean | null;
89
+ message_type: string;
90
+ performed_by: string | null;
91
+ poll_results: any; // change to appropriate type if known
92
+ sender_phone: string;
93
+ delivery_info: {
94
+ read: Record<string, number>;
95
+ pending: any[]; // or string[] if known
96
+ delivered: Record<string, number>;
97
+ read_count: number;
98
+ delivered_count: number;
99
+ };
100
+ flag_metadata: any; // change to appropriate type if known
101
+ mentioned_ids: string[];
102
+ has_quoted_msg: boolean | null;
103
+ sent_message_id: string;
104
+ forwarding_score: number | null;
105
+ message_ticket_id: string | null;
106
+ quoted_message_id: string | null;
107
+ flag_response_time: number | null;
108
+ };
109
+ };
110
+
111
+ export type ObjChatNotificationType = {
112
+ org_id: string;
113
+ notification_id: string;
114
+ chat_id: string;
115
+ author: string;
116
+ body: string | null;
117
+ id: {
118
+ id: string;
119
+ fromMe: boolean;
120
+ remote: string;
121
+ serialized: string;
122
+ };
123
+ recipientids: string[];
124
+ type: 'remove' | string; // you can union other types if known
125
+ timestamp: string;
126
+ org_phone: string;
127
+ unique_id: string;
128
+ };
129
+
130
+ export type ObjMessageType = {
131
+ message_id: string;
132
+ org_id: string;
133
+ ack: string;
134
+ author: string;
135
+ body: string | null;
136
+ broadcast: string | null;
137
+ device_type: 'android' | 'ios' | string | null;
138
+ flag_status: boolean | null;
139
+ duration: number | null;
140
+ forwarding_score: string;
141
+ from: string;
142
+ from_me: boolean;
143
+ has_media: boolean;
144
+ has_quoted_msg: boolean;
145
+ has_reaction: boolean;
146
+ id: {
147
+ id: string;
148
+ fromMe: boolean;
149
+ remote: string;
150
+ _serialized: string;
151
+ };
152
+ invite_v4: any | null;
153
+ is_ephemeral: boolean | null;
154
+ is_forwarded: boolean;
155
+ is_gif: boolean;
156
+ is_starred: boolean;
157
+ is_status: boolean;
158
+ links: string | null; // or JSON-parsed structure if applicable
159
+ location: any | null;
160
+ media_key: string | null;
161
+ mentioned_ids: string[];
162
+ order_id: string | null;
163
+ raw_data: any | null;
164
+ to: string;
165
+ token: string | null;
166
+ message_type: string;
167
+ vcards: any[];
168
+ chat_id: string;
169
+ timestamp: string;
170
+ org_phone: string;
171
+ broadcast_id: string | null;
172
+ is_deleted: boolean | null;
173
+ media: {
174
+ path: string;
175
+ size: number;
176
+ filename: string;
177
+ mimetype: string;
178
+ dimensions: {
179
+ ar: number;
180
+ width: number;
181
+ height: number;
182
+ };
183
+ } | null;
184
+ performed_by: string;
185
+ prev_body: string | null;
186
+ quoted_message_id: string | null;
187
+ sender_phone: string;
188
+ sent_message_id: string;
189
+ delivery_info: {
190
+ read: Record<string, number>;
191
+ pending: string[];
192
+ delivered: Record<string, number>;
193
+ read_count: number;
194
+ delivered_count: number;
195
+ };
196
+ flag_metadata: {
197
+ status: boolean;
198
+ response_id: string;
199
+ response_type: string;
200
+ response_email: string;
201
+ response_timestamp: string;
202
+ } | null;
203
+ poll_info: {
204
+ options: {
205
+ allowMultipleAnswers: boolean;
206
+ };
207
+ pollName: string;
208
+ pollOptions: string[];
209
+ } | null;
210
+ poll_results: Record<string, Record<string, string>>;
211
+ updated_at: string;
212
+ message_ticket_id: string | null;
213
+ unique_id: string;
214
+ };
215
+
216
+ export type ObjReactionType = {
217
+ org_id: string;
218
+ message_id: string;
219
+ ack: string;
220
+ id: {
221
+ id: string;
222
+ fromMe: boolean;
223
+ remote: string;
224
+ _serialized: string;
225
+ };
226
+ orphan: string;
227
+ reaction: string;
228
+ read: boolean;
229
+ reaction_id: string;
230
+ timestamp: string;
231
+ msg_id: {
232
+ id: string;
233
+ fromMe: boolean;
234
+ remote: string;
235
+ _serialized: string;
236
+ };
237
+ orphan_reason: string | null;
238
+ sender_id: string;
239
+ org_phone: string;
240
+ chat_id: string;
241
+ unique_id: string;
242
+ };
243
+
244
+ export type ObjTicketType = {
245
+ chat: {
246
+ org_id: string;
247
+ org_phone: string;
248
+ chat_id: string;
249
+ members: Record<
250
+ string,
251
+ {
252
+ org_id: string;
253
+ chat_id: string;
254
+ is_admin: boolean;
255
+ org_phone: string;
256
+ contact_id: string;
257
+ is_internal: boolean;
258
+ contact_name: string;
259
+ contact_color: string;
260
+ contact_image: string;
261
+ is_super_admin: boolean;
262
+ }
263
+ >;
264
+ is_muted: boolean;
265
+ chat_name: string;
266
+ chat_type: string;
267
+ chat_image: string;
268
+ created_at: string;
269
+ chat_labels: string;
270
+ invite_link: string;
271
+ custom_properties: Record<string, string>;
272
+ group_description: string | null;
273
+ };
274
+ message: {
275
+ body: string;
276
+ chat_id: string;
277
+ org_phone: string;
278
+ timestamp: string;
279
+ media_path: string;
280
+ message_id: string;
281
+ sender_name: string;
282
+ performed_by: string;
283
+ sender_phone: string;
284
+ };
285
+ ticket: {
286
+ org_id: string;
287
+ status: string;
288
+ subject: string;
289
+ assignee: string;
290
+ due_date: string;
291
+ priority: number;
292
+ closed_at: string;
293
+ closed_by: string;
294
+ raised_by: string;
295
+ ticket_id: string;
296
+ created_at: string;
297
+ is_deleted: boolean;
298
+ assigned_by: string;
299
+ ticket_labels: string;
300
+ quoted_message_id: string;
301
+ ticket_custom_properties: Record<string, string>;
302
+ };
303
+ attached_messages: Array<{
304
+ body: string;
305
+ chat_id: string;
306
+ org_phone: string;
307
+ timestamp: string;
308
+ media_path: string;
309
+ message_id: string;
310
+ sender_name: string;
311
+ performed_by: string;
312
+ sender_phone: string;
313
+ }>;
314
+ };
315
+
316
+ export type ObjContactType = {
317
+ chat_ids: string[];
318
+ contact_color: string;
319
+ contact_id: string;
320
+ contact_image: string;
321
+ contact_name: string;
322
+ contact_type: string;
323
+ is_imported: boolean | null;
324
+ is_internal: boolean;
325
+ is_my_contact: boolean | null;
326
+ is_wa_contact: boolean;
327
+ labels: string[];
328
+ org_id: string;
329
+ updated_at: string;
330
+ };
331
+
332
+ export type ObjPhoneType = {
333
+ org_id: string;
334
+ org_phone: string;
335
+ created_at: string;
336
+ updated_at: string;
337
+ wa_state: string;
338
+ phone_id: string;
339
+ qr_code: string | null;
340
+ phone_image: string;
341
+ phone_name: string;
342
+ first_connected_at: string;
343
+ is_ready: boolean;
344
+ label_ids: Record<string, boolean>;
345
+ labels: string[];
346
+ };
347
+
348
+ export type ObjMessageJobType = {
349
+ addedTimestamp: number;
350
+ attemptsMade: number;
351
+ attemptsStarted: number;
352
+ data: {
353
+ body: string;
354
+ chat_id: string;
355
+ };
356
+ finishedTimestamp: number;
357
+ id: string;
358
+ message_id: string;
359
+ processedTimestamp: number;
360
+ stacktrace: string[];
361
+ status: string;
362
+ };
@@ -3275,4 +3275,4 @@ export const Constants = {
3275
3275
  },
3276
3276
  } as const
3277
3277
 
3278
-
3278
+