tychat-contracts 1.0.61 → 1.0.63

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 (53) hide show
  1. package/dist/ai/ai-integration-response.dto.d.ts +1 -0
  2. package/dist/ai/ai-integration-response.dto.d.ts.map +1 -1
  3. package/dist/ai/ai-integration-response.dto.js +10 -0
  4. package/dist/ai/ai-usage-response.dto.d.ts +16 -0
  5. package/dist/ai/ai-usage-response.dto.d.ts.map +1 -0
  6. package/dist/ai/ai-usage-response.dto.js +77 -0
  7. package/dist/ai/create-ai-usage.dto.d.ts +14 -0
  8. package/dist/ai/create-ai-usage.dto.d.ts.map +1 -0
  9. package/dist/ai/create-ai-usage.dto.js +70 -0
  10. package/dist/ai/index.d.ts +2 -0
  11. package/dist/ai/index.d.ts.map +1 -1
  12. package/dist/ai/index.js +2 -0
  13. package/dist/connections/connections.dto.d.ts +53 -0
  14. package/dist/connections/connections.dto.d.ts.map +1 -0
  15. package/dist/connections/connections.dto.js +376 -0
  16. package/dist/connections/index.d.ts +2 -0
  17. package/dist/connections/index.d.ts.map +1 -0
  18. package/dist/connections/index.js +17 -0
  19. package/dist/conversations/conversation-response.dto.d.ts +16 -0
  20. package/dist/conversations/conversation-response.dto.d.ts.map +1 -0
  21. package/dist/conversations/conversation-response.dto.js +98 -0
  22. package/dist/conversations/conversation-session-response.dto.d.ts +14 -0
  23. package/dist/conversations/conversation-session-response.dto.d.ts.map +1 -0
  24. package/dist/conversations/conversation-session-response.dto.js +81 -0
  25. package/dist/conversations/conversation-type.dto.d.ts +3 -0
  26. package/dist/conversations/conversation-type.dto.d.ts.map +1 -0
  27. package/dist/conversations/conversation-type.dto.js +7 -0
  28. package/dist/conversations/create-conversation-session.dto.d.ts +10 -0
  29. package/dist/conversations/create-conversation-session.dto.d.ts.map +1 -0
  30. package/dist/conversations/create-conversation-session.dto.js +46 -0
  31. package/dist/conversations/create-conversation.dto.d.ts +15 -0
  32. package/dist/conversations/create-conversation.dto.d.ts.map +1 -0
  33. package/dist/conversations/create-conversation.dto.js +86 -0
  34. package/dist/conversations/index.d.ts +6 -0
  35. package/dist/conversations/index.d.ts.map +1 -0
  36. package/dist/conversations/index.js +21 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2 -0
  40. package/package.json +1 -1
  41. package/src/ai/ai-integration-response.dto.ts +9 -1
  42. package/src/ai/ai-usage-response.dto.ts +47 -0
  43. package/src/ai/create-ai-usage.dto.ts +43 -0
  44. package/src/ai/index.ts +2 -0
  45. package/src/connections/connections.dto.ts +297 -0
  46. package/src/connections/index.ts +1 -0
  47. package/src/conversations/conversation-response.dto.ts +68 -0
  48. package/src/conversations/conversation-session-response.dto.ts +54 -0
  49. package/src/conversations/conversation-type.dto.ts +5 -0
  50. package/src/conversations/create-conversation-session.dto.ts +27 -0
  51. package/src/conversations/create-conversation.dto.ts +68 -0
  52. package/src/conversations/index.ts +5 -0
  53. package/src/index.ts +2 -0
@@ -3,5 +3,6 @@ export declare class AiIntegrationResponseDto {
3
3
  tenant: string;
4
4
  response: AiStructuredResponseDto;
5
5
  output?: string;
6
+ aiUsageId?: string;
6
7
  }
7
8
  //# sourceMappingURL=ai-integration-response.dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai-integration-response.dto.d.ts","sourceRoot":"","sources":["../../src/ai/ai-integration-response.dto.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,qBAAa,wBAAwB;IAOnC,MAAM,EAAE,MAAM,CAAC;IAQf,QAAQ,EAAE,uBAAuB,CAAC;IAUlC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"ai-integration-response.dto.d.ts","sourceRoot":"","sources":["../../src/ai/ai-integration-response.dto.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,qBAAa,wBAAwB;IAOnC,MAAM,EAAE,MAAM,CAAC;IAQf,QAAQ,EAAE,uBAAuB,CAAC;IAUlC,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -18,6 +18,7 @@ class AiIntegrationResponseDto {
