evo360-types 1.3.321 → 1.3.326

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.
Files changed (36) hide show
  1. package/dist/apps/evo-chat/dic/ticket-close/zod-schemas.d.ts +207 -0
  2. package/dist/apps/evo-chat/dic/ticket-close/zod-schemas.js +27 -0
  3. package/dist/apps/evo-chat/dic/ticket-close/zod-schemas.ts +26 -0
  4. package/dist/apps/evo-chat/ticket/zod-schemas.d.ts +109 -49
  5. package/dist/apps/evo-chat/ticket/zod-schemas.js +12 -7
  6. package/dist/apps/evo-chat/ticket/zod-schemas.ts +11 -6
  7. package/dist/apps/evo-task/zod-schemas.d.ts +68 -4
  8. package/dist/apps/evo-task/zod-schemas.js +12 -1
  9. package/dist/apps/evo-task/zod-schemas.ts +12 -0
  10. package/dist/apps/evo-task-runner/index.d.ts +1 -0
  11. package/dist/apps/evo-task-runner/index.js +17 -0
  12. package/dist/apps/evo-task-runner/index.ts +1 -0
  13. package/dist/apps/evo-task-runner/zod-schemas.d.ts +30 -0
  14. package/dist/apps/evo-task-runner/zod-schemas.js +15 -0
  15. package/dist/apps/evo-task-runner/zod-schemas.ts +15 -0
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.js +3 -0
  18. package/dist/index.ts +3 -0
  19. package/dist/types/evo-chat/dic/index.d.ts +30 -0
  20. package/dist/types/evo-chat/dic/index.js +26 -0
  21. package/dist/types/evo-chat/dic/index.ts +39 -0
  22. package/dist/types/evo-chat/fb_collections.d.ts +4 -0
  23. package/dist/types/evo-chat/fb_collections.js +6 -1
  24. package/dist/types/evo-chat/fb_collections.ts +6 -0
  25. package/dist/types/evo-chat/ticket/index.d.ts +11 -6
  26. package/dist/types/evo-chat/ticket/index.ts +11 -6
  27. package/dist/types/evo-task/index.d.ts +9 -0
  28. package/dist/types/evo-task/index.js +1 -0
  29. package/dist/types/evo-task/index.ts +13 -0
  30. package/dist/types/evo-task-runner/fb_collections.d.ts +1 -0
  31. package/dist/types/evo-task-runner/fb_collections.js +8 -0
  32. package/dist/types/evo-task-runner/fb_collections.ts +5 -0
  33. package/dist/types/evo-task-runner/index.d.ts +4 -0
  34. package/dist/types/evo-task-runner/index.js +23 -1
  35. package/dist/types/evo-task-runner/index.ts +11 -0
  36. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zTaskLogSchema = exports.zTaskExecutionSchema = exports.zTaskExecutionProviderSchema = exports.zTaskExecutionErrorSchema = exports.zTaskCommentSchema = exports.zTaskCommentAuthorSchema = exports.zTaskSchema = exports.zTaskCreatorSchema = exports.zTaskOnFailureSchema = exports.zTaskAutoSpecSchema = exports.zTaskDedupSchema = exports.zTaskRetryPolicySchema = exports.zTaskLockSchema = exports.zTaskUserAssigneeSchema = exports.zTaskScheduleSchema = exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema = exports.zTaskExecutionStatusSchema = exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema = exports.zTaskDedupWindowSchema = exports.zTaskDedupScopeSchema = exports.zTaskRetryStrategySchema = exports.zTaskAutoHandlerSchema = exports.zTaskModeSchema = exports.zTaskSourceSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
