evo360-types 1.3.336 → 1.3.338

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.
@@ -10083,7 +10083,7 @@ export declare const zTakerTaxProfileSchema: z.ZodObject<{
10083
10083
  observations: z.ZodOptional<z.ZodString>;
10084
10084
  }, "strip", z.ZodTypeAny, {
10085
10085
  name: string;
10086
- type: "PJ" | "PF" | "unknown";
10086
+ type: "unknown" | "PJ" | "PF";
10087
10087
  email?: string | undefined;
10088
10088
  address?: z.objectOutputType<{
10089
10089
  postalCode: z.ZodOptional<z.ZodString>;
@@ -10103,7 +10103,7 @@ export declare const zTakerTaxProfileSchema: z.ZodObject<{
10103
10103
  observations?: string | undefined;
10104
10104
  }, {
10105
10105
  name: string;
10106
- type: "PJ" | "PF" | "unknown";
10106
+ type: "unknown" | "PJ" | "PF";
10107
10107
  email?: string | undefined;
10108
10108
  address?: z.objectInputType<{
10109
10109
  postalCode: z.ZodOptional<z.ZodString>;
@@ -10392,7 +10392,7 @@ export declare const zInvoiceTakerSnapshotSchema: z.ZodObject<{
10392
10392
  }, z.ZodTypeAny, "passthrough">>>;
10393
10393
  }, "strip", z.ZodTypeAny, {
10394
10394
  name: string;
10395
- taker_type: "PJ" | "PF" | "unknown";
10395
+ taker_type: "unknown" | "PJ" | "PF";
10396
10396
  email?: string | undefined;
10397
10397
  address?: z.objectOutputType<{
10398
10398
  street: z.ZodOptional<z.ZodString>;
@@ -10409,7 +10409,7 @@ export declare const zInvoiceTakerSnapshotSchema: z.ZodObject<{
10409
10409
  cpf_cnpj?: string | undefined;
10410
10410
  }, {
10411
10411
  name: string;
10412
- taker_type: "PJ" | "PF" | "unknown";
10412
+ taker_type: "unknown" | "PJ" | "PF";
10413
10413
  email?: string | undefined;
10414
10414
  address?: z.objectInputType<{
10415
10415
  street: z.ZodOptional<z.ZodString>;
@@ -10466,7 +10466,7 @@ export declare const zInvoiceTakerRefSchema: z.ZodObject<{
10466
10466
  }, z.ZodTypeAny, "passthrough">>>;
10467
10467
  }, "strip", z.ZodTypeAny, {
10468
10468
  name: string;
10469
- taker_type: "PJ" | "PF" | "unknown";
10469
+ taker_type: "unknown" | "PJ" | "PF";
10470
10470
  email?: string | undefined;
10471
10471
  address?: z.objectOutputType<{
10472
10472
  street: z.ZodOptional<z.ZodString>;
@@ -10483,7 +10483,7 @@ export declare const zInvoiceTakerRefSchema: z.ZodObject<{
10483
10483
  cpf_cnpj?: string | undefined;
10484
10484
  }, {
10485
10485
  name: string;
10486
- taker_type: "PJ" | "PF" | "unknown";
10486
+ taker_type: "unknown" | "PJ" | "PF";
10487
10487
  email?: string | undefined;
10488
10488
  address?: z.objectInputType<{
10489
10489
  street: z.ZodOptional<z.ZodString>;
@@ -10502,7 +10502,7 @@ export declare const zInvoiceTakerRefSchema: z.ZodObject<{
10502
10502
  }, "strip", z.ZodTypeAny, {
10503
10503
  snapshot: {
10504
10504
  name: string;
10505
- taker_type: "PJ" | "PF" | "unknown";
10505
+ taker_type: "unknown" | "PJ" | "PF";
10506
10506
  email?: string | undefined;
10507
10507
  address?: z.objectOutputType<{
10508
10508
  street: z.ZodOptional<z.ZodString>;
@@ -10524,7 +10524,7 @@ export declare const zInvoiceTakerRefSchema: z.ZodObject<{
10524
10524
  }, {
10525
10525
  snapshot: {
10526
10526
  name: string;
10527
- taker_type: "PJ" | "PF" | "unknown";
10527
+ taker_type: "unknown" | "PJ" | "PF";
10528
10528
  email?: string | undefined;
10529
10529
  address?: z.objectInputType<{
10530
10530
  street: z.ZodOptional<z.ZodString>;
@@ -10754,7 +10754,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10754
10754
  }, z.ZodTypeAny, "passthrough">>>;
10755
10755
  }, "strip", z.ZodTypeAny, {
10756
10756
  name: string;
10757
- taker_type: "PJ" | "PF" | "unknown";
10757
+ taker_type: "unknown" | "PJ" | "PF";
10758
10758
  email?: string | undefined;
10759
10759
  address?: z.objectOutputType<{
10760
10760
  street: z.ZodOptional<z.ZodString>;
@@ -10771,7 +10771,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10771
10771
  cpf_cnpj?: string | undefined;
10772
10772
  }, {
10773
10773
  name: string;
10774
- taker_type: "PJ" | "PF" | "unknown";
10774
+ taker_type: "unknown" | "PJ" | "PF";
10775
10775
  email?: string | undefined;
10776
10776
  address?: z.objectInputType<{
10777
10777
  street: z.ZodOptional<z.ZodString>;
@@ -10790,7 +10790,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10790
10790
  }, "strip", z.ZodTypeAny, {
10791
10791
  snapshot: {
10792
10792
  name: string;
10793
- taker_type: "PJ" | "PF" | "unknown";
10793
+ taker_type: "unknown" | "PJ" | "PF";
10794
10794
  email?: string | undefined;
10795
10795
  address?: z.objectOutputType<{
10796
10796
  street: z.ZodOptional<z.ZodString>;
@@ -10812,7 +10812,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10812
10812
  }, {
10813
10813
  snapshot: {
10814
10814
  name: string;
10815
- taker_type: "PJ" | "PF" | "unknown";
10815
+ taker_type: "unknown" | "PJ" | "PF";
10816
10816
  email?: string | undefined;
10817
10817
  address?: z.objectInputType<{
10818
10818
  street: z.ZodOptional<z.ZodString>;
@@ -10939,7 +10939,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10939
10939
  }, z.ZodTypeAny, "passthrough">>>;
10940
10940
  }, "strip", z.ZodTypeAny, {
10941
10941
  name: string;
10942
- taker_type: "PJ" | "PF" | "unknown";
10942
+ taker_type: "unknown" | "PJ" | "PF";
10943
10943
  email?: string | undefined;
10944
10944
  address?: z.objectOutputType<{
10945
10945
  street: z.ZodOptional<z.ZodString>;
@@ -10956,7 +10956,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10956
10956
  cpf_cnpj?: string | undefined;
10957
10957
  }, {
10958
10958
  name: string;
10959
- taker_type: "PJ" | "PF" | "unknown";
10959
+ taker_type: "unknown" | "PJ" | "PF";
10960
10960
  email?: string | undefined;
10961
10961
  address?: z.objectInputType<{
10962
10962
  street: z.ZodOptional<z.ZodString>;
@@ -10975,7 +10975,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10975
10975
  }, "strip", z.ZodTypeAny, {
10976
10976
  snapshot: {
10977
10977
  name: string;
10978
- taker_type: "PJ" | "PF" | "unknown";
10978
+ taker_type: "unknown" | "PJ" | "PF";
10979
10979
  email?: string | undefined;
10980
10980
  address?: z.objectOutputType<{
10981
10981
  street: z.ZodOptional<z.ZodString>;
@@ -10997,7 +10997,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
10997
10997
  }, {
10998
10998
  snapshot: {
10999
10999
  name: string;
11000
- taker_type: "PJ" | "PF" | "unknown";
11000
+ taker_type: "unknown" | "PJ" | "PF";
11001
11001
  email?: string | undefined;
11002
11002
  address?: z.objectInputType<{
11003
11003
  street: z.ZodOptional<z.ZodString>;
@@ -11124,7 +11124,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
11124
11124
  }, z.ZodTypeAny, "passthrough">>>;
11125
11125
  }, "strip", z.ZodTypeAny, {
11126
11126
  name: string;
11127
- taker_type: "PJ" | "PF" | "unknown";
11127
+ taker_type: "unknown" | "PJ" | "PF";
11128
11128
  email?: string | undefined;
11129
11129
  address?: z.objectOutputType<{
11130
11130
  street: z.ZodOptional<z.ZodString>;
@@ -11141,7 +11141,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
11141
11141
  cpf_cnpj?: string | undefined;
11142
11142
  }, {
11143
11143
  name: string;
11144
- taker_type: "PJ" | "PF" | "unknown";
11144
+ taker_type: "unknown" | "PJ" | "PF";
11145
11145
  email?: string | undefined;
11146
11146
  address?: z.objectInputType<{
11147
11147
  street: z.ZodOptional<z.ZodString>;
@@ -11160,7 +11160,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
11160
11160
  }, "strip", z.ZodTypeAny, {
11161
11161
  snapshot: {
11162
11162
  name: string;
11163
- taker_type: "PJ" | "PF" | "unknown";
11163
+ taker_type: "unknown" | "PJ" | "PF";
11164
11164
  email?: string | undefined;
11165
11165
  address?: z.objectOutputType<{
11166
11166
  street: z.ZodOptional<z.ZodString>;
@@ -11182,7 +11182,7 @@ export declare const zPaymentLinkSchema: z.ZodObject<{
11182
11182
  }, {
11183
11183
  snapshot: {
11184
11184
  name: string;
11185
- taker_type: "PJ" | "PF" | "unknown";
11185
+ taker_type: "unknown" | "PJ" | "PF";
11186
11186
  email?: string | undefined;
11187
11187
  address?: z.objectInputType<{
11188
11188
  street: z.ZodOptional<z.ZodString>;
@@ -11329,7 +11329,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11329
11329
  }, z.ZodTypeAny, "passthrough">>>;
11330
11330
  }, "strip", z.ZodTypeAny, {
11331
11331
  name: string;
11332
- taker_type: "PJ" | "PF" | "unknown";
11332
+ taker_type: "unknown" | "PJ" | "PF";
11333
11333
  email?: string | undefined;
11334
11334
  address?: z.objectOutputType<{
11335
11335
  street: z.ZodOptional<z.ZodString>;
@@ -11346,7 +11346,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11346
11346
  cpf_cnpj?: string | undefined;
11347
11347
  }, {
11348
11348
  name: string;
11349
- taker_type: "PJ" | "PF" | "unknown";
11349
+ taker_type: "unknown" | "PJ" | "PF";
11350
11350
  email?: string | undefined;
11351
11351
  address?: z.objectInputType<{
11352
11352
  street: z.ZodOptional<z.ZodString>;
@@ -11365,7 +11365,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11365
11365
  }, "strip", z.ZodTypeAny, {
11366
11366
  snapshot: {
11367
11367
  name: string;
11368
- taker_type: "PJ" | "PF" | "unknown";
11368
+ taker_type: "unknown" | "PJ" | "PF";
11369
11369
  email?: string | undefined;
11370
11370
  address?: z.objectOutputType<{
11371
11371
  street: z.ZodOptional<z.ZodString>;
@@ -11387,7 +11387,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11387
11387
  }, {
11388
11388
  snapshot: {
11389
11389
  name: string;
11390
- taker_type: "PJ" | "PF" | "unknown";
11390
+ taker_type: "unknown" | "PJ" | "PF";
11391
11391
  email?: string | undefined;
11392
11392
  address?: z.objectInputType<{
11393
11393
  street: z.ZodOptional<z.ZodString>;
@@ -11748,7 +11748,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11748
11748
  }, z.ZodTypeAny, "passthrough">>>;
11749
11749
  }, "strip", z.ZodTypeAny, {
11750
11750
  name: string;
11751
- taker_type: "PJ" | "PF" | "unknown";
11751
+ taker_type: "unknown" | "PJ" | "PF";
11752
11752
  email?: string | undefined;
11753
11753
  address?: z.objectOutputType<{
11754
11754
  street: z.ZodOptional<z.ZodString>;
@@ -11765,7 +11765,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11765
11765
  cpf_cnpj?: string | undefined;
11766
11766
  }, {
11767
11767
  name: string;
11768
- taker_type: "PJ" | "PF" | "unknown";
11768
+ taker_type: "unknown" | "PJ" | "PF";
11769
11769
  email?: string | undefined;
11770
11770
  address?: z.objectInputType<{
11771
11771
  street: z.ZodOptional<z.ZodString>;
@@ -11784,7 +11784,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11784
11784
  }, "strip", z.ZodTypeAny, {
11785
11785
  snapshot: {
11786
11786
  name: string;
11787
- taker_type: "PJ" | "PF" | "unknown";
11787
+ taker_type: "unknown" | "PJ" | "PF";
11788
11788
  email?: string | undefined;
11789
11789
  address?: z.objectOutputType<{
11790
11790
  street: z.ZodOptional<z.ZodString>;
@@ -11806,7 +11806,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
11806
11806
  }, {
11807
11807
  snapshot: {
11808
11808
  name: string;
11809
- taker_type: "PJ" | "PF" | "unknown";
11809
+ taker_type: "unknown" | "PJ" | "PF";
11810
11810
  email?: string | undefined;
11811
11811
  address?: z.objectInputType<{
11812
11812
  street: z.ZodOptional<z.ZodString>;
@@ -12167,7 +12167,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
12167
12167
  }, z.ZodTypeAny, "passthrough">>>;
12168
12168
  }, "strip", z.ZodTypeAny, {
12169
12169
  name: string;
12170
- taker_type: "PJ" | "PF" | "unknown";
12170
+ taker_type: "unknown" | "PJ" | "PF";
12171
12171
  email?: string | undefined;
12172
12172
  address?: z.objectOutputType<{
12173
12173
  street: z.ZodOptional<z.ZodString>;
@@ -12184,7 +12184,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
12184
12184
  cpf_cnpj?: string | undefined;
12185
12185
  }, {
12186
12186
  name: string;
12187
- taker_type: "PJ" | "PF" | "unknown";
12187
+ taker_type: "unknown" | "PJ" | "PF";
12188
12188
  email?: string | undefined;
12189
12189
  address?: z.objectInputType<{
12190
12190
  street: z.ZodOptional<z.ZodString>;
@@ -12203,7 +12203,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
12203
12203
  }, "strip", z.ZodTypeAny, {
12204
12204
  snapshot: {
12205
12205
  name: string;
12206
- taker_type: "PJ" | "PF" | "unknown";
12206
+ taker_type: "unknown" | "PJ" | "PF";
12207
12207
  email?: string | undefined;
12208
12208
  address?: z.objectOutputType<{
12209
12209
  street: z.ZodOptional<z.ZodString>;
@@ -12225,7 +12225,7 @@ export declare const zServiceInvoiceSchema: z.ZodObject<{
12225
12225
  }, {
12226
12226
  snapshot: {
12227
12227
  name: string;
12228
- taker_type: "PJ" | "PF" | "unknown";
12228
+ taker_type: "unknown" | "PJ" | "PF";
12229
12229
  email?: string | undefined;
12230
12230
  address?: z.objectInputType<{
12231
12231
  street: z.ZodOptional<z.ZodString>;
@@ -18,14 +18,14 @@ export declare const zNotifUserSourceSchema: z.ZodObject<{
18
18
  actorId: z.ZodOptional<z.ZodString>;
19
19
  actorName: z.ZodOptional<z.ZodString>;
20
20
  }, "strip", z.ZodTypeAny, {
21
- module: string;
22
21
  event: string;
22
+ module: string;
23
23
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
24
24
  actorId?: string | undefined;
25
25
  actorName?: string | undefined;
26
26
  }, {
27
- module: string;
28
27
  event: string;
28
+ module: string;
29
29
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
30
30
  actorId?: string | undefined;
31
31
  actorName?: string | undefined;
@@ -87,14 +87,14 @@ export declare const zNotifUserSchema: z.ZodObject<{
87
87
  actorId: z.ZodOptional<z.ZodString>;
88
88
  actorName: z.ZodOptional<z.ZodString>;
89
89
  }, "strip", z.ZodTypeAny, {
90
- module: string;
91
90
  event: string;
91
+ module: string;
92
92
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
93
93
  actorId?: string | undefined;
94
94
  actorName?: string | undefined;
95
95
  }, {
96
- module: string;
97
96
  event: string;
97
+ module: string;
98
98
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
99
99
  actorId?: string | undefined;
100
100
  actorName?: string | undefined;
@@ -166,14 +166,14 @@ export declare const zNotifUserSchema: z.ZodObject<{
166
166
  actorId: z.ZodOptional<z.ZodString>;
167
167
  actorName: z.ZodOptional<z.ZodString>;
168
168
  }, "strip", z.ZodTypeAny, {
169
- module: string;
170
169
  event: string;
170
+ module: string;
171
171
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
172
172
  actorId?: string | undefined;
173
173
  actorName?: string | undefined;
174
174
  }, {
175
- module: string;
176
175
  event: string;
176
+ module: string;
177
177
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
178
178
  actorId?: string | undefined;
179
179
  actorName?: string | undefined;
@@ -245,14 +245,14 @@ export declare const zNotifUserSchema: z.ZodObject<{
245
245
  actorId: z.ZodOptional<z.ZodString>;
246
246
  actorName: z.ZodOptional<z.ZodString>;
247
247
  }, "strip", z.ZodTypeAny, {
248
- module: string;
249
248
  event: string;
249
+ module: string;
250
250
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
251
251
  actorId?: string | undefined;
252
252
  actorName?: string | undefined;
253
253
  }, {
254
- module: string;
255
254
  event: string;
255
+ module: string;
256
256
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
257
257
  actorId?: string | undefined;
258
258
  actorName?: string | undefined;
@@ -323,14 +323,14 @@ export declare const zCreateNotifUserInputSchema: z.ZodObject<{
323
323
  actorId: z.ZodOptional<z.ZodString>;
324
324
  actorName: z.ZodOptional<z.ZodString>;
325
325
  }, "strip", z.ZodTypeAny, {
326
- module: string;
327
326
  event: string;
327
+ module: string;
328
328
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
329
329
  actorId?: string | undefined;
330
330
  actorName?: string | undefined;
331
331
  }, {
332
- module: string;
333
332
  event: string;
333
+ module: string;
334
334
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
335
335
  actorId?: string | undefined;
336
336
  actorName?: string | undefined;
@@ -381,8 +381,8 @@ export declare const zCreateNotifUserInputSchema: z.ZodObject<{
381
381
  category: string;
382
382
  userId: string;
383
383
  source?: {
384
- module: string;
385
384
  event: string;
385
+ module: string;
386
386
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
387
387
  actorId?: string | undefined;
388
388
  actorName?: string | undefined;
@@ -414,8 +414,8 @@ export declare const zCreateNotifUserInputSchema: z.ZodObject<{
414
414
  category: string;
415
415
  userId: string;
416
416
  source?: {
417
- module: string;
418
417
  event: string;
418
+ module: string;
419
419
  actorType?: "user" | "system" | "automation" | "ai" | undefined;
420
420
  actorId?: string | undefined;
421
421
  actorName?: string | undefined;
@@ -9,6 +9,7 @@ export * from "./ticket";
9
9
  export * from "./inbox";
10
10
  export * from "./waba-template";
11
11
  export * from "./quick-reply";
12
+ export * from "./search";
12
13
  export declare const EvoChatPermissions: {
13
14
  readonly Read: "evo_chat_read";
14
15
  readonly Write: "evo_chat_write";
@@ -26,6 +26,7 @@ __exportStar(require("./ticket"), exports);
26
26
  __exportStar(require("./inbox"), exports);
27
27
  __exportStar(require("./waba-template"), exports);
28
28
  __exportStar(require("./quick-reply"), exports);
29
+ __exportStar(require("./search"), exports);
29
30
  // Permissões para o evo-chat
30
31
  exports.EvoChatPermissions = {
31
32
  Read: "evo_chat_read",
@@ -9,6 +9,7 @@ export * from "./ticket";
9
9
  export * from "./inbox";
10
10
  export * from "./waba-template";
11
11
  export * from "./quick-reply";
12
+ export * from "./search";
12
13
 
13
14
  // Permissões para o evo-chat
14
15
  export const EvoChatPermissions = {
@@ -0,0 +1,135 @@
1
+ export type SearchTicketStatus = 'open' | 'closed';
2
+ export type SearchAttendantType = 'ai' | 'human' | 'hybrid' | 'unknown';
3
+ export interface SearchThreadsParams {
4
+ date_from?: string;
5
+ date_to?: string;
6
+ status?: SearchTicketStatus;
7
+ department_ids?: string[];
8
+ attendant_type?: SearchAttendantType;
9
+ assigned_user_id?: string;
10
+ tag_ids?: string[];
11
+ cursor?: string;
12
+ limit?: number;
13
+ }
14
+ export interface SearchThreadCursor {
15
+ last_activity_ms: number;
16
+ contact_id: string;
17
+ }
18
+ export interface ThreadAggregateContact {
19
+ name: string;
20
+ subtitle?: string;
21
+ lead_id?: string | null;
22
+ }
23
+ export interface ThreadAggregateTag {
24
+ id: string;
25
+ name: string;
26
+ color?: string;
27
+ }
28
+ export interface ThreadAggregateCurrentOpenTicket {
29
+ id: string;
30
+ department_id?: string;
31
+ department_name?: string;
32
+ assigned_user_id?: string | null;
33
+ assigned_user_name?: string | null;
34
+ attendant_type?: SearchAttendantType | null;
35
+ last_message_at?: string;
36
+ waiting_since?: string;
37
+ unread_count?: number;
38
+ open_count_match: boolean;
39
+ }
40
+ export interface ThreadAggregate {
41
+ tenant: string;
42
+ contact_id: string;
43
+ thread_id: string;
44
+ last_activity_at: string;
45
+ total_tickets: number;
46
+ open_count_bq: number;
47
+ closed_count_bq: number;
48
+ departments_seen: string[];
49
+ attendant_types_seen: SearchAttendantType[];
50
+ latest_ticket_id?: string | null;
51
+ contact?: ThreadAggregateContact;
52
+ tags?: ThreadAggregateTag[];
53
+ current_open_ticket?: ThreadAggregateCurrentOpenTicket | null;
54
+ }
55
+ export interface SearchThreadsStats {
56
+ bq_query_id?: string;
57
+ bq_bytes_processed?: number;
58
+ fs_reads: number;
59
+ duration_ms: number;
60
+ }
61
+ export interface SearchThreadsResponse {
62
+ ok: true;
63
+ threads: ThreadAggregate[];
64
+ nextCursor?: string;
65
+ stats: SearchThreadsStats;
66
+ }
67
+ export type SearchThreadsErrorCode = 'invalid_filter' | 'tag_filter_too_broad' | 'forbidden' | 'bq_error' | 'fs_error';
68
+ export interface SearchThreadsErrorResponse {
69
+ ok: false;
70
+ error: string;
71
+ code: SearchThreadsErrorCode;
72
+ error_id?: string;
73
+ }
74
+ export type TimelineEntryType = 'event' | 'message_in' | 'message_out' | 'internal_note' | 'status' | 'reaction';
75
+ export interface TimelineParams {
76
+ date_from?: string;
77
+ date_to?: string;
78
+ types?: TimelineEntryType[];
79
+ cursor?: string;
80
+ limit?: number;
81
+ }
82
+ export interface TimelineEventEntry {
83
+ type: 'event';
84
+ occurred_at: string;
85
+ event_id: string;
86
+ event_type: string;
87
+ ticket_id?: string;
88
+ actor_display_name?: string;
89
+ department_name?: string;
90
+ extras?: Record<string, unknown>;
91
+ }
92
+ export interface TimelineMessageEntry {
93
+ type: 'message_in' | 'message_out' | 'internal_note';
94
+ occurred_at: string;
95
+ firestore_message_id: string;
96
+ direction: 'in' | 'out' | 'internal';
97
+ message_type: string;
98
+ body_preview?: string;
99
+ channel_type?: string;
100
+ ticket_id?: string;
101
+ }
102
+ export interface TimelineStatusEntry {
103
+ type: 'status';
104
+ occurred_at: string;
105
+ firestore_message_id: string;
106
+ status_type: string;
107
+ channel_type?: string;
108
+ error_code?: string;
109
+ }
110
+ export interface TimelineReactionEntry {
111
+ type: 'reaction';
112
+ occurred_at: string;
113
+ action: 'added' | 'removed';
114
+ emoji?: string | null;
115
+ reactor_wa_id?: string;
116
+ reactor_display_name?: string;
117
+ target_firestore_message_id: string;
118
+ direction: 'in' | 'out';
119
+ }
120
+ export type TimelineEntry = TimelineEventEntry | TimelineMessageEntry | TimelineStatusEntry | TimelineReactionEntry;
121
+ export interface TimelineCursor {
122
+ occurred_at_ms: number;
123
+ tiebreak: string;
124
+ }
125
+ export interface TimelineStats {
126
+ bq_query_id?: string;
127
+ bq_bytes_processed?: number;
128
+ duration_ms: number;
129
+ }
130
+ export interface TimelineResponse {
131
+ ok: true;
132
+ timeline: TimelineEntry[];
133
+ nextCursor?: string;
134
+ stats: TimelineStats;
135
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // feat-008-omni-tickets-search — types for hubomni_search Cloud Function.
3
+ // List endpoint reads only `evo_chat.events` (BigQuery) + Firestore enrichment
4
+ // for top-N. Timeline endpoint UNION-ALLs events + messages_raw +
5
+ // message_statuses + message_reactions for a single contact (archive use case).
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,178 @@
1
+ // feat-008-omni-tickets-search — types for hubomni_search Cloud Function.
2
+ // List endpoint reads only `evo_chat.events` (BigQuery) + Firestore enrichment
3
+ // for top-N. Timeline endpoint UNION-ALLs events + messages_raw +
4
+ // message_statuses + message_reactions for a single contact (archive use case).
5
+
6
+ export type SearchTicketStatus = 'open' | 'closed';
7
+
8
+ export type SearchAttendantType = 'ai' | 'human' | 'hybrid' | 'unknown';
9
+
10
+ export interface SearchThreadsParams {
11
+ date_from?: string;
12
+ date_to?: string;
13
+ status?: SearchTicketStatus;
14
+ department_ids?: string[];
15
+ attendant_type?: SearchAttendantType;
16
+ assigned_user_id?: string;
17
+ tag_ids?: string[];
18
+ cursor?: string;
19
+ limit?: number;
20
+ }
21
+
22
+ export interface SearchThreadCursor {
23
+ last_activity_ms: number;
24
+ contact_id: string;
25
+ }
26
+
27
+ export interface ThreadAggregateContact {
28
+ name: string;
29
+ subtitle?: string;
30
+ lead_id?: string | null;
31
+ }
32
+
33
+ export interface ThreadAggregateTag {
34
+ id: string;
35
+ name: string;
36
+ color?: string;
37
+ }
38
+
39
+ export interface ThreadAggregateCurrentOpenTicket {
40
+ id: string;
41
+ department_id?: string;
42
+ department_name?: string;
43
+ assigned_user_id?: string | null;
44
+ assigned_user_name?: string | null;
45
+ attendant_type?: SearchAttendantType | null;
46
+ last_message_at?: string;
47
+ waiting_since?: string;
48
+ unread_count?: number;
49
+ open_count_match: boolean;
50
+ }
51
+
52
+ export interface ThreadAggregate {
53
+ tenant: string;
54
+ contact_id: string;
55
+ thread_id: string;
56
+ last_activity_at: string;
57
+ total_tickets: number;
58
+ open_count_bq: number;
59
+ closed_count_bq: number;
60
+ departments_seen: string[];
61
+ attendant_types_seen: SearchAttendantType[];
62
+ latest_ticket_id?: string | null;
63
+ contact?: ThreadAggregateContact;
64
+ tags?: ThreadAggregateTag[];
65
+ current_open_ticket?: ThreadAggregateCurrentOpenTicket | null;
66
+ }
67
+
68
+ export interface SearchThreadsStats {
69
+ bq_query_id?: string;
70
+ bq_bytes_processed?: number;
71
+ fs_reads: number;
72
+ duration_ms: number;
73
+ }
74
+
75
+ export interface SearchThreadsResponse {
76
+ ok: true;
77
+ threads: ThreadAggregate[];
78
+ nextCursor?: string;
79
+ stats: SearchThreadsStats;
80
+ }
81
+
82
+ export type SearchThreadsErrorCode =
83
+ | 'invalid_filter'
84
+ | 'tag_filter_too_broad'
85
+ | 'forbidden'
86
+ | 'bq_error'
87
+ | 'fs_error';
88
+
89
+ export interface SearchThreadsErrorResponse {
90
+ ok: false;
91
+ error: string;
92
+ code: SearchThreadsErrorCode;
93
+ error_id?: string;
94
+ }
95
+
96
+ // ── Timeline ──
97
+
98
+ export type TimelineEntryType =
99
+ | 'event'
100
+ | 'message_in'
101
+ | 'message_out'
102
+ | 'internal_note'
103
+ | 'status'
104
+ | 'reaction';
105
+
106
+ export interface TimelineParams {
107
+ date_from?: string;
108
+ date_to?: string;
109
+ types?: TimelineEntryType[];
110
+ cursor?: string;
111
+ limit?: number;
112
+ }
113
+
114
+ export interface TimelineEventEntry {
115
+ type: 'event';
116
+ occurred_at: string;
117
+ event_id: string;
118
+ event_type: string;
119
+ ticket_id?: string;
120
+ actor_display_name?: string;
121
+ department_name?: string;
122
+ extras?: Record<string, unknown>;
123
+ }
124
+
125
+ export interface TimelineMessageEntry {
126
+ type: 'message_in' | 'message_out' | 'internal_note';
127
+ occurred_at: string;
128
+ firestore_message_id: string;
129
+ direction: 'in' | 'out' | 'internal';
130
+ message_type: string;
131
+ body_preview?: string;
132
+ channel_type?: string;
133
+ ticket_id?: string;
134
+ }
135
+
136
+ export interface TimelineStatusEntry {
137
+ type: 'status';
138
+ occurred_at: string;
139
+ firestore_message_id: string;
140
+ status_type: string;
141
+ channel_type?: string;
142
+ error_code?: string;
143
+ }
144
+
145
+ export interface TimelineReactionEntry {
146
+ type: 'reaction';
147
+ occurred_at: string;
148
+ action: 'added' | 'removed';
149
+ emoji?: string | null;
150
+ reactor_wa_id?: string;
151
+ reactor_display_name?: string;
152
+ target_firestore_message_id: string;
153
+ direction: 'in' | 'out';
154
+ }
155
+
156
+ export type TimelineEntry =
157
+ | TimelineEventEntry
158
+ | TimelineMessageEntry
159
+ | TimelineStatusEntry
160
+ | TimelineReactionEntry;
161
+
162
+ export interface TimelineCursor {
163
+ occurred_at_ms: number;
164
+ tiebreak: string;
165
+ }
166
+
167
+ export interface TimelineStats {
168
+ bq_query_id?: string;
169
+ bq_bytes_processed?: number;
170
+ duration_ms: number;
171
+ }
172
+
173
+ export interface TimelineResponse {
174
+ ok: true;
175
+ timeline: TimelineEntry[];
176
+ nextCursor?: string;
177
+ stats: TimelineStats;
178
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.336",
3
+ "version": "1.3.338",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",