nicot 1.1.31 → 1.1.33
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/README.md +3 -4
- package/dist/index.cjs +153 -87
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +94 -26
- package/dist/index.mjs.map +4 -4
- package/dist/src/restful.d.ts +1 -0
- package/dist/src/utility/index.d.ts +0 -1
- package/dist/src/utility/metadata.d.ts +1 -0
- package/dist/src/utility/non-transformable-types.d.ts +1 -0
- package/dist/src/utility/patch-column-in-get.d.ts +2 -0
- package/package.json +2 -2
- package/dist/src/utility/rename-class.d.ts +0 -1
package/README.md
CHANGED
|
@@ -192,7 +192,7 @@ RestfulFactory 处理 Entity 类的时候,会以这些装饰器为依据,裁
|
|
|
192
192
|
nickname: string;
|
|
193
193
|
|
|
194
194
|
@BoolColumn()
|
|
195
|
-
@
|
|
195
|
+
@QueryEqual()
|
|
196
196
|
isActive: boolean;
|
|
197
197
|
```
|
|
198
198
|
|
|
@@ -209,7 +209,6 @@ NICOT 提供了一套查询装饰器,用于在 Entity 字段上声明支持的
|
|
|
209
209
|
| `@QueryEqual()` | 精确匹配:`WHERE field = :value` |
|
|
210
210
|
| `@QueryLike()` | 前缀模糊匹配:`WHERE field LIKE :value%` |
|
|
211
211
|
| `@QuerySearch()` | 宽泛模糊搜索:`WHERE field LIKE %:value%` |
|
|
212
|
-
| `@QueryMatchBoolean()` | `true/false/1/0` 转换为布尔类型查询 |
|
|
213
212
|
| `@QueryEqualZeroNullable()` | `0 → IS NULL`,否则 `= :value`(适合 nullable) |
|
|
214
213
|
| `@QueryGreater(field)` | 大于查询:`WHERE field > :value` |
|
|
215
214
|
| `@QueryLess(field)` | 小于查询:`WHERE field < :value` |
|
|
@@ -287,7 +286,7 @@ views: number;
|
|
|
287
286
|
title: string;
|
|
288
287
|
|
|
289
288
|
@BoolColumn()
|
|
290
|
-
@
|
|
289
|
+
@QueryEqual()
|
|
291
290
|
isPublished: boolean;
|
|
292
291
|
|
|
293
292
|
@NotWritable()
|
|
@@ -474,7 +473,7 @@ NICOT 提供了 `RestfulFactory(Entity)` 工厂函数,自动为实体生成标
|
|
|
474
473
|
name: string;
|
|
475
474
|
|
|
476
475
|
@BoolColumn()
|
|
477
|
-
@
|
|
476
|
+
@QueryEqual()
|
|
478
477
|
isActive: boolean;
|
|
479
478
|
```
|
|
480
479
|
|
package/dist/index.cjs
CHANGED
|
@@ -80,7 +80,6 @@ __export(index_exports, {
|
|
|
80
80
|
QuerySearch: () => QuerySearch,
|
|
81
81
|
Relation: () => Relation,
|
|
82
82
|
RelationComputed: () => RelationComputed,
|
|
83
|
-
RenameClass: () => RenameClass,
|
|
84
83
|
RestfulFactory: () => RestfulFactory,
|
|
85
84
|
StringColumn: () => StringColumn,
|
|
86
85
|
StringIdBase: () => StringIdBase,
|
|
@@ -202,16 +201,60 @@ var BigintTransformer = class {
|
|
|
202
201
|
// src/decorators/property.ts
|
|
203
202
|
var import_nesties4 = require("nesties");
|
|
204
203
|
|
|
204
|
+
// src/utility/non-transformable-types.ts
|
|
205
|
+
var nonTransformableTypes = /* @__PURE__ */ new Set([
|
|
206
|
+
// Primitive wrappers
|
|
207
|
+
String,
|
|
208
|
+
Number,
|
|
209
|
+
Boolean,
|
|
210
|
+
BigInt,
|
|
211
|
+
Symbol,
|
|
212
|
+
// Built-ins
|
|
213
|
+
Date,
|
|
214
|
+
RegExp,
|
|
215
|
+
Error,
|
|
216
|
+
Array,
|
|
217
|
+
Object,
|
|
218
|
+
Function,
|
|
219
|
+
Promise,
|
|
220
|
+
// Collections
|
|
221
|
+
Map,
|
|
222
|
+
Set,
|
|
223
|
+
WeakMap,
|
|
224
|
+
WeakSet,
|
|
225
|
+
// Node / Buffer
|
|
226
|
+
Buffer,
|
|
227
|
+
ArrayBuffer,
|
|
228
|
+
SharedArrayBuffer,
|
|
229
|
+
DataView,
|
|
230
|
+
Int8Array,
|
|
231
|
+
Uint8Array,
|
|
232
|
+
Uint8ClampedArray,
|
|
233
|
+
Int16Array,
|
|
234
|
+
Uint16Array,
|
|
235
|
+
Int32Array,
|
|
236
|
+
Uint32Array,
|
|
237
|
+
Float32Array,
|
|
238
|
+
Float64Array,
|
|
239
|
+
BigInt64Array,
|
|
240
|
+
BigUint64Array,
|
|
241
|
+
// URL stuff
|
|
242
|
+
URL,
|
|
243
|
+
URLSearchParams
|
|
244
|
+
]);
|
|
245
|
+
|
|
205
246
|
// src/utility/type-transformer.ts
|
|
206
|
-
var nonTransformableTypes = /* @__PURE__ */ new Set([String, Number, Boolean]);
|
|
207
247
|
var toValue = (cl, value) => {
|
|
208
|
-
if (nonTransformableTypes.has(cl)) {
|
|
209
|
-
return value;
|
|
210
|
-
}
|
|
211
248
|
if (cl === Date) {
|
|
212
249
|
return new Date(value);
|
|
213
250
|
}
|
|
214
|
-
|
|
251
|
+
if (nonTransformableTypes.has(cl) || value instanceof cl) {
|
|
252
|
+
return value;
|
|
253
|
+
}
|
|
254
|
+
if (typeof value === "object") {
|
|
255
|
+
return Object.assign(new cl(), value);
|
|
256
|
+
}
|
|
257
|
+
return value;
|
|
215
258
|
};
|
|
216
259
|
var TypeTransformer = class {
|
|
217
260
|
constructor(definition) {
|
|
@@ -373,7 +416,8 @@ var BoolColumn = (options = {}) => (0, import_nesties3.MergePropertyDecorators)(
|
|
|
373
416
|
}),
|
|
374
417
|
(0, import_typeorm.Column)("boolean", columnDecoratorOptions(options)),
|
|
375
418
|
validatorDecorator(options),
|
|
376
|
-
swaggerDecorator(options, { type: Boolean })
|
|
419
|
+
swaggerDecorator(options, { type: Boolean }),
|
|
420
|
+
Metadata.set("boolColumn", true, "boolColumnFields")
|
|
377
421
|
]);
|
|
378
422
|
var JsonColumn = (definition, options = {}) => {
|
|
379
423
|
const cl = (0, import_nesties4.getClassFromClassOrArray)(definition);
|
|
@@ -493,12 +537,6 @@ var applyQueryMatchBoolean = createQueryCondition(
|
|
|
493
537
|
}
|
|
494
538
|
);
|
|
495
539
|
|
|
496
|
-
// src/utility/rename-class.ts
|
|
497
|
-
function RenameClass(cls, name) {
|
|
498
|
-
Object.defineProperty(cls, "name", { value: name });
|
|
499
|
-
return cls;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
540
|
// src/decorators/query.ts
|
|
503
541
|
var import_nesties5 = require("nesties");
|
|
504
542
|
|
|
@@ -1695,10 +1733,10 @@ function CrudService(entityClass, crudOptions = {}) {
|
|
|
1695
1733
|
|
|
1696
1734
|
// src/restful.ts
|
|
1697
1735
|
var import_common3 = require("@nestjs/common");
|
|
1698
|
-
var
|
|
1699
|
-
var
|
|
1736
|
+
var import_nesties10 = require("nesties");
|
|
1737
|
+
var import_swagger7 = require("@nestjs/swagger");
|
|
1700
1738
|
var import_lodash4 = __toESM(require("lodash"));
|
|
1701
|
-
var
|
|
1739
|
+
var import_nesties11 = require("nesties");
|
|
1702
1740
|
|
|
1703
1741
|
// src/bases/base-restful-controller.ts
|
|
1704
1742
|
var RestfulMethods = [
|
|
@@ -1759,6 +1797,27 @@ var OmitTypeExclude = (cl, keys) => {
|
|
|
1759
1797
|
return omitted;
|
|
1760
1798
|
};
|
|
1761
1799
|
|
|
1800
|
+
// src/utility/patch-column-in-get.ts
|
|
1801
|
+
var import_swagger6 = require("@nestjs/swagger");
|
|
1802
|
+
var import_nesties9 = require("nesties");
|
|
1803
|
+
var PatchColumnsInGet = (cl, originalCl = cl, fieldsToOmit = []) => {
|
|
1804
|
+
const omit2 = new Set(fieldsToOmit);
|
|
1805
|
+
const boolFields = getSpecificFields(originalCl || cl, "boolColumn").filter(
|
|
1806
|
+
(f) => !omit2.has(f)
|
|
1807
|
+
);
|
|
1808
|
+
for (const field of boolFields) {
|
|
1809
|
+
const originalApiProp = (0, import_nesties9.getApiProperty)(originalCl, field);
|
|
1810
|
+
(0, import_swagger6.ApiProperty)({
|
|
1811
|
+
...originalApiProp,
|
|
1812
|
+
type: String,
|
|
1813
|
+
required: false,
|
|
1814
|
+
enum: ["", "1"],
|
|
1815
|
+
default: originalApiProp?.default === true ? "1" : originalApiProp?.default === false ? "" : void 0
|
|
1816
|
+
})(cl.prototype, field);
|
|
1817
|
+
}
|
|
1818
|
+
return cl;
|
|
1819
|
+
};
|
|
1820
|
+
|
|
1762
1821
|
// src/restful.ts
|
|
1763
1822
|
var getCurrentLevelRelations = (relations) => relations.filter((r) => !r.includes("."));
|
|
1764
1823
|
var getNextLevelRelations = (relations, enteringField) => relations.filter((r) => r.includes(".") && r.startsWith(`${enteringField}.`)).map((r) => r.split(".").slice(1).join("."));
|
|
@@ -1778,7 +1837,7 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1778
1837
|
this.entityClass,
|
|
1779
1838
|
this.fieldsToOmit
|
|
1780
1839
|
);
|
|
1781
|
-
this.createDto = RenameClass(
|
|
1840
|
+
this.createDto = (0, import_nesties11.RenameClass)(
|
|
1782
1841
|
OmitTypeExclude(
|
|
1783
1842
|
this.basicInputDto,
|
|
1784
1843
|
getSpecificFields(this.entityClass, "notWritable")
|
|
@@ -1786,27 +1845,35 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1786
1845
|
`Create${this.entityClass.name}Dto`
|
|
1787
1846
|
);
|
|
1788
1847
|
this.importDto = ImportDataDto(this.createDto);
|
|
1789
|
-
this.
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1848
|
+
this.fieldsInGetToOmit = import_lodash4.default.uniq([
|
|
1849
|
+
...this.fieldsToOmit,
|
|
1850
|
+
...getSpecificFields(this.entityClass, "notQueryable")
|
|
1851
|
+
]);
|
|
1852
|
+
this.findAllDto = (0, import_nesties11.RenameClass)(
|
|
1853
|
+
(0, import_swagger7.PartialType)(
|
|
1854
|
+
PatchColumnsInGet(
|
|
1855
|
+
OmitTypeExclude(
|
|
1856
|
+
this.entityClass instanceof PageSettingsDto ? this.entityClass : (0, import_swagger7.IntersectionType)(
|
|
1857
|
+
this.entityClass,
|
|
1858
|
+
PageSettingsDto
|
|
1859
|
+
),
|
|
1860
|
+
this.fieldsInGetToOmit
|
|
1795
1861
|
),
|
|
1796
|
-
|
|
1862
|
+
this.entityClass,
|
|
1863
|
+
this.fieldsInGetToOmit
|
|
1797
1864
|
)
|
|
1798
1865
|
),
|
|
1799
1866
|
`Find${this.entityClass.name}Dto`
|
|
1800
1867
|
);
|
|
1801
|
-
this.findAllCursorPaginatedDto = RenameClass(
|
|
1802
|
-
(0,
|
|
1868
|
+
this.findAllCursorPaginatedDto = (0, import_nesties11.RenameClass)(
|
|
1869
|
+
(0, import_swagger7.IntersectionType)(
|
|
1803
1870
|
OmitTypeExclude(this.findAllDto, ["pageCount"]),
|
|
1804
1871
|
CursorPaginationDto
|
|
1805
1872
|
),
|
|
1806
1873
|
`Find${this.entityClass.name}CursorPaginatedDto`
|
|
1807
1874
|
);
|
|
1808
|
-
this.updateDto = RenameClass(
|
|
1809
|
-
(0,
|
|
1875
|
+
this.updateDto = (0, import_nesties11.RenameClass)(
|
|
1876
|
+
(0, import_swagger7.PartialType)(
|
|
1810
1877
|
OmitTypeExclude(
|
|
1811
1878
|
this.createDto,
|
|
1812
1879
|
getSpecificFields(this.entityClass, "notChangeable")
|
|
@@ -1815,8 +1882,8 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1815
1882
|
`Update${this.entityClass.name}Dto`
|
|
1816
1883
|
);
|
|
1817
1884
|
this.entityResultDto = this.resolveEntityResultDto();
|
|
1818
|
-
this.entityCreateResultDto = RenameClass(
|
|
1819
|
-
(0,
|
|
1885
|
+
this.entityCreateResultDto = (0, import_nesties11.RenameClass)(
|
|
1886
|
+
(0, import_swagger7.OmitType)(this.entityResultDto, [
|
|
1820
1887
|
...getTypeormRelations(this.entityClass).map(
|
|
1821
1888
|
(r) => r.propertyName
|
|
1822
1889
|
),
|
|
@@ -1828,15 +1895,15 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1828
1895
|
]),
|
|
1829
1896
|
`${this.getEntityClassName()}CreateResultDto`
|
|
1830
1897
|
);
|
|
1831
|
-
this.entityReturnMessageDto = (0,
|
|
1832
|
-
this.entityCreateReturnMessageDto = (0,
|
|
1898
|
+
this.entityReturnMessageDto = (0, import_nesties10.ReturnMessageDto)(this.entityResultDto);
|
|
1899
|
+
this.entityCreateReturnMessageDto = (0, import_nesties10.ReturnMessageDto)(
|
|
1833
1900
|
this.entityCreateResultDto
|
|
1834
1901
|
);
|
|
1835
|
-
this.entityArrayReturnMessageDto = (0,
|
|
1902
|
+
this.entityArrayReturnMessageDto = (0, import_nesties10.PaginatedReturnMessageDto)(
|
|
1836
1903
|
this.entityResultDto
|
|
1837
1904
|
);
|
|
1838
1905
|
this.entityCursorPaginationReturnMessageDto = CursorPaginationReturnMessageDto(this.entityResultDto);
|
|
1839
|
-
this.importReturnMessageDto = (0,
|
|
1906
|
+
this.importReturnMessageDto = (0, import_nesties10.ReturnMessageDto)([
|
|
1840
1907
|
ImportEntryDto(this.entityCreateResultDto)
|
|
1841
1908
|
]);
|
|
1842
1909
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -1867,16 +1934,16 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1867
1934
|
...this.options.outputFieldsToOmit || [],
|
|
1868
1935
|
...this.options.relations ? relations.map((r) => r.propertyName).filter((r) => !currentLevelRelations.has(r)) : []
|
|
1869
1936
|
]);
|
|
1870
|
-
const resultDto = (0,
|
|
1937
|
+
const resultDto = (0, import_swagger7.OmitType)(this.entityClass, [...outputFieldsToOmit]);
|
|
1871
1938
|
for (const relation of relations) {
|
|
1872
1939
|
if (outputFieldsToOmit.has(relation.propertyName)) continue;
|
|
1940
|
+
if (nonTransformableTypes.has(relation.propertyClass)) continue;
|
|
1873
1941
|
const replace = (useClass) => {
|
|
1874
|
-
const oldApiProperty =
|
|
1875
|
-
|
|
1876
|
-
this.entityClass.prototype,
|
|
1942
|
+
const oldApiProperty = (0, import_nesties10.getApiProperty)(
|
|
1943
|
+
this.entityClass,
|
|
1877
1944
|
relation.propertyName
|
|
1878
|
-
)
|
|
1879
|
-
(0,
|
|
1945
|
+
);
|
|
1946
|
+
(0, import_swagger7.ApiProperty)({
|
|
1880
1947
|
...oldApiProperty,
|
|
1881
1948
|
required: false,
|
|
1882
1949
|
type: () => relation.isArray ? [useClass[0]] : useClass[0]
|
|
@@ -1910,7 +1977,7 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1910
1977
|
}
|
|
1911
1978
|
}
|
|
1912
1979
|
}
|
|
1913
|
-
const res = RenameClass(
|
|
1980
|
+
const res = (0, import_nesties11.RenameClass)(
|
|
1914
1981
|
resultDto,
|
|
1915
1982
|
`${this.getEntityClassName()}ResultDto`
|
|
1916
1983
|
);
|
|
@@ -1936,17 +2003,17 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1936
2003
|
}
|
|
1937
2004
|
}
|
|
1938
2005
|
create(extras = {}) {
|
|
1939
|
-
return (0,
|
|
2006
|
+
return (0, import_nesties10.MergeMethodDecorators)([
|
|
1940
2007
|
this.usePrefix(import_common3.Post),
|
|
1941
2008
|
(0, import_common3.HttpCode)(200),
|
|
1942
|
-
(0,
|
|
2009
|
+
(0, import_swagger7.ApiOperation)({
|
|
1943
2010
|
summary: `Create a new ${this.getEntityClassName()}`,
|
|
1944
2011
|
...extras
|
|
1945
2012
|
}),
|
|
1946
|
-
(0,
|
|
1947
|
-
(0,
|
|
1948
|
-
(0,
|
|
1949
|
-
type:
|
|
2013
|
+
(0, import_swagger7.ApiBody)({ type: this.createDto }),
|
|
2014
|
+
(0, import_swagger7.ApiOkResponse)({ type: this.entityCreateReturnMessageDto }),
|
|
2015
|
+
(0, import_swagger7.ApiBadRequestResponse)({
|
|
2016
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
1950
2017
|
description: `The ${this.getEntityClassName()} is not valid`
|
|
1951
2018
|
})
|
|
1952
2019
|
]);
|
|
@@ -1955,16 +2022,16 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1955
2022
|
return (0, import_common3.Body)(CreatePipe());
|
|
1956
2023
|
}
|
|
1957
2024
|
findOne(extras = {}) {
|
|
1958
|
-
return (0,
|
|
2025
|
+
return (0, import_nesties10.MergeMethodDecorators)([
|
|
1959
2026
|
this.usePrefix(import_common3.Get, ":id"),
|
|
1960
|
-
(0,
|
|
2027
|
+
(0, import_swagger7.ApiOperation)({
|
|
1961
2028
|
summary: `Find a ${this.getEntityClassName()} by id`,
|
|
1962
2029
|
...extras
|
|
1963
2030
|
}),
|
|
1964
|
-
(0,
|
|
1965
|
-
(0,
|
|
1966
|
-
(0,
|
|
1967
|
-
type:
|
|
2031
|
+
(0, import_swagger7.ApiParam)({ name: "id", type: this.idType, required: true }),
|
|
2032
|
+
(0, import_swagger7.ApiOkResponse)({ type: this.entityReturnMessageDto }),
|
|
2033
|
+
(0, import_swagger7.ApiNotFoundResponse)({
|
|
2034
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
1968
2035
|
description: `The ${this.getEntityClassName()} with the given id was not found`
|
|
1969
2036
|
})
|
|
1970
2037
|
]);
|
|
@@ -1977,49 +2044,49 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
1977
2044
|
}
|
|
1978
2045
|
}
|
|
1979
2046
|
findAll(extras = {}) {
|
|
1980
|
-
return (0,
|
|
2047
|
+
return (0, import_nesties10.MergeMethodDecorators)([
|
|
1981
2048
|
this.usePrefix(import_common3.Get),
|
|
1982
|
-
(0,
|
|
2049
|
+
(0, import_swagger7.ApiOperation)({
|
|
1983
2050
|
summary: `Find all ${this.getEntityClassName()}`,
|
|
1984
2051
|
...extras
|
|
1985
2052
|
}),
|
|
1986
|
-
(0,
|
|
2053
|
+
(0, import_swagger7.ApiOkResponse)({ type: this.entityArrayReturnMessageDto })
|
|
1987
2054
|
]);
|
|
1988
2055
|
}
|
|
1989
2056
|
findAllCursorPaginated(extras = {}) {
|
|
1990
|
-
return (0,
|
|
2057
|
+
return (0, import_nesties10.MergeMethodDecorators)([
|
|
1991
2058
|
this.usePrefix(import_common3.Get),
|
|
1992
|
-
(0,
|
|
2059
|
+
(0, import_swagger7.ApiOperation)({
|
|
1993
2060
|
summary: `Find all ${this.getEntityClassName()}`,
|
|
1994
2061
|
...extras
|
|
1995
2062
|
}),
|
|
1996
|
-
(0,
|
|
2063
|
+
(0, import_swagger7.ApiOkResponse)({ type: this.entityCursorPaginationReturnMessageDto })
|
|
1997
2064
|
]);
|
|
1998
2065
|
}
|
|
1999
2066
|
findAllParam() {
|
|
2000
2067
|
return (0, import_common3.Query)(GetPipe());
|
|
2001
2068
|
}
|
|
2002
2069
|
update(extras = {}) {
|
|
2003
|
-
return (0,
|
|
2070
|
+
return (0, import_nesties10.MergeMethodDecorators)([
|
|
2004
2071
|
this.usePrefix(import_common3.Patch, ":id"),
|
|
2005
2072
|
(0, import_common3.HttpCode)(200),
|
|
2006
|
-
(0,
|
|
2073
|
+
(0, import_swagger7.ApiOperation)({
|
|
2007
2074
|
summary: `Update a ${this.getEntityClassName()} by id`,
|
|
2008
2075
|
...extras
|
|
2009
2076
|
}),
|
|
2010
|
-
(0,
|
|
2011
|
-
(0,
|
|
2012
|
-
(0,
|
|
2013
|
-
(0,
|
|
2014
|
-
type:
|
|
2077
|
+
(0, import_swagger7.ApiParam)({ name: "id", type: this.idType, required: true }),
|
|
2078
|
+
(0, import_swagger7.ApiBody)({ type: this.updateDto }),
|
|
2079
|
+
(0, import_swagger7.ApiOkResponse)({ type: import_nesties10.BlankReturnMessageDto }),
|
|
2080
|
+
(0, import_swagger7.ApiNotFoundResponse)({
|
|
2081
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
2015
2082
|
description: `The ${this.getEntityClassName()} with the given id was not found`
|
|
2016
2083
|
}),
|
|
2017
|
-
(0,
|
|
2018
|
-
type:
|
|
2084
|
+
(0, import_swagger7.ApiBadRequestResponse)({
|
|
2085
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
2019
2086
|
description: `The ${this.getEntityClassName()} is not valid`
|
|
2020
2087
|
}),
|
|
2021
|
-
(0,
|
|
2022
|
-
type:
|
|
2088
|
+
(0, import_swagger7.ApiInternalServerErrorResponse)({
|
|
2089
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
2023
2090
|
description: "Internal error"
|
|
2024
2091
|
})
|
|
2025
2092
|
]);
|
|
@@ -2028,37 +2095,37 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
2028
2095
|
return (0, import_common3.Body)(UpdatePipe());
|
|
2029
2096
|
}
|
|
2030
2097
|
delete(extras = {}) {
|
|
2031
|
-
return (0,
|
|
2098
|
+
return (0, import_nesties10.MergeMethodDecorators)([
|
|
2032
2099
|
this.usePrefix(import_common3.Delete, ":id"),
|
|
2033
2100
|
(0, import_common3.HttpCode)(200),
|
|
2034
|
-
(0,
|
|
2101
|
+
(0, import_swagger7.ApiOperation)({
|
|
2035
2102
|
summary: `Delete a ${this.getEntityClassName()} by id`,
|
|
2036
2103
|
...extras
|
|
2037
2104
|
}),
|
|
2038
|
-
(0,
|
|
2039
|
-
(0,
|
|
2040
|
-
(0,
|
|
2041
|
-
type:
|
|
2105
|
+
(0, import_swagger7.ApiParam)({ name: "id", type: this.idType, required: true }),
|
|
2106
|
+
(0, import_swagger7.ApiOkResponse)({ type: import_nesties10.BlankReturnMessageDto }),
|
|
2107
|
+
(0, import_swagger7.ApiNotFoundResponse)({
|
|
2108
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
2042
2109
|
description: `The ${this.getEntityClassName()} with the given id was not found`
|
|
2043
2110
|
}),
|
|
2044
|
-
(0,
|
|
2045
|
-
type:
|
|
2111
|
+
(0, import_swagger7.ApiInternalServerErrorResponse)({
|
|
2112
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
2046
2113
|
description: "Internal error"
|
|
2047
2114
|
})
|
|
2048
2115
|
]);
|
|
2049
2116
|
}
|
|
2050
2117
|
import(extras = {}) {
|
|
2051
|
-
return (0,
|
|
2118
|
+
return (0, import_nesties10.MergeMethodDecorators)([
|
|
2052
2119
|
(0, import_common3.Post)("import"),
|
|
2053
2120
|
(0, import_common3.HttpCode)(200),
|
|
2054
|
-
(0,
|
|
2121
|
+
(0, import_swagger7.ApiOperation)({
|
|
2055
2122
|
summary: `Import ${this.getEntityClassName()}`,
|
|
2056
2123
|
...extras
|
|
2057
2124
|
}),
|
|
2058
|
-
(0,
|
|
2059
|
-
(0,
|
|
2060
|
-
(0,
|
|
2061
|
-
type:
|
|
2125
|
+
(0, import_swagger7.ApiBody)({ type: this.importDto }),
|
|
2126
|
+
(0, import_swagger7.ApiOkResponse)({ type: this.importReturnMessageDto }),
|
|
2127
|
+
(0, import_swagger7.ApiInternalServerErrorResponse)({
|
|
2128
|
+
type: import_nesties10.BlankReturnMessageDto,
|
|
2062
2129
|
description: "Internal error"
|
|
2063
2130
|
})
|
|
2064
2131
|
]);
|
|
@@ -2091,7 +2158,7 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
2091
2158
|
},
|
|
2092
2159
|
findAll: {
|
|
2093
2160
|
paramTypes: [
|
|
2094
|
-
routeOptions.paginateType === "cursor" ? this.findAllCursorPaginatedDto : routeOptions.paginateType === "none" ? (0,
|
|
2161
|
+
routeOptions.paginateType === "cursor" ? this.findAllCursorPaginatedDto : routeOptions.paginateType === "none" ? (0, import_swagger7.OmitType)(this.findAllDto, [
|
|
2095
2162
|
"pageCount",
|
|
2096
2163
|
"recordsPerPage"
|
|
2097
2164
|
]) : this.findAllDto
|
|
@@ -2174,7 +2241,7 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
2174
2241
|
Object.defineProperty(cl.prototype, method, descriptor);
|
|
2175
2242
|
});
|
|
2176
2243
|
}
|
|
2177
|
-
return RenameClass(cl, `${this.getEntityClassName()}Controller`);
|
|
2244
|
+
return (0, import_nesties11.RenameClass)(cl, `${this.getEntityClassName()}Controller`);
|
|
2178
2245
|
}
|
|
2179
2246
|
crudService(options = {}) {
|
|
2180
2247
|
return CrudService(this.entityClass, {
|
|
@@ -2227,7 +2294,6 @@ var RestfulFactory = class _RestfulFactory {
|
|
|
2227
2294
|
QuerySearch,
|
|
2228
2295
|
Relation,
|
|
2229
2296
|
RelationComputed,
|
|
2230
|
-
RenameClass,
|
|
2231
2297
|
RestfulFactory,
|
|
2232
2298
|
StringColumn,
|
|
2233
2299
|
StringIdBase,
|