3
+ exports.zTaskLogSchema = exports.zTaskExecutionSchema = exports.zTaskExecutionProviderSchema = exports.zTaskExecutionErrorSchema = exports.zTaskCommentSchema = exports.zTaskCommentAuthorSchema = exports.zTaskSchema = exports.zTaskCreatorSchema = exports.zTaskOnFailureSchema = exports.zTaskAutoSpecSchema = exports.zTaskDedupSchema = exports.zTaskRetryPolicySchema = exports.zTaskRunnerStateSchema = exports.zTaskLockSchema = exports.zTaskUserAssigneeSchema = exports.zTaskScheduleSchema = exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema = exports.zTaskExecutionStatusSchema = exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema = exports.zTaskDedupWindowSchema = exports.zTaskDedupScopeSchema = exports.zTaskRetryStrategySchema = exports.zTaskAutoHandlerSchema = exports.zTaskModeSchema = exports.zTaskSourceSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../shared/zod-schemas");
6
6
  exports.zTaskActionSchema = zod_1.z.enum([
@@ -16,6 +16,7 @@ exports.zTaskStatusSchema = zod_1.z.enum([
16
16
  "cancelled",
17
17
  "on_hold",
18
18
  "suppressed",
19
+ "dead_letter",
19
20
  ]);
20
21
  exports.zTaskPrioritySchema = zod_1.z.enum(["low", "medium", "high"]);
21
22
  exports.zTaskSourceSchema = zod_1.z.enum(["user", "automation_hub", "system"]);
@@ -83,6 +84,15 @@ exports.zTaskLockSchema = zod_1.z
83
84
  lock_until: zod_1.z.coerce.date(),
84
85
  })
85
86
  .passthrough();
87
+ // Schema para ITaskRunnerState
88
+ exports.zTaskRunnerStateSchema = zod_1.z
89
+ .object({
90
+ reclaim_count: zod_1.z.number().optional(),
91
+ fallback_index: zod_1.z.number().optional(),
92
+ last_dispatch_at: zod_1.z.coerce.date().optional(),
93
+ dispatched_attempts: zod_1.z.number().optional(),
94
+ })
95
+ .passthrough();
86
96
  // Schema para ITaskRetryPolicy
87
97
  exports.zTaskRetryPolicySchema = zod_1.z
88
98
  .object({
@@ -179,6 +189,7 @@ exports.zTaskSchema = zod_schemas_1.zFireDocSchema
179
189
  lock: exports.zTaskLockSchema.optional(), // for auto tasks
180
190
  retry: exports.zTaskRetryPolicySchema.optional(), // for auto tasks
181
191
  on_failure: exports.zTaskOnFailureSchema.optional(), // for auto tasks
192
+ runner_state: exports.zTaskRunnerStateSchema.optional(), // for auto tasks (maintained by Task Runner)
182
193
  auto: exports.zTaskAutoSpecSchema.optional(), // for auto tasks (required when mode=auto)
183
194
  })
184
195
  .passthrough();
@@ -15,6 +15,7 @@ export const zTaskStatusSchema = z.enum([
15
15
  "cancelled",
16
16
  "on_hold",
17
17
  "suppressed",
18
+ "dead_letter",
18
19
  ]);
19
20
 
20
21
  export const zTaskPrioritySchema = z.enum(["low", "medium", "high"]);
@@ -101,6 +102,16 @@ export const zTaskLockSchema = z
101
102
  })
102
103
  .passthrough();
103
104
 
105
+ // Schema para ITaskRunnerState
106
+ export const zTaskRunnerStateSchema = z
107
+ .object({
108
+ reclaim_count: z.number().optional(),
109
+ fallback_index: z.number().optional(),
110
+ last_dispatch_at: z.coerce.date().optional(),
111
+ dispatched_attempts: z.number().optional(),
112
+ })
113
+ .passthrough();
114
+
104
115
  // Schema para ITaskRetryPolicy
105
116
  export const zTaskRetryPolicySchema = z
106
117
  .object({
@@ -204,6 +215,7 @@ export const zTaskSchema = zFireDocSchema
204
215
  lock: zTaskLockSchema.optional(), // for auto tasks
205
216
  retry: zTaskRetryPolicySchema.optional(), // for auto tasks
206
217
  on_failure: zTaskOnFailureSchema.optional(), // for auto tasks
218
+ runner_state: zTaskRunnerStateSchema.optional(), // for auto tasks (maintained by Task Runner)
207
219
  auto: zTaskAutoSpecSchema.optional(), // for auto tasks (required when mode=auto)
208
220
  })
209
221
  .passthrough();
