tychat-contracts 1.6.13 → 1.6.14

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.
@@ -8,6 +8,13 @@ export type DashboardChartType = (typeof DASHBOARD_CHART_TYPES)[number];
8
8
  export declare const DASHBOARD_DATA_MODULE_KEYS: readonly ["overview.clients_total", "overview.clients_active_inactive", "overview.units_total", "overview.revenue_totals", "overview.revenue_growth", "overview.invoice_counts", "billing.revenue_by_status", "billing.invoice_counts", "billing.recent_invoices", "billing.payment_links", "tenants.client_list", "tenants.plan_per_client", "tenants.legal_term_policy", "tenants.whatsapp_provider", "tenants.scheduled_deletion", "tenants.hostnames", "tenants.storage_usage", "limits.per_client", "limits.session_policy", "limits.extra_storage", "plans.stats", "plans.list", "ia.tokens_per_tenant", "ia.agents_per_tenant", "ia.tool_policies", "ia.models_availability", "evolution.configs_summary", "evolution.instances_totals", "evolution.connection_state", "global.platform_config", "team.panel_admins", "audit.recent_events", "audit.outcome_counts", "security.device_sessions", "security.totp_status"];
9
9
  export type DashboardDataModuleKey = (typeof DASHBOARD_DATA_MODULE_KEYS)[number];
10
10
  export declare function isDashboardDataModuleKey(v: string): v is DashboardDataModuleKey;
