@hed-hog/core 0.0.150 → 0.0.152
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/dist/dashboard/dashboard/dashboard.controller.d.ts +214 -9
- package/dist/dashboard/dashboard/dashboard.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dashboard.controller.js +35 -35
- package/dist/dashboard/dashboard/dashboard.controller.js.map +1 -1
- package/dist/dashboard/dashboard/dashboard.module.d.ts +1 -1
- package/dist/dashboard/dashboard/dashboard.module.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dashboard.module.js +11 -6
- package/dist/dashboard/dashboard/dashboard.module.js.map +1 -1
- package/dist/dashboard/dashboard/dashboard.service.d.ts +217 -16
- package/dist/dashboard/dashboard/dashboard.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dashboard.service.js +115 -28
- package/dist/dashboard/dashboard/dashboard.service.js.map +1 -1
- package/dist/dashboard/dashboard/dto/create.dto.d.ts +4 -2
- package/dist/dashboard/dashboard/dto/create.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dto/create.dto.js +10 -1
- package/dist/dashboard/dashboard/dto/create.dto.js.map +1 -1
- package/dist/dashboard/dashboard/dto/index.d.ts +5 -0
- package/dist/dashboard/dashboard/dto/index.d.ts.map +1 -0
- package/dist/dashboard/dashboard/dto/index.js +25 -0
- package/dist/dashboard/dashboard/dto/index.js.map +1 -0
- package/dist/dashboard/dashboard/dto/update.dto.d.ts +5 -4
- package/dist/dashboard/dashboard/dto/update.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard/dto/update.dto.js +27 -3
- package/dist/dashboard/dashboard/dto/update.dto.js.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +114 -9
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.controller.js +35 -36
- package/dist/dashboard/dashboard-component/dashboard-component.controller.js.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.module.js +4 -3
- package/dist/dashboard/dashboard-component/dashboard-component.module.js.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +116 -15
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dashboard-component.service.js +109 -22
- package/dist/dashboard/dashboard-component/dashboard-component.service.js.map +1 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.d.ts +4 -2
- package/dist/dashboard/dashboard-component/dto/create.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.js +10 -1
- package/dist/dashboard/dashboard-component/dto/create.dto.js.map +1 -1
- package/dist/dashboard/dashboard-component/dto/index.d.ts +5 -0
- package/dist/dashboard/dashboard-component/dto/index.d.ts.map +1 -0
- package/dist/dashboard/dashboard-component/dto/index.js +25 -0
- package/dist/dashboard/dashboard-component/dto/index.js.map +1 -0
- package/dist/dashboard/dashboard-component/dto/update.dto.d.ts +13 -4
- package/dist/dashboard/dashboard-component/dto/update.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-component/dto/update.dto.js +67 -3
- package/dist/dashboard/dashboard-component/dto/update.dto.js.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +56 -0
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.controller.js +65 -0
- package/dist/dashboard/dashboard-core/dashboard-core.controller.js.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +52 -0
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.js +221 -0
- package/dist/dashboard/dashboard-core/dashboard-core.service.js.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +26 -29
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.controller.js +24 -43
- package/dist/dashboard/dashboard-item/dashboard-item.controller.js.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +30 -34
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts.map +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.service.js +51 -35
- package/dist/dashboard/dashboard-item/dashboard-item.service.js.map +1 -1
- package/dist/dashboard/dashboard-item/dto/index.d.ts +5 -0
- package/dist/dashboard/dashboard-item/dto/index.d.ts.map +1 -0
- package/dist/dashboard/dashboard-item/dto/index.js +25 -0
- package/dist/dashboard/dashboard-item/dto/index.js.map +1 -0
- package/dist/dashboard/dashboard-item/dto/update.dto.d.ts +7 -4
- package/dist/dashboard/dashboard-item/dto/update.dto.d.ts.map +1 -1
- package/dist/dashboard/dashboard-item/dto/update.dto.js +42 -3
- package/dist/dashboard/dashboard-item/dto/update.dto.js.map +1 -1
- package/dist/dashboard/dashboard.module.js +1 -1
- package/dist/dashboard/dashboard.module.js.map +1 -1
- package/hedhog/data/route.yaml +44 -14
- package/hedhog/data/setting_group.yaml +11 -0
- package/hedhog/query/dashboard-seed.sql +131 -0
- package/package.json +4 -4
- package/src/dashboard/dashboard/dashboard.controller.ts +26 -23
- package/src/dashboard/dashboard/dashboard.module.ts +7 -2
- package/src/dashboard/dashboard/dashboard.service.ts +125 -44
- package/src/dashboard/dashboard/dto/create.dto.ts +12 -3
- package/src/dashboard/dashboard/dto/index.ts +7 -0
- package/src/dashboard/dashboard/dto/update.dto.ts +17 -3
- package/src/dashboard/dashboard-component/dashboard-component.controller.ts +22 -19
- package/src/dashboard/dashboard-component/dashboard-component.module.ts +3 -3
- package/src/dashboard/dashboard-component/dashboard-component.service.ts +128 -39
- package/src/dashboard/dashboard-component/dto/create.dto.ts +12 -3
- package/src/dashboard/dashboard-component/dto/index.ts +7 -0
- package/src/dashboard/dashboard-component/dto/update.dto.ts +49 -3
- package/src/dashboard/dashboard-core/dashboard-core.controller.ts +53 -2
- package/src/dashboard/dashboard-core/dashboard-core.service.ts +271 -0
- package/src/dashboard/dashboard-item/dashboard-item.controller.ts +17 -26
- package/src/dashboard/dashboard-item/dashboard-item.service.ts +55 -47
- package/src/dashboard/dashboard-item/dto/index.ts +7 -0
- package/src/dashboard/dashboard-item/dto/update.dto.ts +27 -3
- package/src/dashboard/dashboard.module.ts +2 -2
- package/src/language/en.json +4 -1
- package/src/language/pt.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard/dashboard.service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"dashboard.service.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard/dashboard.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE/D,qBACa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAElC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAJb,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB,EAEpC,aAAa,EAAE,aAAa;IAEzC,gBAAgB,CAAC,gBAAgB,KAAA,EAAE,MAAM,EAAE,MAAM;;;;;;;;;IAoBjD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkCvC,eAAe,CAAC,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BxD,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoCpE,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;CAgBjD"}
|
|
@@ -8,54 +8,141 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.DashboardService = void 0;
|
|
13
16
|
const api_locale_1 = require("@hed-hog/api-locale");
|
|
17
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
14
18
|
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
15
19
|
const common_1 = require("@nestjs/common");
|
|
16
|
-
const exceptions_1 = require("@nestjs/common/exceptions");
|
|
17
20
|
let DashboardService = class DashboardService {
|
|
18
|
-
constructor(
|
|
19
|
-
this.localeService = localeService;
|
|
21
|
+
constructor(prismaService, paginationService, localeService) {
|
|
20
22
|
this.prismaService = prismaService;
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
+
this.paginationService = paginationService;
|
|
24
|
+
this.localeService = localeService;
|
|
23
25
|
}
|
|
24
|
-
async
|
|
25
|
-
return this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
async getAllDashboards(paginationParams, locale) {
|
|
27
|
+
return this.paginationService.paginate(this.prismaService.dashboard, paginationParams, {
|
|
28
|
+
include: {
|
|
29
|
+
dashboard_locale: {
|
|
30
|
+
include: {
|
|
31
|
+
locale: true,
|
|
32
|
+
},
|
|
29
33
|
},
|
|
30
34
|
},
|
|
31
|
-
|
|
35
|
+
orderBy: {
|
|
36
|
+
id: 'desc',
|
|
37
|
+
},
|
|
38
|
+
}, 'dashboard');
|
|
32
39
|
}
|
|
33
|
-
async
|
|
34
|
-
|
|
40
|
+
async getDashboard(id, locale) {
|
|
41
|
+
const dashboard = await this.prismaService.dashboard.findUnique({
|
|
42
|
+
where: { id },
|
|
43
|
+
include: {
|
|
44
|
+
dashboard_locale: {
|
|
45
|
+
include: {
|
|
46
|
+
locale: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
dashboard_item: {
|
|
50
|
+
include: {
|
|
51
|
+
dashboard_component: {
|
|
52
|
+
include: {
|
|
53
|
+
dashboard_component_locale: {
|
|
54
|
+
include: {
|
|
55
|
+
locale: true,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
if (!dashboard) {
|
|
65
|
+
throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('dashboardNotFound', locale, 'Dashboard not found'));
|
|
66
|
+
}
|
|
67
|
+
return dashboard;
|
|
35
68
|
}
|
|
36
|
-
async
|
|
37
|
-
|
|
69
|
+
async createDashboard(data, locale) {
|
|
70
|
+
const dashboard = await this.prismaService.dashboard.create({
|
|
71
|
+
data: {
|
|
72
|
+
slug: data.slug,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
// Criar locales se fornecidos
|
|
76
|
+
if (data.locale) {
|
|
77
|
+
for (const [localeCode, localeData] of Object.entries(data.locale)) {
|
|
78
|
+
const localeRecord = await this.prismaService.locale.findFirst({
|
|
79
|
+
where: { code: localeCode },
|
|
80
|
+
});
|
|
81
|
+
if (localeRecord) {
|
|
82
|
+
await this.prismaService.dashboard_locale.create({
|
|
83
|
+
data: {
|
|
84
|
+
dashboard_id: dashboard.id,
|
|
85
|
+
locale_id: localeRecord.id,
|
|
86
|
+
name: localeData.name,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return this.getDashboard(dashboard.id, locale);
|
|
38
93
|
}
|
|
39
|
-
async
|
|
40
|
-
|
|
94
|
+
async updateDashboard(id, data, locale) {
|
|
95
|
+
await this.prismaService.dashboard.update({
|
|
96
|
+
where: { id },
|
|
97
|
+
data: {
|
|
98
|
+
slug: data.slug,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
// Atualizar locales se fornecidos
|
|
102
|
+
if (data.locale) {
|
|
103
|
+
// Remove locales existentes
|
|
104
|
+
await this.prismaService.dashboard_locale.deleteMany({
|
|
105
|
+
where: { dashboard_id: id },
|
|
106
|
+
});
|
|
107
|
+
// Criar novos locales
|
|
108
|
+
for (const [localeCode, localeData] of Object.entries(data.locale)) {
|
|
109
|
+
const localeRecord = await this.prismaService.locale.findFirst({
|
|
110
|
+
where: { code: localeCode },
|
|
111
|
+
});
|
|
112
|
+
if (localeRecord) {
|
|
113
|
+
await this.prismaService.dashboard_locale.create({
|
|
114
|
+
data: {
|
|
115
|
+
dashboard_id: id,
|
|
116
|
+
locale_id: localeRecord.id,
|
|
117
|
+
name: localeData.name,
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return this.getDashboard(id, locale);
|
|
41
124
|
}
|
|
42
|
-
async
|
|
43
|
-
|
|
44
|
-
|
|
125
|
+
async deleteDashboard(id, locale) {
|
|
126
|
+
const dashboard = await this.prismaService.dashboard.findUnique({
|
|
127
|
+
where: { id },
|
|
128
|
+
});
|
|
129
|
+
if (!dashboard) {
|
|
130
|
+
throw new common_1.NotFoundException((0, api_locale_1.getLocaleText)('dashboardNotFound', locale, 'Dashboard not found'));
|
|
45
131
|
}
|
|
46
|
-
|
|
47
|
-
where: {
|
|
48
|
-
id: {
|
|
49
|
-
in: ids,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
132
|
+
await this.prismaService.dashboard.delete({
|
|
133
|
+
where: { id },
|
|
52
134
|
});
|
|
135
|
+
return { success: true };
|
|
53
136
|
}
|
|
54
137
|
};
|
|
55
138
|
exports.DashboardService = DashboardService;
|
|
56
139
|
exports.DashboardService = DashboardService = __decorate([
|
|
57
140
|
(0, common_1.Injectable)(),
|
|
58
|
-
|
|
59
|
-
|
|
141
|
+
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_prisma_1.PrismaService))),
|
|
142
|
+
__param(1, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_pagination_1.PaginationService))),
|
|
143
|
+
__param(2, (0, common_1.Inject)((0, common_1.forwardRef)(() => api_locale_1.LocaleService))),
|
|
144
|
+
__metadata("design:paramtypes", [api_prisma_1.PrismaService,
|
|
145
|
+
api_pagination_1.PaginationService,
|
|
146
|
+
api_locale_1.LocaleService])
|
|
60
147
|
], DashboardService);
|
|
61
148
|
//# sourceMappingURL=dashboard.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.service.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard/dashboard.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard.service.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard/dashboard.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAAmE;AACnE,4DAA4D;AAC5D,oDAAoD;AACpD,2CAAmF;AAI5E,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,YAEmB,aAA4B,EAE5B,iBAAoC,EAEpC,aAA4B;QAJ5B,kBAAa,GAAb,aAAa,CAAe;QAE5B,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEpC,kB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mBAAU,EAAC,GAAG,EAAE,CAAC,kCAAiB,CAAC,CAAC,CAAA;IAE3C,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,0BAAa,CAAC,CAAC,CAAA;qCAHR,0BAAa;QAET,kCAAiB;QAErB,0BAAa;GAPpC,gBAAgB,CAgJ5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/create.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/create.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAGpB,IAAI,EAAE,MAAM,CAAC;IASb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1C"}
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.CreateDTO = void 0;
|
|
13
13
|
const api_locale_1 = require("@hed-hog/api-locale");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
|
-
class CreateDTO
|
|
15
|
+
class CreateDTO {
|
|
16
16
|
}
|
|
17
17
|
exports.CreateDTO = CreateDTO;
|
|
18
18
|
__decorate([
|
|
@@ -20,4 +20,13 @@ __decorate([
|
|
|
20
20
|
(0, class_validator_1.IsNotEmpty)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.fieldRequired', args.value) }),
|
|
21
21
|
__metadata("design:type", String)
|
|
22
22
|
], CreateDTO.prototype, "slug", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsObject)({
|
|
25
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeMustBeObject', args.value),
|
|
26
|
+
}),
|
|
27
|
+
(0, class_validator_1.IsNotEmpty)({
|
|
28
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeRequired', args.value),
|
|
29
|
+
}),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], CreateDTO.prototype, "locale", void 0);
|
|
23
32
|
//# sourceMappingURL=create.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"create.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAAiE;AAEjE,MAAa,SAAS;CAarB;AAbD,8BAaC;AAVC;IAFC,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACvF,IAAA,4BAAU,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,0BAA0B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;uCAC5E;AASb;IAPC,IAAA,0BAAQ,EAAC;QACR,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,IAAA,0BAAa,EAAC,+BAA+B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC7D,CAAC;IACD,IAAA,4BAAU,EAAC;QACV,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;yCACuC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
exports.UpdateDashboardDTO = exports.CreateDashboardDTO = void 0;
|
|
18
|
+
__exportStar(require("./create.dto"), exports);
|
|
19
|
+
__exportStar(require("./update.dto"), exports);
|
|
20
|
+
// Aliases para compatibilidade
|
|
21
|
+
var create_dto_1 = require("./create.dto");
|
|
22
|
+
Object.defineProperty(exports, "CreateDashboardDTO", { enumerable: true, get: function () { return create_dto_1.CreateDTO; } });
|
|
23
|
+
var update_dto_1 = require("./update.dto");
|
|
24
|
+
Object.defineProperty(exports, "UpdateDashboardDTO", { enumerable: true, get: function () { return update_dto_1.UpdateDTO; } });
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAE7B,+BAA+B;AAC/B,2CAA+D;AAAtD,gHAAA,SAAS,OAAsB;AACxC,2CAA+D;AAAtD,gHAAA,SAAS,OAAsB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare class UpdateDTO {
|
|
2
|
+
slug?: string;
|
|
3
|
+
locale?: Record<string, {
|
|
4
|
+
name: string;
|
|
5
|
+
}>;
|
|
4
6
|
}
|
|
5
|
-
export {};
|
|
6
7
|
//# sourceMappingURL=update.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/update.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/update.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,SAAS;IAGpB,IAAI,CAAC,EAAE,MAAM,CAAC;IAUd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3C"}
|
|
@@ -1,9 +1,33 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.UpdateDTO = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
class UpdateDTO
|
|
13
|
+
const api_locale_1 = require("@hed-hog/api-locale");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class UpdateDTO {
|
|
7
16
|
}
|
|
8
17
|
exports.UpdateDTO = UpdateDTO;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsOptional)(),
|
|
20
|
+
(0, class_validator_1.IsString)({ message: (args) => (0, api_locale_1.getLocaleText)('validation.stringRequired', args.value) }),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], UpdateDTO.prototype, "slug", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
(0, class_validator_1.IsObject)({
|
|
26
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeMustBeObject', args.value),
|
|
27
|
+
}),
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)({
|
|
29
|
+
message: (args) => (0, api_locale_1.getLocaleText)('validation.localeRequired', args.value),
|
|
30
|
+
}),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], UpdateDTO.prototype, "locale", void 0);
|
|
9
33
|
//# sourceMappingURL=update.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/update.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../../src/dashboard/dashboard/dto/update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAoD;AACpD,qDAA6E;AAE7E,MAAa,SAAS;CAcrB;AAdD,8BAcC;AAXC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;;uCAC1E;AAUd;IARC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC;QACR,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAChB,IAAA,0BAAa,EAAC,+BAA+B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC7D,CAAC;IACD,IAAA,4BAAU,EAAC;QACV,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAa,EAAC,2BAA2B,EAAE,IAAI,CAAC,KAAK,CAAC;KAC1E,CAAC;;yCACwC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { CreateDTO } from './dto/create.dto';
|
|
2
|
-
import { UpdateDTO } from './dto/update.dto';
|
|
3
1
|
import { DashboardComponentService } from './dashboard-component.service';
|
|
4
|
-
import {
|
|
2
|
+
import { CreateDashboardComponentDTO, UpdateDashboardComponentDTO } from './dto';
|
|
5
3
|
export declare class DashboardComponentController {
|
|
6
4
|
private readonly dashboardComponentService;
|
|
7
5
|
constructor(dashboardComponentService: DashboardComponentService);
|
|
8
|
-
|
|
6
|
+
getAllComponents(paginationParams: any): Promise<{
|
|
9
7
|
total: any;
|
|
10
8
|
lastPage: number;
|
|
11
9
|
page: number;
|
|
@@ -14,11 +12,118 @@ export declare class DashboardComponentController {
|
|
|
14
12
|
next: number;
|
|
15
13
|
data: any[];
|
|
16
14
|
}>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
getComponent(id: number, locale: string): Promise<{
|
|
16
|
+
dashboard_component_locale: ({
|
|
17
|
+
locale: {
|
|
18
|
+
code: string;
|
|
19
|
+
name: string;
|
|
20
|
+
region: string;
|
|
21
|
+
id: number;
|
|
22
|
+
created_at: Date;
|
|
23
|
+
updated_at: Date;
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
};
|
|
26
|
+
} & {
|
|
27
|
+
name: string;
|
|
28
|
+
id: number;
|
|
29
|
+
created_at: Date;
|
|
30
|
+
updated_at: Date;
|
|
31
|
+
locale_id: number;
|
|
32
|
+
dashboard_component_id: number;
|
|
33
|
+
})[];
|
|
34
|
+
} & {
|
|
35
|
+
path: string;
|
|
36
|
+
width: number;
|
|
37
|
+
id: number;
|
|
38
|
+
created_at: Date;
|
|
39
|
+
updated_at: Date;
|
|
40
|
+
slug: string;
|
|
41
|
+
min_width: number;
|
|
42
|
+
max_width: number | null;
|
|
43
|
+
min_height: number;
|
|
44
|
+
max_height: number | null;
|
|
45
|
+
height: number;
|
|
46
|
+
is_resizable: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
createComponent(data: CreateDashboardComponentDTO, locale: string): Promise<{
|
|
49
|
+
dashboard_component_locale: ({
|
|
50
|
+
locale: {
|
|
51
|
+
code: string;
|
|
52
|
+
name: string;
|
|
53
|
+
region: string;
|
|
54
|
+
id: number;
|
|
55
|
+
created_at: Date;
|
|
56
|
+
updated_at: Date;
|
|
57
|
+
enabled: boolean;
|
|
58
|
+
};
|
|
59
|
+
} & {
|
|
60
|
+
name: string;
|
|
61
|
+
id: number;
|
|
62
|
+
created_at: Date;
|
|
63
|
+
updated_at: Date;
|
|
64
|
+
locale_id: number;
|
|
65
|
+
dashboard_component_id: number;
|
|
66
|
+
})[];
|
|
67
|
+
} & {
|
|
68
|
+
path: string;
|
|
69
|
+
width: number;
|
|
70
|
+
id: number;
|
|
71
|
+
created_at: Date;
|
|
72
|
+
updated_at: Date;
|
|
73
|
+
slug: string;
|
|
74
|
+
min_width: number;
|
|
75
|
+
max_width: number | null;
|
|
76
|
+
min_height: number;
|
|
77
|
+
max_height: number | null;
|
|
78
|
+
height: number;
|
|
79
|
+
is_resizable: boolean;
|
|
80
|
+
}>;
|
|
81
|
+
updateComponent(id: number, data: UpdateDashboardComponentDTO, locale: string): Promise<{
|
|
82
|
+
dashboard_component_locale: ({
|
|
83
|
+
locale: {
|
|
84
|
+
code: string;
|
|
85
|
+
name: string;
|
|
86
|
+
region: string;
|
|
87
|
+
id: number;
|
|
88
|
+
created_at: Date;
|
|
89
|
+
updated_at: Date;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
};
|
|
92
|
+
} & {
|
|
93
|
+
name: string;
|
|
94
|
+
id: number;
|
|
95
|
+
created_at: Date;
|
|
96
|
+
updated_at: Date;
|
|
97
|
+
locale_id: number;
|
|
98
|
+
dashboard_component_id: number;
|
|
99
|
+
})[];
|
|
100
|
+
} & {
|
|
101
|
+
path: string;
|
|
102
|
+
width: number;
|
|
103
|
+
id: number;
|
|
104
|
+
created_at: Date;
|
|
105
|
+
updated_at: Date;
|
|
106
|
+
slug: string;
|
|
107
|
+
min_width: number;
|
|
108
|
+
max_width: number | null;
|
|
109
|
+
min_height: number;
|
|
110
|
+
max_height: number | null;
|
|
111
|
+
height: number;
|
|
112
|
+
is_resizable: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
deleteComponent(id: number, locale: string): Promise<{
|
|
115
|
+
path: string;
|
|
116
|
+
width: number;
|
|
117
|
+
id: number;
|
|
118
|
+
created_at: Date;
|
|
119
|
+
updated_at: Date;
|
|
120
|
+
slug: string;
|
|
121
|
+
min_width: number;
|
|
122
|
+
max_width: number | null;
|
|
123
|
+
min_height: number;
|
|
124
|
+
max_height: number | null;
|
|
125
|
+
height: number;
|
|
126
|
+
is_resizable: boolean;
|
|
22
127
|
}>;
|
|
23
128
|
}
|
|
24
129
|
//# sourceMappingURL=dashboard-component.controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-component.controller.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard-component.controller.d.ts","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.controller.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,OAAO,CAAC;AAEf,qBAEa,4BAA4B;IAGrC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBAAzB,yBAAyB,EAAE,yBAAyB;IAIvE,gBAAgB,CAAe,gBAAgB,KAAA;;;;;;;;;IAK/C,YAAY,CAA4B,EAAE,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK5E,eAAe,CAAS,IAAI,EAAE,2BAA2B,EAAY,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnF,eAAe,CACc,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,2BAA2B,EAC/B,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAM1B,eAAe,CAA4B,EAAE,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM;;;;;;;;;;;;;;CAGhF"}
|
|
@@ -13,74 +13,73 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.DashboardComponentController = void 0;
|
|
16
|
-
const
|
|
16
|
+
const api_1 = require("@hed-hog/api");
|
|
17
17
|
const api_locale_1 = require("@hed-hog/api-locale");
|
|
18
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
18
19
|
const common_1 = require("@nestjs/common");
|
|
19
|
-
const create_dto_1 = require("./dto/create.dto");
|
|
20
|
-
const update_dto_1 = require("./dto/update.dto");
|
|
21
20
|
const dashboard_component_service_1 = require("./dashboard-component.service");
|
|
22
|
-
const
|
|
21
|
+
const dto_1 = require("./dto");
|
|
23
22
|
let DashboardComponentController = class DashboardComponentController {
|
|
24
23
|
constructor(dashboardComponentService) {
|
|
25
24
|
this.dashboardComponentService = dashboardComponentService;
|
|
26
25
|
}
|
|
27
|
-
|
|
28
|
-
return this.dashboardComponentService.
|
|
26
|
+
getAllComponents(paginationParams) {
|
|
27
|
+
return this.dashboardComponentService.getAllComponents(paginationParams);
|
|
29
28
|
}
|
|
30
|
-
|
|
31
|
-
return this.dashboardComponentService.
|
|
29
|
+
getComponent(id, locale) {
|
|
30
|
+
return this.dashboardComponentService.getComponent(id, locale);
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
return this.dashboardComponentService.
|
|
32
|
+
createComponent(data, locale) {
|
|
33
|
+
return this.dashboardComponentService.createComponent(data, locale);
|
|
35
34
|
}
|
|
36
|
-
|
|
37
|
-
return this.dashboardComponentService.
|
|
38
|
-
id,
|
|
39
|
-
data,
|
|
40
|
-
});
|
|
35
|
+
updateComponent(id, data, locale) {
|
|
36
|
+
return this.dashboardComponentService.updateComponent(id, data, locale);
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
return this.dashboardComponentService.
|
|
38
|
+
deleteComponent(id, locale) {
|
|
39
|
+
return this.dashboardComponentService.deleteComponent(id, locale);
|
|
44
40
|
}
|
|
45
41
|
};
|
|
46
42
|
exports.DashboardComponentController = DashboardComponentController;
|
|
47
43
|
__decorate([
|
|
48
44
|
(0, common_1.Get)(),
|
|
49
|
-
__param(0, (0,
|
|
50
|
-
__param(1, (0, api_pagination_1.Pagination)()),
|
|
45
|
+
__param(0, (0, api_pagination_1.Pagination)()),
|
|
51
46
|
__metadata("design:type", Function),
|
|
52
|
-
__metadata("design:paramtypes", [Object
|
|
53
|
-
__metadata("design:returntype",
|
|
54
|
-
], DashboardComponentController.prototype, "
|
|
47
|
+
__metadata("design:paramtypes", [Object]),
|
|
48
|
+
__metadata("design:returntype", void 0)
|
|
49
|
+
], DashboardComponentController.prototype, "getAllComponents", null);
|
|
55
50
|
__decorate([
|
|
56
51
|
(0, common_1.Get)(':id'),
|
|
57
52
|
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
53
|
+
__param(1, (0, api_locale_1.Locale)()),
|
|
58
54
|
__metadata("design:type", Function),
|
|
59
|
-
__metadata("design:paramtypes", [Number]),
|
|
60
|
-
__metadata("design:returntype",
|
|
61
|
-
], DashboardComponentController.prototype, "
|
|
55
|
+
__metadata("design:paramtypes", [Number, String]),
|
|
56
|
+
__metadata("design:returntype", void 0)
|
|
57
|
+
], DashboardComponentController.prototype, "getComponent", null);
|
|
62
58
|
__decorate([
|
|
63
59
|
(0, common_1.Post)(),
|
|
64
60
|
__param(0, (0, common_1.Body)()),
|
|
61
|
+
__param(1, (0, api_locale_1.Locale)()),
|
|
65
62
|
__metadata("design:type", Function),
|
|
66
|
-
__metadata("design:paramtypes", [
|
|
67
|
-
__metadata("design:returntype",
|
|
68
|
-
], DashboardComponentController.prototype, "
|
|
63
|
+
__metadata("design:paramtypes", [dto_1.CreateDashboardComponentDTO, String]),
|
|
64
|
+
__metadata("design:returntype", void 0)
|
|
65
|
+
], DashboardComponentController.prototype, "createComponent", null);
|
|
69
66
|
__decorate([
|
|
70
67
|
(0, common_1.Patch)(':id'),
|
|
71
68
|
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
72
69
|
__param(1, (0, common_1.Body)()),
|
|
70
|
+
__param(2, (0, api_locale_1.Locale)()),
|
|
73
71
|
__metadata("design:type", Function),
|
|
74
|
-
__metadata("design:paramtypes", [Number,
|
|
75
|
-
__metadata("design:returntype",
|
|
76
|
-
], DashboardComponentController.prototype, "
|
|
72
|
+
__metadata("design:paramtypes", [Number, dto_1.UpdateDashboardComponentDTO, String]),
|
|
73
|
+
__metadata("design:returntype", void 0)
|
|
74
|
+
], DashboardComponentController.prototype, "updateComponent", null);
|
|
77
75
|
__decorate([
|
|
78
|
-
(0, common_1.Delete)(),
|
|
79
|
-
__param(0, (0, common_1.
|
|
76
|
+
(0, common_1.Delete)(':id'),
|
|
77
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
78
|
+
__param(1, (0, api_locale_1.Locale)()),
|
|
80
79
|
__metadata("design:type", Function),
|
|
81
|
-
__metadata("design:paramtypes", [
|
|
82
|
-
__metadata("design:returntype",
|
|
83
|
-
], DashboardComponentController.prototype, "
|
|
80
|
+
__metadata("design:paramtypes", [Number, String]),
|
|
81
|
+
__metadata("design:returntype", void 0)
|
|
82
|
+
], DashboardComponentController.prototype, "deleteComponent", null);
|
|
84
83
|
exports.DashboardComponentController = DashboardComponentController = __decorate([
|
|
85
84
|
(0, api_1.Role)(),
|
|
86
85
|
(0, common_1.Controller)('dashboard-component'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-component.controller.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"dashboard-component.controller.js","sourceRoot":"","sources":["../../../src/dashboard/dashboard-component/dashboard-component.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAoC;AACpC,oDAA6C;AAC7C,4DAAqD;AACrD,2CAWwB;AACxB,+EAA0E;AAC1E,+BAGe;AAIR,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YAEmB,yBAAoD;QAApD,8BAAyB,GAAzB,yBAAyB,CAA2B;IACpE,CAAC;IAGJ,gBAAgB,CAAe,gBAAgB;QAC7C,OAAO,IAAI,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAC3E,CAAC;IAGD,YAAY,CAA4B,EAAU,EAAY,MAAc;QAC1E,OAAO,IAAI,CAAC,yBAAyB,CAAC,YAAY,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IAGD,eAAe,CAAS,IAAiC,EAAY,MAAc;QACjF,OA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