@@ -0,0 +1 @@
1
+ export * from "./zod-schemas";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./zod-schemas"), exports);
@@ -0,0 +1 @@
1
+ export * from "./zod-schemas";
@@ -0,0 +1,30 @@
1
+ import { z } from "zod";
2
+ export declare const zTaskRunnerConfigSchema: z.ZodObject<{
3
+ active: z.ZodDefault<z.ZodBoolean>;
4
+ limits: z.ZodOptional<z.ZodObject<{
5
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
6
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
7
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
8
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
9
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
10
+ }, z.ZodTypeAny, "passthrough">>>;
11
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12
+ active: z.ZodDefault<z.ZodBoolean>;
13
+ limits: z.ZodOptional<z.ZodObject<{
14
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
15
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
16
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
17
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
18
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
19
+ }, z.ZodTypeAny, "passthrough">>>;
20
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
21
+ active: z.ZodDefault<z.ZodBoolean>;
22
+ limits: z.ZodOptional<z.ZodObject<{
23
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
24
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
25
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
26
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
27
+ max_claims_per_tick: z.ZodOptional<z.ZodNumber>;
28
+ }, z.ZodTypeAny, "passthrough">>>;
29
+ }, z.ZodTypeAny, "passthrough">>;
30
+ export type ITaskRunnerConfig = z.infer<typeof zTaskRunnerConfigSchema>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.zTaskRunnerConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.zTaskRunnerConfigSchema = zod_1.z
6
+ .object({
7
+ active: zod_1.z.boolean().default(false),
8
+ limits: zod_1.z
9
+ .object({
10
+ max_claims_per_tick: zod_1.z.number().optional(),
11
+ })
12
+ .passthrough()
13
+ .optional(),
14
+ })
15
+ .passthrough();
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+
3
+ export const zTaskRunnerConfigSchema = z
4
+ .object({
5
+ active: z.boolean().default(false),
6
+ limits: z
7
+ .object({
8
+ max_claims_per_tick: z.number().optional(),
9
+ })
10
+ .passthrough()
11
+ .optional(),
12
+ })
13
+ .passthrough();
14
+
15
+ export type ITaskRunnerConfig = z.infer<typeof zTaskRunnerConfigSchema>;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from "./types/evo-people";
8
8
  export * from "./types/evo-crm/dic";
9
9
  export * from "./types/evo-crm/lead";
10
10
  export * from "./types/evo-chat";
11
+ export * from "./types/evo-chat/dic";
11
12
  export * from "./types/evo-med/calendar";
12
13
  export * from "./types/evo-med/appointment";
13
14
  export * from "./types/evo-med/dic";
@@ -29,6 +30,7 @@ export * from "./apps/evo-activity/zod-schemas";
29
30
  export * from "./apps/evo-people/zod-schemas";
30
31
  export * from "./apps/evo-crm/dic/zod-schemas";
31
32
  export * from "./apps/evo-crm/lead/zod-schemas";
33
+ export * from "./apps/evo-chat/dic/ticket-close/zod-schemas";
32
34
  export * from "./apps/evo-chat/chatbee/zod-schemas";
33
35
  export * from "./apps/evo-chat/contact/zod-schemas";
34
36
  export * from "./apps/evo-chat/message/zod-schemas";
@@ -53,3 +55,4 @@ export * from "./apps/evo-survey/zod-schemas";
53
55
  export * from "./apps/evo-finops/zod-schemas";
54
56
  export * from "./apps/evo-notif-user/zod-schemas";
55
57
  export * from "./apps/evo-notifications/zod-schemas";
58
+ export * from "./apps/evo-task-runner/zod-schemas";
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ __exportStar(require("./types/evo-people"), exports);
25
25
  __exportStar(require("./types/evo-crm/dic"), exports);
26
26
  __exportStar(require("./types/evo-crm/lead"), exports);
27
27
  __exportStar(require("./types/evo-chat"), exports);
28
+ __exportStar(require("./types/evo-chat/dic"), exports);
28
29
  __exportStar(require("./types/evo-med/calendar"), exports);
29
30
  __exportStar(require("./types/evo-med/appointment"), exports);
30
31
  __exportStar(require("./types/evo-med/dic"), exports);
@@ -47,6 +48,7 @@ __exportStar(require("./apps/evo-activity/zod-schemas"), exports);
47
48
  __exportStar(require("./apps/evo-people/zod-schemas"), exports);