11
+ /** Posição e tamanho no painel em percentagem (0–100) relativamente ao contentor do canvas. */
12
+ export declare class DashboardCanvasRectDto {
13
+ leftPct: number;
14
+ topPct: number;
15
+ widthPct: number;
16
+ heightPct: number;
17
+ }
11
18
  export declare class DashboardWidgetDto {
12
19
  id: string;
13
20
  dataModule: DashboardDataModuleKey;
@@ -24,6 +31,8 @@ export declare class DashboardWidgetDto {
24
31
  /** Ordem de leitura (menor = primeiro). */
25
32
  order: number;
26
33
  title?: string;
34
+ /** Modo canvas: posicionamento livre (percentagens). Opcional; quando presente, o cliente deve preferir isto à grelha. */
35
+ canvas?: DashboardCanvasRectDto;
27
36
  }
28
37
  export declare class DashboardLayoutDto {
29
38
  version: number;
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-layout.dto.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/dashboard-layout.dto.ts"],"names":[],"mappings":"AAgBA,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,4EASxB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,i4BAoC7B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,sBAAsB,CAE/E;AAED,qBAAa,kBAAkB;IAG7B,EAAE,EAAE,MAAM,CAAC;IAKX,UAAU,EAAE,sBAAsB,CAAC;IAKnC,SAAS,EAAE,kBAAkB,CAAC;IAE9B,0CAA0C;IAK1C,CAAC,EAAE,MAAM,CAAC;IAEV,iCAAiC;IAKjC,CAAC,EAAE,MAAM,CAAC;IAEV;;;OAGG;IAOH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX,2CAA2C;IAI3C,KAAK,EAAE,MAAM,CAAC;IAMd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,kBAAkB;IAK7B,OAAO,EAAE,MAAM,CAAC;IAOhB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B"}
1
+ {"version":3,"file":"dashboard-layout.dto.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/dashboard-layout.dto.ts"],"names":[],"mappings":"AAiBA,oEAAoE;AACpE,eAAO,MAAM,qBAAqB,4EASxB,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,i4BAoC7B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,IAAI,sBAAsB,CAE/E;AAED,+FAA+F;AAC/F,qBAAa,sBAAsB;IAMjC,OAAO,EAAE,MAAM,CAAC;IAOhB,MAAM,EAAE,MAAM,CAAC;IAOf,QAAQ,EAAE,MAAM,CAAC;IAOjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,kBAAkB;IAG7B,EAAE,EAAE,MAAM,CAAC;IAKX,UAAU,EAAE,sBAAsB,CAAC;IAKnC,SAAS,EAAE,kBAAkB,CAAC;IAE9B,0CAA0C;IAK1C,CAAC,EAAE,MAAM,CAAC;IAEV,iCAAiC;IAKjC,CAAC,EAAE,MAAM,CAAC;IAEV;;;OAGG;IAOH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX,2CAA2C;IAI3C,KAAK,EAAE,MAAM,CAAC;IAMd,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,0HAA0H;IAK1H,MAAM,CAAC,EAAE,sBAAsB,CAAC;CACjC;AAED,qBAAa,kBAAkB;IAK7B,OAAO,EAAE,MAAM,CAAC;IAOhB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DashboardLayoutDto = exports.DashboardWidgetDto = exports.DASHBOARD_DATA_MODULE_KEYS = exports.DASHBOARD_CHART_TYPES = void 0;
12
+ exports.DashboardLayoutDto = exports.DashboardWidgetDto = exports.DashboardCanvasRectDto = exports.DASHBOARD_DATA_MODULE_KEYS = exports.DASHBOARD_CHART_TYPES = void 0;
13
13
  exports.isDashboardDataModuleKey = isDashboardDataModuleKey;
14
14
  const swagger_1 = require("@nestjs/swagger");
15
15
  const class_transformer_1 = require("class-transformer");
@@ -69,6 +69,46 @@ exports.DASHBOARD_DATA_MODULE_KEYS = [
69
69
  function isDashboardDataModuleKey(v) {
70
70
  return exports.DASHBOARD_DATA_MODULE_KEYS.includes(v);
71
71
  }
72
+ /** Posição e tamanho no painel em percentagem (0–100) relativamente ao contentor do canvas. */
73
+ class DashboardCanvasRectDto {
74
+ leftPct;
75
+ topPct;
76
+ widthPct;
77
+ heightPct;
78
+ }
79
+ exports.DashboardCanvasRectDto = DashboardCanvasRectDto;
80
+ __decorate([
81
+ (0, swagger_1.ApiProperty)({ minimum: 0, maximum: 100 }),
82
+ (0, class_transformer_1.Type)(() => Number),
83
+ (0, class_validator_1.IsNumber)(),
84
+ (0, class_validator_1.Min)(0),
85
+ (0, class_validator_1.Max)(100),
86
+ __metadata("design:type", Number)
87
+ ], DashboardCanvasRectDto.prototype, "leftPct", void 0);
88
+ __decorate([
89
+ (0, swagger_1.ApiProperty)({ minimum: 0, maximum: 100 }),
90
+ (0, class_transformer_1.Type)(() => Number),
91
+ (0, class_validator_1.IsNumber)(),
92
+ (0, class_validator_1.Min)(0),
93
+ (0, class_validator_1.Max)(100),
94
+ __metadata("design:type", Number)
95
+ ], DashboardCanvasRectDto.prototype, "topPct", void 0);
96
+ __decorate([
97
+ (0, swagger_1.ApiProperty)({ minimum: 0, maximum: 100 }),
98
+ (0, class_transformer_1.Type)(() => Number),
99
+ (0, class_validator_1.IsNumber)(),
100
+ (0, class_validator_1.Min)(0),
101
+ (0, class_validator_1.Max)(100),
102
+ __metadata("design:type", Number)
103
+ ], DashboardCanvasRectDto.prototype, "widthPct", void 0);
104
+ __decorate([
105
+ (0, swagger_1.ApiProperty)({ minimum: 0, maximum: 100 }),
106
+ (0, class_transformer_1.Type)(() => Number),
107
+ (0, class_validator_1.IsNumber)(),
108
+ (0, class_validator_1.Min)(0),
109
+ (0, class_validator_1.Max)(100),
110
+ __metadata("design:type", Number)
111
+ ], DashboardCanvasRectDto.prototype, "heightPct", void 0);
72
112
  class DashboardWidgetDto {
73
113
  id;
74
114
  dataModule;
@@ -85,6 +125,8 @@ class DashboardWidgetDto {
85
125
  /** Ordem de leitura (menor = primeiro). */
86
126
  order;
87
127
  title;
128
+ /** Modo canvas: posicionamento livre (percentagens). Opcional; quando presente, o cliente deve preferir isto à grelha. */
129
+ canvas;
88
130
  }
89
131
  exports.DashboardWidgetDto = DashboardWidgetDto;
90
132
  __decorate([
@@ -140,16 +182,23 @@ __decorate([
140
182
  (0, class_validator_1.MaxLength)(120),
141
183
  __metadata("design:type", String)
142
184
  ], DashboardWidgetDto.prototype, "title", void 0);
185
+ __decorate([
186
+ (0, swagger_1.ApiPropertyOptional)({ type: DashboardCanvasRectDto }),
187
+ (0, class_validator_1.IsOptional)(),
188
+ (0, class_validator_1.ValidateNested)(),
189
+ (0, class_transformer_1.Type)(() => DashboardCanvasRectDto),
190
+ __metadata("design:type", DashboardCanvasRectDto)
191
+ ], DashboardWidgetDto.prototype, "canvas", void 0);
143
192
  class DashboardLayoutDto {
144
193
  version;
145
194
  widgets;
146
195
  }
147
196
  exports.DashboardLayoutDto = DashboardLayoutDto;
148
197
  __decorate([
149
- (0, swagger_1.ApiProperty)({ default: 1 }),
198
+ (0, swagger_1.ApiProperty)({ default: 1, description: '1 = só grelha; 2 = canvas com campo canvas por widget' }),
150
199
  (0, class_validator_1.IsInt)(),
151
200
  (0, class_validator_1.Min)(1),
152
- (0, class_validator_1.Max)(1),
201
+ (0, class_validator_1.Max)(2),
153
202
  __metadata("design:type", Number)
154
203
  ], DashboardLayoutDto.prototype, "version", void 0);
155
204
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.6.13",
3
+ "version": "1.6.14",
4
4
  "description": "DTOs compartilhados com class-validator (API e microserviços)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -5,6 +5,7 @@ import {
5
5
  IsArray,
6
6
  IsIn,
7
7
  IsInt,
8
+ IsNumber,
8
9
  IsOptional,
9
10
  IsString,
10
11
  IsUUID,
@@ -76,6 +77,37 @@ export function isDashboardDataModuleKey(v: string): v is DashboardDataModuleKey
76
77
  return (DASHBOARD_DATA_MODULE_KEYS as readonly string[]).includes(v);
77
78
  }
78
79
 
80
+ /** Posição e tamanho no painel em percentagem (0–100) relativamente ao contentor do canvas. */
81
+ export class DashboardCanvasRectDto {
82
+ @ApiProperty({ minimum: 0, maximum: 100 })
83
+ @Type(() => Number)
84
+ @IsNumber()
85
+ @Min(0)
86
+ @Max(100)
87
+ leftPct: number;
88
+
89
+ @ApiProperty({ minimum: 0, maximum: 100 })
90
+ @Type(() => Number)
91
+ @IsNumber()
92
+ @Min(0)
93
+ @Max(100)
94
+ topPct: number;
95
+
96
+ @ApiProperty({ minimum: 0, maximum: 100 })
97
+ @Type(() => Number)
98
+ @IsNumber()
99
+ @Min(0)
100
+ @Max(100)
101
+ widthPct: number;
102
+
103
+ @ApiProperty({ minimum: 0, maximum: 100 })
104
+ @Type(() => Number)
105
+ @IsNumber()
106
+ @Min(0)
107
+ @Max(100)
108
+ heightPct: number;
109
+ }
110
+
79
111
  export class DashboardWidgetDto {
80
112
  @ApiProperty({ format: 'uuid' })
81
113
  @IsUUID('4')
@@ -128,13 +160,20 @@ export class DashboardWidgetDto {
128
160
  @IsString()
129
161
  @MaxLength(120)
130
162
  title?: string;
163
+
164
+ /** Modo canvas: posicionamento livre (percentagens). Opcional; quando presente, o cliente deve preferir isto à grelha. */
165
+ @ApiPropertyOptional({ type: DashboardCanvasRectDto })
166
+ @IsOptional()
167
+ @ValidateNested()
168
+ @Type(() => DashboardCanvasRectDto)
169
+ canvas?: DashboardCanvasRectDto;
131
170
  }
132
171
 
133
172
  export class DashboardLayoutDto {
134
- @ApiProperty({ default: 1 })
173
+ @ApiProperty({ default: 1, description: '1 = só grelha; 2 = canvas com campo canvas por widget' })
135
174
  @IsInt()
136
175
  @Min(1)
137
- @Max(1)
176
+ @Max(2)
138
177
  version: number;
139
178
 
140
179
  @ApiProperty({ type: [DashboardWidgetDto] })