@trii/types 2.10.555 → 2.10.557

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.
@@ -0,0 +1,55 @@
1
+ import { ToolCall, ContentPart, Attachment } from "./Message";
2
+ export interface PostUserMessage {
3
+ type: "user_message";
4
+ threadId: string;
5
+ parts: ContentPart[];
6
+ attachments?: Attachment[];
7
+ params?: Record<string, unknown>;
8
+ context?: {
9
+ spaceId?: string;
10
+ userId?: string;
11
+ };
12
+ }
13
+ export interface PostUserMessageResponse {
14
+ ok: boolean;
15
+ messageId: string;
16
+ }
17
+ export interface Control {
18
+ type: "control";
19
+ threadId: string;
20
+ action: "abort" | "retry" | "regenerate";
21
+ targetMessageId?: string;
22
+ }
23
+ export type ServerEvent = {
24
+ type: "assistant_started";
25
+ threadId: string;
26
+ messageId: string;
27
+ } | {
28
+ type: "assistant_delta";
29
+ threadId: string;
30
+ messageId: string;
31
+ delta: ContentPart;
32
+ } | {
33
+ type: "assistant_tool_call";
34
+ threadId: string;
35
+ messageId: string;
36
+ toolCall: ToolCall;
37
+ } | {
38
+ type: "assistant_completed";
39
+ threadId: string;
40
+ messageId: string;
41
+ usage?: TokenUsage;
42
+ } | {
43
+ type: "error";
44
+ threadId: string;
45
+ messageId?: string;
46
+ code: string;
47
+ message: string;
48
+ };
49
+ export interface TokenUsage {
50
+ inputTokens?: number;
51
+ outputTokens?: number;
52
+ totalTokens?: number;
53
+ model?: string;
54
+ latencyMs?: number;
55
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,62 @@
1
+ export interface Message {
2
+ id: string;
3
+ threadId: string;
4
+ role: Role;
5
+ parts: ContentPart[];
6
+ toolCalls?: ToolCall[];
7
+ toolResults?: ToolResult[];
8
+ attachments?: Attachment[];
9
+ createdAt: string;
10
+ status?: "pending" | "streaming" | "completed" | "error";
11
+ error?: {
12
+ code: string;
13
+ message: string;
14
+ };
15
+ tenantId?: string;
16
+ spaceId?: string;
17
+ userId?: string;
18
+ replyToId?: string;
19
+ metadata?: Record<string, unknown>;
20
+ }
21
+ export interface ToolCall {
22
+ id: string;
23
+ name: string;
24
+ arguments: unknown;
25
+ state?: "requested" | "running" | "succeeded" | "failed";
26
+ }
27
+ export interface ToolResult {
28
+ callId: string;
29
+ ok: boolean;
30
+ result?: unknown;
31
+ error?: {
32
+ code: string;
33
+ message: string;
34
+ };
35
+ elapsedMs?: number;
36
+ }
37
+ export type Role = "user" | "assistant" | "tool" | "system";
38
+ export type ContentPart = {
39
+ type: "text";
40
+ text: string;
41
+ } | {
42
+ type: "image";
43
+ url: string;
44
+ alt?: string;
45
+ } | {
46
+ type: "file";
47
+ url: string;
48
+ name: string;
49
+ mime: string;
50
+ size?: number;
51
+ } | {
52
+ type: "json";
53
+ data: unknown;
54
+ };
55
+ export interface Attachment {
56
+ id?: string;
57
+ kind: "image" | "file";
58
+ url: string;
59
+ name?: string;
60
+ mime?: string;
61
+ size?: number;
62
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { Role, Message } from "./Message";
2
+ export interface Thread {
3
+ id: string;
4
+ title?: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ messages: MessageSummary[];
8
+ lastMessageId?: string;
9
+ defaultParams?: Record<string, unknown>;
10
+ allowedCollections?: string[];
11
+ metadata?: Record<string, unknown>;
12
+ tenantId?: string;
13
+ spaceId?: string;
14
+ ownerUserId?: string;
15
+ }
16
+ export interface MessageSummary {
17
+ id: string;
18
+ role: Role;
19
+ preview: string;
20
+ createdAt: string;
21
+ status?: Message["status"];
22
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from "./API";
2
+ export * from "./Message";
3
+ export * from "./Thread";
@@ -0,0 +1,19 @@
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("./API"), exports);
18
+ __exportStar(require("./Message"), exports);
19
+ __exportStar(require("./Thread"), exports);
@@ -1,3 +1,4 @@
1
1
  export * from './Credential';
2
2
  export * from './Provider';
3
3
  export * from './aiModuleStatus';
4
+ export * from './Threads';
package/dist/AI/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Credential"), exports);
18
18
  __exportStar(require("./Provider"), exports);
19
19
  __exportStar(require("./aiModuleStatus"), exports);
20
+ __exportStar(require("./Threads"), exports);
@@ -19,6 +19,14 @@ export interface Template {
19
19
  status: TemplateStatus;
20
20
  rejectedReason: boolean;
21
21
  timestamp?: Date;
22
+ /**lista de id de grupos */
23
+ allowGroups?: string[];
24
+ /**lista de id de usuarios */
25
+ allowUsers?: string[];
26
+ /**Usar en modulo Conversations */
27
+ allowInConversations?: boolean | true;
28
+ /**Usar en modulo Marketing */
29
+ allowInMarketing?: boolean | true;
22
30
  }
23
31
  export declare enum TemplateStatus {
24
32
  PENDING = 0,
@@ -17,7 +17,7 @@ export interface BodyDashboard {
17
17
  memberId: string | null;
18
18
  groupId: string;
19
19
  ending?: string | null;
20
- /** For filter conversations with .assignedTo.userInfo.id */
20
+ /** For filter conversations with IConversation.assignedTo.userInfo.id */
21
21
  assignedToUserId?: string | null;
22
22
  }
23
23
  export declare enum GeneralDashboardType {
@@ -0,0 +1,56 @@
1
+ export declare enum ReportSendType {
2
+ daily = 1,
3
+ weekly = 2,
4
+ monthly = 3
5
+ }
6
+ export declare enum TimeRange {
7
+ DAY = 1,
8
+ WEEK = 7,
9
+ MONTH = 30,
10
+ YEAR = 365,
11
+ LAST_7_DAYS = 77,
12
+ LAST_15_DAYS = 15,
13
+ LAST_30_DAYS = 3030,
14
+ LAST_60_DAYS = 60,
15
+ CUSTOM = 0
16
+ }
17
+ export interface ScheduledReport {
18
+ id: string;
19
+ title: string;
20
+ description: string;
21
+ reportModule: string;
22
+ reportName: string;
23
+ timeRange: TimeRange;
24
+ filter: string;
25
+ startAt: Date;
26
+ endsAt?: Date | null;
27
+ neverEnds: boolean;
28
+ sendType: ReportSendType;
29
+ sendOnMonday: boolean;
30
+ sendOnTuesday: boolean;
31
+ sendOnWednesday: boolean;
32
+ sendOnThursday: boolean;
33
+ sendOnFriday: boolean;
34
+ sendOnSaturday: boolean;
35
+ sendOnSunday: boolean;
36
+ /**
37
+ * 1 a 31 indica el día del mes que se enviará el reporte
38
+ * 0 indica el último día del mes
39
+ */
40
+ dayOfMonth: number;
41
+ /** 1= lunes ... 7 = domingo */
42
+ dayOfWeek: number;
43
+ /**
44
+ * emails separated by semicolon ;
45
+ */
46
+ sendTo: string;
47
+ finished: boolean;
48
+ summary: string;
49
+ nextSend: Date;
50
+ createdBy: string;
51
+ createdAt: Date;
52
+ updatedAt: Date | null;
53
+ updatedBy: string | null;
54
+ deletedAt?: Date | null;
55
+ deletedBy?: string | null;
56
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TimeRange = exports.ReportSendType = void 0;
4
+ var ReportSendType;
5
+ (function (ReportSendType) {
6
+ ReportSendType[ReportSendType["daily"] = 1] = "daily";
7
+ ReportSendType[ReportSendType["weekly"] = 2] = "weekly";
8
+ ReportSendType[ReportSendType["monthly"] = 3] = "monthly";
9
+ })(ReportSendType || (exports.ReportSendType = ReportSendType = {}));
10
+ var TimeRange;
11
+ (function (TimeRange) {
12
+ TimeRange[TimeRange["DAY"] = 1] = "DAY";
13
+ TimeRange[TimeRange["WEEK"] = 7] = "WEEK";
14
+ TimeRange[TimeRange["MONTH"] = 30] = "MONTH";
15
+ TimeRange[TimeRange["YEAR"] = 365] = "YEAR";
16
+ TimeRange[TimeRange["LAST_7_DAYS"] = 77] = "LAST_7_DAYS";
17
+ TimeRange[TimeRange["LAST_15_DAYS"] = 15] = "LAST_15_DAYS";
18
+ TimeRange[TimeRange["LAST_30_DAYS"] = 3030] = "LAST_30_DAYS";
19
+ TimeRange[TimeRange["LAST_60_DAYS"] = 60] = "LAST_60_DAYS";
20
+ TimeRange[TimeRange["CUSTOM"] = 0] = "CUSTOM";
21
+ })(TimeRange || (exports.TimeRange = TimeRange = {}));
@@ -0,0 +1,12 @@
1
+ export interface ReportAIResult {
2
+ title: string;
3
+ module: string;
4
+ content: string;
5
+ filters: Record<string, any>;
6
+ reportTemplate: unknown;
7
+ sharedWithUsers: string[];
8
+ sharedWithGroups: string[];
9
+ threadId: string;
10
+ ownerId: string;
11
+ createdAt: Date;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trii/types",
3
- "version": "2.10.555",
3
+ "version": "2.10.557",
4
4
  "description": "Types definitions for Trii projects - ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",