48
49
  __exportStar(require("./apps/evo-crm/dic/zod-schemas"), exports);
49
50
  __exportStar(require("./apps/evo-crm/lead/zod-schemas"), exports);
51
+ __exportStar(require("./apps/evo-chat/dic/ticket-close/zod-schemas"), exports);
50
52
  __exportStar(require("./apps/evo-chat/chatbee/zod-schemas"), exports);
51
53
  __exportStar(require("./apps/evo-chat/contact/zod-schemas"), exports);
52
54
  __exportStar(require("./apps/evo-chat/message/zod-schemas"), exports);
@@ -71,3 +73,4 @@ __exportStar(require("./apps/evo-survey/zod-schemas"), exports);
71
73
  __exportStar(require("./apps/evo-finops/zod-schemas"), exports);
72
74
  __exportStar(require("./apps/evo-notif-user/zod-schemas"), exports);
73
75
  __exportStar(require("./apps/evo-notifications/zod-schemas"), exports);
76
+ __exportStar(require("./apps/evo-task-runner/zod-schemas"), exports);
package/dist/index.ts CHANGED
@@ -9,6 +9,7 @@ export * from "./types/evo-people";
9
9
  export * from "./types/evo-crm/dic";
10
10
  export * from "./types/evo-crm/lead";
11
11
  export * from "./types/evo-chat";
12
+ export * from "./types/evo-chat/dic";
12
13
  export * from "./types/evo-med/calendar";
13
14
  export * from "./types/evo-med/appointment";
14
15
  export * from "./types/evo-med/dic";
@@ -32,6 +33,7 @@ export * from "./apps/evo-activity/zod-schemas";
32
33
  export * from "./apps/evo-people/zod-schemas";
33
34
  export * from "./apps/evo-crm/dic/zod-schemas";
34
35
  export * from "./apps/evo-crm/lead/zod-schemas";
36
+ export * from "./apps/evo-chat/dic/ticket-close/zod-schemas";
35
37
  export * from "./apps/evo-chat/chatbee/zod-schemas";
36
38
  export * from "./apps/evo-chat/contact/zod-schemas";
37
39
  export * from "./apps/evo-chat/message/zod-schemas";
@@ -56,3 +58,4 @@ export * from "./apps/evo-survey/zod-schemas";
56
58
  export * from "./apps/evo-finops/zod-schemas";
57
59
  export * from "./apps/evo-notif-user/zod-schemas";
58
60
  export * from "./apps/evo-notifications/zod-schemas";
