tychat-contracts 1.6.8 → 1.6.11
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.
- package/.github/workflows/publish-npm.yml +25 -25
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/legal-terms/legal-term-dispatch.dto.d.ts +8 -1
- package/dist/legal-terms/legal-term-dispatch.dto.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-preview.dto.d.ts +4 -0
- package/dist/legal-terms/legal-term-preview.dto.d.ts.map +1 -1
- package/dist/legal-terms/legal-term-preview.dto.js +13 -1
- package/dist/panel-rbac/access-permission-item.dto.d.ts +6 -0
- package/dist/panel-rbac/access-permission-item.dto.d.ts.map +1 -0
- package/dist/panel-rbac/access-permission-item.dto.js +36 -0
- package/dist/panel-rbac/create-access-level.dto.d.ts +6 -0
- package/dist/panel-rbac/create-access-level.dto.d.ts.map +1 -0
- package/dist/panel-rbac/create-access-level.dto.js +39 -0
- package/dist/panel-rbac/dashboard-layout.dto.d.ts +27 -0
- package/dist/panel-rbac/dashboard-layout.dto.d.ts.map +1 -0
- package/dist/panel-rbac/dashboard-layout.dto.js +148 -0
- package/dist/panel-rbac/index.d.ts +8 -0
- package/dist/panel-rbac/index.d.ts.map +1 -0
- package/dist/panel-rbac/index.js +23 -0
- package/dist/panel-rbac/panel-context-response.dto.d.ts +12 -0
- package/dist/panel-rbac/panel-context-response.dto.d.ts.map +1 -0
- package/dist/panel-rbac/panel-context-response.dto.js +48 -0
- package/dist/panel-rbac/panel-permission-keys.d.ts +29 -0
- package/dist/panel-rbac/panel-permission-keys.d.ts.map +1 -0
- package/dist/panel-rbac/panel-permission-keys.js +48 -0
- package/dist/panel-rbac/panel-permission-keys.spec.d.ts +2 -0
- package/dist/panel-rbac/panel-permission-keys.spec.d.ts.map +1 -0
- package/dist/panel-rbac/panel-permission-keys.spec.js +16 -0
- package/dist/panel-rbac/replace-access-permissions.dto.d.ts +5 -0
- package/dist/panel-rbac/replace-access-permissions.dto.d.ts.map +1 -0
- package/dist/panel-rbac/replace-access-permissions.dto.js +28 -0
- package/dist/panel-rbac/update-access-level.dto.d.ts +8 -0
- package/dist/panel-rbac/update-access-level.dto.d.ts.map +1 -0
- package/dist/panel-rbac/update-access-level.dto.js +54 -0
- package/package.json +29 -29
- package/src/analytics/analytics-kafka-topics.ts +24 -24
- package/src/analytics/create-tenant-audit-log.dto.ts +105 -105
- package/src/analytics/index.ts +8 -8
- package/src/analytics/list-tenant-audit-logs-query.dto.ts +45 -45
- package/src/auth/auth-kafka.payloads.ts +218 -218
- package/src/auth/change-own-password.dto.ts +34 -34
- package/src/auth/index.ts +28 -28
- package/src/auth/login-2fa.dto.ts +14 -14
- package/src/auth/password-reset-finalize-2fa.dto.ts +36 -36
- package/src/auth/request-password-reset-response.dto.ts +26 -26
- package/src/auth/revoke-device-session.dto.ts +19 -19
- package/src/auth/totp-user.dto.ts +58 -58
- package/src/configurations/app-module-policy.dto.ts +72 -72
- package/src/configurations/app-module-policy.enums.ts +30 -30
- package/src/configurations/configuration-tenant-summary.dto.ts +79 -79
- package/src/configurations/index.ts +13 -13
- package/src/index.ts +1 -0
- package/src/legal-terms/legal-term-dispatch.dto.ts +12 -1
- package/src/legal-terms/legal-term-preview.dto.ts +15 -1
- package/src/panel-rbac/access-permission-item.dto.ts +20 -0
- package/src/panel-rbac/create-access-level.dto.ts +20 -0
- package/src/panel-rbac/dashboard-layout.dto.ts +133 -0
- package/src/panel-rbac/index.ts +7 -0
- package/src/panel-rbac/panel-context-response.dto.ts +28 -0
- package/src/panel-rbac/panel-permission-keys.spec.ts +20 -0
- package/src/panel-rbac/panel-permission-keys.ts +57 -0
- package/src/panel-rbac/replace-access-permissions.dto.ts +13 -0
- package/src/panel-rbac/update-access-level.dto.ts +40 -0
- package/src/storage/presign-download-rpc.dto.ts +38 -38
- package/src/storage/storage-rmq-patterns.ts +5 -5
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
name: Publish packages
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
push:
|
|
6
|
-
tags:
|
|
7
|
-
- 'v*.*.*'
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
permissions:
|
|
13
|
-
contents: read
|
|
14
|
-
id-token: write
|
|
15
|
-
steps:
|
|
16
|
-
- uses: actions/checkout@v5
|
|
17
|
-
- uses: actions/setup-node@v4
|
|
18
|
-
with:
|
|
19
|
-
node-version: '20'
|
|
20
|
-
registry-url: 'https://registry.npmjs.org'
|
|
21
|
-
cache: npm
|
|
22
|
-
- run: npm ci
|
|
23
|
-
- run: npm publish --provenance --access public
|
|
24
|
-
env:
|
|
25
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
1
|
+
name: Publish packages
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
tags:
|
|
7
|
+
- 'v*.*.*'
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
id-token: write
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v5
|
|
17
|
+
- uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: '20'
|
|
20
|
+
registry-url: 'https://registry.npmjs.org'
|
|
21
|
+
cache: npm
|
|
22
|
+
- run: npm ci
|
|
23
|
+
- run: npm publish --provenance --access public
|
|
24
|
+
env:
|
|
25
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
/** Status do registro de envio na clínica (WhatsApp / fluxo). */
|
|
2
2
|
export type LegalTermDispatchStatusValue = 'created' | 'sent' | 'failed';
|
|
3
3
|
/** Status do documento na Clicksign (signature-service). */
|
|
4
|
-
export type SignatureDocumentStatusValue = 'pending' | 'signed' | 'refused' | 'cancelled' | 'expired'
|
|
4
|
+
export type SignatureDocumentStatusValue = 'pending' | 'signed' | 'refused' | 'cancelled' | 'expired'
|
|
5
|
+
/** Fluxo impresso: aguardando upload da digitalização assinada (sem registro em signature-service). */
|
|
6
|
+
| 'upload_required';
|
|
7
|
+
/** Método de assinatura escolhido no envio do termo. */
|
|
8
|
+
export type LegalTermSignatureMethodValue = 'digital' | 'printed';
|
|
9
|
+
/** Política por tenant (admin): quais métodos o produto oferece. */
|
|
10
|
+
export type LegalTermSignaturePolicyValue = 'printed_only' | 'printed_and_integrations';
|
|
5
11
|
/** Item agregado para a ficha do paciente (API: clinic + signature). */
|
|
6
12
|
export type PatientLegalTermDispatchItemDto = {
|
|
7
13
|
id: string;
|
|
@@ -10,6 +16,7 @@ export type PatientLegalTermDispatchItemDto = {
|
|
|
10
16
|
procedure_names: string[];
|
|
11
17
|
dispatch_status: LegalTermDispatchStatusValue;
|
|
12
18
|
error_code: string | null;
|
|
19
|
+
signature_method: LegalTermSignatureMethodValue;
|
|
13
20
|
signature_document_id: string | null;
|
|
14
21
|
signature_status: SignatureDocumentStatusValue | null;
|
|
15
22
|
signed_at: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal-term-dispatch.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-dispatch.dto.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,MAAM,4BAA4B,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzE,4DAA4D;AAC5D,MAAM,MAAM,4BAA4B,GACpC,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"legal-term-dispatch.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-dispatch.dto.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,MAAM,4BAA4B,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzE,4DAA4D;AAC5D,MAAM,MAAM,4BAA4B,GACpC,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,SAAS;AACX,uGAAuG;GACrG,iBAAiB,CAAC;AAEtB,wDAAwD;AACxD,MAAM,MAAM,6BAA6B,GAAG,SAAS,GAAG,SAAS,CAAC;AAElE,oEAAoE;AACpE,MAAM,MAAM,6BAA6B,GACrC,cAAc,GACd,0BAA0B,CAAC;AAE/B,wEAAwE;AACxE,MAAM,MAAM,+BAA+B,GAAG;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,EAAE,4BAA4B,CAAC;IAC9C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,gBAAgB,EAAE,4BAA4B,GAAG,IAAI,CAAC;IACtD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG;IAClD,KAAK,EAAE,+BAA+B,EAAE,CAAC;CAC1C,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type LegalTermBodyFormat } from './legal-term-body-format';
|
|
2
|
+
declare const LEGAL_TERM_SIGNATURE_METHODS: readonly ["digital", "printed"];
|
|
3
|
+
export type LegalTermSignatureMethodDto = (typeof LEGAL_TERM_SIGNATURE_METHODS)[number];
|
|
2
4
|
/** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
|
|
3
5
|
export declare class LegalTermPreviewRequestDto {
|
|
4
6
|
body_html?: string;
|
|
@@ -10,6 +12,7 @@ export declare class LegalTermPreviewRequestDto {
|
|
|
10
12
|
data_hora_iso?: string;
|
|
11
13
|
}
|
|
12
14
|
export declare class LegalTermSendDto {
|
|
15
|
+
signatureMethod?: LegalTermSignatureMethodDto;
|
|
13
16
|
procedureIds: string[];
|
|
14
17
|
whatsappMessage: string;
|
|
15
18
|
signerEmail?: string;
|
|
@@ -21,4 +24,5 @@ export declare class LegalTermSendDto {
|
|
|
21
24
|
tenantSignerDocumentation?: string;
|
|
22
25
|
tenantSignerPhone?: string;
|
|
23
26
|
}
|
|
27
|
+
export {};
|
|
24
28
|
//# sourceMappingURL=legal-term-preview.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"AAcA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE7F,4FAA4F;AAC5F,qBAAa,0BAA0B;IAQrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAMlC,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAU9B,+BAA+B,CAAC,EAAE,MAAM,EAAE,CAAC;IAM3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,gBAAgB;
|
|
1
|
+
{"version":3,"file":"legal-term-preview.dto.d.ts","sourceRoot":"","sources":["../../src/legal-terms/legal-term-preview.dto.ts"],"names":[],"mappings":"AAcA,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE7F,QAAA,MAAM,4BAA4B,iCAAkC,CAAC;AACrE,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAExF,4FAA4F;AAC5F,qBAAa,0BAA0B;IAQrC,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAMlC,aAAa,CAAC,EAAE,MAAM,CAAC;IAMvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAU9B,+BAA+B,CAAC,EAAE,MAAM,EAAE,CAAC;IAM3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,gBAAgB;IAS3B,eAAe,CAAC,EAAE,2BAA2B,CAAC;IAK9C,YAAY,EAAE,MAAM,EAAE,CAAC;IAUvB,eAAe,EAAE,MAAM,CAAC;IAMxB,WAAW,CAAC,EAAE,MAAM,CAAC;IASrB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,cAAc,CAAC,EAAE,OAAO,CAAC;IAMzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAK1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAO3B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAM9B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAWnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -13,6 +13,7 @@ exports.LegalTermSendDto = exports.LegalTermPreviewRequestDto = void 0;
|
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
const legal_term_body_format_1 = require("./legal-term-body-format");
|
|
16
|
+
const LEGAL_TERM_SIGNATURE_METHODS = ['digital', 'printed'];
|
|
16
17
|
/** Valores explícitos para substituição na pré-visualização (sem inferência heurística). */
|
|
17
18
|
class LegalTermPreviewRequestDto {
|
|
18
19
|
body_html;
|
|
@@ -82,6 +83,7 @@ __decorate([
|
|
|
82
83
|
__metadata("design:type", String)
|
|
83
84
|
], LegalTermPreviewRequestDto.prototype, "data_hora_iso", void 0);
|
|
84
85
|
class LegalTermSendDto {
|
|
86
|
+
signatureMethod;
|
|
85
87
|
procedureIds;
|
|
86
88
|
whatsappMessage;
|
|
87
89
|
signerEmail;
|
|
@@ -94,6 +96,16 @@ class LegalTermSendDto {
|
|
|
94
96
|
tenantSignerPhone;
|
|
95
97
|
}
|
|
96
98
|
exports.LegalTermSendDto = LegalTermSendDto;
|
|
99
|
+
__decorate([
|
|
100
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
101
|
+
enum: LEGAL_TERM_SIGNATURE_METHODS,
|
|
102
|
+
description: 'Método de assinatura: digital (Clicksign + link no WhatsApp) ou printed (PDF para impressão, sem Clicksign). Padrão: digital.',
|
|
103
|
+
default: 'digital',
|
|
104
|
+
}),
|
|
105
|
+
(0, class_validator_1.IsOptional)(),
|
|
106
|
+
(0, class_validator_1.IsIn)(LEGAL_TERM_SIGNATURE_METHODS),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], LegalTermSendDto.prototype, "signatureMethod", void 0);
|
|
97
109
|
__decorate([
|
|
98
110
|
(0, swagger_1.ApiProperty)({ type: [String], format: 'uuid' }),
|
|
99
111
|
(0, class_validator_1.IsArray)(),
|
|
@@ -102,7 +114,7 @@ __decorate([
|
|
|
102
114
|
], LegalTermSendDto.prototype, "procedureIds", void 0);
|
|
103
115
|
__decorate([
|
|
104
116
|
(0, swagger_1.ApiProperty)({
|
|
105
|
-
description: 'Mensagem WhatsApp
|
|
117
|
+
description: 'Mensagem WhatsApp. Com signatureMethod digital (padrão), deve conter exatamente {{ link_termo_juridico }}. Com printed, qualquer texto (sem esse placeholder).',
|
|
106
118
|
example: 'Olá, assine seu termo: {{ link_termo_juridico }}',
|
|
107
119
|
}),
|
|
108
120
|
(0, class_validator_1.IsString)(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-permission-item.dto.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/access-permission-item.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIrF,qBAAa,uBAAuB;IAIlC,QAAQ,EAAE,aAAa,CAAC;IAQxB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.AccessPermissionItemDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const panel_permission_keys_1 = require("./panel-permission-keys");
|
|
16
|
+
const RESOURCES = Object.keys(panel_permission_keys_1.PANEL_RESOURCE_ACTIONS);
|
|
17
|
+
class AccessPermissionItemDto {
|
|
18
|
+
resource;
|
|
19
|
+
action;
|
|
20
|
+
}
|
|
21
|
+
exports.AccessPermissionItemDto = AccessPermissionItemDto;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({ enum: RESOURCES }),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsIn)(RESOURCES),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], AccessPermissionItemDto.prototype, "resource", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, swagger_1.ApiProperty)({
|
|
30
|
+
description: 'Ação permitida para o recurso',
|
|
31
|
+
example: 'view',
|
|
32
|
+
}),
|
|
33
|
+
(0, class_validator_1.IsString)(),
|
|
34
|
+
(0, class_validator_1.MaxLength)(80),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], AccessPermissionItemDto.prototype, "action", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-access-level.dto.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/create-access-level.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,oBAAoB;IAI/B,IAAI,EAAE,MAAM,CAAC;IAMb,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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.CreateAccessLevelDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class CreateAccessLevelDto {
|
|
16
|
+
name;
|
|
17
|
+
description;
|
|
18
|
+
isActive;
|
|
19
|
+
}
|
|
20
|
+
exports.CreateAccessLevelDto = CreateAccessLevelDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
(0, class_validator_1.MinLength)(1),
|
|
24
|
+
(0, class_validator_1.MaxLength)(120),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CreateAccessLevelDto.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, swagger_1.ApiPropertyOptional)(),
|
|
29
|
+
(0, class_validator_1.IsOptional)(),
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.MaxLength)(500),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CreateAccessLevelDto.prototype, "description", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiPropertyOptional)({ default: true }),
|
|
36
|
+
(0, class_validator_1.IsOptional)(),
|
|
37
|
+
(0, class_validator_1.IsBoolean)(),
|
|
38
|
+
__metadata("design:type", Boolean)
|
|
39
|
+
], CreateAccessLevelDto.prototype, "isActive", void 0);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Tipos de visualização permitidos no painel (determinísticos). */
|
|
2
|
+
export declare const DASHBOARD_CHART_TYPES: readonly ["stat", "card", "bar", "line", "area", "pie", "radial", "table"];
|
|
3
|
+
export type DashboardChartType = (typeof DASHBOARD_CHART_TYPES)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Módulos de dados agregados do dashboard (cada um mapeia a permissões e a fatia do summary).
|
|
6
|
+
* Manter alinhado ao `Frontend/.../lib/dashboard-data-modules.ts`.
|
|
7
|
+
*/
|
|
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
|
+
export type DashboardDataModuleKey = (typeof DASHBOARD_DATA_MODULE_KEYS)[number];
|
|
10
|
+
export declare function isDashboardDataModuleKey(v: string): v is DashboardDataModuleKey;
|
|
11
|
+
export declare class DashboardWidgetDto {
|
|
12
|
+
id: string;
|
|
13
|
+
dataModule: DashboardDataModuleKey;
|
|
14
|
+
chartType: DashboardChartType;
|
|
15
|
+
/** Coluna inicial (grelha 12 colunas). */
|
|
16
|
+
x: number;
|
|
17
|
+
/** Largura em colunas (1–12). */
|
|
18
|
+
w: number;
|
|
19
|
+
/** Ordem de leitura (menor = primeiro). */
|
|
20
|
+
order: number;
|
|
21
|
+
title?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class DashboardLayoutDto {
|
|
24
|
+
version: number;
|
|
25
|
+
widgets: DashboardWidgetDto[];
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=dashboard-layout.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-layout.dto.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/dashboard-layout.dto.ts"],"names":[],"mappings":"AAeA,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"}
|
|
@@ -0,0 +1,148 @@
|
|
|
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.DashboardLayoutDto = exports.DashboardWidgetDto = exports.DASHBOARD_DATA_MODULE_KEYS = exports.DASHBOARD_CHART_TYPES = void 0;
|
|
13
|
+
exports.isDashboardDataModuleKey = isDashboardDataModuleKey;
|
|
14
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
const class_validator_1 = require("class-validator");
|
|
17
|
+
/** Tipos de visualização permitidos no painel (determinísticos). */
|
|
18
|
+
exports.DASHBOARD_CHART_TYPES = [
|
|
19
|
+
'stat',
|
|
20
|
+
'card',
|
|
21
|
+
'bar',
|
|
22
|
+
'line',
|
|
23
|
+
'area',
|
|
24
|
+
'pie',
|
|
25
|
+
'radial',
|
|
26
|
+
'table',
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* Módulos de dados agregados do dashboard (cada um mapeia a permissões e a fatia do summary).
|
|
30
|
+
* Manter alinhado ao `Frontend/.../lib/dashboard-data-modules.ts`.
|
|
31
|
+
*/
|
|
32
|
+
exports.DASHBOARD_DATA_MODULE_KEYS = [
|
|
33
|
+
'overview.clients_total',
|
|
34
|
+
'overview.clients_active_inactive',
|
|
35
|
+
'overview.units_total',
|
|
36
|
+
'overview.revenue_totals',
|
|
37
|
+
'overview.revenue_growth',
|
|
38
|
+
'overview.invoice_counts',
|
|
39
|
+
'billing.revenue_by_status',
|
|
40
|
+
'billing.invoice_counts',
|
|
41
|
+
'billing.recent_invoices',
|
|
42
|
+
'billing.payment_links',
|
|
43
|
+
'tenants.client_list',
|
|
44
|
+
'tenants.plan_per_client',
|
|
45
|
+
'tenants.legal_term_policy',
|
|
46
|
+
'tenants.whatsapp_provider',
|
|
47
|
+
'tenants.scheduled_deletion',
|
|
48
|
+
'tenants.hostnames',
|
|
49
|
+
'tenants.storage_usage',
|
|
50
|
+
'limits.per_client',
|
|
51
|
+
'limits.session_policy',
|
|
52
|
+
'limits.extra_storage',
|
|
53
|
+
'plans.stats',
|
|
54
|
+
'plans.list',
|
|
55
|
+
'ia.tokens_per_tenant',
|
|
56
|
+
'ia.agents_per_tenant',
|
|
57
|
+
'ia.tool_policies',
|
|
58
|
+
'ia.models_availability',
|
|
59
|
+
'evolution.configs_summary',
|
|
60
|
+
'evolution.instances_totals',
|
|
61
|
+
'evolution.connection_state',
|
|
62
|
+
'global.platform_config',
|
|
63
|
+
'team.panel_admins',
|
|
64
|
+
'audit.recent_events',
|
|
65
|
+
'audit.outcome_counts',
|
|
66
|
+
'security.device_sessions',
|
|
67
|
+
'security.totp_status',
|
|
68
|
+
];
|
|
69
|
+
function isDashboardDataModuleKey(v) {
|
|
70
|
+
return exports.DASHBOARD_DATA_MODULE_KEYS.includes(v);
|
|
71
|
+
}
|
|
72
|
+
class DashboardWidgetDto {
|
|
73
|
+
id;
|
|
74
|
+
dataModule;
|
|
75
|
+
chartType;
|
|
76
|
+
/** Coluna inicial (grelha 12 colunas). */
|
|
77
|
+
x;
|
|
78
|
+
/** Largura em colunas (1–12). */
|
|
79
|
+
w;
|
|
80
|
+
/** Ordem de leitura (menor = primeiro). */
|
|
81
|
+
order;
|
|
82
|
+
title;
|
|
83
|
+
}
|
|
84
|
+
exports.DashboardWidgetDto = DashboardWidgetDto;
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, swagger_1.ApiProperty)({ format: 'uuid' }),
|
|
87
|
+
(0, class_validator_1.IsUUID)('4'),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], DashboardWidgetDto.prototype, "id", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, swagger_1.ApiProperty)({ enum: exports.DASHBOARD_DATA_MODULE_KEYS }),
|
|
92
|
+
(0, class_validator_1.IsString)(),
|
|
93
|
+
(0, class_validator_1.IsIn)([...exports.DASHBOARD_DATA_MODULE_KEYS]),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], DashboardWidgetDto.prototype, "dataModule", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, swagger_1.ApiProperty)({ enum: exports.DASHBOARD_CHART_TYPES }),
|
|
98
|
+
(0, class_validator_1.IsString)(),
|
|
99
|
+
(0, class_validator_1.IsIn)([...exports.DASHBOARD_CHART_TYPES]),
|
|
100
|
+
__metadata("design:type", String)
|
|
101
|
+
], DashboardWidgetDto.prototype, "chartType", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, swagger_1.ApiProperty)({ minimum: 0, maximum: 11 }),
|
|
104
|
+
(0, class_validator_1.IsInt)(),
|
|
105
|
+
(0, class_validator_1.Min)(0),
|
|
106
|
+
(0, class_validator_1.Max)(11),
|
|
107
|
+
__metadata("design:type", Number)
|
|
108
|
+
], DashboardWidgetDto.prototype, "x", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, swagger_1.ApiProperty)({ minimum: 1, maximum: 12 }),
|
|
111
|
+
(0, class_validator_1.IsInt)(),
|
|
112
|
+
(0, class_validator_1.Min)(1),
|
|
113
|
+
(0, class_validator_1.Max)(12),
|
|
114
|
+
__metadata("design:type", Number)
|
|
115
|
+
], DashboardWidgetDto.prototype, "w", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
(0, swagger_1.ApiProperty)(),
|
|
118
|
+
(0, class_validator_1.IsInt)(),
|
|
119
|
+
(0, class_validator_1.Min)(0),
|
|
120
|
+
__metadata("design:type", Number)
|
|
121
|
+
], DashboardWidgetDto.prototype, "order", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, swagger_1.ApiPropertyOptional)({ description: 'Título opcional no painel' }),
|
|
124
|
+
(0, class_validator_1.IsOptional)(),
|
|
125
|
+
(0, class_validator_1.IsString)(),
|
|
126
|
+
(0, class_validator_1.Max)(120),
|
|
127
|
+
__metadata("design:type", String)
|
|
128
|
+
], DashboardWidgetDto.prototype, "title", void 0);
|
|
129
|
+
class DashboardLayoutDto {
|
|
130
|
+
version;
|
|
131
|
+
widgets;
|
|
132
|
+
}
|
|
133
|
+
exports.DashboardLayoutDto = DashboardLayoutDto;
|
|
134
|
+
__decorate([
|
|
135
|
+
(0, swagger_1.ApiProperty)({ default: 1 }),
|
|
136
|
+
(0, class_validator_1.IsInt)(),
|
|
137
|
+
(0, class_validator_1.Min)(1),
|
|
138
|
+
(0, class_validator_1.Max)(1),
|
|
139
|
+
__metadata("design:type", Number)
|
|
140
|
+
], DashboardLayoutDto.prototype, "version", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, swagger_1.ApiProperty)({ type: [DashboardWidgetDto] }),
|
|
143
|
+
(0, class_validator_1.IsArray)(),
|
|
144
|
+
(0, class_validator_1.ArrayMaxSize)(80),
|
|
145
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
146
|
+
(0, class_transformer_1.Type)(() => DashboardWidgetDto),
|
|
147
|
+
__metadata("design:type", Array)
|
|
148
|
+
], DashboardLayoutDto.prototype, "widgets", void 0);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './panel-permission-keys';
|
|
2
|
+
export * from './create-access-level.dto';
|
|
3
|
+
export * from './update-access-level.dto';
|
|
4
|
+
export * from './access-permission-item.dto';
|
|
5
|
+
export * from './replace-access-permissions.dto';
|
|
6
|
+
export * from './panel-context-response.dto';
|
|
7
|
+
export * from './dashboard-layout.dto';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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("./panel-permission-keys"), exports);
|
|
18
|
+
__exportStar(require("./create-access-level.dto"), exports);
|
|
19
|
+
__exportStar(require("./update-access-level.dto"), exports);
|
|
20
|
+
__exportStar(require("./access-permission-item.dto"), exports);
|
|
21
|
+
__exportStar(require("./replace-access-permissions.dto"), exports);
|
|
22
|
+
__exportStar(require("./panel-context-response.dto"), exports);
|
|
23
|
+
__exportStar(require("./dashboard-layout.dto"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PanelPermissionKey } from './panel-permission-keys';
|
|
2
|
+
import { DashboardLayoutDto } from './dashboard-layout.dto';
|
|
3
|
+
/**
|
|
4
|
+
* Resposta de GET /auth/me/panel-context (tenant-service).
|
|
5
|
+
*/
|
|
6
|
+
export declare class PanelContextResponseDto {
|
|
7
|
+
is_master: boolean;
|
|
8
|
+
access_level_id: string | null;
|
|
9
|
+
permissions: PanelPermissionKey[] | null;
|
|
10
|
+
dashboard_layout: DashboardLayoutDto | null;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=panel-context-response.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-context-response.dto.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/panel-context-response.dto.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;GAEG;AACH,qBAAa,uBAAuB;IAElC,SAAS,EAAE,OAAO,CAAC;IAGnB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAO/B,WAAW,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;IAOzC,gBAAgB,EAAE,kBAAkB,GAAG,IAAI,CAAC;CAC7C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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.PanelContextResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const dashboard_layout_dto_1 = require("./dashboard-layout.dto");
|
|
15
|
+
/**
|
|
16
|
+
* Resposta de GET /auth/me/panel-context (tenant-service).
|
|
17
|
+
*/
|
|
18
|
+
class PanelContextResponseDto {
|
|
19
|
+
is_master;
|
|
20
|
+
access_level_id;
|
|
21
|
+
permissions;
|
|
22
|
+
dashboard_layout;
|
|
23
|
+
}
|
|
24
|
+
exports.PanelContextResponseDto = PanelContextResponseDto;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, swagger_1.ApiProperty)(),
|
|
27
|
+
__metadata("design:type", Boolean)
|
|
28
|
+
], PanelContextResponseDto.prototype, "is_master", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiPropertyOptional)({ nullable: true }),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], PanelContextResponseDto.prototype, "access_level_id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
35
|
+
nullable: true,
|
|
36
|
+
description: 'null = master (todas as permissões); array = chaves canônicas',
|
|
37
|
+
type: [String],
|
|
38
|
+
}),
|
|
39
|
+
__metadata("design:type", Object)
|
|
40
|
+
], PanelContextResponseDto.prototype, "permissions", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
43
|
+
nullable: true,
|
|
44
|
+
description: 'Layout guardado para o nível; null no master ou sem layout.',
|
|
45
|
+
type: dashboard_layout_dto_1.DashboardLayoutDto,
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], PanelContextResponseDto.prototype, "dashboard_layout", void 0);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chaves canônicas de permissão do painel administrativo (resource.action).
|
|
3
|
+
*/
|
|
4
|
+
export declare const PANEL_RESOURCE_ACTIONS: {
|
|
5
|
+
readonly dashboard: readonly ["view"];
|
|
6
|
+
readonly tenants: readonly ["view", "create", "update", "delete"];
|
|
7
|
+
readonly tenant_users: readonly ["view", "create", "update", "delete", "device_sessions_view", "device_sessions_revoke", "totp_clear"];
|
|
8
|
+
readonly tenant_units: readonly ["view", "create", "update", "delete"];
|
|
9
|
+
readonly tenant_billings: readonly ["view", "create", "update", "delete"];
|
|
10
|
+
readonly tenant_connections: readonly ["view", "update"];
|
|
11
|
+
readonly tenant_ai_tokens: readonly ["view", "update"];
|
|
12
|
+
readonly audit_logs: readonly ["view"];
|
|
13
|
+
readonly plans: readonly ["view", "create", "update"];
|
|
14
|
+
readonly configurations: readonly ["view", "update"];
|
|
15
|
+
readonly evogo_configs: readonly ["view", "create"];
|
|
16
|
+
readonly app_modules: readonly ["view", "update"];
|
|
17
|
+
readonly ai_tools: readonly ["view", "update"];
|
|
18
|
+
readonly admin_notifications: readonly ["push"];
|
|
19
|
+
readonly admin_users: readonly ["view", "create", "update", "delete"];
|
|
20
|
+
readonly access_levels: readonly ["view", "create", "update", "delete"];
|
|
21
|
+
readonly conversation: readonly ["execute"];
|
|
22
|
+
};
|
|
23
|
+
export type PanelResource = keyof typeof PANEL_RESOURCE_ACTIONS;
|
|
24
|
+
export type PanelAction<R extends PanelResource> = (typeof PANEL_RESOURCE_ACTIONS)[R][number];
|
|
25
|
+
export declare const PANEL_PERMISSION_KEYS: readonly string[];
|
|
26
|
+
export type PanelPermissionKey = (typeof PANEL_PERMISSION_KEYS)[number];
|
|
27
|
+
export declare function isPanelPermissionKey(value: string): value is PanelPermissionKey;
|
|
28
|
+
export declare function panelPermissionKey(resource: PanelResource, action: PanelAction<PanelResource>): PanelPermissionKey;
|
|
29
|
+
//# sourceMappingURL=panel-permission-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-permission-keys.d.ts","sourceRoot":"","sources":["../../src/panel-rbac/panel-permission-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;CA0BzB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,sBAAsB,CAAC;AAEhE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,aAAa,IAC7C,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAS7C,eAAO,MAAM,qBAAqB,EAAW,SAAS,MAAM,EAAE,CAAC;AAE/D,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAE/E;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,WAAW,CAAC,aAAa,CAAC,GACjC,kBAAkB,CAEpB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PANEL_PERMISSION_KEYS = exports.PANEL_RESOURCE_ACTIONS = void 0;
|
|
4
|
+
exports.isPanelPermissionKey = isPanelPermissionKey;
|
|
5
|
+
exports.panelPermissionKey = panelPermissionKey;
|
|
6
|
+
/**
|
|
7
|
+
* Chaves canônicas de permissão do painel administrativo (resource.action).
|
|
8
|
+
*/
|
|
9
|
+
exports.PANEL_RESOURCE_ACTIONS = {
|
|
10
|
+
dashboard: ['view'],
|
|
11
|
+
tenants: ['view', 'create', 'update', 'delete'],
|
|
12
|
+
tenant_users: [
|
|
13
|
+
'view',
|
|
14
|
+
'create',
|
|
15
|
+
'update',
|
|
16
|
+
'delete',
|
|
17
|
+
'device_sessions_view',
|
|
18
|
+
'device_sessions_revoke',
|
|
19
|
+
'totp_clear',
|
|
20
|
+
],
|
|
21
|
+
tenant_units: ['view', 'create', 'update', 'delete'],
|
|
22
|
+
tenant_billings: ['view', 'create', 'update', 'delete'],
|
|
23
|
+
tenant_connections: ['view', 'update'],
|
|
24
|
+
tenant_ai_tokens: ['view', 'update'],
|
|
25
|
+
audit_logs: ['view'],
|
|
26
|
+
plans: ['view', 'create', 'update'],
|
|
27
|
+
configurations: ['view', 'update'],
|
|
28
|
+
evogo_configs: ['view', 'create'],
|
|
29
|
+
app_modules: ['view', 'update'],
|
|
30
|
+
ai_tools: ['view', 'update'],
|
|
31
|
+
admin_notifications: ['push'],
|
|
32
|
+
admin_users: ['view', 'create', 'update', 'delete'],
|
|
33
|
+
access_levels: ['view', 'create', 'update', 'delete'],
|
|
34
|
+
conversation: ['execute'],
|
|
35
|
+
};
|
|
36
|
+
const keys = [];
|
|
37
|
+
for (const [resource, actions] of Object.entries(exports.PANEL_RESOURCE_ACTIONS)) {
|
|
38
|
+
for (const action of actions) {
|
|
39
|
+
keys.push(`${resource}.${action}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.PANEL_PERMISSION_KEYS = keys;
|
|
43
|
+
function isPanelPermissionKey(value) {
|
|
44
|
+
return exports.PANEL_PERMISSION_KEYS.includes(value);
|
|
45
|
+
}
|
|
46
|
+
function panelPermissionKey(resource, action) {
|
|
47
|
+
return `${resource}.${action}`;
|
|
48
|
+
}
|