18
18
  tenant;
19
19
  response;
20
20
  output;
21
+ aiUsageId;
21
22
  }
22
23
  exports.AiIntegrationResponseDto = AiIntegrationResponseDto;
23
24
  __decorate([
@@ -49,3 +50,12 @@ __decorate([
49
50
  (0, class_validator_1.IsNotEmpty)(),
50
51
  __metadata("design:type", String)
51
52
  ], AiIntegrationResponseDto.prototype, "output", void 0);
53
+ __decorate([
54
+ (0, swagger_1.ApiPropertyOptional)({
55
+ description: 'AI usage record ID generated after the generation call — used to link token costs to a conversation message',
56
+ example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
57
+ }),
58
+ (0, class_validator_1.IsOptional)(),
59
+ (0, class_validator_1.IsString)(),
60
+ __metadata("design:type", String)
61
+ ], AiIntegrationResponseDto.prototype, "aiUsageId", void 0);
@@ -0,0 +1,16 @@
1
+ import { AiIntegrationDto } from './integration-provider.dto';
2
+ /**
3
+ * Represents a persisted AI token-usage record returned by the API.
4
+ */
5
+ export declare class AiUsageResponseDto {
6
+ id: string;
7
+ tenant: string;
8
+ unitId?: number;
9
+ integration: AiIntegrationDto;
10
+ model: string;
11
+ promptTokens: number;
12
+ completionTokens: number;
13
+ totalTokens: number;
14
+ createdAt: string;
15
+ }
16
+ //# sourceMappingURL=ai-usage-response.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-usage-response.dto.d.ts","sourceRoot":"","sources":["../../src/ai/ai-usage-response.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D;;GAEG;AACH,qBAAa,kBAAkB;IAI7B,EAAE,EAAE,MAAM,CAAC;IAKX,MAAM,EAAE,MAAM,CAAC;IAIf,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,WAAW,EAAE,gBAAgB,CAAC;IAK9B,KAAK,EAAE,MAAM,CAAC;IAGd,YAAY,EAAE,MAAM,CAAC;IAGrB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,WAAW,EAAE,MAAM,CAAC;IAQpB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AiUsageResponseDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Represents a persisted AI token-usage record returned by the API.
17
+ */
18
+ class AiUsageResponseDto {
19
+ id;
20
+ tenant;
21
+ unitId;
22
+ integration;
23
+ model;
24
+ promptTokens;
25
+ completionTokens;
26
+ totalTokens;
27
+ createdAt;
28
+ }
29
+ exports.AiUsageResponseDto = AiUsageResponseDto;
30
+ __decorate([
31
+ (0, swagger_1.ApiProperty)({ description: 'AI usage record UUID', example: 'a1b2c3d4-...' }),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ __metadata("design:type", String)
35
+ ], AiUsageResponseDto.prototype, "id", void 0);
36
+ __decorate([
37
+ (0, swagger_1.ApiProperty)({ description: 'Tenant slug', example: 'clinic-alpha' }),
38
+ (0, class_validator_1.IsString)(),
39
+ (0, class_validator_1.IsNotEmpty)(),
40
+ __metadata("design:type", String)
41
+ ], AiUsageResponseDto.prototype, "tenant", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Tenant unit id', example: 1 }),
44
+ (0, class_validator_1.IsOptional)(),
45
+ __metadata("design:type", Number)
46
+ ], AiUsageResponseDto.prototype, "unitId", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiProperty)({ description: 'AI integration used', example: 'OPENAI' }),
49
+ __metadata("design:type", String)
50
+ ], AiUsageResponseDto.prototype, "integration", void 0);
51
+ __decorate([
52
+ (0, swagger_1.ApiProperty)({ description: 'Model name', example: 'gpt-4.1-mini' }),
53
+ (0, class_validator_1.IsString)(),
54
+ (0, class_validator_1.IsNotEmpty)(),
55
+ __metadata("design:type", String)
56
+ ], AiUsageResponseDto.prototype, "model", void 0);
57
+ __decorate([
58
+ (0, swagger_1.ApiProperty)({ description: 'Number of prompt tokens consumed', example: 120 }),
59
+ __metadata("design:type", Number)
60
+ ], AiUsageResponseDto.prototype, "promptTokens", void 0);
61
+ __decorate([
62
+ (0, swagger_1.ApiProperty)({ description: 'Number of completion tokens generated', example: 60 }),
63
+ __metadata("design:type", Number)
64
+ ], AiUsageResponseDto.prototype, "completionTokens", void 0);
65
+ __decorate([
66
+ (0, swagger_1.ApiProperty)({ description: 'Total tokens (prompt + completion)', example: 180 }),
67
+ __metadata("design:type", Number)
68
+ ], AiUsageResponseDto.prototype, "totalTokens", void 0);
69
+ __decorate([
70
+ (0, swagger_1.ApiProperty)({
71
+ description: 'Creation timestamp (ISO 8601)',
72
+ example: '2024-01-01T00:00:00.000Z',
73
+ }),
74
+ (0, class_validator_1.IsString)(),
75
+ (0, class_validator_1.IsNotEmpty)(),
76
+ __metadata("design:type", String)
77
+ ], AiUsageResponseDto.prototype, "createdAt", void 0);
@@ -0,0 +1,14 @@
1
+ import { AiIntegrationDto } from './integration-provider.dto';
2
+ /**
3
+ * Payload used to persist an AI token-usage record after a generation call.
4
+ */
5
+ export declare class CreateAiUsageDto {
6
+ tenant: string;
7
+ unitId?: number;
8
+ integration: AiIntegrationDto;
9
+ model: string;
10
+ promptTokens: number;
11
+ completionTokens: number;
12
+ totalTokens: number;
13
+ }
14
+ //# sourceMappingURL=create-ai-usage.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-ai-usage.dto.d.ts","sourceRoot":"","sources":["../../src/ai/create-ai-usage.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE/E;;GAEG;AACH,qBAAa,gBAAgB;IAI3B,MAAM,EAAE,MAAM,CAAC;IAMf,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,WAAW,EAAE,gBAAgB,CAAC;IAK9B,KAAK,EAAE,MAAM,CAAC;IAKd,YAAY,EAAE,MAAM,CAAC;IAKrB,gBAAgB,EAAE,MAAM,CAAC;IAKzB,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateAiUsageDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const integration_provider_dto_1 = require("./integration-provider.dto");
16
+ /**
17
+ * Payload used to persist an AI token-usage record after a generation call.
18
+ */
19
+ class CreateAiUsageDto {
20
+ tenant;
21
+ unitId;
22
+ integration;
23
+ model;
24
+ promptTokens;
25
+ completionTokens;
26
+ totalTokens;
27
+ }
28
+ exports.CreateAiUsageDto = CreateAiUsageDto;
29
+ __decorate([
30
+ (0, swagger_1.ApiProperty)({ description: 'Tenant slug', example: 'clinic-alpha' }),
31
+ (0, class_validator_1.IsString)(),
32
+ (0, class_validator_1.IsNotEmpty)(),
33
+ __metadata("design:type", String)
34
+ ], CreateAiUsageDto.prototype, "tenant", void 0);
35
+ __decorate([
36
+ (0, swagger_1.ApiPropertyOptional)({ description: 'Tenant unit id', example: 1 }),
37
+ (0, class_validator_1.IsOptional)(),
38
+ (0, class_validator_1.IsInt)(),
39
+ (0, class_validator_1.Min)(1),
40
+ __metadata("design:type", Number)
41
+ ], CreateAiUsageDto.prototype, "unitId", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({ description: 'AI integration used', enum: integration_provider_dto_1.AI_INTEGRATIONS }),
44
+ (0, class_validator_1.IsEnum)(integration_provider_dto_1.AI_INTEGRATIONS),
45
+ __metadata("design:type", String)
46
+ ], CreateAiUsageDto.prototype, "integration", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiProperty)({ description: 'Model name used for generation', example: 'gpt-4.1-mini' }),
49
+ (0, class_validator_1.IsString)(),
50
+ (0, class_validator_1.IsNotEmpty)(),
51
+ __metadata("design:type", String)
52
+ ], CreateAiUsageDto.prototype, "model", void 0);
53
+ __decorate([
54
+ (0, swagger_1.ApiProperty)({ description: 'Number of prompt tokens consumed', example: 120 }),
55
+ (0, class_validator_1.IsInt)(),
56
+ (0, class_validator_1.Min)(0),
57
+ __metadata("design:type", Number)
58
+ ], CreateAiUsageDto.prototype, "promptTokens", void 0);
59
+ __decorate([
60
+ (0, swagger_1.ApiProperty)({ description: 'Number of completion tokens generated', example: 60 }),
61
+ (0, class_validator_1.IsInt)(),
62
+ (0, class_validator_1.Min)(0),
63
+ __metadata("design:type", Number)
64
+ ], CreateAiUsageDto.prototype, "completionTokens", void 0);
65
+ __decorate([
66
+ (0, swagger_1.ApiProperty)({ description: 'Total tokens (prompt + completion)', example: 180 }),
67
+ (0, class_validator_1.IsInt)(),
68
+ (0, class_validator_1.Min)(0),
69
+ __metadata("design:type", Number)
70
+ ], CreateAiUsageDto.prototype, "totalTokens", void 0);
@@ -6,4 +6,6 @@ export * from './ai-integration-request.dto';
6
6
  export * from './ai-integration-response.dto';