61
+ export * from "./apps/evo-task-runner/zod-schemas";
@@ -0,0 +1,30 @@
1
+ export * from "../fb_collections";
2
+ import { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
3
+ export declare const EvoChatDicPermissions: {
4
+ readonly List: "evo_chat_dics_read";
5
+ readonly Get: "evo_chat_dics_read";
6
+ readonly Create: "evo_chat_dics_write";
7
+ readonly Update: "evo_chat_dics_write";
8
+ readonly Delete: "evo_chat_dics_write";
9
+ };
10
+ export type EvoChatDicPermissions = (typeof EvoChatDicPermissions)[keyof typeof EvoChatDicPermissions];
11
+ export interface ITicketCloseType extends IFireDoc {
12
+ code: string;
13
+ name: string;
14
+ tags?: ITag[] | null;
15
+ [key: string]: unknown;
16
+ }
17
+ export interface ITicketClose extends IFireDoc {
18
+ code: string;
19
+ name: string;
20
+ color: string;
21
+ notes_req: boolean;
22
+ description: string;
23
+ order: number;
24
+ type_code?: string;
25
+ type_name?: string;
26
+ typeRef?: FirestoreDocumentReference;
27
+ external_id?: string | null;
28
+ tags?: ITag[] | null;
29
+ [key: string]: unknown;
30
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.EvoChatDicPermissions = void 0;
18
+ __exportStar(require("../fb_collections"), exports);
19
+ // Permissões para o dicionário
20
+ exports.EvoChatDicPermissions = {
21
+ List: "evo_chat_dics_read",
22
+ Get: "evo_chat_dics_read",
23
+ Create: "evo_chat_dics_write",
24
+ Update: "evo_chat_dics_write",
25
+ Delete: "evo_chat_dics_write",
26
+ };
@@ -0,0 +1,39 @@
1
+ export * from "../fb_collections";
2
+
3
+ import { FirestoreDocumentReference, IFireDoc, ITag } from "../../shared";
4
+
5
+ // Permissões para o dicionário
6
+ export const EvoChatDicPermissions = {
7
+ List: "evo_chat_dics_read",
8
+ Get: "evo_chat_dics_read",
9
+ Create: "evo_chat_dics_write",
10
+ Update: "evo_chat_dics_write",
11
+ Delete: "evo_chat_dics_write",
12
+ } as const;
13
+
14
+ export type EvoChatDicPermissions =
15
+ (typeof EvoChatDicPermissions)[keyof typeof EvoChatDicPermissions];
16
+
17
+ // ----- EvoChatDicTypes
18
+
19
+ export interface ITicketCloseType extends IFireDoc {
20
+ code: string;
21
+ name: string;
22
+ tags?: ITag[] | null;
23
+ [key: string]: unknown;
24
+ }
25
+
26
+ export interface ITicketClose extends IFireDoc {
27
+ code: string;
28
+ name: string;
29
+ color: string;
30
+ notes_req: boolean;
31
+ description: string;
32
+ order: number;
33
+ type_code?: string;
34
+ type_name?: string;
35
+ typeRef?: FirestoreDocumentReference;
36
+ external_id?: string | null;
37
+ tags?: ITag[] | null;
38
+ [key: string]: unknown;
39
+ }
@@ -1,4 +1,8 @@
1
1
  export declare const EVO_CHAT_APP = "evo-chat";
2
+ export declare const CHAT_DICS_COLLECTION = "dics";
3
+ export declare const TICKET_CLOSES = "ticket-closes";
4
+ export declare const TICKET_CLOSES_COLLECTION = "items";
5
+ export declare const TICKET_CLOSE_TYPES_COLLECTION = "types";
2
6
  export declare const CONTACTS_COLLECTION = "contacts";
3
7
  export declare const PROTOCOLS_COLLECTION = "protocols";
4
8
  export declare const HSM_MESSAGES_COLLECTION = "hsm-messages";
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HubWabaCollections = exports.INBOXES_COLLECTION = exports.TICKETS_COLLECTION = exports.THREAD_MESSAGES_COLLECTION = exports.THREADS_COLLECTION = exports.CHANNELS_COLLECTION = exports.CHATBEE_CHANNELS_COLLECTION = exports.HSM_MESSAGES_COLLECTION = exports.PROTOCOLS_COLLECTION = exports.CONTACTS_COLLECTION = exports.EVO_CHAT_APP = void 0;
3
+ exports.HubWabaCollections = exports.INBOXES_COLLECTION = exports.TICKETS_COLLECTION = exports.THREAD_MESSAGES_COLLECTION = exports.THREADS_COLLECTION = exports.CHANNELS_COLLECTION = exports.CHATBEE_CHANNELS_COLLECTION = exports.HSM_MESSAGES_COLLECTION = exports.PROTOCOLS_COLLECTION = exports.CONTACTS_COLLECTION = exports.TICKET_CLOSE_TYPES_COLLECTION = exports.TICKET_CLOSES_COLLECTION = exports.TICKET_CLOSES = exports.CHAT_DICS_COLLECTION = exports.EVO_CHAT_APP = void 0;
4
4
  //EVO Chat Application Doc
5
5
  exports.EVO_CHAT_APP = "evo-chat";
6
+ //dictionaries
7
+ exports.CHAT_DICS_COLLECTION = "dics";
8
+ exports.TICKET_CLOSES = "ticket-closes";
9
+ exports.TICKET_CLOSES_COLLECTION = "items";
10
+ exports.TICKET_CLOSE_TYPES_COLLECTION = "types";
6
11
  //contacts collection
7
12
  exports.CONTACTS_COLLECTION = "contacts";
8
13
  //protocols collection
@@ -1,6 +1,12 @@
1
1
  //EVO Chat Application Doc
2
2
  export const EVO_CHAT_APP = "evo-chat";
3
3
 
4
+ //dictionaries
5
+ export const CHAT_DICS_COLLECTION = "dics";
6
+ export const TICKET_CLOSES = "ticket-closes";
7
+ export const TICKET_CLOSES_COLLECTION = "items";
8
+ export const TICKET_CLOSE_TYPES_COLLECTION = "types";
9
+
4
10
  //contacts collection
5
11
  export const CONTACTS_COLLECTION = "contacts";
6
12
 
@@ -1,11 +1,16 @@
1
1
  import { IFireDoc } from "../../shared";
2
2
  export type TicketStatus = 'open' | 'closed';
3
- export interface ITicketClose {
4
- base: string;
5
- label: string;
3
+ export interface ITicketCloseInfo {
4
+ base?: string;
5
+ label?: string;
6
+ code?: string;
7
+ name?: string;
8
+ color?: string;
9
+ type_code?: string;
10
+ type_name?: string;
6
11
  notes?: string;
7
- closed_by_user_id: string;
8
- closed_at: Date;
12
+ closed_by_user_id?: string;
13
+ closed_at?: Date;
9
14
  }
10
15
  export interface ITicketCreatedBy {
11
16
  type: 'human' | 'automation' | 'system';
@@ -20,7 +25,7 @@ export interface ITicket extends IFireDoc {
20
25
  department_id: string;
21
26
  status: TicketStatus;
22
27
  channel_ids: string[];
23
- close?: ITicketClose;
28
+ close?: ITicketCloseInfo;
24
29
  system_status?: 'normal' | 'moved';
25
30
  quality_indicator?: number | string;
26
31
  message_count?: number;
@@ -6,12 +6,17 @@ export type TicketStatus = 'open' | 'closed';
6
6
 
7
7
  // ── Ticket close info ──
8
8
 
9
- export interface ITicketClose {
10
- base: string;
11
- label: string;
9
+ export interface ITicketCloseInfo {
10
+ base?: string;
11
+ label?: string;
12
+ code?: string;
13
+ name?: string;
14
+ color?: string;
15
+ type_code?: string;
16
+ type_name?: string;
12
17
  notes?: string;
13
- closed_by_user_id: string;
14
- closed_at: Date;
18
+ closed_by_user_id?: string;
19
+ closed_at?: Date;
15
20
  }
16
21
 
17
22
  // ── Ticket creator ──
@@ -35,7 +40,7 @@ export interface ITicket extends IFireDoc {
35
40
  // Channels active during this ticket
36
41
  channel_ids: string[];
37
42
 
38
- close?: ITicketClose;
43
+ close?: ITicketCloseInfo;
39
44
 
40
45
  system_status?: 'normal' | 'moved';
41
46
  quality_indicator?: number | string;
@@ -22,6 +22,7 @@ export declare const TaskStatusEnum: {
22
22
  readonly Cancelled: "cancelled";
23
23
  readonly OnHold: "on_hold";
24
24
  readonly Suppressed: "suppressed";
25
+ readonly DeadLetter: "dead_letter";
25
26
  };
26
27
  export type TaskStatus = (typeof TaskStatusEnum)[keyof typeof TaskStatusEnum];
27
28
  export declare const TaskPriorityEnum: {
@@ -73,6 +74,13 @@ export interface ITaskLock {
73
74
  lock_until: Date;
74
75
  [key: string]: unknown;
75
76
  }
77
+ export interface ITaskRunnerState {
78
+ reclaim_count?: number;
79
+ fallback_index?: number;
80
+ last_dispatch_at?: Date;
81
+ dispatched_attempts?: number;
82
+ [key: string]: unknown;
83
+ }
76
84
  export declare const TaskDedupScopeEnum: {
77
85
  readonly PerRecipient: "per_recipient";
78
86
  readonly PerRecipientAndObject: "per_recipient_and_object";
@@ -167,6 +175,7 @@ export interface IAutoTask extends ITaskBase {
167
175
  lock?: ITaskLock;
168
176
  retry?: ITaskRetryPolicy;
169
177
  on_failure?: ITaskOnFailure;
178
+ runner_state?: ITaskRunnerState;
170
179
  auto: ITaskAutoSpec;
171
180
  }
172
181
  export type ITask = IHumanTask | IAutoTask;
@@ -50,6 +50,7 @@ exports.TaskStatusEnum = {
50
50
  Cancelled: "cancelled",
51
51
  OnHold: "on_hold",
52
52
  Suppressed: "suppressed", // intentionally skipped (e.g., dedup)
53
+ DeadLetter: "dead_letter", // unrecoverable after reclaim attempts
53
54
  };
54
55
  // ----- Task priority (human-friendly)
55
56
  exports.TaskPriorityEnum = {
@@ -48,6 +48,7 @@ export const TaskStatusEnum = {
48
48
  Cancelled: "cancelled",
49
49
  OnHold: "on_hold",
50
50
  Suppressed: "suppressed", // intentionally skipped (e.g., dedup)
51
+ DeadLetter: "dead_letter", // unrecoverable after reclaim attempts
51
52
  } as const;
52
53
 
53
54
  export type TaskStatus = (typeof TaskStatusEnum)[keyof typeof TaskStatusEnum];
@@ -123,6 +124,15 @@ export interface ITaskLock {
123
124
  [key: string]: unknown;
124
125
  }
125
126
 
127
+ // ----- Runtime state maintained by the Task Runner
128
+ export interface ITaskRunnerState {
129
+ reclaim_count?: number;
130
+ fallback_index?: number; // -1 = primary, 0..N = auto_fallbacks[i]
131
+ last_dispatch_at?: Date;
132
+ dispatched_attempts?: number;
133
+ [key: string]: unknown;
134
+ }
135
+
126
136
  // ----- Dedup / suppression (optional)
127
137
  export const TaskDedupScopeEnum = {
128
138
  PerRecipient: "per_recipient",
@@ -276,6 +286,9 @@ export interface IAutoTask extends ITaskBase {
276
286
  retry?: ITaskRetryPolicy;
277
287
  on_failure?: ITaskOnFailure;
278
288
 
289
+ // Runtime state populated by the Task Runner
290
+ runner_state?: ITaskRunnerState;
291
+
279
292
  // What to execute
280
293
  auto: ITaskAutoSpec;
281
294
  }
@@ -0,0 +1 @@
1
+ export declare const TASK_RUNNER_CONFIG_DOC = "config";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TASK_RUNNER_CONFIG_DOC = void 0;
4
+ // Per-tenant task runner configuration.
5
+ // Path: tenants/{tenant}/apps/evo-task-runner/config/config
6
+ // - `config` subcollection reuses the shared CONFIG_COLLECTION ("config")
7
+ // - TASK_RUNNER_CONFIG_DOC is the fixed doc id inside that subcollection
8
+ exports.TASK_RUNNER_CONFIG_DOC = "config";
@@ -0,0 +1,5 @@
1
+ // Per-tenant task runner configuration.
2
+ // Path: tenants/{tenant}/apps/evo-task-runner/config/config
3
+ // - `config` subcollection reuses the shared CONFIG_COLLECTION ("config")
4
+ // - TASK_RUNNER_CONFIG_DOC is the fixed doc id inside that subcollection
5
+ export const TASK_RUNNER_CONFIG_DOC = "config";
@@ -1,3 +1,4 @@
1
+ export * from "./fb_collections";
1
2
  import type { IFireDoc } from "../shared";
2
3
  import type { TaskAutoHandler, TaskExecutionStatus, TaskRetryStrategy } from "../evo-task";
3
4
  export declare const EvoTaskRunnerPermissions: {
@@ -8,12 +9,15 @@ export declare const EvoTaskRunnerPermissions: {
8
9
  readonly Delete: "evo_task_runner_write";
9
10
  };
10
11
  export type EvoTaskRunnerPermissions = (typeof EvoTaskRunnerPermissions)[keyof typeof EvoTaskRunnerPermissions];
12
+ export declare const EVO_TASK_RUNNER_APP = "evo-task-runner";
13
+ export declare const TaskRunnerWorkerIdPrefix = "task-runner";
11
14
  export declare const TaskRunnerTopics: {
12
15
  readonly Tick: "task_runner.tick";
13
16
  readonly ExecuteRequests: "task_runner.execute_requests";
14
17
  readonly ExecutionReports: "task_runner.execution_reports";
15
18
  };
16
19
  export type TaskRunnerTopic = (typeof TaskRunnerTopics)[keyof typeof TaskRunnerTopics];
20
+ export declare const taskRunnerHandlerTopic: (handler: string) => string;
17
21
  export declare const TaskRunnerTickReasonEnum: {
18
22
  readonly Schedule: "schedule";
19
23
  readonly Manual: "manual";
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TaskRunnerTickReasonEnum = exports.TaskRunnerTopics = exports.EvoTaskRunnerPermissions = void 0;
17
+ exports.TaskRunnerTickReasonEnum = exports.taskRunnerHandlerTopic = exports.TaskRunnerTopics = exports.TaskRunnerWorkerIdPrefix = exports.EVO_TASK_RUNNER_APP = exports.EvoTaskRunnerPermissions = void 0;
18
+ __exportStar(require("./fb_collections"), exports);
4
19
  // Permissões para o task runner
5
20
  exports.EvoTaskRunnerPermissions = {
6
21
  List: "evo_task_runner_read",
@@ -21,12 +36,19 @@ exports.EvoTaskRunnerPermissions = {
21
36
  // - Task payload schemas live in their respective modules.
22
37
  // - This contract is handler-agnostic and safe to share between backend/frontend.
23
38
  // ======================================================
39
+ // ----- App identifier (Firestore path: tenants/{t}/apps/evo-task-runner/...)
40
+ exports.EVO_TASK_RUNNER_APP = "evo-task-runner";
41
+ // ----- Prefix used to compose worker ids (e.g. `${prefix}-${K_SERVICE}-${uuid}`)
42
+ exports.TaskRunnerWorkerIdPrefix = "task-runner";
24
43
  // ----- Pub/Sub topic suggestions (logical names)
25
44
  exports.TaskRunnerTopics = {
26
45
  Tick: "task_runner.tick",
27
46
  ExecuteRequests: "task_runner.execute_requests",
28
47
  ExecutionReports: "task_runner.execution_reports",
29
48
  };
49
+ // ----- Per-handler execute requests topic (one topic per handler id)
50
+ const taskRunnerHandlerTopic = (handler) => `${handler}.execute_requests`;
51
+ exports.taskRunnerHandlerTopic = taskRunnerHandlerTopic;
30
52
  // ----- Runner tick messages (optional)
31
53
  exports.TaskRunnerTickReasonEnum = {
32
54
  Schedule: "schedule",
@@ -1,3 +1,4 @@
1
+ export * from "./fb_collections";
1
2
  import type { IFireDoc } from "../shared";
2
3
  import type {
3
4
  TaskAutoHandler,
@@ -29,6 +30,12 @@ export type EvoTaskRunnerPermissions =
29
30
  // - This contract is handler-agnostic and safe to share between backend/frontend.
30
31
  // ======================================================
31
32
 
33
+ // ----- App identifier (Firestore path: tenants/{t}/apps/evo-task-runner/...)
34
+ export const EVO_TASK_RUNNER_APP = "evo-task-runner";
35
+
36
+ // ----- Prefix used to compose worker ids (e.g. `${prefix}-${K_SERVICE}-${uuid}`)
37
+ export const TaskRunnerWorkerIdPrefix = "task-runner";
38
+
32
39
  // ----- Pub/Sub topic suggestions (logical names)
33
40
  export const TaskRunnerTopics = {
34
41
  Tick: "task_runner.tick",
@@ -39,6 +46,10 @@ export const TaskRunnerTopics = {
39
46
  export type TaskRunnerTopic =
40
47
  (typeof TaskRunnerTopics)[keyof typeof TaskRunnerTopics];
41
48
 
49
+ // ----- Per-handler execute requests topic (one topic per handler id)
50
+ export const taskRunnerHandlerTopic = (handler: string) =>
51
+ `${handler}.execute_requests`;
52
+
42
53
  // ----- Runner tick messages (optional)
43
54
  export const TaskRunnerTickReasonEnum = {
44
55
  Schedule: "schedule",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.321",
3
+ "version": "1.3.326",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",