tychat-contracts 1.6.12 → 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;
@@ -16,9 +23,16 @@ export declare class DashboardWidgetDto {
16
23
  x: number;
17
24
  /** Largura em colunas (1–12). */
18
25
  w: number;
26
+ /**
27
+ * Altura em linhas da grelha CSS (`grid-row: span h`), alinhada a `gridAutoRows` do painel.
28
+ * Omitir = 1 (compatível com layouts antigos).
29
+ */
30
+ h?: number;
19
31
  /** Ordem de leitura (menor = primeiro). */
20
32
  order: number;
21
33
  title?: string;
34
+ /** Modo canvas: posicionamento livre (percentagens). Opcional; quando presente, o cliente deve preferir isto à grelha. */
35
+ canvas?: DashboardCanvasRectDto;
22
36
  }
23
37
  export declare class DashboardLayoutDto {
24
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,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;
@@ -77,9 +117,16 @@ class DashboardWidgetDto {
77
117
  x;
78
118
  /** Largura em colunas (1–12). */
79
119
  w;
120
+ /**
121
+ * Altura em linhas da grelha CSS (`grid-row: span h`), alinhada a `gridAutoRows` do painel.
122
+ * Omitir = 1 (compatível com layouts antigos).
123
+ */
124
+ h;
80
125
  /** Ordem de leitura (menor = primeiro). */
81
126
  order;
82
127
  title;
128
+ /** Modo canvas: posicionamento livre (percentagens). Opcional; quando presente, o cliente deve preferir isto à grelha. */
129
+ canvas;
83
130
  }
84
131
  exports.DashboardWidgetDto = DashboardWidgetDto;
85
132
  __decorate([
@@ -113,6 +160,15 @@ __decorate([
113
160
  (0, class_validator_1.Max)(12),
114
161
  __metadata("design:type", Number)
115
162
  ], DashboardWidgetDto.prototype, "w", void 0);
163
+ __decorate([
164
+ (0, swagger_1.ApiPropertyOptional)({ minimum: 1, maximum: 12, default: 1 }),
165
+ (0, class_validator_1.IsOptional)(),
166
+ (0, class_transformer_1.Type)(() => Number),
167
+ (0, class_validator_1.IsInt)(),
168
+ (0, class_validator_1.Min)(1),
169
+ (0, class_validator_1.Max)(12),
170
+ __metadata("design:type", Number)
171
+ ], DashboardWidgetDto.prototype, "h", void 0);
116
172
  __decorate([
117
173
  (0, swagger_1.ApiProperty)(),
118
174
  (0, class_validator_1.IsInt)(),
@@ -126,16 +182,23 @@ __decorate([
126
182
  (0, class_validator_1.MaxLength)(120),
127
183
  __metadata("design:type", String)
128
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);
129
192
  class DashboardLayoutDto {
130
193
  version;
131
194
  widgets;
132
195
  }
133
196
  exports.DashboardLayoutDto = DashboardLayoutDto;
134
197
  __decorate([
135
- (0, swagger_1.ApiProperty)({ default: 1 }),
198
+ (0, swagger_1.ApiProperty)({ default: 1, description: '1 = só grelha; 2 = canvas com campo canvas por widget' }),
136
199
  (0, class_validator_1.IsInt)(),
137
200
  (0, class_validator_1.Min)(1),
138
- (0, class_validator_1.Max)(1),
201
+ (0, class_validator_1.Max)(2),
139
202
  __metadata("design:type", Number)
140
203
  ], DashboardLayoutDto.prototype, "version", void 0);
141
204
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tychat-contracts",
3
- "version": "1.6.12",
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')
@@ -105,6 +137,18 @@ export class DashboardWidgetDto {
105
137
  @Max(12)
106
138
  w: number;
107
139
 
140
+ /**
141
+ * Altura em linhas da grelha CSS (`grid-row: span h`), alinhada a `gridAutoRows` do painel.
142
+ * Omitir = 1 (compatível com layouts antigos).
143
+ */
144
+ @ApiPropertyOptional({ minimum: 1, maximum: 12, default: 1 })
145
+ @IsOptional()
146
+ @Type(() => Number)
147
+ @IsInt()
148
+ @Min(1)
149
+ @Max(12)
150
+ h?: number;
151
+
108
152
  /** Ordem de leitura (menor = primeiro). */
109
153
  @ApiProperty()
110
154
  @IsInt()
@@ -116,13 +160,20 @@ export class DashboardWidgetDto {
116
160
  @IsString()
117
161
  @MaxLength(120)
118
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;
119
170
  }
120
171
 
121
172
  export class DashboardLayoutDto {
122
- @ApiProperty({ default: 1 })
173
+ @ApiProperty({ default: 1, description: '1 = só grelha; 2 = canvas com campo canvas por widget' })
123
174
  @IsInt()
124
175
  @Min(1)
125
- @Max(1)
176
+ @Max(2)
126
177
  version: number;
127
178
 
128
179
  @ApiProperty({ type: [DashboardWidgetDto] })