7
7
  export * from './list-models.dto';
8
8
  export * from './ai-action.dto';
9
+ export * from './create-ai-usage.dto';
10
+ export * from './ai-usage-response.dto';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC"}
package/dist/ai/index.js CHANGED
@@ -22,3 +22,5 @@ __exportStar(require("./ai-integration-request.dto"), exports);
22
22
  __exportStar(require("./ai-integration-response.dto"), exports);
23
23
  __exportStar(require("./list-models.dto"), exports);
24
24
  __exportStar(require("./ai-action.dto"), exports);
25
+ __exportStar(require("./create-ai-usage.dto"), exports);
26
+ __exportStar(require("./ai-usage-response.dto"), exports);
@@ -0,0 +1,53 @@
1
+ export declare class CreateConnectionInstanceDto {
2
+ token?: string;
3
+ qrcode?: boolean;
4
+ number?: string;
5
+ rejectCall?: boolean;
6
+ msgCall?: string;
7
+ groupsIgnore?: boolean;
8
+ alwaysOnline?: boolean;
9
+ readMessages?: boolean;
10
+ readStatus?: boolean;
11
+ syncFullHistory?: boolean;
12
+ }
13
+ export declare class ConnectionInstanceConnectQueryDto {
14
+ number?: string;
15
+ }
16
+ export declare class SetConnectionWebhookDto {
17
+ enabled: boolean;
18
+ url: string;
19
+ webhookByEvents: boolean;
20
+ webhookBase64: boolean;
21
+ events: string[];
22
+ }
23
+ export declare class SendConnectionTextDto {
24
+ number: string;
25
+ text: string;
26
+ delay?: number;
27
+ linkPreview?: boolean;
28
+ }
29
+ export declare class SendConnectionMediaDto {
30
+ number: string;
31
+ mediatype: string;
32
+ mimetype: string;
33
+ caption: string;
34
+ media: string;
35
+ fileName: string;
36
+ delay?: number;
37
+ }
38
+ export declare class SendConnectionWhatsAppAudioDto {
39
+ number: string;
40
+ audio: string;
41
+ delay?: number;
42
+ }
43
+ export declare class ConnectionMediaMessageKeyDto {
44
+ id: string;
45
+ }
46
+ export declare class ConnectionMediaMessageDto {
47
+ key: ConnectionMediaMessageKeyDto;
48
+ }
49
+ export declare class GetConnectionBase64Dto {
50
+ message: ConnectionMediaMessageDto;
51
+ convertToMp4: boolean;
52
+ }
53
+ //# sourceMappingURL=connections.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connections.dto.d.ts","sourceRoot":"","sources":["../../src/connections/connections.dto.ts"],"names":[],"mappings":"AAaA,qBAAa,2BAA2B;IAQtC,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,MAAM,CAAC,EAAE,OAAO,CAAC;IAQjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,UAAU,CAAC,EAAE,OAAO,CAAC;IAQrB,OAAO,CAAC,EAAE,MAAM,CAAC;IAQjB,YAAY,CAAC,EAAE,OAAO,CAAC;IAQvB,YAAY,CAAC,EAAE,OAAO,CAAC;IAQvB,YAAY,CAAC,EAAE,OAAO,CAAC;IAQvB,UAAU,CAAC,EAAE,OAAO,CAAC;IAQrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,iCAAiC;IAO5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,uBAAuB;IAMlC,OAAO,EAAG,OAAO,CAAC;IAQlB,GAAG,EAAG,MAAM,CAAC;IAOb,eAAe,EAAG,OAAO,CAAC;IAO1B,aAAa,EAAG,OAAO,CAAC;IASxB,MAAM,EAAG,MAAM,EAAE,CAAC;CACnB;AAED,qBAAa,qBAAqB;IAOhC,MAAM,EAAG,MAAM,CAAC;IAQhB,IAAI,EAAG,MAAM,CAAC;IASd,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,sBAAsB;IAOjC,MAAM,EAAG,MAAM,CAAC;IAQhB,SAAS,EAAG,MAAM,CAAC;IAQnB,QAAQ,EAAG,MAAM,CAAC;IAQlB,OAAO,EAAG,MAAM,CAAC;IAQjB,KAAK,EAAG,MAAM,CAAC;IAQf,QAAQ,EAAG,MAAM,CAAC;IASlB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,8BAA8B;IAOzC,MAAM,EAAG,MAAM,CAAC;IAQhB,KAAK,EAAG,MAAM,CAAC;IASf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,4BAA4B;IAOvC,EAAE,EAAG,MAAM,CAAC;CACb;AAED,qBAAa,yBAAyB;IAIpC,GAAG,EAAG,4BAA4B,CAAC;CACpC;AAED,qBAAa,sBAAsB;IAIjC,OAAO,EAAG,yBAAyB,CAAC;IAOpC,YAAY,EAAG,OAAO,CAAC;CACxB"}
@@ -0,0 +1,376 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GetConnectionBase64Dto = exports.ConnectionMediaMessageDto = exports.ConnectionMediaMessageKeyDto = exports.SendConnectionWhatsAppAudioDto = exports.SendConnectionMediaDto = exports.SendConnectionTextDto = exports.SetConnectionWebhookDto = exports.ConnectionInstanceConnectQueryDto = exports.CreateConnectionInstanceDto = void 0;
13
+ const swagger_1 = require("@nestjs/swagger");
14
+ const class_validator_1 = require("class-validator");
15
+ const class_transformer_1 = require("class-transformer");
16
+ class CreateConnectionInstanceDto {
17
+ token;
18
+ qrcode;
19
+ number;
20
+ rejectCall;
21
+ msgCall;
22
+ groupsIgnore;
23
+ alwaysOnline;
24
+ readMessages;
25
+ readStatus;
26
+ syncFullHistory;
27
+ }
28
+ exports.CreateConnectionInstanceDto = CreateConnectionInstanceDto;
29
+ __decorate([
30
+ (0, swagger_1.ApiPropertyOptional)({
31
+ description: 'Token da instância (se omitido, EvolutionAPI pode gerar dinamicamente)',
32
+ example: 'my-instance-token',
33
+ }),
34
+ (0, class_validator_1.IsOptional)(),
35
+ (0, class_validator_1.IsString)(),
36
+ __metadata("design:type", String)
37
+ ], CreateConnectionInstanceDto.prototype, "token", void 0);
38
+ __decorate([
39
+ (0, swagger_1.ApiPropertyOptional)({
40
+ description: 'Cria QR Code automaticamente após criar a instância',
41
+ example: true,
42
+ }),
43
+ (0, class_validator_1.IsOptional)(),
44
+ (0, class_validator_1.IsBoolean)(),
45
+ __metadata("design:type", Boolean)
46
+ ], CreateConnectionInstanceDto.prototype, "qrcode", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiPropertyOptional)({
49
+ description: 'Número proprietário da instância com DDI (somente dígitos)',
50
+ example: '5511999999999',
51
+ }),
52
+ (0, class_validator_1.IsOptional)(),
53
+ (0, class_validator_1.IsString)(),
54
+ __metadata("design:type", String)
55
+ ], CreateConnectionInstanceDto.prototype, "number", void 0);
56
+ __decorate([
57
+ (0, swagger_1.ApiPropertyOptional)({
58
+ description: 'Rejeitar chamadas automaticamente',
59
+ example: true,
60
+ }),
61
+ (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.IsBoolean)(),
63
+ __metadata("design:type", Boolean)
64
+ ], CreateConnectionInstanceDto.prototype, "rejectCall", void 0);
65
+ __decorate([
66
+ (0, swagger_1.ApiPropertyOptional)({
67
+ description: 'Mensagem enviada ao rejeitar chamada automaticamente',
68
+ example: 'Nao atendemos chamadas por este canal.',
69
+ }),
70
+ (0, class_validator_1.IsOptional)(),
71
+ (0, class_validator_1.IsString)(),
72
+ __metadata("design:type", String)
73
+ ], CreateConnectionInstanceDto.prototype, "msgCall", void 0);
74
+ __decorate([
75
+ (0, swagger_1.ApiPropertyOptional)({
76
+ description: 'Ignorar mensagens de grupos',
77
+ example: false,
78
+ }),
79
+ (0, class_validator_1.IsOptional)(),
80
+ (0, class_validator_1.IsBoolean)(),
81
+ __metadata("design:type", Boolean)
82
+ ], CreateConnectionInstanceDto.prototype, "groupsIgnore", void 0);
83
+ __decorate([
84
+ (0, swagger_1.ApiPropertyOptional)({
85
+ description: 'Manter sessao sempre online',
86
+ example: true,
87
+ }),
88
+ (0, class_validator_1.IsOptional)(),
89
+ (0, class_validator_1.IsBoolean)(),
90
+ __metadata("design:type", Boolean)
91
+ ], CreateConnectionInstanceDto.prototype, "alwaysOnline", void 0);
92
+ __decorate([
93
+ (0, swagger_1.ApiPropertyOptional)({
94
+ description: 'Marcar mensagens recebidas como lidas',
95
+ example: true,
96
+ }),
97
+ (0, class_validator_1.IsOptional)(),
98
+ (0, class_validator_1.IsBoolean)(),
99
+ __metadata("design:type", Boolean)
100
+ ], CreateConnectionInstanceDto.prototype, "readMessages", void 0);
101
+ __decorate([
102
+ (0, swagger_1.ApiPropertyOptional)({
103
+ description: 'Exibir status de leitura das mensagens enviadas',
104
+ example: true,
105
+ }),
106
+ (0, class_validator_1.IsOptional)(),
107
+ (0, class_validator_1.IsBoolean)(),
108
+ __metadata("design:type", Boolean)
109
+ ], CreateConnectionInstanceDto.prototype, "readStatus", void 0);
110
+ __decorate([
111
+ (0, swagger_1.ApiPropertyOptional)({
112
+ description: 'Sincronizar historico completo do WhatsApp',
113
+ example: false,
114
+ }),
115
+ (0, class_validator_1.IsOptional)(),
116
+ (0, class_validator_1.IsBoolean)(),
117
+ __metadata("design:type", Boolean)
118
+ ], CreateConnectionInstanceDto.prototype, "syncFullHistory", void 0);
119
+ class ConnectionInstanceConnectQueryDto {
120
+ number;
121
+ }
122
+ exports.ConnectionInstanceConnectQueryDto = ConnectionInstanceConnectQueryDto;
123
+ __decorate([
124
+ (0, swagger_1.ApiPropertyOptional)({
125
+ description: 'Numero com DDI para pareamento por codigo (opcional)',
126
+ example: '5511999999999',
127
+ }),
128
+ (0, class_validator_1.IsOptional)(),
129
+ (0, class_validator_1.IsString)(),
130
+ __metadata("design:type", String)
131
+ ], ConnectionInstanceConnectQueryDto.prototype, "number", void 0);
132
+ class SetConnectionWebhookDto {
133
+ enabled;
134
+ url;
135
+ webhookByEvents;
136
+ webhookBase64;
137
+ events;
138
+ }
139
+ exports.SetConnectionWebhookDto = SetConnectionWebhookDto;
140
+ __decorate([
141
+ (0, swagger_1.ApiProperty)({
142
+ description: 'Habilita webhook da instancia',
143
+ example: true,
144
+ }),
145
+ (0, class_validator_1.IsBoolean)(),
146
+ __metadata("design:type", Boolean)
147
+ ], SetConnectionWebhookDto.prototype, "enabled", void 0);
148
+ __decorate([
149
+ (0, swagger_1.ApiProperty)({
150
+ description: 'URL que recebera eventos',
151
+ example: 'https://api.seusistema.com/webhooks/whatsapp',
152
+ }),
153
+ (0, class_validator_1.IsString)(),
154
+ (0, class_validator_1.IsNotEmpty)(),
155
+ __metadata("design:type", String)
156
+ ], SetConnectionWebhookDto.prototype, "url", void 0);
157
+ __decorate([
158
+ (0, swagger_1.ApiProperty)({
159
+ description: 'Webhook por eventos especificos',
160
+ example: true,
161
+ }),
162
+ (0, class_validator_1.IsBoolean)(),
163
+ __metadata("design:type", Boolean)
164
+ ], SetConnectionWebhookDto.prototype, "webhookByEvents", void 0);
165
+ __decorate([
166
+ (0, swagger_1.ApiProperty)({
167
+ description: 'Incluir arquivos em base64 quando disponivel',
168
+ example: false,
169
+ }),
170
+ (0, class_validator_1.IsBoolean)(),
171
+ __metadata("design:type", Boolean)
172
+ ], SetConnectionWebhookDto.prototype, "webhookBase64", void 0);
173
+ __decorate([
174
+ (0, swagger_1.ApiProperty)({
175
+ description: 'Eventos permitidos pela Evolution API',
176
+ example: ['CONNECTION_UPDATE', 'MESSAGES_UPSERT'],
177
+ type: [String],
178
+ }),
179
+ (0, class_validator_1.IsArray)(),
180
+ (0, class_validator_1.IsString)({ each: true }),
181
+ __metadata("design:type", Array)
182
+ ], SetConnectionWebhookDto.prototype, "events", void 0);
183
+ class SendConnectionTextDto {
184
+ number;
185
+ text;
186
+ delay;
187
+ linkPreview;
188
+ }
189
+ exports.SendConnectionTextDto = SendConnectionTextDto;
190
+ __decorate([
191
+ (0, swagger_1.ApiProperty)({
192
+ description: 'Numero destino com DDI',
193
+ example: '5511999999999',
194
+ }),
195
+ (0, class_validator_1.IsString)(),
196
+ (0, class_validator_1.IsNotEmpty)(),
197
+ __metadata("design:type", String)
198
+ ], SendConnectionTextDto.prototype, "number", void 0);
199
+ __decorate([
200
+ (0, swagger_1.ApiProperty)({
201
+ description: 'Texto da mensagem',
202
+ example: 'Ola! Tudo bem?',
203
+ }),
204
+ (0, class_validator_1.IsString)(),
205
+ (0, class_validator_1.IsNotEmpty)(),
206
+ __metadata("design:type", String)
207
+ ], SendConnectionTextDto.prototype, "text", void 0);
208
+ __decorate([
209
+ (0, swagger_1.ApiPropertyOptional)({
210
+ description: 'Delay de presenca em ms antes do envio',
211
+ example: 1000,
212
+ }),
213
+ (0, class_validator_1.IsOptional)(),
214
+ (0, class_validator_1.IsInt)(),
215
+ (0, class_validator_1.Min)(0),
216
+ __metadata("design:type", Number)
217
+ ], SendConnectionTextDto.prototype, "delay", void 0);
218
+ __decorate([
219
+ (0, swagger_1.ApiPropertyOptional)({
220
+ description: 'Ativar preview de links',
221
+ example: true,
222
+ }),
223
+ (0, class_validator_1.IsOptional)(),
224
+ (0, class_validator_1.IsBoolean)(),
225
+ __metadata("design:type", Boolean)
226
+ ], SendConnectionTextDto.prototype, "linkPreview", void 0);
227
+ class SendConnectionMediaDto {
228
+ number;
229
+ mediatype;
230
+ mimetype;
231
+ caption;
232
+ media;
233
+ fileName;
234
+ delay;
235
+ }
236
+ exports.SendConnectionMediaDto = SendConnectionMediaDto;
237
+ __decorate([
238
+ (0, swagger_1.ApiProperty)({
239
+ description: 'Numero destino com DDI',
240
+ example: '5511999999999',
241
+ }),
242
+ (0, class_validator_1.IsString)(),
243
+ (0, class_validator_1.IsNotEmpty)(),
244
+ __metadata("design:type", String)
245
+ ], SendConnectionMediaDto.prototype, "number", void 0);
246
+ __decorate([
247
+ (0, swagger_1.ApiProperty)({
248
+ description: 'Tipo da midia',
249
+ example: 'image',
250
+ }),
251
+ (0, class_validator_1.IsString)(),
252
+ (0, class_validator_1.IsNotEmpty)(),
253
+ __metadata("design:type", String)
254
+ ], SendConnectionMediaDto.prototype, "mediatype", void 0);
255
+ __decorate([
256
+ (0, swagger_1.ApiProperty)({
257
+ description: 'MIME type da midia',
258
+ example: 'image/png',
259
+ }),
260
+ (0, class_validator_1.IsString)(),
261
+ (0, class_validator_1.IsNotEmpty)(),
262
+ __metadata("design:type", String)
263
+ ], SendConnectionMediaDto.prototype, "mimetype", void 0);
264
+ __decorate([
265
+ (0, swagger_1.ApiProperty)({
266
+ description: 'Legenda',
267
+ example: 'Imagem de teste',
268
+ }),
269
+ (0, class_validator_1.IsString)(),
270
+ (0, class_validator_1.IsNotEmpty)(),
271
+ __metadata("design:type", String)
272
+ ], SendConnectionMediaDto.prototype, "caption", void 0);
273
+ __decorate([
274
+ (0, swagger_1.ApiProperty)({
275
+ description: 'URL publica da midia ou conteudo base64',
276
+ example: 'https://cdn.seusistema.com/media/example.png',
277
+ }),
278
+ (0, class_validator_1.IsString)(),
279
+ (0, class_validator_1.IsNotEmpty)(),
280
+ __metadata("design:type", String)
281
+ ], SendConnectionMediaDto.prototype, "media", void 0);
282
+ __decorate([
283
+ (0, swagger_1.ApiProperty)({
284
+ description: 'Nome do arquivo',
285
+ example: 'example.png',
286
+ }),
287
+ (0, class_validator_1.IsString)(),
288
+ (0, class_validator_1.IsNotEmpty)(),
289
+ __metadata("design:type", String)
290
+ ], SendConnectionMediaDto.prototype, "fileName", void 0);
291
+ __decorate([
292
+ (0, swagger_1.ApiPropertyOptional)({
293
+ description: 'Delay de presenca em ms antes do envio',
294
+ example: 1000,
295
+ }),
296
+ (0, class_validator_1.IsOptional)(),
297
+ (0, class_validator_1.IsInt)(),
298
+ (0, class_validator_1.Min)(0),
299
+ __metadata("design:type", Number)
300
+ ], SendConnectionMediaDto.prototype, "delay", void 0);
301
+ class SendConnectionWhatsAppAudioDto {
302
+ number;
303
+ audio;
304
+ delay;
305
+ }
306
+ exports.SendConnectionWhatsAppAudioDto = SendConnectionWhatsAppAudioDto;
307
+ __decorate([
308
+ (0, swagger_1.ApiProperty)({
309
+ description: 'Numero destino com DDI',
310
+ example: '5511999999999',
311
+ }),
312
+ (0, class_validator_1.IsString)(),
313
+ (0, class_validator_1.IsNotEmpty)(),
314
+ __metadata("design:type", String)
315
+ ], SendConnectionWhatsAppAudioDto.prototype, "number", void 0);
316
+ __decorate([
317
+ (0, swagger_1.ApiProperty)({
318
+ description: 'URL publica do audio ou conteudo base64',
319
+ example: 'https://cdn.seusistema.com/media/audio.ogg',
320
+ }),
321
+ (0, class_validator_1.IsString)(),
322
+ (0, class_validator_1.IsNotEmpty)(),
323
+ __metadata("design:type", String)
324
+ ], SendConnectionWhatsAppAudioDto.prototype, "audio", void 0);
325
+ __decorate([
326
+ (0, swagger_1.ApiPropertyOptional)({
327
+ description: 'Delay de presenca em ms antes do envio',
328
+ example: 1000,
329
+ }),
330
+ (0, class_validator_1.IsOptional)(),
331
+ (0, class_validator_1.IsInt)(),
332
+ (0, class_validator_1.Min)(0),
333
+ __metadata("design:type", Number)
334
+ ], SendConnectionWhatsAppAudioDto.prototype, "delay", void 0);
335
+ class ConnectionMediaMessageKeyDto {
336
+ id;
337
+ }
338
+ exports.ConnectionMediaMessageKeyDto = ConnectionMediaMessageKeyDto;
339
+ __decorate([
340
+ (0, swagger_1.ApiProperty)({
341
+ description: 'ID da mensagem de midia no WhatsApp',
342
+ example: 'BAE594145F4C59B4',
343
+ }),
344
+ (0, class_validator_1.IsString)(),
345
+ (0, class_validator_1.IsNotEmpty)(),
346
+ __metadata("design:type", String)
347
+ ], ConnectionMediaMessageKeyDto.prototype, "id", void 0);
348
+ class ConnectionMediaMessageDto {
349
+ key;
350
+ }
351
+ exports.ConnectionMediaMessageDto = ConnectionMediaMessageDto;
352
+ __decorate([
353
+ (0, swagger_1.ApiProperty)({ type: ConnectionMediaMessageKeyDto }),
354
+ (0, class_validator_1.ValidateNested)(),
355
+ (0, class_transformer_1.Type)(() => ConnectionMediaMessageKeyDto),
356
+ __metadata("design:type", ConnectionMediaMessageKeyDto)
357
+ ], ConnectionMediaMessageDto.prototype, "key", void 0);
358
+ class GetConnectionBase64Dto {
359
+ message;
360
+ convertToMp4;
361
+ }
362
+ exports.GetConnectionBase64Dto = GetConnectionBase64Dto;
363
+ __decorate([
364
+ (0, swagger_1.ApiProperty)({ type: ConnectionMediaMessageDto }),
365
+ (0, class_validator_1.ValidateNested)(),
366
+ (0, class_transformer_1.Type)(() => ConnectionMediaMessageDto),
367
+ __metadata("design:type", ConnectionMediaMessageDto)
368
+ ], GetConnectionBase64Dto.prototype, "message", void 0);
369
+ __decorate([
370
+ (0, swagger_1.ApiProperty)({
371
+ description: 'Converter video para MP4 (valido para mensagens de video)',
372
+ example: false,
373
+ }),
374
+ (0, class_validator_1.IsBoolean)(),
375
+ __metadata("design:type", Boolean)
376
+ ], GetConnectionBase64Dto.prototype, "convertToMp4", void 0);